update sirius.sh with taro socket support, change t2stats battery meter
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmQieNsACgkQO3+8IhRO Y5hQHBAAg/Z6HXf83XxO6k5XqPwt5n03ZMfkf4CCQWT9Bgnvrm3gU6S7RSgd5fsK yCjkBZJoDUUxW2kmE9FZqilDuS5M3hTyptmDQuBSCgnZ8aBDPCo8IEBtxUKRrLjh ra5lr/BIIE5OIsVsbcx8Vaih3bV8x7NVC4sF32kcJHK8IlxMPEDuaJngJulbKjKU +C2fxX6zw47k6D5V35hVCOSYBSd8nu3wyQLip67igiGCSzvbpF4MiHYA4C6X8Ttx DyuEG36gp3mmygtw8g+cWnQK8zU01Uq2fr17mUANsaTaiJ7rPAJd5rjMxNnkD2po PQusNmhahVwSpXzRDrC8x77jYE5J6wvNJVPmiytgYlcYNrPwrXsVmgJEDpzqr63x nE91VO1xlxTI67wMydGkkZaM8yxOp4/r9Uc2Z4w7WV0e5XZqLdB0ycA9bQwL5u83 0OzRIxr7l6FXihNBxhtMsf55C+Tm7z19/2XyA1dlkj5yndUZwLe0hDPU3ty7DyMc lPXiR6FOpKxKGj1/3cAtfI6rCETRGxy1Gg2wxCHbuKI9dsrslbdR+rvHbyhf368r UDGV5TupLdMWSp6ZZ/x5qGWxTmLrON+45VwaLGzFZwliDFcUlPJDnT1XgDIN+FMD XEJCs5DPHLvTdCGdrDip/6G42nf1WMUIDF66c9hwi0C1rmtqt+Y= =Wm0R -----END PGP SIGNATURE-----
2 files changed,
29 insertions(+),
11 deletions(-)
M
sirius.sh
→
sirius.sh
@@ -5,6 +5,7 @@ # Derek Stevens <nilix@nilfm.cc>
# MIT License inbox=~/lib/mail/zoho/INBOX +tarosock=~/src/taro/taro.sock if [ "$1" = "-s" ]; then oldnew=$(\ls -1 ${inbox}/new | wc -l)@@ -21,6 +22,9 @@ newnew=$(\ls -1 ${inbox}/new | wc -l)
if [ ${newnew} -gt ${oldnew} ]; then notify-send -c mail 'new mail' "[${newnew}]" + if [ -S ${tarosock} ]; then + printf "0" | socat UNIX-CONNECT:${tarosock} - + fi else notify-send -c mail 'mail' "[sync complete]" fi@@ -33,6 +37,9 @@ newnew=$(\ls -1 ${inbox}/new | wc -l)
if [ ${newnew} -gt ${oldnew} ]; then notify-send -c mail 'new mail' "[${newnew}]" + if [ -S ${tarosock} ]; then + printf "0" | socat UNIX-CONNECT:${tarosock} - + fi fi oldnew=${newnew} sleep 5m
M
t2stats.sh
→
t2stats.sh
@@ -45,39 +45,50 @@ # battery
if ! grep Full /sys/class/power_supply/BAT*/status > /dev/null \ && [ -d /sys/class/power_supply/BAT* ]; then 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 0) - meter=" " + meter="${left} ${right}" ;; 1|2|3|4|5|6|7|8|9) - meter=" " + meter="${left} ${right}" ;; 10|11|12|13|14|15|16|17|18|19) - meter=" " + meter="${left} ${right}" ;; 20|21|22|23|24|25|26|27|28|29) - meter=" " + meter="${left} ${right}" ;; 30|31|32|33|34|35|36|37|38|39) - meter=" " + meter="${left} ${right}" ;; 40|41|42|43|44|45|46|47|48|49) - meter=" " + meter="${left} ${right}" ;; 50|51|52|53|54|55|56|57|58|59) - meter=" " + meter="${left} ${right}" ;; 60|61|62|63|64|65|66|67|68|69) - meter=" " + meter="${left} ${right}" ;; 70|71|72|73|74|75|76|77|78|79) - meter=" " + meter="${left} ${right}" ;; 80|81|82|83|84|85|86|87|88|89) - meter="" + meter="${left}${right}" ;; *) - meter="" + meter="${left}${right}" ;; esac