OSDN Git Service

improve instantdisper formatting
authorpaperbenni <paperbenni@gmail.com>
Sun, 2 Aug 2020 15:55:30 +0000 (17:55 +0200)
committerpaperbenni <paperbenni@gmail.com>
Sun, 2 Aug 2020 15:55:30 +0000 (17:55 +0200)
autostart.sh
programs/instantdisper

index a9c8a77..5f3d4e5 100755 (executable)
@@ -310,14 +310,14 @@ if ! (iconf -i noautoswitch && iconf -i islaptop) || iconf -i autoswitch; then
                while :; do
                        NEWDISPLAYCOUNT="$(xrandr | grep -c '[^s]connected')"
                        if ! [ "$DISPLAYCOUNT" = "$NEWDISPLAYCOUNT" ]; then
+                               notify-send "display changed"
+                               echo "displays changed"
                                if [ "$NEWDISPLAYCOUNT" -gt 1 ]; then
                                        instantdisper
                                        echo "multi monitor setup"
                                else
                                        disper -e
                                fi
-                               echo "displays changed"
-                               notify-send "display changed"
                                DISPLAYCOUNT="$NEWDISPLAYCOUNT"
                                # todo: open menu
                        fi
index f1b31ec..6d17349 100755 (executable)
@@ -8,7 +8,7 @@ mainmenu() {
            Extend
            PC screen only
            Second screen only
-               Duplicate
+               Duplicate
 :g Set default action
 :r Close menu' | instantmenu -l 20 -h -1 -w 400 -c -w -1 -bw 4 -q search
 }
@@ -65,8 +65,9 @@ setdefault() {
 # apply saved setting
 applydefault() {
     if ! iconf automon; then
-        echo "error applying default monitor setting"
+        echo "no default monitor setting"
     fi
+
     AUTOMON="$(iconf automon)"
     if grep '^[esSc]$' <<<"$AUTOMON"; then
         disper -"$AUTOMON"