Minor improvments to init & ~/bin scripts, remove numlock from autostarts

This commit is contained in:
natemaia
2017-12-26 15:03:54 -08:00
parent 88ecac0da3
commit 92ada44d97
8 changed files with 39 additions and 21 deletions

View File

@ -4,15 +4,19 @@ on=""
off=""
# if the script is passed --toggle
if [[ $1 == *toggle* ]] && pgrep caffeine &>/dev/null; then
killall caffeine && exit 0
elif [[ $1 == *toggle* ]]; then
caffeine && exit 0
if [[ "$1" ]]; then
if [[ "$1" == *toggle* ]] && [[ "$(pidof caffeine)" ]]; then
killall caffeine
elif [[ "$1" == *toggle* ]]; then
caffeine &
fi
exit 0
fi
while true; do
# caffeine is running
if pgrep caffeine &>/dev/null; then
if [[ "$(pidof caffeine)" ]]; then
echo "%{F#0000FF}$on"
else
echo "%{F#FF0000}$off"