Using the Super Key in Xfce

Update: Ksuperkey is in the Korora repo now and included in Korora Xfce 24.

One of the restrictions in Xfce is that you can’t use a key as both a shortcut key and a key modifier. I have often seen questions about this particularly as regards the Super (aka Win) key. It is often set to open the menu whether the default menu or WhiskerMenu is used. If it is also used as a modifier, i.e. in a combination with another key as a shortcut, the menu will be opened as well as the action called by the shortcut.

A question from another Korora team member reminded me of Ksuperkey and looking at the Github page for the project I noted a comment that while it was written for KDE it should work in other Desktop Environments including Xfce. That sounded like it was worth checking out.

Unfortunately Ksuperkey is no longer packed for Fedora 23 so can’t just be installed in Korora. However it is simple to build. I followed this guide, replacing yum with dnf, and it worked without any issues.

If used without any options Ksuperkey calls alt + F1 which in Korora opens the menu by default. I removed that shortcut as I use whiskermenu. In Korora the Super key is used to open WhiskerMenu so in Settings – Keyboard – Shortcuts I edited that to use Alt + F1. Next I ran ksuperkey from alt + F2 and tested. I had previously configured some shortcuts to open applications using Super + other keys so I could easily test. The applications opened and the menu didn’t appear. When used by itself the super key opened WhiskerMenu. Exactly what I hoped to achieve and what was promised.

Lastly I added ksuperkey to Settings – Sessions and Startup – Application Autostart so I didn’t need to run it manually each session.

Ksuperkey adds useful and needed functionality to Xfce and probably other Desktops and is a worthy addition. It has a number of options that can tailor its operation to different situations, see the Usage section on the project page. Don’t be misled by the name, Ksuperkey doesn’t have a bunch, or even any, KDE dependencies that will be added to your system. Its name merely reflects it’s heritage.

Road to Xfce 4.14

It is rare that there is a post on the Xfce blog so when there is it is worth taking notice. Today there was a status report on the Xfce development. Those of us who use Xfce know that development is slow. It is probably an open secret that the next version will be ported to GTK3.

Today’s post clarifies what is happening and the current progress. There are some interesting comments such as no new features. Can we expect that 4.14 will be indistinguishable from 4.12 for most users? It appears so. Also there is no mention of Wayland so it appears that too will be pushed back.

It is good news that Xfce development is continuing and it is great to hear what is going on because communication with users is probably one area Xfce handles poorly.

Source: Road to Xfce 4.14

Update to the Touchpad Script

Some time ago I posted a script that turned the touchpad on and off as needed. This script disabled the touchpad when I using a mouse. After using it for sometime I found that occasionally the device numbers changed after a reboot. So I modified the script to use the device name in place of the ID.

The original post, now updated, is here.

A New Xfce Utility

A new utility has been made available for Xfce in Fedora. It is xfpanel-switch and has been packaged by nonamedotc who you may recognise as a busy contributor of Xfce on Fedora. His past efforts have certainly added to my enjoyment of running Xfce on Korora.

xfpanel-switch is a simple utility that can back up and restore your panel configuration. It includes a couple of different configs you can try out but use its backup option to backup your set up first. There are full details about it here.

I’ve been testing it for couple of days and it works well for me. It will be included in future versions of Korora Xfce but if you want to try it on 23 it is currently in updates-testing. You can install it with ‘sudo dnf –enablerepo=updates-testing install xfpanel-switch’.

Fedora’s Copr and Remixes

This is a slightly edited version of a news item I recently posted on the Korora Project site. It covered the failure of the repo setup instructions provided on Fedora’s Copr site.
The Fedora COPR repos are a great source of software that isn’t (yet?) available in the regular repos. Some are new versions that will appear in future releases but are available now for testing. Some are very specialised software for which there is little demand.
Adding a COPR repo is simple as dnf core plugins provide a one step command. Unfortunately the command provided on the COPR site does not work on Fedora remixes such as Korora. The command attempts to determine the version and arch you are running but doesn’t recognise a remix. You must provide this information as an additional argument. For example the following command would install a copr repo in a 64 bit Korora system:
$ sudo dnf copr enable reponame fedora-23-x86_64
This instructs the dnf copr plugin it to explicitly enable the Fedora 23 64 bit repo, edit the command for other versions (use i686 for 32 bit). Replace ‘reponame’ with the name given on the COPR page.
There is no need to add that argument if using the disable repo command only when initially setting it up. There are more details about the dnf copr plugin at

Kdenlive Appearance in Xfce

The KDE video editor Kdenlive is one of the best Linux video editors available for general users. I’ve used it for many versions both in KDE and other desktops like Xfce. Recently it was updated to version 15.12.2 in Fedora. One of the changes from the former 9.10 version was the conversion to Plasma 5 / QF5. This means it defaults to using the Breeze style.

Unfortunately Kdenlive doesn’t detect or use the GTK settings or even the QT5 setting. The style used is set within the application. I’m not sure why it does this but in my experience it is the only KDE application that does it.

I use a dark theme in Xfce and kdenlive looked way out of place. I tried to set it to use the GTK theme but that meant some elements were dark and some not. it looked a real mess. I needed to install the Breeze theme and then set Kdenlive to use Breeze Dark. ‘dnf install plasma-breeze’ is all I needed to do. Then select Breeze in Settings – Style and Breeze Dark in Theme and in that order too. It still isn’t exactly the same colours as other applications but it is close and that seems to be the best I can do.

Korora 23 is Here

The release of Korora 23 has been delayed waiting for RPMFusion to get their repos up and running. The beta of Korora 23 used the testing repos and they are working fine so it was decided to release Korora 23 as stable.

If you are running Korora 23 beta there is no need to reinstall. Just keep your system up to date.

The full announcement is here.


Disabling Touchpad when using a Mouse

After using this script for a while I found a problem when occasionally after a reboot the device numbers had changed. So I have changed the script to use the device name in place of the ID. This has solved the problem. I’ve also added icons to the notification output.

There is a common feature on current Linux desktop that allows the touchpad to be disabled while typing. This is a useful feature but it has its limitations. The delay before the touchpad starts working can be set to a long time to reduce accidental movement but then the delay becomes irritating. I find I still occasionally brush the touchpad and cause an issue with what I am typing particularly when I pause to review what I have written.

As I normally use a bluetooth mouse I would prefer that the touchpad is completely disabled or preferably disabled when the mouse is in use. There are several scripts around which do this using synclient. I have found a few of these and tested them and none worked for me. I could see that the setting was changed but the touchpad was still active.

After a fair bit of research I found mention of using xinput and the commands needed to use xinput to disable the touchpad. Xinput has an advantage over synclient in that it completely disables the touchpad, buttons and all whereas synclient just stops any cursor movement.

I have tested this on my Thinkpad running Korora 23 Xfce but it should work on any recent version of most distros and with most desktop environments. It isn’t needed in KDE which includes this as an option in the touchpad settings. The script should also work with a USB mouse, in fact any sort of mouse, as well as the Bluetooth mouse it was tested with. The script uses xinput to check if a mouse is present. If your mouse is listed there and the name includes the word “mouse” it will work. Type “xinput –list” (without the quotes of course) with your mouse attached and check it is there.

There are a couple of steps needed to get xinput to work. The first is to identify the id of the touchpad. To do this run the command “xinput –list”. It will show a list of all the devices xinput controls. One of these is clearly marked as the touchpad. Looking along that line there is an ‘id=’ field. Make a note of this number, mine is 11 but yours may well be different. Looking along that line also make a note of the exact title of the touchpad, mine was “SynPS/2 Synaptics TouchPad” which seems to be common.

Next you need the id of the touchpad off setting for that device. Run “xinput –list-props 11” substituting the device number you found earlier for 11. This gives a long list of properties for that device. Look for “Device Enabled”, for me this was first on the list and so I had to scroll up to see it. That line will have a number in brackets, the property id, mine is 139 but again yours will probably be different.

With both those numbers recorded we are ready to test the xinput command. There is no point making a script if the command doesn’t work. Test with the command “xinput set-int-prop 11 139 8 0” (replacing my 11 with the device number you found and the 139 with the property number you found). If the command works your touchpad will be disabled. Run the command “xinput set-int-prop 11 139 8 1” (yes replace my numbers with yours again) to enable it again.

Once that is working we can create a script. My script is copied form several I found that used synclient but with the appropriate command replaced. Don’t forget to put the correct numbers in your script. We will also use the exact name of the touchpad in place of the number.

First as root or using sudo open /usr/local/bin/touchpad in your favourite text editor. It should be a new file. Copy and paste the script below and then edit the lines with the xinput command.

sleep 1
list=`xinput --list | grep -i 'mouse'`
if [ ${#list} -eq 0 ]; then
xinput set-int-prop 'SynPS/2 Synaptics TouchPad' 139 8 1
notify-send -i touchpad-indicator "No Mouse found" "Your touchpad is set to ON"
xinput set-int-prop 'SynPS/2 Synaptics TouchPad' 139 8 0
notify-send -i preferences-desktop-peripherals "Mouse connected" "Your touchpad is now turned OFF"

Save the file. Make it executable, “chmod +x /usr/local/bin/touchpad”. Note the sleep on the first line isn’t strictly needed but occasionally the script fails to run without it.

Now it should work. Test by running the script as a user. If your mouse is connected you should see a notification and the touchpad should be disabled. Next disconnect the mouse and check the touchpad again. I use a bluetooth mouse and it takes some time for the system to recognise that the mouse is off. I’m guessing it thinks there is a temporary break in communication. But with a usb mouse it should react much faster. I normally don’t need to run the script again.

However the exception is after a reboot or very occasionally upon returning from a suspend I find I need to run it. I use a dropdown terminal so it isn’t a problem to open it and run the script. However you may prefer to create a keyboard shortcut so that you can run the script quickly and easily as needed. In Xfce go to settings – Keyboard – Application Shortcuts and put the full path to the command as the application, press the key(s) and it is set. Test it.

One interesting result of this script is I can still move the cursor on my Thinkpad using the Trackpoint but none of the buttons work. I could disable the Trackpoint too but it isn’t easy to accidentally bump the Trackpoint, at least I’ve never done it so I don’t think it is necessary.

Dynamic Colour Changes in Conky

Conky is a popular system monitor that I have blogged about before. Its advantages are that it can be whatever you want it to be. You decide what is displayed and the format and so much more.
I’ve got a couple of Conkys on my regular desktop. The main one displays system info and is the one I’m updating today. The other one displays the Now Playing details. It works with both Amarok and Clementine as I switch between them all the time. It only appears when either is in use.
The main Conky includes battery information for both the batteries in my Thinkpad. The information includes the current charge level of each battery, the time remaining on the battery that is currently being used and the status of the batteries i.e. if they are discharging or charging. There is an additional line that shows whether the AC Adapter is attached or not, actually whether it is supplying power or not.
It all has worked well for a while but I wanted the battery information to change colour dependent on the current charge level. A search gave me a number of similar methods of achieving this.
Conky battery status

All these methods had one thing in common, they used Conky’s battery_percent variable but I prefer and use the battery variable. The reason they use the battery_percent variable is simple, battery_percent has a numeric output and therefore the if_match command is easy to use to match the battery charge level. I prefer the battery variable as it outputs status as well as the charge level.
After some experimenting I found a simple solution. I use the battery_percent variable in the if_match statement but use the battery variable for the output. The line from my conkyrc is below. It is all one line in the conkyrc and the second line is the same with BAT) set to BAT1.

$font${color1}Battery 1: $color${if_match ${battery_percent BAT0}<=15}${color7}${blink ${battery BAT0}}${color}${else}${if_match ${battery_percent BAT0}<=25}${color8}${battery BAT0}${else}${if_match ${battery_percent BAT0}>25}${color}${battery BAT0}${endif}${endif}${endif}, ${battery_time BAT0}${color}

The if_match variable looks for 3 different battery charge levels. Above 25% it shows in the regular text colour I use through most of the display. When it reaches 25% the line changes to gold text. A third check looks for a charge of less than 15%. At that point the line of text turns red and starts to blink.

Xfce Screen Locking without XScreensaver

If like me you dislike XScreensaver and its ugly unlock screen there is an easy alternative that is actually better integrated into Xfce. Korora like most distros includes Xscreensaver with Xfce. Xscreensaver provides both the screensaver graphics and screenlocking for security. Screensaving isn’t needed these days with modern monitors. It is a relic from the distant past of CRT monitors. However for laptops that can be taken anywhere and for desktops in public areas, screen locking is an important part of your security set up.

You can disable the screensaving so it just blanks the screen. But you still have the ugly Xscreensaver screen to type your password. There is a better way.

I remove xscreensaver, this isn’t strictly necessary but as it isn’t being used there is no point keeping it. ‘dnf erase xscreensaver*’ takes care of that.

Next I install light-locker. Light-locker works with LightDM which is the default Display Manager for Xfce in Korora and many other distros. Actually LightDM is used in Korora for other Desktop Environments too so this applies to them too. However it is well integrated into Xfce. ‘dnf install light-locker’ is all that is needed. I did a restart but I’m not sure if that is really needed.

Now Xfce’s Power Manager settings has gained an additional “Security” tab which allows you to configure Light-locker. Not that much needs configuring. On my laptop I enabled “Lock when Going to Sleep”. This enables me to put the laptop to sleep and lock the screen simply by closing the lid as I have set that as the default action elsewhere in the Power Manager settings.

Now when I open the laptop rather than the unlocked desktop or the ugly XScreensaver window appearing I get the LightDM login screen. That looks much better particularly as I have customised it but that is a subject for another day.