How can I stop windows re-positioning after waking up monitors?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have a laptop with multi-monitor setup, one is HDMI and the other is VGA. I have the energy saving setting set to dim screen after 5 min and switch screen off after 10 min, with suspends set to never. I lock my PC and after 10 had passed, when I re-login all open windows will moved to the laptop screen! I would like to keep all windows in place without having to reorder them each time. Is there a solution to this?
System Information:
List item
OS: Kubuntu 18.04 64-bit
- KDE Plasma Version: 5.12.6
- Graphics Card: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
kde multi-monitor kubuntu plasma5
add a comment |Â
up vote
2
down vote
favorite
I have a laptop with multi-monitor setup, one is HDMI and the other is VGA. I have the energy saving setting set to dim screen after 5 min and switch screen off after 10 min, with suspends set to never. I lock my PC and after 10 had passed, when I re-login all open windows will moved to the laptop screen! I would like to keep all windows in place without having to reorder them each time. Is there a solution to this?
System Information:
List item
OS: Kubuntu 18.04 64-bit
- KDE Plasma Version: 5.12.6
- Graphics Card: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
kde multi-monitor kubuntu plasma5
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a laptop with multi-monitor setup, one is HDMI and the other is VGA. I have the energy saving setting set to dim screen after 5 min and switch screen off after 10 min, with suspends set to never. I lock my PC and after 10 had passed, when I re-login all open windows will moved to the laptop screen! I would like to keep all windows in place without having to reorder them each time. Is there a solution to this?
System Information:
List item
OS: Kubuntu 18.04 64-bit
- KDE Plasma Version: 5.12.6
- Graphics Card: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
kde multi-monitor kubuntu plasma5
I have a laptop with multi-monitor setup, one is HDMI and the other is VGA. I have the energy saving setting set to dim screen after 5 min and switch screen off after 10 min, with suspends set to never. I lock my PC and after 10 had passed, when I re-login all open windows will moved to the laptop screen! I would like to keep all windows in place without having to reorder them each time. Is there a solution to this?
System Information:
List item
OS: Kubuntu 18.04 64-bit
- KDE Plasma Version: 5.12.6
- Graphics Card: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
kde multi-monitor kubuntu plasma5
kde multi-monitor kubuntu plasma5
asked Sep 3 at 11:22
Waqleh
156117
156117
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
Use this simple shellscript before and after suspend:
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This can be saved & loaded
getpos()
wmctrl -l -G > /dev/shm/winposs
setpos()
while read -r id g x y w h host app;do
IFS=" ," read ta tb a b c d <<<$(xprop -id "$id" _NET_FRAME_EXTENTS 2>/dev/null)
[ -z $d ] && continue
wmctrl -i -r $id -e "$g,$((x-$d)),$((y-$c)),$((w+$d+$b)),$((h+$c+$a))" 2>/dev/null
done < /dev/shm/winposs
case $1 in
get) echo getting window positions
getpos
;;
set) echo setting window positions
setpos
;;
run) getpos
shift
$@
setpos
;;
*) echo "Usage: $0##*/"' [get|set|run <command>]'
;;
esac
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
Replace firstsh
tobash
.
â Ipor Sircer
Sep 18 at 8:33
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Use this simple shellscript before and after suspend:
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This can be saved & loaded
getpos()
wmctrl -l -G > /dev/shm/winposs
setpos()
while read -r id g x y w h host app;do
IFS=" ," read ta tb a b c d <<<$(xprop -id "$id" _NET_FRAME_EXTENTS 2>/dev/null)
[ -z $d ] && continue
wmctrl -i -r $id -e "$g,$((x-$d)),$((y-$c)),$((w+$d+$b)),$((h+$c+$a))" 2>/dev/null
done < /dev/shm/winposs
case $1 in
get) echo getting window positions
getpos
;;
set) echo setting window positions
setpos
;;
run) getpos
shift
$@
setpos
;;
*) echo "Usage: $0##*/"' [get|set|run <command>]'
;;
esac
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
Replace firstsh
tobash
.
â Ipor Sircer
Sep 18 at 8:33
add a comment |Â
up vote
2
down vote
Use this simple shellscript before and after suspend:
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This can be saved & loaded
getpos()
wmctrl -l -G > /dev/shm/winposs
setpos()
while read -r id g x y w h host app;do
IFS=" ," read ta tb a b c d <<<$(xprop -id "$id" _NET_FRAME_EXTENTS 2>/dev/null)
[ -z $d ] && continue
wmctrl -i -r $id -e "$g,$((x-$d)),$((y-$c)),$((w+$d+$b)),$((h+$c+$a))" 2>/dev/null
done < /dev/shm/winposs
case $1 in
get) echo getting window positions
getpos
;;
set) echo setting window positions
setpos
;;
run) getpos
shift
$@
setpos
;;
*) echo "Usage: $0##*/"' [get|set|run <command>]'
;;
esac
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
Replace firstsh
tobash
.
â Ipor Sircer
Sep 18 at 8:33
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Use this simple shellscript before and after suspend:
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This can be saved & loaded
getpos()
wmctrl -l -G > /dev/shm/winposs
setpos()
while read -r id g x y w h host app;do
IFS=" ," read ta tb a b c d <<<$(xprop -id "$id" _NET_FRAME_EXTENTS 2>/dev/null)
[ -z $d ] && continue
wmctrl -i -r $id -e "$g,$((x-$d)),$((y-$c)),$((w+$d+$b)),$((h+$c+$a))" 2>/dev/null
done < /dev/shm/winposs
case $1 in
get) echo getting window positions
getpos
;;
set) echo setting window positions
setpos
;;
run) getpos
shift
$@
setpos
;;
*) echo "Usage: $0##*/"' [get|set|run <command>]'
;;
esac
Use this simple shellscript before and after suspend:
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This can be saved & loaded
getpos()
wmctrl -l -G > /dev/shm/winposs
setpos()
while read -r id g x y w h host app;do
IFS=" ," read ta tb a b c d <<<$(xprop -id "$id" _NET_FRAME_EXTENTS 2>/dev/null)
[ -z $d ] && continue
wmctrl -i -r $id -e "$g,$((x-$d)),$((y-$c)),$((w+$d+$b)),$((h+$c+$a))" 2>/dev/null
done < /dev/shm/winposs
case $1 in
get) echo getting window positions
getpos
;;
set) echo setting window positions
setpos
;;
run) getpos
shift
$@
setpos
;;
*) echo "Usage: $0##*/"' [get|set|run <command>]'
;;
esac
edited Sep 18 at 8:33
answered Sep 3 at 12:30
Ipor Sircer
9,3511920
9,3511920
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
Replace firstsh
tobash
.
â Ipor Sircer
Sep 18 at 8:33
add a comment |Â
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
Replace firstsh
tobash
.
â Ipor Sircer
Sep 18 at 8:33
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
i think this script has a syntax error on line 11, but i cant figure out how ti fix it!
â Waqleh
Sep 18 at 8:22
1
1
Replace first
sh
to bash
.â Ipor Sircer
Sep 18 at 8:33
Replace first
sh
to bash
.â Ipor Sircer
Sep 18 at 8:33
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466551%2fhow-can-i-stop-windows-re-positioning-after-waking-up-monitors%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password