Browse Source

Added dwm_pulse.sh

main
joestandring 5 years ago
parent
commit
17b104fc0b
3 changed files with 40 additions and 1 deletions
  1. +5
    -1
      README.md
  2. +1
    -0
      dwm_bar.sh
  3. +34
    -0
      functions/dwm_pulse.sh

+ 5
- 1
README.md View File

@ -26,6 +26,11 @@ Displays the current master volume of ALSA
```
[🔉 55]
```
### dwm_pulse
Displays the current master volume of PulseAudio
```
[🔉 55]
```
Dependencies: ```alsa-utils```
### dwm_countdown
Displays the status of [countdown](https://github.com/joestandring/countdown)
@ -117,7 +122,6 @@ Code for some functions was modified from:
* [Parket Johnson](https://github.com/ronno/scripts/blob/master/xsetcmus)
* [suckless.org](https://dwm.suckless.org/status_monitor/)
## More to come!
* dwm_pulse function to control pulseaudio sound
* dwm_bat function to display battery percentage and status
* dwm_notifs function to show the last recieved notification in the bar
* dwm_bluez function to show currently connected Bluetooth device using bluez


+ 1
- 0
dwm_bar.sh View File

@ -23,6 +23,7 @@ DIR=$(dirname "$LOC")
. "$DIR/functions/dwm_resources.sh"
. "$DIR/functions/dwm_mail.sh"
. "$DIR/functions/dwm_alsa.sh"
# . "$DIR/functions/dwm_pulse.sh"
. "$DIR/functions/dwm_weather.sh"
. "$DIR/functions/dwm_keyboard.sh"
. "$DIR/functions/dwm_date.sh"


+ 34
- 0
functions/dwm_pulse.sh View File

@ -0,0 +1,34 @@
#!/bin/sh
# A dwm_bar function to show the master volume of PulseAudio
# Joe Standring <git@joestandring.com>
# GNU GPLv3
# Dependencies: pamixer
dwm_pulse () {
VOL=$(pamixer --get-volume)
if [ "$IDENTIFIER" = "unicode" ]; then
if [ "$VOL" -eq 0 ]; then
printf "[🔇 %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[🔈 %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[🔉 %s]\n" "$VOL"
else
printf "[🔊 %s]\n" "$VOL"
fi
else
if [ "$VOL" -eq 0 ]; then
printf "[VOL %s]\n" "$VOL]\n"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "[VOL %s]\n" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "[VOL %s]\n" "$VOL"
else
printf "[VOL %s]\n" "$VOL"
fi
fi
}
dwm_pulse

Loading…
Cancel
Save