You are not logged in.

#1 2018-09-04 05:23:29

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Start autocutsel on boot

I try to start autocutsel on boot of the system.
autocutsel.service

[Unit]
Description=Start autocutsel on boot
After=graphical.target
[Service]
Type=idle
User=user1
ExecStart=usr/bin/autocutsel -buttonup
ExecStop=pkill autocutsel
[Install]
WantedBy=graphical.target

journalctl -b

autocutsel[369]: Error: Can't open display:

If I try to run "systemctl start autocutsel" after start of X then get the same result.
What do I do wrong?

Last edited by Kirill Bugaev (2018-09-04 09:14:15)

Offline

#2 2018-09-04 07:00:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,840

Offline

#3 2018-09-04 08:11:47

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Re: Start autocutsel on boot

Thanks. systemd --user is exactly what I need.
But a small question. I try to

sudo systemctl --user --global enable autocutsel

But after reboot "systemctl --user status autocutsel" say

● autocutsel.service - Start autocutsel on boot
   Loaded: loaded (/etc/systemd/user/autocutsel.service; en>
   Active: inactive (dead)

The most interesting is

$ systemctl --user status graphical.target
Unit graphical.target could not be found.

I need to start autocutsel after X Server.
I have accidentally read neighbor topic where topic starter have similar problem with absent systemd dbus.target and use .xprofile to start spice-vdagent. It works in my case, God bless autocutsel stops automatically after X Server shut down. But I am still interesting in how it can be done with systemd service.

Last edited by Kirill Bugaev (2018-09-04 15:21:23)

Offline

Board footer

Powered by FluxBB