From 513f9a4e870a4f235a5b1cf3b7bd2afc8b55355a Mon Sep 17 00:00:00 2001 From: randomuser Date: Sat, 18 Jun 2022 15:33:14 -0500 Subject: [PATCH] simplestatus improvements --- simplestatus/config | 7 ++++--- simplestatus/date | 2 +- simplestatus/volume | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 simplestatus/volume diff --git a/simplestatus/config b/simplestatus/config index 03f00de..4f1685b 100644 --- a/simplestatus/config +++ b/simplestatus/config @@ -1,8 +1,9 @@ module power 7 30 module time 7 30 module date 7 30 -module bspwm 10 1000000 +module volume 12 30 +module bspwm 10 30 -order bspwm date time power +order bspwm date time volume power -format %{l}&%{c}& &%{r}& +format %{l}&%{r}& & & & diff --git a/simplestatus/date b/simplestatus/date index e76a83a..5dbddec 100755 --- a/simplestatus/date +++ b/simplestatus/date @@ -1,5 +1,5 @@ #!/bin/sh -printf "%s" $(date '+%Y-%m-%d') +printf "%s" $(date '+%m-%d') exit diff --git a/simplestatus/volume b/simplestatus/volume new file mode 100755 index 0000000..dcce443 --- /dev/null +++ b/simplestatus/volume @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$(ps aux | grep pulseaudio | wc -l)" -eq 2 ]; then + text="$(pactl list sinks | awk -F' ' '$1 == "Volume:" {print $5}')" + printf "pv%s" "$text" +else + text="$(amixer | grep '^ Front' | awk -F'[' '{ ORS = ""; print substr($2, 1, 3); exit }')" + printf "av%s" "$text" +fi