diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-06-21 12:21:37 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-06-21 12:21:37 -0300 |
commit | b5671afebb3a90405b0fa4829e0fe654a4697928 (patch) | |
tree | b97fb1b78f710d9c022542ffa9063fed92d7b8d5 | |
parent | 7aabcfcda3aabdbee2dcad04c657a67f6cd5bd19 (diff) | |
download | utils-x11-b5671afebb3a90405b0fa4829e0fe654a4697928.tar.gz utils-x11-b5671afebb3a90405b0fa4829e0fe654a4697928.tar.bz2 |
Restore window focus at xlock
-rwxr-xr-x | xlock | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,8 +1,12 @@ #!/bin/bash # -# Lock the screen using xscreensaver +# Lock the screen of a X11 session # +# Get current focused window +# Some screen lockers such as i3lock loose the window focus +WINDOW="`xdotool getwindowfocus`" + # Using xscreensaver #xscreensaver-command --lock @@ -13,3 +17,6 @@ i3lock -c 1c1c1c # https://askubuntu.com/questions/62858/turn-off-monitor-using-command-line#62861 sleep 1 xset dpms force off + +# Restore focus +xdotool windowfocus $WINDOW |