zero posix compliance but cleaner
This commit is contained in:
parent
350ea17468
commit
c4e20ef151
8 changed files with 22 additions and 28 deletions
|
@ -1,7 +1,8 @@
|
|||
#!/bin/sh
|
||||
# Reduces mic volume by 5%
|
||||
# Decreases mic volume by 5%
|
||||
|
||||
amixer set Capture 5%-
|
||||
$HOME/.config/scripts/status/micstat
|
||||
|
||||
kill -45 "$(pidof dwmblocks)"
|
||||
MICSTAT="$(micstat)"
|
||||
notify-send -u low --replace-id=11 "$MICSTAT" 2>/dev/null
|
||||
kill -45 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/sh
|
||||
# Mute
|
||||
# Mute mic
|
||||
|
||||
amixer -q set Capture toggle
|
||||
$HOME/.config/scripts/status/micstat
|
||||
|
||||
kill -45 "$(pidof dwmblocks)"
|
||||
MICSTAT="$(micstat)"
|
||||
notify-send -u low --replace-id=11 "$MICSTAT" 2>/dev/null
|
||||
kill -45 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# Increases mic volume by 5%
|
||||
|
||||
amixer set Capture 5%+
|
||||
$HOME/.config/scripts/status/micstat
|
||||
|
||||
MICSTAT="$(micstat)"
|
||||
notify-send -u low --replace-id=11 "$MICSTAT" 2>/dev/null
|
||||
kill -45 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# Mute
|
||||
|
||||
amixer -q set Master toggle
|
||||
$HOME/.config/scripts/status/volstat
|
||||
|
||||
VOLSTAT="$(volstat)"
|
||||
notify-send -u low --replace-id=10 "$VOLSTAT" 2>/dev/null
|
||||
kill -44 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
|
@ -3,15 +3,11 @@
|
|||
# (in current default Capture)
|
||||
|
||||
# Get volume levels
|
||||
vol=$(amixer | grep "Capture" | grep -o '[0-9]*[0-9]%' | tail -n 1)
|
||||
vol=$(amixer | grep "Capture" | grep -m 1 -o '[0-9]*[0-9]%')
|
||||
vol="${vol%\%*}" # Remove percentage sign
|
||||
|
||||
# If device is off (muted), notify mute, print volume otherwise
|
||||
if amixer scontents | grep "Capture" | grep -q "\[off\]"; then
|
||||
echo " ──────────"
|
||||
notify-send -u low --replace-id=11 " Silenced" 2>/dev/null
|
||||
exit
|
||||
fi
|
||||
if amixer scontents | grep "Capture" | grep -q "\[off\]"; then echo " ──────────" && exit ; fi
|
||||
|
||||
# Define bar progress with volume
|
||||
case 1 in
|
||||
|
@ -30,4 +26,3 @@ esac
|
|||
|
||||
# Print and notify
|
||||
echo " $bar"
|
||||
notify-send -u low --replace-id=11 " $bar" 2>/dev/null
|
||||
|
|
|
@ -3,15 +3,11 @@
|
|||
# (in current default output)
|
||||
|
||||
# Get volume level
|
||||
vol=$(amixer | grep "Playback" | grep -o '[0-9]*[0-9]%' | head -n 1)
|
||||
vol=$(amixer | grep "Playback" | grep -m 1 -o '[0-9]*[0-9]%')
|
||||
vol="${vol%\%*}" # Remove percentage sign
|
||||
|
||||
# If device is off (muted), notify mute, print volume otherwise
|
||||
if amixer scontents | grep "Playback" | grep -q "\[off\]"; then
|
||||
echo " ──────────"
|
||||
notify-send -u low --replace-id=10 " Mute" 2>/dev/null
|
||||
exit
|
||||
fi
|
||||
if amixer scontents | grep "Playback" | grep -q "\[off\]"; then echo " ──────────" && exit ; fi
|
||||
|
||||
# Define bar progress with volume
|
||||
case 1 in
|
||||
|
@ -29,5 +25,4 @@ case 1 in
|
|||
esac
|
||||
|
||||
# Print and notify
|
||||
notify-send -u low --replace-id=10 " $bar" 2>/dev/null
|
||||
echo " $bar"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
# Increases volume by 5%,
|
||||
# then restarts statusbar module
|
||||
# Decreases volume by 5%
|
||||
|
||||
amixer set Master 5%- unmute
|
||||
$HOME/.config/scripts/status/volstat
|
||||
|
||||
VOLSTAT="$(volstat)"
|
||||
notify-send -u low --replace-id=10 "$VOLSTAT" 2>/dev/null
|
||||
kill -44 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
# Increases volume by 5%,
|
||||
# then restarts statusbar module
|
||||
# Increases volume by 5%
|
||||
|
||||
amixer set Master 5%+ unmute
|
||||
$HOME/.config/scripts/status/volstat
|
||||
|
||||
VOLSTAT="$(volstat)"
|
||||
notify-send -u low --replace-id=10 "$VOLSTAT" 2>/dev/null
|
||||
kill -44 "$(pidof dwmblocks)" 2>/dev/null
|
||||
|
|
Loading…
Reference in a new issue