bulletmark / libinput-gestures

Actions gestures on your touchpad using libinput
3.9k stars 241 forks source link

Add systemd service #291

Closed gmykhailiuta closed 3 years ago

gmykhailiuta commented 3 years ago

Some users use systemd user services to manage session startup applications. Systemd is used in most popular distributions, so it might be handy to provide such service file as part of application and not as part of particular distribution: https://aur.archlinux.org/packages/libinput-gestures-git/#comment-792261.

bulletmark commented 3 years ago

I like this so I have merged your PR in to a new branch "service" for you to try and comment on. I have also added options to the setup script so that users can easily choose to install as a systemd user service rather than as a desktop app. Please see the new words I have added to the README in that branch describing all this.

I'd actually prefer this was the default starting option because handling all the various desktop approaches and oddities is problematic whereas systemd is standard although of course not all systems use systemd so I can't make it the default. I will change to this approach myself though.

gmykhailiuta commented 3 years ago

I can confirm that suggested systemd unit works fine for me. Thanks!

bulletmark commented 3 years ago

Did you notice I did more than just add your service file though. I also made it simple for users to select to start either as a service or a desktop app. Did you try that?

gmykhailiuta commented 3 years ago

Sorry, I managed it with pure systemd from the very beginning. Played a bit with libinput-gestures-setup service/desktop and autostart/autostop and it also works fine for me. But while skimming through the code, I noticed this line https://github.com/bulletmark/libinput-gestures/blob/master/libinput-gestures-setup#L291. Should't it be has_sysd=0?

bulletmark commented 3 years ago

Oops, good spot. Thanks.

Have fixed it now and pushed new version.