Use DMZ-Red mouse cursor as default

Find a download site for the DMZ-Red mouse cursor theme and download the tarball to ~/140570-Cursors.tar.gz.

Expand it under /usr/local and fix permissions :

sudo mkdir -p /usr/local/share/icons
cd /usr/local/share/icons
sudo tar xvzf ~/140570-Cursors.tar.gz
sudo chmod -R go-w DMZ-Red

Edit the *.theme files so that they look like this :

$ cat /usr/local/share/icons/DMZ-Red/cursor.theme
[Icon Theme]
Inherits=DMZ-Red

$ cat /usr/local/share/icons/DMZ-Red/index.theme 
[Icon Theme]
Name=DMZ (Red)

Link into /usr/share/icons :

sudo ln -s /usr/local/share/icons/DMZ-Red /usr/share/icons

Configure as system-wide default :

sudo update-alternatives --install /usr/share/icons/default/index.theme x-cursor-theme /usr/share/icons/DMZ-Red/cursor.theme 100

sudo update-alternatives --config x-cursor-theme

The last command should come up with a list of choices and a prompt similar to this :

There are 4 choices for the alternative x-cursor-theme (providing /usr/share/icons/default/index.theme).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
* 0            /usr/share/icons/DMZ-Red/cursor.theme     100       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-Red/cursor.theme     100       manual mode
  4            /usr/share/icons/DMZ-White/cursor.theme   50        manual mode

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

In XFCE, the “Settings – Mouse and Touchpad – Theme” dialog should look like this :

Enter passphrase once at X login for ssh, scp, sshfs

I use ssh, scp, sshfs and x2go with key-based authentication, ie. not entering remote passwords when I connect. There are pros and cons of this, but I think it is more secure.

I use a non-empty passphrase but do not want to enter it on every connection. Once per X session is enough for me.

Here is how I set it up on Debian 11 (“bullseye”):

# do this once and set a good passphrase:
ssh-keygen
# then for each of your accounts on remote hosts:
ssh-copy-id username@otherhost

Configure ssh agent and ssh-add to run when your X session starts. I use the gnome-keyring service as agent:

sudo apt install gnome-keyring

In XFCE – Settings – Session and Startup – Application Autostart, I have two entries with trigger “on login” :

  • “SSH Key Agent (GNOME Keyring: SSH Agent)”
  • “ssh-add” – created by me, command: ssh-add

This setup will bring up a visual prompt for your ssh passphrase right after XFCE login. The default ssh-askpass looks quite ugly, so I installed a more modern one:

sudo apt install ssh-askpass-gnome

On Debian, that package sets itself as default ssh-askpass “alternative”. If in doubt , try this:

sudo update-alternatives --config ssh-askpass

The resulting prompt looks like this for me (“Adwaita Dark” theme):

After all this your ssh, scp, sshfs, x2go and other ssh based tools should be able to connect to your remote accounts without password prompts.

Update: I took convenience one step further and enabled “Launch GNOME services on startup” in the Advanced tab of Session and Startup in the XFCE setting, as described in the XFCE wiki.

This activates GNOME Keyring which “is integrated with the user’s login, so that their secret storage can be unlocked when the user logins into their session”. This means it will store your once entered ssh passphrase on disk, using your Linux login as the only secret that you still have to enter (as you log in as usual).

Hide window from taskbar

Some application windows are sort of “background noise” and you would usually not like to see them on your taskbar, i.e. on the panel item that shows a button for each application window. Often, applications like that support a “minimize to system tray” option, but some don’t.

In the latter case you might at least want to have a convenient way to hide those windows from your taskbar. I did the following on Debian stable:

Install the “wmctrl” package:

sudo apt install wmctrl

In my XFCE, I added a launcher to the panel, specifying the command:

wmctrl -r :SELECT: -b add,skip_taskbar

See “man wmctrl” for details.

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

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.