Changed quoting convention
This commit is contained in:
parent
d763d33e20
commit
e2201ce340
|
@ -8,31 +8,31 @@ read -r charge_now </sys/class/power_supply/BAT0/charge_now
|
||||||
|
|
||||||
if [ "$ac" = 1 ] ; then
|
if [ "$ac" = 1 ] ; then
|
||||||
read -r charge_full </sys/class/power_supply/BAT0/charge_full
|
read -r charge_full </sys/class/power_supply/BAT0/charge_full
|
||||||
val=$(( charge_full-charge_now ))
|
val="$(( charge_full-charge_now ))"
|
||||||
else
|
else
|
||||||
val=$charge_now
|
val="$charge_now"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
hr=$(( val / rate ))
|
hr="$(( val / rate ))"
|
||||||
mn=$(( (val * 60) / rate - hr * 60 ))
|
mn="$(( (val * 60) / rate - hr * 60 ))"
|
||||||
|
|
||||||
case $hr in
|
case "$hr" in
|
||||||
0)
|
0)
|
||||||
case $mn in
|
case "$mn" in
|
||||||
0) notify-send "Battery fully charged" ;;
|
0) notify-send "Battery fully charged" ;;
|
||||||
1) notify-send "1 minute remaining" ;;
|
1) notify-send "1 minute remaining" ;;
|
||||||
*) notify-send "$mn minutes remaining" ;;
|
*) notify-send "$mn minutes remaining" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
case $mn in
|
case "$mn" in
|
||||||
0) notify-send "1 hour remaining" ;;
|
0) notify-send "1 hour remaining" ;;
|
||||||
1) notify-send "1 hour, 1 minute remaining" ;;
|
1) notify-send "1 hour, 1 minute remaining" ;;
|
||||||
*) notify-send "1 hour, $mn minutes remaining" ;;
|
*) notify-send "1 hour, $mn minutes remaining" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case $mn in
|
case "$mn" in
|
||||||
0) notify-send "$hr hours remaining" ;;
|
0) notify-send "$hr hours remaining" ;;
|
||||||
1) notify-send "$hr hours, 1 minute remaining" ;;
|
1) notify-send "$hr hours, 1 minute remaining" ;;
|
||||||
*) notify-send "$hr hours, $mn minutes remaining" ;;
|
*) notify-send "$hr hours, $mn minutes remaining" ;;
|
||||||
|
|
|
@ -6,7 +6,7 @@ ICONc="
" # icon for critical temperatures
|
||||||
crit=70 # critical temperature
|
crit=70 # critical temperature
|
||||||
|
|
||||||
read -r temp </sys/class/thermal/thermal_zone0/temp
|
read -r temp </sys/class/thermal/thermal_zone0/temp
|
||||||
temp=${temp%???}
|
temp="${temp%???}"
|
||||||
|
|
||||||
if [ "$temp" -lt "$crit" ] ; then
|
if [ "$temp" -lt "$crit" ] ; then
|
||||||
printf "$ICONn%s°C" "$temp"
|
printf "$ICONn%s°C" "$temp"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
case $1 in
|
case "$1" in
|
||||||
1) exec "$TERMINAL" -e "htop -s PERCENT_CPU" ;;
|
1) exec "$TERMINAL" -e "htop -s PERCENT_CPU" ;;
|
||||||
2) exec "$TERMINAL" -e "htop" ;;
|
2) exec "$TERMINAL" -e "htop" ;;
|
||||||
3) exec "$TERMINAL" -e "htop -s PERCENT_MEM" ;;
|
3) exec "$TERMINAL" -e "htop -s PERCENT_MEM" ;;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# This script parses the output of `pactl list sinks' to find volume and mute
|
# This script parses the output of `pactl list sinks' to find volume and mute
|
||||||
# status of the default audio sink and whether headphones are plugged in or not
|
# status of the default audio sink and whether headphones are plugged in or not
|
||||||
# Also see ../daemons/pulse_daemon.sh
|
# Also see ../daemons/pulse_daemon.sh
|
||||||
sink=$(pactl info | awk '$1 == "Default" && $2 == "Sink:" {print $3}')
|
sink="$(pactl info | awk '$1 == "Default" && $2 == "Sink:" {print $3}')"
|
||||||
[ -n "$sink" ] || exit
|
[ -n "$sink" ] || exit
|
||||||
pactl list sinks | awk -v sink="$sink" '
|
pactl list sinks | awk -v sink="$sink" '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
case $1 in
|
case "$1" in
|
||||||
1) pactl set-sink-mute @DEFAULT_SINK@ toggle ;;
|
1) pactl set-sink-mute @DEFAULT_SINK@ toggle ;;
|
||||||
3) pactl set-sink-volume @DEFAULT_SINK@ 50% ;;
|
3) pactl set-sink-volume @DEFAULT_SINK@ 50% ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# It signals volume block to update on audio related events
|
# It signals volume block to update on audio related events
|
||||||
pactl subscribe |
|
pactl subscribe |
|
||||||
while IFS='' read -r output ; do
|
while IFS='' read -r output ; do
|
||||||
case $output in
|
case "$output" in
|
||||||
*" sink "*) sigdwmblocks 1 ;;
|
*" sink "*) sigdwmblocks 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue