38 lines
923 B
Nix
38 lines
923 B
Nix
{ pkgs, ... }:
|
|
{
|
|
home.packages = with pkgs; [
|
|
(writeShellScriptBin "sb-volume" ''
|
|
# Prints the current volume or 婢 if muted.
|
|
get_mic_status=$(${pamixer}/bin/pamixer --default-source --get-mute)
|
|
vol="$(${pamixer}/bin/pamixer --get-volume)"
|
|
|
|
if [ $get_mic_status == false ]; then
|
|
mic_status=""
|
|
else
|
|
mic_status=""
|
|
fi
|
|
|
|
if [ "$vol" -gt "90" ]; then
|
|
icon=""
|
|
elif [ "$vol" -gt "50" ]; then
|
|
icon=""
|
|
elif [ "$vol" -gt "30" ]; then
|
|
icon=""
|
|
elif [ "$vol" -gt "0" ]; then
|
|
icon=""
|
|
else
|
|
icon=""
|
|
fi
|
|
|
|
if [ $(${pamixer}/bin/pamixer --get-mute) = true ]; then
|
|
icon=""
|
|
vol="0"
|
|
fi
|
|
|
|
print_string="$mic_status $icon $vol%"
|
|
printf '%s' "''${print_string}"
|
|
'')
|
|
];
|
|
}
|
|
|