A Junk Box Digital Radio Server

In the modelling world you occasionally hear of a junk box creation. It is when you take parts left over from old projects and other items that are no longer used and create a new masterpiece. Well I don’t claim this is a masterpiece but it fits the description in every other way. I took various components I had laying around and solved a problem I had.

The Problem

I live just outside a major city in an area where television and radio reception is poor. Although I can pick up major city FM stations they can be poor in quality.
Another issue is that the more interesting, at least to me, programs were often on the digital back channels. The only way to receive them is with a digital radio, if it worked in my area, or by streaming. The internet here isn’t very great either. Technically it is ADSL2 but performance isn’t great. However it can handle streaming a radio broadcast, well most of the time. I tested that on my laptop.

The Solution

Somehow it is easy to accumulate various pieces of hardware that are no longer used. What was once the latest toy that was proudly set up on the main system but is now laying in a cupboard unused, almost forgotten.
There are 3 main items I used for this project. First is my netbook. This still runs well even if the battery life is a little less than it used to be. However it is only 32 bit and feels quite slow even when doing something basic.
Next was a Creative Sound Blaster LX USB audio card. This was never state of the art but worked well for its original application. From memory that was to restore sound on an old pc where the audio output didn’t work.
Last was an old stereo receiver amp. It is probably 40 years old but still runs well. It does its best to receive the FM signals that do find their way this far out. But importantly for this project it has plenty of audio inputs on the back. Actually it is the centrepiece of a retro audio setup complete with cassette deck and vinyl turntable.

Putting It All Together

Okay this was the easy part. The netbook was running Korora 23 Xfce when first set up. Even though recent versions of Korora are only 64 bit it is still possible to upgrade existing 32 bit Korora installations to 24 or 25. However initially I didn’t worry about that. First I wanted make sure it all worked.
The only software involved was Audacious and Pulseaudio Volume Control. The later was only needed to tell the system to output sound on the usb sound card.
After getting the streaming urls from the websites of the stations these were saved in Audacious. The analog output was plugged into a spare input on the receiver. Actually this did give me my only problem. I don’t think these inputs had ever been used and maybe they were dirty or oxidised or something as I needed to unplug and replug a couple of times before they started to work.
Only changes I made to Korora was to disable the screensaver. As I was running off AC I also disabled power saving. The netbook has a hotkey to turn the display on and off so that was useful.

The Result

For zero cash outlay, I also had all the cables I needed, I have a working digital streaming radio system. It works well and consumes very little data. I’m pleased with the result. I did upgrade the Korora system to 25 which worked without an issue.
It isn’t perfect there are occasional minor dropouts, some stations are more prone to dropouts than others. I have considered trying other applications to see if that will help.

The Future

Now I’m looking into X2Go so I can control it all from this computer when I’m working. But maybe I need the exercise to get up and walk across the room so I’m not in a hurry to do it.

Korora’s Latest Release

The Korora Project has released version 25 (codename “Gurgle”) which is now available for download. There are quite a few changes with 25 and the release notice highlights many of them.

Korora Xfce 25 is still 4.12 but includes the latest release of many applications including Notifications and the Terminal. Notifications now includes a “Do Not Disturb” option as well as per application settings.

Korora 25 also adds Redshift for those who prefer to work late at night and 3D printing capability.

Give it a try.

Source: Korora Project

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 http://dnf.baseurl.org/2014/03/19/copr-plugin/.

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.