You are not logged in.
Pages: 1
Topic closed
Hi,
I have i3 for my window manager and have it run the code
xset dpms force offto turn off the screen when I press a certain key. It can turn off, but when it's woke back up, the mouse and keyboard don't work. How can I fix this? In my i3 config file I have this
bindsym $mod+F2 exec --no-startup-id xset dpms force offThanks
Last edited by doubleslash (2018-08-27 15:50:39)
Offline
Check your xorg log and dmesg t see what happens to the input devices.
Also elaborate on your setup (notably: is the "screen" an external monitor w/ a USB hub where your input devices are plugged?) and how the devices "don't work" (does the pointer still move? are the devices powered, ie. do their LEDs light? Can you maybe still switch the numlock state?)
Also: is this effect limited to the shortcut or does the same happen if you run xset from an interactive shell?
Offline
My setup is just a regular laptop. The cursor moves but the keyboard can't input the characters. It doesn't happen if I run xset from an interactive shell
Offline
Sounds as if DPMS "confuses" i3 in a way that it stops processing (incl. focus distribution, possibly any input handling) events.
Try to "sleep 1" before xset, possibly forking the command in a subshell, (sleep 1; xset dpms force off) &, to give yourself time to release the key?
Offline
There seems to be something wrong with the syntax. I tried
bindsym $mod+F2 exec (sleep 1; xset dpms force off) & and
bindsym $mod+F2 exec sleep 1; xset dpms force offbut I get the error
ERROR: Expected one of these tokens <end>, '[', 'move', 'exec', 'exit', ...Last edited by doubleslash (2018-08-24 21:33:51)
Offline
I've like zero experience w/ i3, but apparently the exec command has limited shell syntax support - try to wrap the command into a script and bind that.
Offline
I created a script screenoff.sh
sleep 1; xset dpms force off &and bind it to a keystroke like this
bindsym $mod+F2 exec --no-startup-id screenoff.shLast edited by doubleslash (2018-08-27 16:22:13)
Offline
or you can just
bindsym $mod+F2 exec "i3lock -c '#212121' && sleep 1 && xset dpms force off"(do not forget the quotes marks)
Last edited by leolace (2024-02-13 02:48:54)
Offline
Note your necrobumping a 6 year old thread. Please don't bump solved posts, to essentially mention the same thing again.
Closing.
Offline
Pages: 1
Topic closed