Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant amount of delay in command execution from key binding #279

Closed
ohxxm opened this issue Jul 26, 2022 · 2 comments
Closed

Significant amount of delay in command execution from key binding #279

ohxxm opened this issue Jul 26, 2022 · 2 comments

Comments

@ohxxm
Copy link

ohxxm commented Jul 26, 2022

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).

@emanuele6
Copy link

emanuele6 commented Jul 26, 2022

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.

@ohxxm
Copy link
Author

ohxxm commented Jul 30, 2022

This fixed the issue thanks

@ohxxm ohxxm closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants