Skip to content

Instantly share code, notes, and snippets.

@mmonaco
Created September 23, 2012 20:16
Show Gist options
  • Select an option

  • Save mmonaco/3772913 to your computer and use it in GitHub Desktop.

Select an option

Save mmonaco/3772913 to your computer and use it in GitHub Desktop.
#!/bin/bash
info() {
printf "Xsession: $*\n" >&2
}
info "hello!"
info "running from -- $0"
#command env | grep -v ^LESS_TERMCAP | sort > ~/Local/ENV_PRE_PROFILE
info "sourcing profiles:"
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
if [[ -f "$file" ]]; then
info "\t$file"
source "$file"
fi
done
#command env | grep -v ^LESS_TERMCAP | sort > ~/Local/ENV_POST_PROFILE
info "setting DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/dbus_session_socket-$USER"
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/dbus_session_socket-$USER
info "goodbye! starting systemd"
exec systemd --user
info "error running systemd, maybe you can have a terminal?"
exec gnome-terminal
info "we're fucked... -- goodbye!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment