diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-12 16:01:18 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-12 16:01:18 +0200 |
commit | ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6 (patch) | |
tree | 326e6380ad9518add581c17f59e9c1f8cb1927bf /accounts/gkleen@sif | |
parent | 3b4f9240fb6393c693b2a8ad99f20309cc48c26d (diff) | |
download | nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.gz nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.bz2 nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.tar.xz nixos-ccde2fea4f1b3befd7ba05bd4e75e3dc48cc91e6.zip |
...
Diffstat (limited to 'accounts/gkleen@sif')
-rw-r--r-- | accounts/gkleen@sif/default.nix | 19 | ||||
-rw-r--r-- | accounts/gkleen@sif/dunstrc.d/10-brightness.conf | 5 |
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] | ||
2 | appname="brightness" | ||
3 | set_stack_tag="brightness" | ||
4 | set_transient=yes | ||
5 | history_ignore=yes | ||