Update Dunst and sxhkd

This commit is contained in:
Filippo Berto 2023-01-02 19:09:32 +01:00
parent f17bfe4aa3
commit 53f62e4cd5
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
2 changed files with 28 additions and 53 deletions

View file

@ -7,12 +7,12 @@
bc
gnome.gnome-screenshot
lockscreen
pamixer
playerctl
terminator
bsp-layout
update-background
xorg.xbacklight
clipedit
];
services.sxhkd =
@ -23,6 +23,8 @@
emojiChooser = "rofimoji --skin-tone light -a copy";
yad = "${pkgs.yad}/bin/yad";
notify = "${pkgs.libnotify}/bin/notify-send";
pamixer = "${pkgs.pamixer}/bin/pamixer";
xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
resetBspwm = pkgs.writeShellScript "resetBspwm" ''
bspc wm -r
systemctl --user restart polybar # Restart polybar
@ -30,6 +32,14 @@
moveAllNodesToPrimary = pkgs.writeShellScript "moveAllNodesToPrimary" ''
comm -23 <(bspc query -N | sort) <(bspc query -m primary -N | sort) | while read n; do bspc node $n -m primary; done
'';
notifyVolume = pkgs.writeShellScript "notifyVolume" ''
volume=`${pamixer} --get-volume`
${notify} -r 1 -h "int:value:$volume" "Volume $volume%"
'';
notifyBrightness = pkgs.writeShellScript "notifyBrightness" ''
level=`printf "%.0f" $(${xbacklight} -get)`
${notify} -r 2 -h "int:value:$level" "Luminosità $level"
'';
in
{
enable = true;
@ -77,11 +87,9 @@
"super + {_,shift + } w" = "bspc node -{c,k}";
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
# "super + y" = "bspc node newest.marked.local -n newest.!automatic.local";
"{XF86AudioLowerVolume,XF86AudioMute,XF86AudioRaiseVolume}" = "pamixer {-d 2 -u,-t,-i 2 -u} && ${notify} -r 1 Volume `pamixer --get-volume-human`";
"XF86Audio{LowerVolume,Mute,RaiseVolume}" = "${pamixer} {-d 2 -u,-t,-i 2 -u} && ${notifyVolume}";
"XF86Audio{Next,Play,Prev}" = "playerctl {next,play-pause,previous}";
"XF86MonBrightness{Up,Down}" = ''
xbacklight -{inc,dec} 10 && ${notify} -r 2 Luminosità `printf "%.0f" $(xbacklight -get)`
'';
"XF86MonBrightness{Up,Down}" = " ${xbacklight} -{inc,dec} 10 && ${notifyBrightness}";
};
};
}