JoseExposito / touchegg

Linux multi-touch gesture recognizer
GNU General Public License v3.0
3.65k stars 168 forks source link

Useless autostart of client if daemon is not active #615

Closed mikhailnov closed 1 year ago

mikhailnov commented 1 year ago

I will patch the autostart desktop file in ROSA Linux package of touchegg:

diff --git a/installation/touchegg.desktop b/installation/touchegg.desktop
index 9f013e0..58ca3c4 100644
--- a/installation/touchegg.desktop
+++ b/installation/touchegg.desktop
@@ -2,7 +2,7 @@
 Type=Application
 Name=Touchégg
 Comment=Multi-touch gesture recognizer
-Exec=touchegg
+Exec=/bin/sh -c 'if systemctl -q is-active touchegg.service; then exec touchegg; fi'
 Terminal=false
 Categories=Utility;
 NoDisplay=true

It will help to avoid useless activity of the client if daemon is not running (disabled by default after installation). However, I am not sendiung this as a pull request because it is not suitable for non-systemd systems.

mikhailnov commented 1 year ago

Also, I am making a systemd.generator(7) script which will activate touchegg.service if it sees that it is a tablet PC

mikhailnov commented 1 year ago

And maybe it would be useful to avoid starting the client inside a Wayland session?

JoseExposito commented 1 year ago

However, I am not sendiung this as a pull request because it is not suitable for non-systemd systems.

Yes, this would cause issues in non-systemd distros. I can't merge it upstream, but it makes sense as a distro patch.

And maybe it would be useful to avoid starting the client inside a Wayland session?

Yes, it might be useful as animations don't work. There are some actions, like run command, that can be used in Wayland, so I'd leave it enabled upstream for the users that are using them.

Closing the issue since this changes can not be merged upstream, but feel free to add more comments if you need help.

mikhailnov commented 1 year ago

Thanks!