GitHub | Gitlab | Feed | Privacy Policy | Contact & Impressum

Autocutsel and an Introduction to Systemd User Services

This post shows how to run autocutsel as a systemd user service to keep X11 clipboards in sync.

X11 has two kinds of copy/paste buffers, namely the primary selection and the clipboard selection. The primary selection is invoked when highlighting text and with the middle mouse button while the clipboard selection uses Ctrl+C and Ctrl+V.

If you wish to keep both buffers in sync, you can use the autocutsel daemon to do just that, effectively merging the two buffers.

User Service

I used to just start autocutsel with my window manager, but there is a more clean solution, systemd user services. User services are like regular system-wide services, but they are only started when the associated user is logged in and kept running until all sessions of that users are closed.

  1. As with regular systemd services, we need a service file.

    ExecStartPre=/usr/bin/autocutsel -fork
    ExecStart=/usr/bin/autocutsel -selection PRIMARY -fork

    User service file go into the ~/config/systemd/user directory. We will save above service file as

  2. To control user services, use systemctl like usual, but with the --user flag. After saving autocutsel.service, first reload the database of services with

    systemctl --user daemon-reload

    and then enable the service

    systemctl --user enable autocutsel
  3. Log out and back on again. autocutsel should be running and keeping your clipboards in sync.

systemd will make sure that only one instance of the service is running at a time and restart the daemon if it crashes.

The Tip of the Tongue

Lo-lee-ta: the tip of the tongue that goes right up the lip, down the throat to tap, at the lip. Lo-lee: the top of the tongue going down to the top of the teeth. Lo-ler-sa: to go into the mouth. Lo-ll: to drink, to swallow a cup. Lo-ll: to drink. Lo-lle: to drink and forget about it. Lo-lle-sa: to drink and forget about it again. Lo-lle-sa: to drink and forget about it to be sure. Lo-lle-sa. To drink and forget about it, that means to forget. To drink and forget about it: that means to drink when you forget it. Lo-ll-la: to drink and forget about everything, that's the way a man should drink, to the end in the mouth. Lo-ll-la: To drink and forget about everything, that is.

A computer wrote this.

Jelly Comb WGJP-012 on Debian 10

To use the cheapo USB touchpad branded as Jelly Comb WGJP-012 on Debian 10 Buster, you might have to do a bit of tweaking.

  1. Make sure you have xserver-xorg-input-libinput, xserver-xorg-input-evdev and server-xorg-input-mouse installed.

  2. Make sure you do not have xserver-xorg-libinput-synaptics installed.

  3. Create a file /etc/X11/xorg.conf.d/40-libinput.conf with the following contents.

    Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "on"

After a reboot, you should be able to left-click (single tap), right-click (tap with two fingers) and scroll (swipe with two fingers.)

(Infos taken from the Debian Wiki, but shortened for the Jelly Comb touchpad.)