TolikPylypchuk/KeyboardSwitch

Drop systemd

TolikPylypchuk opened this issue · 0 comments

Currently systemd is used to control the lifetime of KeyboardSwitch on Linux. It is also used to make the app start on user login (and it's the main reason for using systemd). This has proved to be problematic - starting desktop applications via systemd at login is hacky, and sometimes fails. On CentOS it doesn't appear to work at all.

What does work is simply putting a .desktop file for starting KeyboardSwitch into the ~/config/autostart directory. This directory is used by freedesktop-compliant UI systems to start desktop apps on user login. Since apparently all popular UI systems are freedesktop-compliant (at least GNOME, KDE Plasma, Xfce, and LXQt), this approach looks better than using systemd with hacks.

As part of this feature, starting KeyboardSwitch with retrying will be dropped as well. It didn't prove to be useful since the X server just kills the process when a fatal connection error appears, and there seems to be no chance to retry within the app. Also, this won't be a problem with the new approach since at that point X will be initialized (I hope).

The only downside is that the app's status cannot be tracked through the terminal. But since this app is a desktop app first and foremost, this is not such a big deal. Looking the app's status through the settings app will always be available.