OSDN Git Service

auto restart applets
authorpaperbenni <paperbenni@gmail.com>
Mon, 23 Mar 2020 00:06:52 +0000 (01:06 +0100)
committerpaperbenni <paperbenni@gmail.com>
Mon, 23 Mar 2020 00:06:52 +0000 (01:06 +0100)
autostart.sh

index da1b0cc..6746a86 100755 (executable)
@@ -127,23 +127,32 @@ if [ -z "$ISLIVE" ]; then
        # don't need applet for ethernet
        if [ -e ~/.cache/haswifi ]; then
                echo "wifi enabled"
-               nm-applet &
+               while :; do
+                       if ! pgrep nm-applet; then
+                               nm-applet &
+                       fi
+                       sleep 6m
+               done &
        fi
 
 else
        instantmonitor
        feh --bg-scale /usr/share/instantwallpaper/defaultphoto.png
        conky -c /usr/share/instantwidgets/install.conf &
-       installapplet &
-       sleep 1
-       nm-applet &
+       sleep 0.3
+       while :; do
+               if ! pgrep nm-applet; then
+                       installapplet &
+                       nm-applet &
+               fi
+               sleep 6m
+       done &
        sleep 1
-       pa-applet &
 fi
 
 # laptop specific background jobs
 if [ -n "$ISLAPTOP" ]; then
-echo "libinput gestures"
+       echo "libinput gestures"
        command -v libinput-gestures \
                &>/dev/null &&
                libinput-gestures &