-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
(Enh) Config file for Windows-like remaps #233
Comments
To illustrate the idea of having some remaps affect the whole application, and some that only affect a specific window or dialog of the application, here's a pair of slightly modified sample keymaps from Toshy's default macOS config file for KWrite. The remaps may need to be modified to make sense from a Windows perspective. keymap("KWrite text editor - Close Document dialog", {
C("C-d"): C("Alt-d"), # [D]iscard file without saving (from Close Document dialog)
C("C-s"): C("Alt-s"), # Save file (from Close Document dialog)
}, when = matchProps(clas="^kwrite$|^org.kde.Kwrite$", name="^Close Document.*KWrite$") )
keymap("KWrite text editor", {
C("C-comma"): C("Shift-C-comma"), # Open preferences dialog
C("C-t"): C("C-n"), # New tab (new document)
}, when = matchProps(clas="^kwrite$|^org.kde.Kwrite$") ) |
Installing Toshy on KDE, even with the
|
Well, technically you should be able to do: ./setup_toshy.py remove-tweaks ... and that should reverse the change to the Meta-only shortcut. And I think that has already been adjusted for Plasma 6. But it shouldn't get applied for the barebones config, for sure. I'll work on disabling that. |
From the Reddit chat:
There's the documentation for The key names can be found in the Reference:
I'm still no expert in |
A fix for the installer messing with the Meta-only shortcut when using the barebones config has been applied to the def apply_tweaks_KDE():
"""Utility function to add desktop tweaks to KDE"""
if cnfg.barebones_config:
print('Not doing tweaks due to barebones config flag.')
return
...
def remove_tweaks_KDE():
"""Utility function to remove the tweaks applied to KDE"""
if cnfg.barebones_config:
print('Not removing tweaks due to barebones config flag.')
return
... You can test it by downloading the zip from the EDIT: I tried it, it doesn't work yet, except for during the main |
Fixed the installer thing I tried to fix before. This time it works. The installer shouldn't disable the Meta-only shortcut anymore if the barebones config file or flag is detected. Thanks for noticing that. Good thing you found the FAQ entry to fix it. |
This is an issue to track the development of a new config option to make Linux apps conform to some common Windows shortcut combos, as an alternative to the config file that makes Linux conform to macOS shortcut combos.
Add comments for the apps that will need keymaps, and possibly a general keymap if there is any particular global shortcut that does something in Windows that it doesn't do in Linux.
Good rule of thumb to keep your config file readable: Align things on columns 5, 33, and 65 in the keymaps. A good code editor will show you the column number, a better one will let you set up a plugin that will allow you to quickly "indent to column" to these specific columns. I use an extension in VSCode for this.
This sample keymap demonstrates that keymaps have a "name" argument, then a Python dictionary argument (the curly braces and everything inside them), and then a "when" conditional argument, which is an expression of some kind that evaluates to truthy or falsy to determine when the keymap becomes active. In the sample, the keymap becomes active in Dolphin, in the KDE Plasma desktop environment, and only if the KDE major version is 5, 4, or 3, but not in Plasma 6. Most "when" conditionals don't have to be this complicated, but this shows what can be done.
The text was updated successfully, but these errors were encountered: