upload
This commit is contained in:
37
bin/mb-tint2restart
Executable file
37
bin/mb-tint2restart
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# mb-tint2restart to be used by mb-tint2-pipemenu
|
||||
# Written by damo <damo@bunsenlabs.org> for BunsenLabs Linux, April 2015
|
||||
# and johnraff <john@bunsenlabs.org> July 2015
|
||||
# Potred to Manjaro by napcok <napcok@gmail.com>
|
||||
|
||||
declare -A commands # associative array
|
||||
|
||||
while read pid cmd; do
|
||||
if [[ ${cmd%% *} = tint2 ]]; then
|
||||
kill "$pid"
|
||||
commands[$cmd]=1 # duplicate commands will be launched only once
|
||||
fi
|
||||
done <<< "$(pgrep -a tint2)"
|
||||
|
||||
sleep 1
|
||||
|
||||
# any processes still running will be killed with SIGKILL
|
||||
while read pid cmd; do
|
||||
if [[ ${cmd%% *} = tint2 ]]; then
|
||||
kill -KILL "$pid"
|
||||
commands[$cmd]=1
|
||||
fi
|
||||
done <<< "$(pgrep -a tint2)"
|
||||
|
||||
sleep 1
|
||||
for i in "${!commands[@]}" # go through the indexes
|
||||
do
|
||||
(setsid $i &)
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
sleep 1
|
||||
if pgrep picom;then mabox-compositor --restart; fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user