Skip to content

Commit

Permalink
Add vol wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
Akmadan23 committed Apr 4, 2024
1 parent 6e72f85 commit 2db7c26
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/vol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

case "$1" in
mute)
amixer set Master toggle
amixer get Master | tail -2 | grep -Fq '[off]' && level='-m'
;;
+*)
amixer set Master unmute "${1:1}%+"
;;
-*)
amixer set Master unmute "${1:1}%-"
;;
*)
exit 1
;;
esac

volnoti-show "${level-$(amixer get Master | tail -1 | grep -Po '[0-9]+(?=%)')}"

0 comments on commit 2db7c26

Please sign in to comment.