add: volume/brightness scripts
This commit is contained in:
parent
3c90d08364
commit
b57e31314d
3 changed files with 56 additions and 8 deletions
|
|
@ -1,11 +1,54 @@
|
||||||
{ 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 = {
|
wayland.windowManager.hyprland.settings = {
|
||||||
bind = let
|
bind = let
|
||||||
terminal = config.home.sessionVariables.TERMINAL;
|
terminal = config.home.sessionVariables.TERMINAL;
|
||||||
browser = config.home.sessionVariables.BROWSER;
|
browser = config.home.sessionVariables.BROWSER;
|
||||||
editor = config.home.sessionVariables.EDITOR;
|
editor = config.home.sessionVariables.EDITOR;
|
||||||
|
|
||||||
|
bright = "${brightnessScript}/bin/brightness";
|
||||||
|
volume = "${volumeScript}/bin/volume";
|
||||||
|
|
||||||
spotify = "${terminal} -e spotify_player";
|
spotify = "${terminal} -e spotify_player";
|
||||||
|
|
||||||
makoctl = "${config.services.mako.package}/bin/makoctl";
|
makoctl = "${config.services.mako.package}/bin/makoctl";
|
||||||
|
|
@ -29,16 +72,14 @@
|
||||||
|
|
||||||
# Brightness
|
# Brightness
|
||||||
|
|
||||||
",XF86MonBrightnessUp,exec,light -A 10"
|
",XF86MonBrightnessUp,exec,${bright} up"
|
||||||
",XF86MonBrightnessDown,exec,light -U 10"
|
",XF86MonBrightnessDown,exec,${bright} down"
|
||||||
|
|
||||||
# Volume
|
# Volume
|
||||||
|
|
||||||
",XF86AudioRaiseVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ +5%"
|
",XF86AudioRaiseVolume,exec,${volume} up"
|
||||||
",XF86AudioLowerVolume,exec,${pactl} set-sink-volume @DEFAULT_SINK@ -5%"
|
",XF86AudioLowerVolume,exec,${volume} down"
|
||||||
",XF86AudioMute,exec,${pactl} set-sink-mute @DEFAULT_SINK@ toggle"
|
",XF86AudioMute,exec,${volume} mute"
|
||||||
"SHIFT,XF86AudioMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"
|
|
||||||
",XF86AudioMicMute,exec,${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"
|
|
||||||
|
|
||||||
# Window Management
|
# Window Management
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
mpv
|
mpv
|
||||||
gtk3
|
gtk3
|
||||||
pulseaudio
|
pulseaudio
|
||||||
|
pamixer
|
||||||
slurp
|
slurp
|
||||||
wf-recorder
|
wf-recorder
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,11 @@ in {
|
||||||
backgroundColor = "#${colors.base00}dd";
|
backgroundColor = "#${colors.base00}dd";
|
||||||
borderColor = "#${colors.base0C}dd";
|
borderColor = "#${colors.base0C}dd";
|
||||||
textColor = "#${colors.base05}dd";
|
textColor = "#${colors.base05}dd";
|
||||||
|
extraConfig = ''
|
||||||
|
[app-name="system-notify"]
|
||||||
|
padding=3,3
|
||||||
|
width=100
|
||||||
|
height=100
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue