#928520 Provide systemd unit for unclutter

Package:
unclutter
Source:
unclutter
Description:
hides the mouse cursor in X after a period of inactivity
Submitter:
Jörg Sommer
Date:
2019-09-25 20:27:03 UTC
Severity:
wishlist
#928520#5
Date:
2019-05-06 17:14:58 UTC
From:
To:
Hi,

maybe, could you ship this unit file as /usr/lib/systemd/user/unclutter.service?
This runs unclutter independent of the window manager and it aggregates
all log messages via journal.

```
[Unit]
Description=Daemon to remove idle cursor image from screen
Documentation=man:unclutter(1)
PartOf=graphical-session.target

[Service]
ExecStart=/usr/bin/unclutter -idle 4 -root

[Install]
WantedBy=graphical-session.target
```

Regards Jörg

#928520#10
Date:
2019-09-18 00:15:14 UTC
From:
To:
Hi Jörg,

Jörg Sommer wrote:

Well, /etc/X11/Xsession.d/90unclutter is also independent of the
window manager...

So I assume that -- if we include your file --
/etc/X11/Xsession.d/90unclutter will need to check if its running
under systemd and if it discovers that it is running under systemd,
then do nothing? (BTW: What's the best way to do such a check?)

I'm though not sure if we don't loose some cases where it now would
start and later would not start.

So far that's the only advantage I see of that .service file.

		Regards, Axel

#928520#17
Date:
2019-09-25 09:59:00 UTC
From:
To:
Axel Beckert hat am Mi 18. Sep, 02:15 (+0200) geschrieben:

The best way should be checking for the $MANAGERPID (see systemd.exec(5)).
To support non-systemd systems it would be necessary to have the
90unclutter script.

If there's such a check in 90unclutter, it is possible to install the
unit as disabled and run `systemctl --user start unclutter` when systemd
is available.

Another advantage would the possibility to restart unclutter after updates
of system libraries. If it aligns this way, *needrestart* shows the
unclutter unit, when it needs to be restarted after updates.

The systemd unit also provides the easy enforcement of some security
constraints. I didn't check it, but `NoNewPrivileges=true` and
`ProtectHome=read-only` might be working.



Kind regards, Jörg

#928520#22
Date:
2019-09-25 10:45:49 UTC
From:
To:
Hi Jörg.

Jörg Sommer wrote:

Thanks for these hints. Will check for the next upload. (A new version
of the unclutter package currently waits in the NEW queue.)

Is needrestart (or needrestart-session) in the meanwhile able to
restart such user services? IIRC needrestart-session could just inform
the user about necessary restarts in a pop up notification.

Good point. Both suggestions look fitting on a first glance. Will
check.

		Regards, Axel

#928520#31
Date:
2019-09-25 20:25:09 UTC
From:
To:
Hi Axel,

Axel Beckert hat am Mi 25. Sep, 12:45 (+0200) geschrieben:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843778