OSDN Git Service

fix shutdown stop job and brightness saving
authorpaperbenni <paperbenni@gmail.com>
Tue, 8 Sep 2020 17:45:41 +0000 (19:45 +0200)
committerpaperbenni <paperbenni@gmail.com>
Tue, 8 Sep 2020 17:45:41 +0000 (19:45 +0200)
.gitignore [new file with mode: 0644]
programs/instantshutdown

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..6e92f57
--- /dev/null
@@ -0,0 +1 @@
+tags
index f2ad724..688644b 100755 (executable)
@@ -35,16 +35,29 @@ zconfirm() {
     fi
 }
 
+prepareshutdown(){
+    # save current brightness
+    if CURBRIGHT="$(/usr/share/instantassist/utils/b.sh g)"
+    then
+        iconf savebright "$CURBRIGHT"
+    fi
+
+    rm /tmp/instantosrunning
+    # these keep causing stop jobs
+    pkill -f clipnotify
+    pkill -f clipmenud
+}
+
 case "$answer" in
 shut*)
     zconfirm "shutdown"
-    rm /tmp/instantosrunning
+    prepareshutdown
     sleep 0.4
     shutdown now
     ;;
 reb*)
     zconfirm "reboot"
-    rm /tmp/instantosrunning
+    prepareshutdown
     sleep 0.4
     reboot
     ;;