summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/default.nix
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 /accounts/gkleen@sif/default.nix
parent3b4f9240fb6393c693b2a8ad99f20309cc48c26d (diff)
downloadnixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.gz
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.bz2
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.xz
nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.zip
...
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r--accounts/gkleen@sif/default.nix19
1 files changed, 16 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 {