mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
use pamixer again
This commit is contained in:
parent
87ab89cf18
commit
89cf986de0
@ -13,26 +13,15 @@ case $BLOCK_BUTTON in
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
[ "$(pamixer --get-mute)" = true ] && echo "m" && exit
|
||||
|
||||
# If muted, print 🔇 and exit.
|
||||
[ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit
|
||||
|
||||
vol="${vol#Volume: }"
|
||||
split() {
|
||||
# For ommiting the . without calling and external program.
|
||||
IFS=$2
|
||||
set -- $1
|
||||
printf '%s' "$@"
|
||||
}
|
||||
vol="$(split "$vol" ".")"
|
||||
vol="${vol##0}"
|
||||
vol="$(pamixer --get-volume)"
|
||||
|
||||
case 1 in
|
||||
$((vol >= 70)) ) icon="🔊" ;;
|
||||
$((vol >= 30)) ) icon="🔉" ;;
|
||||
$((vol >= 1)) ) icon="🔈" ;;
|
||||
* ) echo 🔇 && exit ;;
|
||||
$((vol >= 70)) ) icon="🔊" ;;
|
||||
$((vol >= 30)) ) icon="🔉" ;;
|
||||
$((vol >= 1)) ) icon="🔈" ;;
|
||||
* ) echo m && exit ;;
|
||||
esac
|
||||
|
||||
echo "$icon$vol%"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user