mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -04:00
change variable names inside sb scripts, and add uptime
This commit is contained in:
parent
057e894770
commit
418f7d5c54
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
read -r capacity < /sys/class/power_supply/BAT1/capacity
|
read -r value < /sys/class/power_supply/BAT1/capacity
|
||||||
|
|
||||||
printf '[BAT %s%%]\n' "$capacity"
|
printf '[BAT %s%%]\n' "$value"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
_date=$(date '+%b %-d %Y %-I:%M %p')
|
value=$(date '+%b %-d %Y %-I:%M %p')
|
||||||
|
|
||||||
printf '[%s]\n' "$_date"
|
printf '[%s]\n' "$value"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
memory=$(free -h | awk '/Mem/ {printf "%s/%s\n", $3, $2}' | sed 's/Gi/G/g; s/Mi/M/g')
|
value=$(free -h | awk '/Mem/ {printf "%s/%s\n", $3, $2}' | sed 's/Gi/G/g; s/Mi/M/g')
|
||||||
|
|
||||||
printf '[MEM %s]\n' "$memory"
|
printf '[MEM %s]\n' "$value"
|
||||||
|
|
5
bin/.local/bin/statusbar/sb-uptime
Executable file
5
bin/.local/bin/statusbar/sb-uptime
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
value=$(uptime -p | sed 's/ day[s]*\b/d/g; s/ hour[s]*\b/h/g; s/ minute[s]*\b/m/g; s/up //; s/,//g')
|
||||||
|
|
||||||
|
printf '[%s]\n' "$value"
|
|
@ -1,21 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
value=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||||
volume=${volume##Volume: }
|
value=${value##Volume: }
|
||||||
volume=${volume%%.*}${volume##*.}
|
value=${value%%.*}${value##*.}
|
||||||
|
|
||||||
case "$volume" in
|
case "$value" in
|
||||||
*MUTED*)
|
*MUTED*)
|
||||||
muted=1
|
muted=1
|
||||||
volume=${volume%% \[MUTED\]}
|
value=${value%% \[MUTED\]}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
volume=${volume#0}
|
value=${value#0}
|
||||||
volume=${volume#0}
|
value=${value#0}
|
||||||
|
|
||||||
if [ -z "$muted" ]; then
|
if [ -z "$muted" ]; then
|
||||||
printf '[VOL %s%%]\n' "$volume"
|
printf '[VOL %s%%]\n' "$value"
|
||||||
else
|
else
|
||||||
printf '[VOL %s%% M]\n' "$volume"
|
printf '[VOL %s%% M]\n' "$value"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue