[systemd-devel] systemd-user and xdg-user-dir

Jakob Schürz wertstoffe at nurfuerspam.de
Wed Jan 11 00:09:22 UTC 2017


Hi there!

I can not find anything valuable for my problem. So i come here...

in ~/.config/user-dirs.dirs are xdg-specific directories for desktop,
downloads and so on. You know this.

I rewrote a fuse-Filesystem for cups and want wo provide it with a
systemd-unit.

There should be a Directory on the desktop called "Printer". In english.
But my Desktop is called "Schreibtisch", because i'm from Austria... And
printers are called "Drucker" here.

if i create a new xdg-user-dir with

$ xdg-user-dirs-update --set PRINTERS $(xdg-user-dir DESKTOP)/Drucker

I get back:

$ xdg-user-dir PRINTERS
/home/jakob/Schreibtisch/Drucker

As expected and wanted.

Now i want to use this XDG_PRINTERS_DIR-Variable in systemd.mount and
systemd.path... in a systemd-user-session.

I made a separate unit to set the environment:

[Unit]
Description=Set environment

[Service]
Type=simple
ExecStart=/bin/sh -c '/bin/systemctl --user set-environment
XDG_PRINTERS_DIR=$(xdg-user-dir PRINTERS)'


But i want to activate this fuse-filesystem only if the directory
$XDG_PRINTERS_DIR exist. But systemd.path accepts no Variable for
"PathExists=..."

How can I manage this path-Unit?

Regards

Jakob


More information about the systemd-devel mailing list