This commit is contained in:
Hadi
2024-08-30 15:47:17 +02:00
parent f0e9294982
commit da1b88305d
25 changed files with 122 additions and 37476 deletions

View File

@@ -4,17 +4,20 @@ let
increments = "5";
sound-change = pkgs.writeShellScriptBin "sound-change" ''
sleep 0.05
[[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
[[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%+"
[[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%-"
[[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%+
[[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%-
[[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}%
'';
sound-up = pkgs.writeShellScriptBin "sound-up" ''
sound-change up ${increments}
'';
sound-set = pkgs.writeShellScriptBin "sound-set" ''
sound-change set ''${1-100}
'';
sound-down = pkgs.writeShellScriptBin "sound-down" ''
sound-change down ${increments}
'';
@@ -22,4 +25,6 @@ let
sound-toggle = pkgs.writeShellScriptBin "sound-toggle" ''
sound-change mute
'';
in { home.packages = [ sound-change sound-up sound-down sound-toggle ]; }
in {
home.packages = [ sound-change sound-up sound-down sound-toggle sound-set ];
}