Skip to content

Instantly share code, notes, and snippets.

@imaami
Created August 24, 2019 19:44
Show Gist options
  • Save imaami/ae73693369f7ef97f09a3d452dc2f132 to your computer and use it in GitHub Desktop.
Save imaami/ae73693369f7ef97f09a3d452dc2f132 to your computer and use it in GitHub Desktop.
Make the user service manager aware of D-Bus etc.
#!/bin/bash
args=()
((n=0))
for v in DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS; do
[[ x${!v} == 'x' ]] || { args[n]="$v=${!v}"; ((n++)); }
done
(( n == 0 )) || /bin/systemctl --user set-environment "${args[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment