Changing the Launcher on Oppo R17

I recently bought a new Android phone, an Oppo R17 Pro. I chose the Oppo as the brand has rated well, actually top, in Canstar satisfaction reviews. It is a good looking phone, well finished and a quality feel. The last point is particularly noticeable when compared to my recently deceased Nexus 5X.

As good as the phone hardware is Oppo have for some unknown reason included their own and poorly developed version of Android called ColourOS. The launcher in particular has no improvements over the standard Android experience and feels slow and clunky. Previously I used the Nova launcher and decided to go back to it. It ran well and I was able to configure it how I like. It made a vast improvement to the whole experience.

However there was one problem. When unlocking the phone I would see the default launcher but then Nova would replace it. I had set Nova as the default so this was confusing. The answer was in ColourOS’s aggressive battery saving settings. By default ColourOS stops all apps running in the background. So when the phone is unlocked Nova isn’t running. The fix then was simple, if well hidden.

In settings – App Management select Nova launcher and in its App info select Power Saver and set it to run in the background. This solved it for me. ColourOS will giving a warning that one app is consuming power but that can be ignored.

This change is needed for any app that needs to run all the time. Data usage monitors are a good example. Despite the warning I find that the Oppo R17 has excellent battery life, certainly better than any other Android phone I’ve owned.

Advertisement

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 from 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.

#!/bin/bash
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"
else
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"
fi

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’s Drop Down Terminal

Screenshot - 011213 - 16:53:01As a followup to yesterday’s post on Tilda there is an alternative for Xfce users. The current Xfce terminal has a drop down option. However it is not obvious to most users.

It is a hidden option which is standard for Xfce4-Terminal. To access it you need to start the terminal with the command ‘xfce4-terminal –drop-down’. The man page gives more details and suggests you bind that command to a keyboard shortcut. That way you can press the key to open the terminal and pressing it again will hide but not close the terminal. This means there is no need to add it to your sessions or Autostart. The first time the key is pressed will launch and open it. Further presses will reveal or hide it.

I would suggest binding it to F12. To do this right click on the desktop, select Applications – Settings – Keyboard. Select the Application Shortcuts tab,  click on the Add button, type in the command as above. Click OK and it will open another window asking for the key, press your chosen key(s) and the window will close. Test the shortcut, the terminal should open as a drop down.

In the Edit menu (or right click in the terminal) there is a Preferences option with a new DropDown tab. Make your choices here for size, location etc. If you turn off the menu bar you can access the preferences and new tab etc. options with a right click. The Dropdown preference screen also has an option for Opacity this applies to the whole terminal including the text. The Opacity option on the Appearance tab only affects the background. The Duration option controls the speed of the animation as the terminal drops down and ascends.

There is an option for a panel indicator too, it will appear in the notification area. Clicking on the panel icon will open the terminal. Right clicking gives access to the Preferences and an option to close the terminal.

This is a great option for Xfce users wanting the convenience of a drop down terminal and may remove the need for Tilda in future versions.

RIP Tilda, Long Live Tilda

UPDATE: Since I wrote this there has been some progress, although Tilda still isn’t available from the Fedora repos there has been some development work done on it. There is a new maintainer so go here for the latest details. You will need to build from source to have Tilda in current versions of Fedora or Korora but hopefully a new packager will emerge.

As many who have read this blog will know I’m a fan of drop down (aka quake style) terminals. I use Yakuake in KDE but in Xfce I’ve been using Tilda. I prefer its minimal style and features to the other options.

However when I installed Korora 19 I discovered that Tilda has been dropped from Fedora’s repos for 19 as it isn’t being currently maintained. In cases like this you have the choice of finding an alternative or building it yourself from source.

I found there is another way of installing Tilda in Korora or Fedora 19. Please note that this isn’t a procedure I would recommend for most packages but it works for Tilda. I ran Fedup on one of my systems but did a clean installation on another. Initially I didn’t notice the Tilda hadn’t been updated by fedup as it was still working. Only after I installed on the other system was the lack of Tilda noticed. I realised that packages from the older version still worked. So that was how I got it working in 19.

First we need a rpm file to install. That’s easy as I found the version for 18 works in 19. One way to obtain rpms is with RPM Search. I’ve used it before to back date when updates break something and yum history hasn’t worked. Go to here for a 64 bit file or here for an i686 one.

Now, as root, change to the directory where the downloaded file resides and run ‘yum localinstall packagename’, obviously replace packagename with the name of the file you downloaded. Yum will handle the dependency and install Tilda for you.

Problem solved, you now have Tilda in Korora or Fedora 19. Hopefully someone will step up and package it again in future version but as development has been slow I guess that’s not likely. See Tilda on github for details on the current state of development.

Favourite Linux Applications

Below is a list of the applications I use regularly. I don’t claim they are the best but they are the ones I prefer. Many are KDE based but there are fewer of them than previously. I use both KDE and Xfce as my desktop environments. The apps that come with Xfce are pretty basic so I prefer alternatives.

One of the complaints I have about many of KDE’s apps it that they have been combined with KDEpim which means you can’t install single apps. If you don’t use Kmail and its brethren then I would avoid Blogilo and Kjots, both of which I have previously used.

Chrome / Chromium is my browser of choice. Not perfect, it doesn’t integrate into the desktop too well. But it is fast and has the main extensions I like.

Conky – just calling Conky a system monitor really understates what it can do. Conky can do so much that it requires its own post. Since it introduced real transparency it greatly reduced the problems running it under KDE. One of the first things I set up on a new installation.

Krusader – twin pane file manager. Dolphin is good especially with the split feature but I like the power and retro style of Krusader. I’ve tried others like Midnight Commander which is quite good but nothing comes close to Krusader.

Gimp – it is all you need to edit images. To work with raw files just add ufraw and ufraw-gimp.

Digikam – adds digital asset management aka photo organiser. Has editor which works better for raw images than ufraw but I prefer Gimp. Has export to almost anything you can think of.

Cups-pdf – while Koffice and LibreOffice can create PDFs adding cups-pdf allows you to create them from anything that can print.

Kdenlive – the most stable video editor under Linux. A good balance between power and ease of use. Not perfect but there is nothing better at the moment.

Tilda – a drop down terminal emulator. Makes accessing the terminal so easy and you can hide it and let it get on with what is doing. KDE provides Yakuake which has many options and is a great application.

LibreOffice – the most polished FOSS office suite there is. If only Base was up to the standard of the rest of the suite.

Clementine – what can I say, can’t work without some music. A good mix of features and performance.

Zim – note taker / desktop wiki. I used Kjots for a while but it was integrated into KDEPim which meant it was near impossible to sync it between 2 systems so I switched to Zim. Just as good maybe better but I don’t use all its features and it has fewer dependencies.

So that is it. There are other applications that I use from time to time which work well too, things like Yumex and VLC but the ones above are those I like and use nearly every day. They are all available in Kororaa, a couple require extra repos to be installed in Fedora though.