From 9a33b0bf2d9a8690f1e05691b11ad25fa805994d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Fri, 7 Jul 2017 13:49:25 +0200 Subject: Save windows position but only in session on main X server --- autodetect.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3