Skip to content

Instantly share code, notes, and snippets.

@kikairoya
Created June 24, 2013 14:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kikairoya/5850256 to your computer and use it in GitHub Desktop.
Save kikairoya/5850256 to your computer and use it in GitHub Desktop.
Enables 'systemctl --user' without X11, dbus-launch, systemd-user-session
if [ ! -S /run/user/$(id -u)/dbus/user_bus_socket ]; then
mkdir -p /run/user/$(id -u)/dbus
dbus-daemon --session --fork --address=unix:path=/run/user/$(id -u)/dbus/user_bus_socket --systemd-activation
fi
if ! systemctl --user > /dev/null 2> /dev/null; then
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/dbus/user_bus_socket /usr/lib/systemd/systemd --user & > /dev/null 2> /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment