Redshift to reduce eye strain from nightly computer use

Note: This tutorial is mainly for Linux users. For other operating systems you could consult the article “Best Automatic Display Adjustment Software for Mac, Windows, iOS and Android“.

Redshift is a little Free and Open Source tool that can reduce the blue component in the light emitted by your computer screen. By default, it does so between sunset and sunrise based on your latitude / longitude coordinates, but you can also use a permanent fixed light temperature.

The underlying idea is that too much blue light can strain your eyes, especially at night.

Permanent candle light

On Debian and derivatives like Ubuntu, the redshift command line version can be installed like this:

sudo apt-get install redshift

I personally like a “permanent candlelight” setting at all times. This simple example sets a relatively low fixed light temperature of 1800K (see man redshift for more details):

redshift -O 1800

If you like this approach, you can run this command at X session start, similar to what is shown under “Autostart after Login” below.

Or set a bash alias like this:

alias candlelight='redshift -O 1800'

To reset your screen color temperature use this command:

redshift -x

Emulating Day and Night

If you want redshift to distinguish between day and night, it is convenient to use the GUI version with a config file that specifies your latitude and longitude as shown below.

On Debian and derivatives like Ubuntu, redshift with the GTK UI can be installed like this:

sudo apt-get install redshift-gtk

You can determine your coordinates by googling for the name of your town or city, combined with the words “longitude” and “latitude”, for example for the German town of “Rodgau” this would be: https://google.com/search?q=rodgau+longitude+latitude

Note that latitudes south of equator and longitudes west of Greenwich must be specified as negative values. The following shows an example ~/.config/redshift.conf for Halifax (44.65° North, 63.58° West), with 1800K candlelight at night and a mild 3600K during the day:

[redshift]
temp-day=3600
temp-night=1800
location-provider=manual

[manual]
lat=44.65
lon=-63.58 

Run the tool for the first time either via Start Menu – Accessories – Redshift on Debian systems, or as redshift-gtk on the Linux command line.

You should then be able to see a reddish light-bulb icon in the system tray (aka “notification area”) of your desktop system. Clicking on it gives you options to temporarily disable the tool or view info about your configured geo-location and whether redshift thinks it is currently night-time. If so, you should notice a reddish screen color temperature.

Autostart after Login

To have redshift-gtk start up on every X session, add an entry to the Autostart mechanism of your desktop environment or window manager.

For XFCE on Debian, open Start Menu – Settings – Session and Startup – Application Autostart tab and add an entry like this:

add-redshift-to-xfce-autostart

Further reading

Set the X cursor theme in XFCE 4.10

After upgrading to Debian Jessie and XFCE 4.10, I set the default cursor theme in XFCE main menu – Settings – Mouse and Touchpad – Theme tab.

But this seemed to affect only a few applications.

To consistently set the theme for all applications and the desktop I had to run this:

oliver@debian:~$ sudo update-alternatives --config x-cursor-theme
There are 3 choices for the alternative x-cursor-theme (providing /usr/share/icons/default/index.theme).

  Selection    Path                                    Priority   Status
------------------------------------------------------------
  0            /usr/share/icons/Adwaita/cursor.theme     90        auto mode
  1            /usr/share/icons/Adwaita/cursor.theme     90        manual mode
  2            /usr/share/icons/DMZ-Black/cursor.theme   30        manual mode
* 3            /usr/share/icons/DMZ-White/cursor.theme   50        manual mode

Press enter to keep the current choice[*], or type selection number:

Select the desired theme from the listed options and make sure it is the same as the one you selected in the XFCE settings.

Use xtrlock via XFCE 4.8 lock button

I currently use XFCE 4.8 on Debian Wheezy as my desktop system. Its panel supports so-called “action buttons” for hibernate, lock, shutdown, etc.

I use one of those buttons to lock the screen but I don’t like xscreensaver (too ugly, don’t need the screensaver stuff), gnome-screensaver (too many dependencies), xlock and its successor xlockmore (too ugly) or slock (just a black blank screen always confuses me).

Good thing is that I found xtrlock which does what I want: It just shows a lock symbol instead of the mouse cursor, all screen content is still visible but user interaction is blocked until the current user password has been typed in.

This is just enough to prevent my 2 and 5 year old children from messing around with my laptop. So I installed it:

sudo apt-get install xtrlock

Problem was that the XFCE lock button calls xflock4 which is a simple shell script that has hardcoded support for the afore-mentioned set of lock programs, but not for xtrlock.

My simple solution was to take advantage of /usr/local/bin being usually before /usr/bin in the PATH and create a script /usr/local/bin/xflock4 with this content:

#!/bin/sh
xtrlock

Make it executable with

sudo chmod a+x /usr/local/bin/xflock4

Now I can use the XFCE lock button and get what I want.

Alternatively, there are a couple of other light-weight lock programs for Linux:

XFCE 4.8 panel : Fix missing Suspend and Hibernate icons

The “Action Buttons” panel plugin of XFCE 4.8 on Debian “wheezy” has a known bug regarding missing icons for the Suspend and Hibernate actions and users will only see a generic placeholder icon.

Ognyan Kulev who reported the bug says this is because most icon themes do not provide icons named “system-suspend” and “system-hibernate”.

As a work-around he suggests linking to the corresponding xfce4-power-manager icons. This fixed the issue on my Debian laptop:

sudo apt-get install xfce4-power-manager-data
cd /usr/share/icons/hicolor/scalable/actions
sudo ln -s xfpm-suspend.svg system-suspend.svg
sudo ln -s xfpm-hibernate.svg system-hibernate.svg
sudo gtk-update-icon-cache-3.0 -f ../..

I saved save the commands into a shell script so I can run it again if the symbolic links get deleted during an apt-get update or accidental apt-get remove:

echo "#! /bin/sh" > /usr/local/bin/fix-xfce-action-icons.sh
chmod ugo+x /usr/local/bin/fix-xfce-action-icons.sh
sudo vim /usr/local/bin/fix-xfce-action-icons.sh

How I manage my website logins (using Firefox)

This blog post describes how I manage my many website logins (usernames, passwords). I am very interested in how I can improve my current approach. I want it to be highly secure and highly convenient. Please feel free to add your comments and suggestions!

I try to use secure passwords for all of my web accounts, i.e. long random combinations of “special characters”, mixed case letters and numbers. They are usually so secure that I definitely cannot remember them.

So I let my web browser remember, manage and auto-fill my website logins. I use

The approach works well and I never have to memorize my passwords. But my worries are:

  • Is Firefox Sync data as secure as Mozilla claims it is?
  • What can happen if malicious hackers gain access to the Firefox Sync servers?
  • Is the Triple-DES encryption with cipher block chaining that is allegedly used for local password storage in the Firefox profile secure enough (especially given this long-standing bug)?
  • Is it a bad idea to let Firefox even remember my online banking, Paypal and other sensitive passwords?

My standard tools on a Windows workstation

If I have to work on a Windows machine, these are the tools I usually install and use:

Free/Libre/Open Source

Free/Libre/Open Source software (“FLOSS”) with OSI certified Open Source license

Cross-platform:

  • Latest JDK
  • Intellij (Community Edition)
  • 7zip
  • Eclipse (Platform Runtime Binary + plugins required for my work)
  • Apache Tomcat
  • Apache Maven
  • Git (from git-scm.org)
  • Cygwin (with openssh, wget, nano)
  • Firefox (with Adblock, Secure Login, Firebug, Uppity)
  • Filezilla
  • LibreOffice
  • Pidgin
  • Gimp
  • Gvim
  • Wireshark
  • OpenVPN

Windows-only:

  • Notepad++
  • PdfCreator
  • Infrarecorder
  • CamStudio
  • Link Shell Extension

Closed source

Binaries currently available for download without license fees:

  • Adobe Reader
  • Sysinternals
  • Deskpins
  • MWSnap

Debian Wheezy XFCE 4.8 simple splash without text shadow

Update 14/Aug/2018: I no longer maintain the patched Debian package mentioned and the download links below are most likely broken.

Debian 7 (wheezy) comes with XFCE 4.8. By default, the “simple” splash screen on session startup displays startup messages with an ugly text shadow that makes the text blurry and harder to read.

This is annoying enough that for example OpenSuse and Fedora both applied a patch to remove the text shadow.

Unfortunately, in Debian, XFCE 4.8 still has the text shadow. So I applied this fix and rebuilt the deb from source. I followed this excellent how-to by Raphaël Hertzog. Feel free to download the resulting xfce4-session_4.8.3-3foo1_i386.deb

You can then install it like this:
sudo dpkg -i xfce4-session_4.8.3-3foo1_i386.deb

If you don’t use sudo then you have to run the dpkg command as the root user in the usual way.

Firefox NoScript and browserling.com

I blogged a while ago about the great browser testing service browserling.com.

Recently I have been getting error messages like “You are already using another session” (when signed in at browserling.com) or “You are already using the service from the same IP address (…). Please log in.” (when not logged in). It looked like somehow the site had stopped working for me.

Today I figured out (with some help from the friendly staff at browserling.com), that the NoScript extension that I use in my Firefox browser was causing the problem, apparently due to the fact that browserling.com uses changing IP addresses on their site (for their virtual browser VMs, I guess) and JavaScript related server-side URLs that identify the host (the VM) by IP address only (and not via a permanent hostname or domain). That seems to have confused NoScript (or maybe just confused me) and somehow important JavaScript was not run which caused the bogus error messages.

So the errors finally stopped when I selected “Allow all this page” in the NoScript menu:

firefox-noscript-extension_allow-all-this-page