ksuperkey

Various Plasma 5 Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/hanschen/ksuperkey

16
Score 85.8%
Description:

ksuperkey allows you to open the application launcher in KDE Plasma < 5.8 using the Super key (also known as the 'Windows key'). Unlike other solutions, it will not affect your current keyboard shortcuts, as the Super key will still act as a modifier when held down.

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.
Last changelog:

4 years ago

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

andreduartesp

4 years ago

Looks like kubuntu will include this app by default.

Report

C

Mogger

4 years ago

Really? That would be awesome! :D

Report

baltolkien

5 years ago

I made the same requet 3 times!

Report

baltolkien

5 years ago

Hello:
I'm a Kubuntu 13.10 user and I try to use superkey.
I installed everything but it doesn't work, when I press the Super Key, in the console appears "PPPP".
I don't know how "right click on the application launcher icon -> Application Launcher Settings -> Keyboard Shortcut", because it doesn't appears in my laptop.
Some help?
Thanks in advance

Report

baltolkien

5 years ago

Hello:
I'm a Kubuntu 13.10 user and I try to use superkey.
I installed everything but it doesn't work, when I press the Super Key, in the console appears "PPPP".
I don't know how "right click on the application launcher icon -> Application Launcher Settings -> Keyboard Shortcut", because it doesn't appears in my laptop.
Some help?
Thanks in advance

Report

baltolkien

5 years ago

Hello:
I'm a Kubuntu 13.10 user and I try to use superkey.
I installed everything but it doesn't work, when I press the Super Key, in the console appears "PPPP".
I don't know how "right click on the application launcher icon -> Application Launcher Settings -> Keyboard Shortcut", because it doesn't appears in my laptop.
Some help?
Thanks in advance

Report

C

Mogger

5 years ago

It sounds like your application launcher shortcut isn't set to Alt+F1.

First you have to right click on the application launcher, usually the left-most icon in your panel.
The menu should look something like this:
http://hanswchen.files.wordpress.com/2010/02/switchmenu.png

You should then click on "... Settings" (could be "Application Launcher Settings", but could be something else depending on your launcher).

In the settings, set the shortcut to Alt+F1.

Hope that helps!

Report

baltolkien

5 years ago

I'm a bit silly!
I don't understand the instructions.
Thanks, now works perfectly!
Bes regards

Report

jeggy

5 years ago

This is definitely the best and most important thing that KDE is missing!
I have multiple times gone away from KDE for this reason, but maybe I will stay this time :D

Report

C

Mogger

5 years ago

Glad that you like it!

Report

ess67

6 years ago

Thanks Han's! I've been trying to find this solution for quite a while and this works great for me! Much appreciation for your time and effort. Now if we could only get it packaged so that it would be easier for the unitiated that would be great!

Thanks again, this is perfect!

Report

C

Mogger

6 years ago

Thanks for your comment, I'm happy to hear that it works well for you!

Some distros actually package ksuperkey (e.g. Chakra, PCLinuxOS, Netrunner). I plan to update the description with distro-specific instructions once I find some time.

Report

ChrisAshton84

6 years ago

This is great! I've been annoyed for years by KDE's decision on this.

Someone mentioned that this steals the ALT+F1 which I suppose some apps might need. Is there some way to use a 'fake' key? Like Alt|F13?

I get:
WARNING: No keycode found for keysym F13

Report

ChrisAshton84

6 years ago

I guess I fixed it? Feels like a hack, but running

xmodmap -e 'keycode 1234567890=F13'

prior to using F13 seems to work, since hopefully there's no hardware that generates 1234567890 as its keycode...

Report

C

Mogger

6 years ago

That is indeed the way to achieve what you want.

Report

ign0tus

6 years ago

When I click on the Ubuntu download, I'm taken to a 404 page. I was able to install via the ppa:mehanik/ksuperkey though. However, after I finally got it set up, when I press the WinKey, it shows the KMenu just briefly. It flashes on-screen and disappears. If I press Alt+F1 the menu pops up correctly. Not sure what the deal is. I'll try rebooting. Kubuntu 13.04 x64.

Report

C

Mogger

6 years ago

Thanks for letting me know about the broken link, I've removed it for the time being. I'll update the description with information about how to install on different distros when I upload the 0.4 version.

The issue with a flashing menu was likely caused by running two instances of ksuperkey, so it would send Alt+F1 Alt+F1 and cause the menu to open and close. Will add that to the FAQ.

Report

ign0tus

6 years ago

I don't see a way to edit my previous post. Just wanted to say that rebooting fixed my issue.

Report

Murz

6 years ago

I want to setup FN key on my Lenovo notebook. When I start ksuperkey -d, it shows:
Intercepted key event 2, key code 151
Intercepted key event 3, key code 151

But in ksuperkey I must setup key name, not code.
How I can get key name from code?
If you know solution, please update FAQ for your app.

Report

C

Mogger

6 years ago

The README.md states:
"The list of key names is found in the header file `X11/keysymdef.h`
(remove the `XK_` prefix)."

The file is usually found in /usr/include/X11/keysymdef.h. I didn't include it on the KDE-apps page since I thought it was too complicated for most users.

You can also try the newest version on Github, which allows you to specify the keycode instead using #. Example:

ksuperkey -e '#151=Alt_L|F1'

With that said, the Fn key is a bit special (I didn't expect it to send a KeyPress event at all) and this solution seems to only work occasionally on my ThinkPad. Hope you have better luck!

I'll release a new version and update this page when I can find some time.

Report

Murz

6 years ago

Thanks, I have find the name for this key - in my system Ubuntu 13.04 Lenovo FN button detected as XF86WakeUp.

But it is not want to work as modifier key, I can't bind any hotkey combination with it.
For example, when I do:
xmodmap -e "keycode 151 = Meta_L"

pressing FN send the Meta_L keypress, but when I try to press FN+S, it shows only FN keypress.

How can I solve this problem? Maybe I must convert this key to "modifier key type" via some command?

Report

C

Mogger

6 years ago

Yes, I believe you have to add it as a modifier. Run "xmodmap" first to see your current modifiers. Then you want to do something like "xmodmap -e 'add mod1 = Alt_L Meta_L'".

But as mentioned the Fn key is a bit special (as far as I know, it usually works at the hardware level) so I don't know how well it'll work as a modifier.

Report

Murz

6 years ago

I have found other problem, ksuperkey may not work when in KDE on System Settings / Keyboard / Advanced in group Alt/Win behavior this item is selected:
Meta is mapped to Win keys

If I remove this checkbox, all works well.

Report

C

Mogger

6 years ago

That's a good point. I've added it under "Troubleshooting" on the KDE-apps page.

Report

Murz

6 years ago

For quick install on Ubuntu and Kubuntu you can use this PPA: https://launchpad.net/~mehanik/+archive/ksuperkey

Install via commands:
sudo add-apt-repository ppa:mehanik/ksuperkey
sudo apt-get update
sudo apt-get install ksuperkey

Report

4 years ago

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

12345678910
34
product-maker psyoma Oct 05 2016 9 excellent
product-maker x-varlesh-x Aug 17 2016 9 excellent
product-maker hacklov Oct 18 2015 9 excellent
product-maker PulsarSuse Sep 06 2015 9 excellent
product-maker roctheme Aug 30 2015 9 excellent
product-maker janet Aug 25 2015 9 excellent
product-maker RingOV Aug 23 2015 9 excellent
product-maker OlafLostViking Aug 17 2015 9 excellent
product-maker jerik Aug 15 2015 9 excellent
product-maker miabraha Jun 24 2015 9 excellent
product-maker macik Mar 11 2015 9 excellent
product-maker jota Apr 29 2014 9 excellent
product-maker amr2205 Feb 15 2014 9 excellent
product-maker balur Jan 30 2014 9 excellent
product-maker jeggy Dec 19 2013 9 excellent
product-maker brdn25 Oct 31 2013 9 excellent
product-maker ChrisAshton84 Sep 18 2013 9 excellent
product-maker yvanb May 01 2013 9 excellent
product-maker ZaWertun Mar 09 2013 9 excellent
product-maker antonisk Feb 25 2013 9 excellent
product-maker augegr Feb 04 2013 9 excellent
product-maker dmnmsc Jan 26 2013 9 excellent
product-maker Murz Jan 09 2013 9 excellent
product-maker pacorayban Nov 27 2012 9 excellent
product-maker alpvonkri Nov 11 2012 9 excellent
product-maker sxe Nov 10 2012 9 excellent
product-maker swiftscythe Nov 09 2012 9 excellent
product-maker cjann Oct 19 2012 9 excellent
product-maker svah4cky0 Oct 09 2012 9 excellent
product-maker vitoubien Oct 08 2012 9 excellent
product-maker cgonzalez Oct 08 2012 9 excellent
product-maker Contrast Oct 08 2012 9 excellent
product-maker damianatorrpm Oct 08 2012 9 excellent
product-maker greatperson Oct 08 2012 9 excellent
product-maker Base: 4 x 5.0 Ratings
kinghat
Dec 11 2018
ObsidianJackal
Apr 25 2016
janet
Aug 25 2015
jota
Apr 29 2014
baltolkien
Feb 10 2014
balur
Jan 30 2014
ChrisAshton84
Sep 18 2013
Qwerty9362
Jun 21 2013
ZaWertun
Mar 09 2013
dmnmsc
Jan 26 2013
Murz
Jan 09 2013
sxe
Nov 10 2012
alpvonkri
Oct 29 2012
cjann
Oct 19 2012
carlcarl
Oct 10 2012
damianatorrpm
Oct 08 2012
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
0.4
updated Sep 10 2017
added Oct 08 2012
downloads 24h
2
page views 24h 27