summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2017-07-07 13:49:25 +0200
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2017-07-07 13:49:25 +0200
commit9a33b0bf2d9a8690f1e05691b11ad25fa805994d (patch)
treeb7a07c6170c9a2caa0344854bba4a636ab3eeb3c
parentThe main display is renamed in stretch (diff)
downloaddisplay_autoset-9a33b0bf2d9a8690f1e05691b11ad25fa805994d.tar.xz
Save windows position but only in session on main X server
-rwxr-xr-xautodetect.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/autodetect.sh b/autodetect.sh
index 23fb26f..0b1ed83 100755
--- a/autodetect.sh
+++ b/autodetect.sh
@@ -81,8 +81,11 @@ EXT1_MAX="$(echo "$XRANDR" | get_resolution "$EXT1_NAME")"
EXT2_MAX="$(echo "$XRANDR" | get_resolution "$EXT2_NAME")"
## Save windows' positions before autodetection
+## ... but only in session on main X server
[ ! -d "$SAVEPATH" ] && mkdir -p "$SAVEPATH"
-"$PROG_PATH"/wpos.sh save "$HASH"
+if [ "$DISPLAY" = ":0.0" -o "$DISPLAY" = ":0" ]; then
+ "$PROG_PATH"/wpos.sh save "$HASH"
+fi
## Main "profiles" logic
## Start with some special command