dakyskye / dxhd

daky's X11 Hotkey Daemon
MIT License
99 stars 6 forks source link

xdotool key not working with dxhd #41

Open avahe-kellenberger opened 3 years ago

avahe-kellenberger commented 3 years ago

What happened

Executing the following script fails with dxhd, but does not with sxhd:

#!/usr/bin/env bash

win=$(xdotool getactivewindow)
xdotool key --window "$win" super+space
xdotool windowsize "$win" 800 970 
xdotool windowmove "$win" 560 295
dakyskye commented 3 years ago

Oh, I might know why. Can you try it without that shebang? env shebangs are not supported IIRC, there's a flaw. I'll try to hotfix it into master in the near future.

avahe-kellenberger commented 3 years ago

It's a separate script file that is executed, does that still matter? I'll try it out later.

dakyskye commented 3 years ago

Oh, then no. Alright I'll debug it when I get some free time :+1:

dakyskye commented 3 years ago

It's very weird. I made a new minimal Go program to try this thing and it still fails. It does the job one out of ten times :woman_shrugging: this issue needs more attention.

avahe-kellenberger commented 3 years ago

Hmm have you attempted this with sxhkd? It works for me but maybe it'll bring attention to something we're missing.

dakyskye commented 3 years ago

No I've not. I will try it now.

dakyskye commented 3 years ago

Does not work for me with sxhkd either.

avahe-kellenberger commented 3 years ago

I'll test it again in a few hours, will report back what I find

dakyskye commented 3 years ago

Have you tested it?

shalva97 commented 3 years ago

my guess is that you should also send keyup evens for the shortcut you bound that script to. I have asked similar question here

There is also 2 workarounds, bind it on keyrelease or make a delay about 500ms so by the time script runs, you wont be pressing on any button on your keyboard...

dakyskye commented 3 years ago

ah, definitely worth giving a try. @avahe-kellenberger just prepend the keybinding with @ to make it run the command on key release event. I'll also try those workarounds tomorrow/the day after tomorrow.