Significant amount of delay in command execution from key binding
ohxxm opened this issue · 2 comments
When using SXHKD with i3, I am getting a delay in execution of the command (1 second minimum). I don't know what's causing this issue and there is no error outputted either. I am currently on Fedora 36 and have installed sxhkd from DNF (Fedora's package manager).
That sounds suspicious.
It is probably caused by an information about your system you have not shared: your user's login shell.
sxhkd
uses the content of the SHELL
environment variable (i.e. the user's login shell) to run commands. (that can be overwritten by introducing a SXHKD_SHELL
variable in the environment.)
You are either using a non-standard shell that has a slow start-up time like tcsh
or fish
(see #161).
(If you are using a shell like fish
or tcsh
, your hotkeys may also not be compatible with dash
so make sure they are); or that maybe you are using the standard fedora shell (bash
), but it is still too slow for your system.
( In the comment I mentioned earlier, you can't see tcsh
, but know that, if you are using tcsh
are your sxhkd
shell, it will extremely slow (way more than fish
): on my PC, tcsh
takes 0.105seconds just to run one tcsh -c '/bin/echo hi'
)
I suggest you to explictly tell sxhkd
what shell to use to run hotkey commands (passing an SXHKD_SHELL
environment variable), and to use dash
as your sxhkd shell. It has a way faster start-up time than any other shell, including bash
.
Make sure you have dash
installed, and run sxhkd
as:
SXHKD_SHELL=/bin/dash sxhkd &
## instead of as just:
#sxhkd &
Or just make sure that SXHKD_SHELL=/bin/dash
is present in the environment and that sxhkd
inherits it.
This fixed the issue thanks