public
Last active

statnot shatus script

  • Download Gist
.statusline.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
batt_stat() {
batt_perc=$(acpi -b |awk -e 'sub(/%/,"") { print $4 }' |sed -e 's/,//')
if acpi -b |egrep 'Charg|Full' >/dev/null
then
batt_sym="\x05"
elif [[ $batt_perc -lt 20 ]]
then
batt_sym="\x03 "
else
batt_sym="\x01 "
fi
 
echo -e "$batt_sym $batt_perc%";
}
 
int () {
 
host -R1 -W1 google.com >/dev/null &&
echo -e "\x05 ON\x01 " || echo -e "\x03 NO\x01"
}
 
if [ $# -eq 0 ]; then
byobu=" \x01 $(tmux list-windows -a|wc -l)"
int=$(int)
home="  $(df -P | sort -d | awk '/^\/dev\/sda7/{s=s (s?" ":"") $5} END {printf "%s", s}') "
mem="  $(awk '/^-/ {print $3}' <(free -mh)) "
batt="$(batt_stat)"
time="\x02  `date +'%F %R'`"
echo -e " $int $batt $byobu $mem $home $time ";
else
echo -e "^tw() ^fg(grey50)[`date +%R`] ^fg(yellow)MSG $( cut -c 1-20 <<< $1 )\n ^fg(grey50)[`date +'%R:%S'`] ^fg(yellow)notify^fg()> $1" > $HOME/.notify;
fi

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.