From d20393e077b8d97b18f4a224ddcb20caf6dac23b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 10 Sep 2025 15:57:26 +0200 Subject: ... --- overlays/quickshell/pipewire.patch | 28 +++++++++++++++++++ overlays/swayosd/default.nix | 13 --------- overlays/swayosd/exponential.patch | 57 -------------------------------------- 3 files changed, 28 insertions(+), 70 deletions(-) delete mode 100644 overlays/swayosd/default.nix delete mode 100644 overlays/swayosd/exponential.patch (limited to 'overlays') diff --git a/overlays/quickshell/pipewire.patch b/overlays/quickshell/pipewire.patch index 33025d8b..2d98eefc 100644 --- a/overlays/quickshell/pipewire.patch +++ b/overlays/quickshell/pipewire.patch @@ -211,6 +211,34 @@ index 1a1f705..ee64858 100644 bool setRouteProps(qint32 routeDevice, const std::function& propsCallback); +diff --git i/src/services/pipewire/node.cpp w/src/services/pipewire/node.cpp +index 3e68149..4721a58 100644 +--- i/src/services/pipewire/node.cpp ++++ w/src/services/pipewire/node.cpp +@@ -145,6 +145,10 @@ void PwNode::initProps(const spa_dict* props) { + this->type = PwNodeType::VideoSink; + } else if (strcmp(mediaClass, "Video/Source") == 0) { + this->type = PwNodeType::VideoSource; ++ } else if (strcmp(mediaClass, "Stream/Output/Video") == 0) { ++ this->type = PwNodeType::VideoOutStream; ++ } else if (strcmp(mediaClass, "Stream/Input/Video") == 0) { ++ this->type = PwNodeType::VideoInStream; + } + } + +diff --git i/src/services/pipewire/node.hpp w/src/services/pipewire/node.hpp +index 0d4c92e..ee6f223 100644 +--- i/src/services/pipewire/node.hpp ++++ w/src/services/pipewire/node.hpp +@@ -144,6 +144,8 @@ public: + // This is equivalent to the media class `Video/Sink` and is composed of the + // @@PwNodeType.Video and @@PwNodeType.Sink flags. + VideoSink = Video | Sink, ++ VideoOutStream = Video | Sink | Stream, ++ VideoInStream = Video | Source | Stream, + }; + Q_ENUM(Flag); + Q_DECLARE_FLAGS(Flags, Flag); diff --git i/src/services/pipewire/qml.cpp w/src/services/pipewire/qml.cpp index 9efb17e..921d12a 100644 --- i/src/services/pipewire/qml.cpp diff --git a/overlays/swayosd/default.nix b/overlays/swayosd/default.nix deleted file mode 100644 index 5e715dae..00000000 --- a/overlays/swayosd/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ final, prev, sources, ... }: { - swayosd = prev.swayosd.overrideAttrs (oldAttrs: rec { - inherit (sources.swayosd) version src; - cargoDeps = prev.rustPlatform.fetchCargoVendor { - inherit (oldAttrs) pname; - inherit version src; - hash = "sha256-J2sl6/4+bRWlkvaTJtFsMqvvOxYtWLRjJcYWcu0loRE="; - }; - patches = (oldAttrs.patches or []) ++ [ - ./exponential.patch - ]; - }); -} diff --git a/overlays/swayosd/exponential.patch b/overlays/swayosd/exponential.patch deleted file mode 100644 index eb90d739..00000000 --- a/overlays/swayosd/exponential.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/src/brightness_backend/brightnessctl.rs b/src/brightness_backend/brightnessctl.rs -index ccb0e11..740fdb6 100644 ---- a/src/brightness_backend/brightnessctl.rs -+++ b/src/brightness_backend/brightnessctl.rs -@@ -107,10 +107,21 @@ impl VirtualDevice { - } - } - -- fn set_percent(&mut self, mut val: u32) -> anyhow::Result<()> { -- val = val.clamp(0, 100); -- self.current = self.max.map(|max| val * max / 100); -- let _: String = self.run(("set", &*format!("{val}%")))?; -+ fn val_to_percent(&mut self, val: u32) -> u32 { -+ return ((val as f64 / self.get_max() as f64).powf(0.25) * 100_f64).round() as u32; -+ } -+ fn percent_to_val(&mut self, perc: u32) -> u32 { -+ return ((perc as f64 / 100_f64).powf(4_f64) * self.get_max() as f64).round() as u32; -+ } -+ -+ fn set_percent(&mut self, val: u32) -> anyhow::Result<()> { -+ let new = self.percent_to_val(val); -+ self.set_val(new) -+ } -+ fn set_val(&mut self, val: u32) -> anyhow::Result<()> { -+ let curr = val.clamp(0, self.get_max()); -+ self.current = Some(curr); -+ let _: String = self.run(("set", &*format!("{curr}")))?; - Ok(()) - } - } -@@ -134,20 +145,18 @@ impl BrightnessBackend for BrightnessCtl { - - fn lower(&mut self, by: u32) -> anyhow::Result<()> { - let curr = self.get_current(); -- let max = self.get_max(); -- -- let curr = curr * 100 / max; -+ let mut new = self.device.val_to_percent(curr).saturating_sub(by); -+ new = self.device.percent_to_val(new).min(curr.saturating_sub(1)); - -- self.device.set_percent(curr.saturating_sub(by)) -+ self.device.set_val(new) - } - - fn raise(&mut self, by: u32) -> anyhow::Result<()> { - let curr = self.get_current(); -- let max = self.get_max(); -- -- let curr = curr * 100 / max; -+ let mut new = self.device.val_to_percent(curr) + by; -+ new = self.device.percent_to_val(new).max(curr + 1); - -- self.device.set_percent(curr + by) -+ self.device.set_val(new) - } - - fn set(&mut self, val: u32) -> anyhow::Result<()> { -- cgit v1.2.3