I want to add hotkey support, and I'm thinking about where to store the definitions.
Options:
1. source code (compile-time)
This is fine for me, but it's less useful for non-programmers.
2. X resources
Challenge: what to query the resource database for to enumerate the hotkeys? One option would be to use the names of all programs on the menu, e.g., flwm.Terminal.hotkey: a-f12. (In addition to program names, it could also use built-in function names for which hotkey is to be defined, e.g., minimize-current-window.)
3. comments in .wmx scripts, e.g.,
#!/bin/sh
#flwm-hotkey: a-f12
...
Note: this is fine for items on the menu but not for proposed built-in-function hotkeys. Also, this requires a script for what might have otherwise just been a symbolic link to program.
4. specially named .wmx files, e.g.,
.hotkey-a-f12.xterm
5. new configuration file (could be xml or more terse text file format)
Such a configuration file could also define the menu (merged with the .wmx directory, if it's also used) and could specify desired desktop names, application geometry, etc.
6. some better idea I haven't thought of...
Opinions?
Thanks
Paul
p.s. In addition to hotkeys, I intend to write edge/corner support, which may be used like hotkeys to launch programs or invoke wm built-in functionality. For example, moving the pointer against an edge of the screen can bring up the flwm menu, invoke a screen-saver, launch a "shelf," etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(If I were to go with #3, I realize I'd need to avoid parsing all of the files each time the menu is activated. What I don't like about #3 is the need to make scripts when a simple symlink would have sufficed.)
(With #4, it is simple to just reindex the hotkeys everytime the menu is invoked (though hotkeys aren't strictly related to the menus).)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to add hotkey support, and I'm thinking about where to store the definitions.
Options:
1. source code (compile-time)
This is fine for me, but it's less useful for non-programmers.
2. X resources
Challenge: what to query the resource database for to enumerate the hotkeys? One option would be to use the names of all programs on the menu, e.g., flwm.Terminal.hotkey: a-f12. (In addition to program names, it could also use built-in function names for which hotkey is to be defined, e.g., minimize-current-window.)
3. comments in .wmx scripts, e.g.,
#!/bin/sh
#flwm-hotkey: a-f12
...
Note: this is fine for items on the menu but not for proposed built-in-function hotkeys. Also, this requires a script for what might have otherwise just been a symbolic link to program.
4. specially named .wmx files, e.g.,
.hotkey-a-f12.xterm
5. new configuration file (could be xml or more terse text file format)
Such a configuration file could also define the menu (merged with the .wmx directory, if it's also used) and could specify desired desktop names, application geometry, etc.
6. some better idea I haven't thought of...
Opinions?
Thanks
Paul
p.s. In addition to hotkeys, I intend to write edge/corner support, which may be used like hotkeys to launch programs or invoke wm built-in functionality. For example, moving the pointer against an edge of the screen can bring up the flwm menu, invoke a screen-saver, launch a "shelf," etc.
Number 4 is my favorite. However it may be easier to use 5, put the file with a special name into the same directory.
You can't put the hotkeys into the files in .wmx because that would require it to open and read all the files, which would slow down the menu popup.
While we are at it, it should probalby try .flwm and only use .wmx if that is not found.
#4 it shall be.
(If I were to go with #3, I realize I'd need to avoid parsing all of the files each time the menu is activated. What I don't like about #3 is the need to make scripts when a simple symlink would have sufficed.)
(With #4, it is simple to just reindex the hotkeys everytime the menu is invoked (though hotkeys aren't strictly related to the menus).)