OSDN Git Service

make instantswitch use iconf
authorpaperbenni <paperbenni@gmail.com>
Tue, 10 Mar 2020 11:10:47 +0000 (12:10 +0100)
committerpaperbenni <paperbenni@gmail.com>
Tue, 10 Mar 2020 11:10:47 +0000 (12:10 +0100)
autostart.sh
monitor.sh
programs/instantswitch

index 10bdb6a..24f9615 100755 (executable)
@@ -75,7 +75,7 @@ instantshell
 
 if [ -z "$ISLIVE" ]; then
        cd ~/instantos
-       if ! grep -q '....' ~/instantos/monitor/max.txt; then
+       if ! iconf -i max; then
                instantmonitor
        fi
 
index 7f2fba3..5078b8a 100755 (executable)
@@ -25,14 +25,14 @@ fi
 
 if [ $(echo "$RESOLUTIONS" | sort -u | wc -l) = "1" ]; then
     echo "resolutions identical"
-    iconf max $(head -1 <<<"$RESOLUTIONS")
+    iconf -i max $(head -1 <<<"$RESOLUTIONS")
 else
     let PIXELS1="$(head -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(head -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
     let PIXELS2="$(tail -1 <<<$RESOLUTIONS | grep -o '^[0-9]*') * $(tail -1 <<<$RESOLUTIONS | grep -o '[0-9]*$')"
     if [ "$PIXELS1" -gt "$PIXELS2" ]; then
-        iconf max "$(head -1 <<<$RESOLUTIONS)"
+        iconf -i max "$(head -1 <<<$RESOLUTIONS)"
     else
-        iconf max "$(tail -1 <<<$RESOLUTIONS)"
+        iconf -i max "$(tail -1 <<<$RESOLUTIONS)"
     fi
 fi
 
index 1dae960..642e98b 100755 (executable)
@@ -13,7 +13,7 @@
 # alt tab like behaviour with rofi
 if ! [ -n "$1" ]; then
     # is multi monitor?
-    if ! [ -e ~/instantos/monitor/right.txt ]; then
+    if ! iconf -i right; then
         rofi -show window -kb-row-down 'Alt+Tab,Down' -kb-row-up 'Alt+Ctrl+Tab,Up' -kb-accept-entry '!Alt_L,!Alt+Tab,Return'
         exit
     else
@@ -35,7 +35,7 @@ focuswin() {
 }
 
 # single monitor doesnt need fixes
-if ! [ -e ~/instantos/monitor/right.txt ]; then
+if ! iconf -i right; then
     focuswin "$1"
     exit
 fi
@@ -61,7 +61,7 @@ pfw() {
 getmonitor() {
     xdotool key 'super+W'
     XPOS=$(xdotool getmouselocation --shell | head -1 | grep -o '[0-9]*')
-    if [ "$XPOS" -gt "$(cat ~/instantos/monitor/right.txt)" ]; then
+    if [ "$XPOS" -gt "$(iconf right)" ]; then
         echo "1"
     else
         echo "0"