feat: remove st

This commit is contained in:
ange 2025-06-29 09:30:03 +00:00
parent 40b8304dce
commit 17b03778ac
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
31 changed files with 54 additions and 7057 deletions

View file

@ -6,28 +6,17 @@ case "$1" in
*) exit 1 ;;
esac
update_vol() {
# shellcheck disable=SC2017
case "$1" in
+*|-*) CUR=$((CUR + $1 - CUR % $1 + CUR % $1 * 10 / $1 / 5 * $1)) ;;
*) CUR="$1" ;;
esac
wpctl set-volume -l 3 "$DEV" "$CUR%"
}
read -r _ CUR MUTE < <(wpctl get-volume "$DEV")
CUR=$((10#${CUR/./}))
if [ -z "$2" ]; then
echo "$CUR"
exit
fi
if [ "$2" == 'm' ] && [ -z "$MUTE" ]; then
wpctl set-mute "$DEV" 1
if [ "$2" = m ]; then
wpctl set-mute "$DEV" toggle
else
if [[ "$2" =~ [0-9] ]]; then
update_vol "$2"
fi
case "$2" in
+*|-*) wpctl set-volume -l 1.5 "$DEV" "$((CUR + $2))%" ;;
'') echo "$CUR${MUTE:+ $MUTE}"; exit ;;
*) wpctl set-volume "$DEV" "$2%" ;;
esac
if [ -n "$MUTE" ]; then
wpctl set-mute "$DEV" 0
fi