ooknet/home/modules/desktop/wayland/windowManager/hyprland/pkgs/hyprvolume.nix
ooks-io 2130903850 refactor(hyprland): change to structure of hyprland configuration
- move bind scripts to standalone shell applications
- split configuration into more modules
- still more work to be done
2024-03-08 17:29:54 +13:00

19 lines
479 B
Nix

{ pkgs, ... }:
pkgs.writeShellApplication {
name = "hyprvolume";
runtimeInputs = with pkgs; [pamixer libnotify];
text = ''
if [ "$1" == "up" ]; then
pamixer --increase 5
elif [ "$1" == "down" ]; then
pamixer --decrease 5
elif [ "$1" == "mute" ]; then
pamixer --toggle-mute
fi
VOLUME=$(pamixer --get-volume-human)
notify-send --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $VOLUME"
'';
}