rohanpm / qingfanyi

Interactive Chinese to English dictionary lookup tool for Linux desktops
GNU General Public License v3.0
0 stars 1 forks source link

Include systemd user unit in package #17

Open rohanpm opened 8 years ago

rohanpm commented 8 years ago

It could be useful to include a qfy.service in the package so that qfy can easily be enabled for the user session by: systemctl --user enable qfy

One reason that's nice is that qfy uses several processes and systemd would robustly contain them.

rohanpm commented 8 years ago

Here is a sample:

[Unit]
Description=qingfanyi

[Install]
WantedBy=default.target

[Service]
Type=simple
ExecStart=/usr/bin/qfy
Restart=on-failure
Environment=DISPLAY=:0 XAUTHORITY=/var/run/lightdm/rmcgover/xauthority PYTHONUNBUFFERED=1

Problem: those X11 related Environment variables can't be hardcoded of course. AFAIK certain systemd versions have shipped with some configuration making this unnecessary. Need to investigate.