Minor improvments to init & ~/bin scripts, remove numlock from autostarts
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
if [ "$(pidof compton)" ]; then
|
||||
if [[ "$(pidof compton)" ]]; then
|
||||
al-compositor --restart
|
||||
else
|
||||
al-compositor --start
|
||||
|
@ -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"
|
||||
|
@ -3,14 +3,17 @@
|
||||
on=""
|
||||
off=""
|
||||
|
||||
if [[ $1 == *toggle* ]] && [[ $(pidof compton) ]]; then
|
||||
al-compositor --stop && exit 0
|
||||
elif [[ $1 == *toggle* ]]; then
|
||||
al-compositor --start && exit 0
|
||||
if [[ "$1" ]]; then
|
||||
if [[ "$1" == *toggle* ]] && [[ "$(pidof compton)" ]]; then
|
||||
al-compositor --stop
|
||||
elif [[ "$1" == *toggle* ]]; then
|
||||
al-compositor --start
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if [[ $(pidof compton) ]]; then
|
||||
if [[ "$(pidof compton)" ]]; then
|
||||
echo "$on"
|
||||
else
|
||||
echo "%{F#888888}$off"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# small script to kill polybar if it is running
|
||||
# if it isnt running then start it the default session
|
||||
if [[ $(pidof polybar) ]]; then
|
||||
if [[ "$(pidof polybar)" ]]; then
|
||||
pkill polybar
|
||||
else
|
||||
al-polybar-session
|
||||
|
Reference in New Issue
Block a user