update sirius.sh with taro socket support, change t2stats battery meter
This commit is contained in:
parent
2c5bc6f971
commit
000dfce9fc
2 changed files with 29 additions and 11 deletions
|
@ -5,6 +5,7 @@
|
||||||
# MIT License
|
# MIT License
|
||||||
|
|
||||||
inbox=~/lib/mail/zoho/INBOX
|
inbox=~/lib/mail/zoho/INBOX
|
||||||
|
tarosock=~/src/taro/taro.sock
|
||||||
|
|
||||||
if [ "$1" = "-s" ]; then
|
if [ "$1" = "-s" ]; then
|
||||||
oldnew=$(\ls -1 ${inbox}/new | wc -l)
|
oldnew=$(\ls -1 ${inbox}/new | wc -l)
|
||||||
|
@ -21,6 +22,9 @@ if [ "$1" = "-s" ]; then
|
||||||
|
|
||||||
if [ ${newnew} -gt ${oldnew} ]; then
|
if [ ${newnew} -gt ${oldnew} ]; then
|
||||||
notify-send -c mail 'new mail' "[${newnew}]"
|
notify-send -c mail 'new mail' "[${newnew}]"
|
||||||
|
if [ -S ${tarosock} ]; then
|
||||||
|
printf "0" | socat UNIX-CONNECT:${tarosock} -
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
notify-send -c mail 'mail' "[sync complete]"
|
notify-send -c mail 'mail' "[sync complete]"
|
||||||
fi
|
fi
|
||||||
|
@ -33,6 +37,9 @@ else
|
||||||
|
|
||||||
if [ ${newnew} -gt ${oldnew} ]; then
|
if [ ${newnew} -gt ${oldnew} ]; then
|
||||||
notify-send -c mail 'new mail' "[${newnew}]"
|
notify-send -c mail 'new mail' "[${newnew}]"
|
||||||
|
if [ -S ${tarosock} ]; then
|
||||||
|
printf "0" | socat UNIX-CONNECT:${tarosock} -
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
oldnew=${newnew}
|
oldnew=${newnew}
|
||||||
sleep 5m
|
sleep 5m
|
||||||
|
|
33
t2stats.sh
33
t2stats.sh
|
@ -45,39 +45,50 @@ if [ "$1" = "-r" ]; then
|
||||||
if ! grep Full /sys/class/power_supply/BAT*/status > /dev/null \
|
if ! grep Full /sys/class/power_supply/BAT*/status > /dev/null \
|
||||||
&& [ -d /sys/class/power_supply/BAT* ]; then
|
&& [ -d /sys/class/power_supply/BAT* ]; then
|
||||||
powerlevel=$(cat /sys/class/power_supply/BAT*/capacity)
|
powerlevel=$(cat /sys/class/power_supply/BAT*/capacity)
|
||||||
|
state=$(cat /sys/class/power_supply/BAT*/status)
|
||||||
|
left=""
|
||||||
|
right=""
|
||||||
|
case $state in
|
||||||
|
Discharging)
|
||||||
|
right="-";;
|
||||||
|
Charging)
|
||||||
|
right="+";;
|
||||||
|
Charged)
|
||||||
|
right="=";;
|
||||||
|
esac
|
||||||
case $powerlevel in
|
case $powerlevel in
|
||||||
0)
|
0)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
1|2|3|4|5|6|7|8|9)
|
1|2|3|4|5|6|7|8|9)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
10|11|12|13|14|15|16|17|18|19)
|
10|11|12|13|14|15|16|17|18|19)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
20|21|22|23|24|25|26|27|28|29)
|
20|21|22|23|24|25|26|27|28|29)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
30|31|32|33|34|35|36|37|38|39)
|
30|31|32|33|34|35|36|37|38|39)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
40|41|42|43|44|45|46|47|48|49)
|
40|41|42|43|44|45|46|47|48|49)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
50|51|52|53|54|55|56|57|58|59)
|
50|51|52|53|54|55|56|57|58|59)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
60|61|62|63|64|65|66|67|68|69)
|
60|61|62|63|64|65|66|67|68|69)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
70|71|72|73|74|75|76|77|78|79)
|
70|71|72|73|74|75|76|77|78|79)
|
||||||
meter=" "
|
meter="${left} ${right}"
|
||||||
;;
|
;;
|
||||||
80|81|82|83|84|85|86|87|88|89)
|
80|81|82|83|84|85|86|87|88|89)
|
||||||
meter=""
|
meter="${left}${right}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
meter=""
|
meter="${left}${right}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue