summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2024-08-12 16:01:18 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2024-08-12 16:01:18 +0200
commitccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6 (patch)
tree326e6380ad9518add581c17f59e9c1f8cb1927bf
parent3b4f9240fb6393c693b2a8ad99f20309cc48c26d (diff)
downloadnixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.gz
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.bz2
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.xz
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.zip
...
-rw-r--r--accounts/gkleen@sif/default.nix19
-rw-r--r--accounts/gkleen@sif/dunstrc.d/10-brightness.conf5
2 files changed, 21 insertions, 3 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 7ff0afc6..b66db697 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -419,12 +419,25 @@ in {
419 format = "{icon}"; 419 format = "{icon}";
420 format-icons = { activated = "&#xf0208;"; deactivated = "&#xf0209;"; }; 420 format-icons = { activated = "&#xf0208;"; deactivated = "&#xf0209;"; };
421 }; 421 };
422 backlight = { 422 backlight = let
423 brightnessNotify = ''
424 max=$(brightnessctl m -m)
425 curr=$(brightnessctl g -m)
426 perc=$((curr * 100 / max))
427 pgrep dunstify || dunstify -u low -a brightness "Brightness ''${perc}" "" -h int:value:''${perc}
428 '';
429 in {
423 format = "{icon}"; 430 format = "{icon}";
424 tooltip-format = "{percent}%"; 431 tooltip-format = "{percent}%";
425 format-icons = ["&#xf00da;" "&#xf00db;" "&#xf00dc;" "&#xf00dd;" "&#xf00de;" "&#xf00df;" "&#xf00e0;"]; 432 format-icons = ["&#xf00da;" "&#xf00db;" "&#xf00dc;" "&#xf00dd;" "&#xf00de;" "&#xf00df;" "&#xf00e0;"];
426 on-scroll-up = "brightnessctl s +1"; 433 on-scroll-up = pkgs.writeShellScript "brightness-up" ''
427 on-scroll-down = "brightnessctl s 1-"; 434 brightnessctl s +1
435 ${brightnessNotify}
436 '';
437 on-scroll-down = pkgs.writeShellScript "brightness-down" ''
438 brightnessctl s 1-
439 ${brightnessNotify}
440 '';
428 }; 441 };
429 } 442 }
430 { 443 {
diff --git a/accounts/gkleen@sif/dunstrc.d/10-brightness.conf b/accounts/gkleen@sif/dunstrc.d/10-brightness.conf
new file mode 100644
index 00000000..c54595ab
--- /dev/null
+++ b/accounts/gkleen@sif/dunstrc.d/10-brightness.conf
@@ -0,0 +1,5 @@
1[brightness]
2appname="brightness"
3set_stack_tag="brightness"
4set_transient=yes
5history_ignore=yes