Skip to content

@joshua-mcintosh /.statusline.sh
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
statnot shatus script
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.