diff --git a/home/ooks/opt/desktop/hyprland/binds.nix b/home/ooks/opt/desktop/hyprland/binds.nix index f6ede53..46e79be 100644 --- a/home/ooks/opt/desktop/hyprland/binds.nix +++ b/home/ooks/opt/desktop/hyprland/binds.nix @@ -1,10 +1,53 @@ -{ lib, config, pkgs, ... }: { +{ lib, config, pkgs, ... }: + let + light = "${pkgs.light}/bin/light"; + notifysend = "${pkgs.libnotify}/bin/notify-send"; + pamixer = "${pkgs.pamixer}/bin/pamixer"; + + brightnessScript = pkgs.writeShellScriptBin "brightness" '' + #!/bin/sh + + if [ "$1" == "up" ]; then + ${light} -A 10 + elif [ "$1" == "down" ]; then + ${light} -U 10 + else + echo "Invalid argument" + exit 1 + fi + + BRIGHTNESS=$(${light} -G | awk -F'.' '{print$1}') + + ${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify "󰃠 $BRIGHTNESS%" + ''; + + volumeScript = pkgs.writeShellScriptBin "volume" '' + #!/bin/sh + + 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) + + ${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $VOLUME" + ''; +in + + { wayland.windowManager.hyprland.settings = { bind = let terminal = config.home.sessionVariables.TERMINAL; browser = config.home.sessionVariables.BROWSER; editor = config.home.sessionVariables.EDITOR; + + bright = "${brightnessScript}/bin/brightness"; + volume = "${volumeScript}/bin/volume"; spotify = "${terminal} -e spotify_player"; @@ -29,16 +72,14 @@ # Brightness - ",XF86MonBrightnessUp,exec,light -A 10" - ",XF86MonBrightnessDown,exec,light -U 10" + ",XF86MonBrightnessUp,exec,${bright} up" + ",XF86MonBrightnessDown,exec,${bright} down" # Volume - ",XF86AudioRaiseVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ +5%" - ",XF86AudioLowerVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ -5%" - ",XF86AudioMute,exec,${pactl} set-sink-mute @DEFAULT_SINK@ toggle" - "SHIFT,XF86AudioMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle" - ",XF86AudioMicMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle" + ",XF86AudioRaiseVolume,exec,${volume} up" + ",XF86AudioLowerVolume,exec,${volume} down" + ",XF86AudioMute,exec,${volume} mute" # Window Management diff --git a/home/ooks/opt/desktop/standard/wayland/default.nix b/home/ooks/opt/desktop/standard/wayland/default.nix index 1f845dd..98821cf 100644 --- a/home/ooks/opt/desktop/standard/wayland/default.nix +++ b/home/ooks/opt/desktop/standard/wayland/default.nix @@ -18,6 +18,7 @@ mpv gtk3 pulseaudio + pamixer slurp wf-recorder wl-clipboard diff --git a/home/ooks/opt/desktop/standard/wayland/mako.nix b/home/ooks/opt/desktop/standard/wayland/mako.nix index 264de62..3dc8018 100644 --- a/home/ooks/opt/desktop/standard/wayland/mako.nix +++ b/home/ooks/opt/desktop/standard/wayland/mako.nix @@ -18,5 +18,11 @@ in { backgroundColor = "#${colors.base00}dd"; borderColor = "#${colors.base0C}dd"; textColor = "#${colors.base05}dd"; + extraConfig = '' + [app-name="system-notify"] + padding=3,3 + width=100 + height=100 + ''; }; }