-
Notifications
You must be signed in to change notification settings - Fork 339
Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when keybinding help window takes a long time (atleast more than a second) to pop up. This is due to the fact that each time hypr/scripts/keybindings.sh is called the whole .conf file is read to auto generate the keybinds variable which is later used as an input redirection to launch a rofi window for the list.
Describe the solution you'd like
Rather than generating the keybinds variable from the keybind .conf (eg. hypr/keybindings/default.conf) file each time hypr/scripts/keybindings.sh script is ran, it can be generated once
after each modification. It can be done in this process:
- check if a generated help file already exists for the selected keybind .conf file.
- if not: generate a file from the
keybindsvariable. - else: use already generated help file
To ensure for each modification a single file is generated if can be checked either using the last modification using stat -c '%Y' $config_file or by generating a hash value for the file.
Additional context
Only the while loop to read default.conf file in hypr/scripts/keybindings.sh takes about ~820 milliseconds on my machine. This is apart from the time taken by rofi to start after the 0.2s sleep. Which sums up to about a couple of seconds sometimes. Meanwhile there is no confirmation whether I've hit the right keybind for the keybind help or not.