diff --git a/dwmblocks_scripts/dwm_battery b/dwmblocks_scripts/dwm_battery index fc303ab..c931b45 100755 --- a/dwmblocks_scripts/dwm_battery +++ b/dwmblocks_scripts/dwm_battery @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash prct=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //') prctonly=$(upower -d | grep percentage | sed -n "1p" | sed -e 's/^.* //' | sed 's/%//') @@ -7,10 +7,10 @@ stat=$(upower -d | grep -m1 state | sed -e 's/^.* //') ## if any argument if [ $# -gt 0 ]; then if [[ $stat == "charging" ]]; then - echo "BAT +$prct" + echo "BAT $prct +" exit fi - echo "BAT -$prct" + echo "BAT $prct -" exit fi diff --git a/dwmblocks_scripts/dwm_ipaddr b/dwmblocks_scripts/dwm_ipaddr index 4598eaf..6b4aba3 100755 --- a/dwmblocks_scripts/dwm_ipaddr +++ b/dwmblocks_scripts/dwm_ipaddr @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash eth="$(ip -4 addr show enp8s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" wlp="$(ip -4 addr show wlp7s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" @@ -8,4 +8,4 @@ then exit; fi -echo "$wlp" \ No newline at end of file +echo "$wlp" diff --git a/dwmblocks_scripts/dwm_memory b/dwmblocks_scripts/dwm_memory index f70e223..eab4d23 100755 --- a/dwmblocks_scripts/dwm_memory +++ b/dwmblocks_scripts/dwm_memory @@ -1,5 +1,5 @@ #!/bin/sh mem="$(free -h | awk '/^Mem:/ {print $3 "/" $2}')" -echo -e "$mem" +echo "$mem" diff --git a/dwmblocks_scripts/dwm_volume b/dwmblocks_scripts/dwm_volume index 09527b8..c774271 100755 --- a/dwmblocks_scripts/dwm_volume +++ b/dwmblocks_scripts/dwm_volume @@ -1,19 +1,5 @@ -#!/bin/sh +#!/bin/bash -vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" +vol="$(pamixer --get-volume-human)" +echo "VOL $vol" -## if any argument -if [ $# -gt 0 ]; then - stat="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)].*/\1/')" - if [[ $(echo $stat) == "on" ]]; then - echo "VOL $vol%" - exit - fi - echo "MUT $vol%" - exit -fi - - -## just returns volume % -vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" -echo -e "$vol" diff --git a/dwmblocks_scripts/dwm_volume_amixer.old b/dwmblocks_scripts/dwm_volume_amixer.old new file mode 100755 index 0000000..09527b8 --- /dev/null +++ b/dwmblocks_scripts/dwm_volume_amixer.old @@ -0,0 +1,19 @@ +#!/bin/sh + +vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" + +## if any argument +if [ $# -gt 0 ]; then + stat="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)].*/\1/')" + if [[ $(echo $stat) == "on" ]]; then + echo "VOL $vol%" + exit + fi + echo "MUT $vol%" + exit +fi + + +## just returns volume % +vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" +echo -e "$vol"