
ksuperkey
Source (link to git-repo or to original if based on someone elses unmodified work):
Available as/for:
Description:Note that ksuperkey does not depend on any specific desktop environment and should work fine on KDE Plasma 4, Plasma 5, GNOME Shell, Unity, Xfce, LXDE, etc.
Also note that this feature is available by default starting from Plasma 5.8.
ksuperkey is a fork of xcape (https://github.com/alols/xcape), most of the work was done by the original author Albin Olsson.
Installation
Distribution-specific instructions
Below is a list of distribution-specific ways to install ksuperkey.
Note that some packages are provided by a third party and that I do not take any responsibility for their contents.
Arch Linux: Available from the official repo ([community])
Chakra: Installed by default, available from the official repo
Debian: https://launchpad.net/~mehanik/+archive/ubuntu/ksuperkey
Fedora: https://copr.fedoraproject.org/coprs/vanoudt/KSuperkey/
Gentoo: emerge ksuperkey
Kubuntu: https://launchpad.net/~mehanik/+archive/ubuntu/ksuperkey
Mint: https://launchpad.net/~mehanik/+archive/ubuntu/ksuperkey
Netrunner: Installed by default, available from the official repo
openSUSE: https://software.opensuse.org/package/ksuperkey
PCLinuxOS: Available from the official repo
Ubuntu: https://launchpad.net/~mehanik/+archive/ubuntu/ksuperkey
Did I miss your favorite distribution? Please add a comment below with instructions on how to install it in your distro!
Compiling from source
If there is no package for ksuperkey for your distribution, you can compile the program from source following these instructions:
1. Install dependencies. On Ubuntu:
sudo apt-get install gcc make libx11-dev libxtst-dev pkg-config
On some system you'll also have to install the build-essential package.
2. Download ksuperkey-0.4 (Source) from this page and extract the tar.gz file (using e.g. Ark).
3. Go to the newly extracted directory called ksuperkey, open a terminal (press F4 in Dolphin), and run:
make
3b. Optionally, if you want to install ksuperkey to the standard PATH for all users:
sudo make install
4. Launch ksuperkey:
./ksuperkey
or by clicking on its icon. ksuperkey will run in the background. (If you did step 3b, you can just type "ksuperkey" from anywhere to launch it.)
5. Try to press the left Super key. If the application launcher does not show up, make sure that its shortcut is set to Alt+F1:
right click on the application launcher icon -> Application Launcher Settings -> Keyboard Shortcut.
6. (Optional) Make ksuperkey autostart in System Settings -> Startup and Shutdown -> Autostart -> Add Program... -> Browse button -> select the ksuperkey application.
Change mapping
If you do not like the default mapping (Super_L to Alt+F1), you can tell ksuperkey to use another mapping. The syntax is as follows:
ksuperkey -e 'ModKey=Key[|OtherKey][;NextExpression]'
Looks complicated? Do not worry, it really is not. Let us look at some examples:
Make Super key open KRunner (Alt+F2)
ksuperkey -e 'Super_L=Alt_L|F2'
We have more modifier keys on our keyboard, why not use them?
ksuperkey -e 'Control_L=Alt_L|F1;Super_L=Alt_L|F2;Shift_L=Control_L|S'
This makes the left Ctrl key generate Alt+F1 (application launcher), left Super generate Alt+F2 (KRunner), and left Shift generate Ctrl+S (save the current document) when pressed and released on their own.
Autostart
If you want to add your custom mapping to Autostart:
1. Follow the instructions in 4. under Installation.
2. When you see the dialog with the tabs (General, Permissions, Application, etc.), click on the Application tab.
3. Add the -e option to the Command field. It could look something like this:
/home/myname/ksuperkey/ksuperkey -e 'Super_L=Alt_L|F2'
Troubleshooting
1. ksuperkey does not work.
Make sure that ksuperkey is running (use e.g. the system monitor, Ctrl+Escape) and that it is running only once.
Also check that the keyboard shortcut for the application launcher is set to Alt+F1, see 4. under Installation.
Finally, make sure you do not remap the Super (Win) key, for example in System Settings -> Input Devices -> Keyboard -> Advanced or by using xmodmap.
2. When I try to change the mapping, I get 'command not found: ksuperkey'
When following the installation instructions above, kusperkey will not be installed to $PATH. This means that your shell does not know where to find ksuperkey. Therefore you have to specify the full path to the executable, e.g.
~/ksuperkey/ksuperkey -e 'Super_L=Alt_L|F2'
3. I remap my keys (e.g. using xmodmap) and ksuperkey does not behave as I want it to.
Try to restart ksuperkey every time after doing the remapping. Also make sure that the key you send has a defined keycode.
4. When I type 'make' I get "xcape.c:22:20: fatal error: stdlib.h: No such file or directory"
You need to install the build-essential package, e.g.
sudo apt-get install build-essential
Tips
You no longer have to bind Alt+F1 to the thing you want ksuperkey to trigger, since you can easily change the mapping! (See "Change mapping" section above.)
For more options, see included README.md or the Github page: https://github.com/hanschen/ksuperkey
Contact
Please post issues to Github:
https://github.com/hanschen/ksuperkey/issues
I will try to answer questions here.
0.4
- Allow keycodes in map expressions. [upstream]
- Fix Makefile to make it easier to package.
0.3
- XKeycodeToKeysym has been deprecated, use XkbKeycodeToKeysym instead. [upstream]
0.2
- It is now possible to define your own mappings (e.g. Super_L to Alt+F2) without editing the source code. [upstream]
0.1
- Initial release
Ratings & Comments
88 Comments
Please add ubuntu version 18 (Bionic beaver) to the lunchpad.
Would any of these current versions work on MATE? I would like to use this program but not sure the other distro versions would be compatible.
Yes, it should work on any X11 desktop. You just have to set up the key bindings correctly.
I am extremely grateful for this little program. THANK YOU for making my life and transition from Gnome a little bit easier.
It's always nice to hear when someone found this program useful, thanks for your comment. :)
git gcc make libx11-dev libxtst-dev pkg-config and build-essential properly installed Quote:$ cd /tmp
$ git clone https://github.com/hanschen/ksuperkey.git
$ cd ksuperkey
$ sudo make install
resulted in:
Quote:install -d -m 0755 /usr/bin
install -m 0755 ksuperkey /usr/bin/ksuperkey
install: der Aufruf von stat für „ksuperkey“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
Makefile:17: recipe for target 'install' failed
make: *** [install] Error 1
Any suggestions for a systemwide installation?
Try to run "make" before "make install".
That was it! Thanks a lot, done!
Super has been renamed Meta, so use "ksuperkey -e 'Meta_L=Alt_L|F1'" it to work with default settings.
Really good! Thank you!
Awesome that it's working well for you! Thanks for leaving a comment. :)
My pleasure! :)
I wonder whether the new Wayland/libinput infrastructure will make a super key shortcut possible directly in Kwin. Until something like that happens, ksuperkey is the perfect solution!
The developers have discussed implementing something similar when Wayland is available, but not in X11. "The plan for Wayland is to handle this specially in the input module in KWin and only allow some very few actions and make the modifiers not configurable." https://mail.kde.org/pipermail/plasma-devel/2014-August/034447.html I haven't followed the discussions lately so it's possible that the plans have changed.
By fluke I post a query on Kubuntu forum about that problem. Someone suggest that utility. Work just fine. Great Work. Thanks. You are right with Kde 5 taking Linux by storm and attracting windows users, this is a must.
Glad to hear that you find ksuperkey useful!
How do I remove a key assignment? Super is now set to F11,F12 and F1+alt
How do you start ksuperkey? The key assignments are set in the argument you give ksuperkey when you start it.
No. How do I unassing a mapping once it's assigned?
Sorry, not sure what your issue is. The mappings that ksuperkey uses are defined when you start the program. If you want to change that, you have to tell me how you start ksuperkey.
I have already launched the application in daemon mode several times, setting the super key to several different things. What I'm asking for is a command flag that kills all copies of this application that involve a particular key and/or removes any other asinements and replaces them all with the one in the flag.
This is tremendously useful for me
Wonderful to hear, thanks for dropping a comment!
It baffles me that this project isn't taken up by KDE or at least included as default with distros. Seems as if lots of people (me included) wants a menu to open with one and not two keys. Thank you for this :D
Thanks for your comment! As far as I know it's actually shipped with Chakra[1], which is really cool! [1] https://www.loomio.org/d/lDbUw5Zv/ksuperkey-by-default-in-kapudan