summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 = "󰈈"; deactivated = "󰈉"; }; 420 format-icons = { activated = "󰈈"; deactivated = "󰈉"; };
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 = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"]; 432 format-icons = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"];
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