home: Emacs should use the user dbus session, not the system one

* user-config/xorg/.xinitrc: Start dbus directly; no longer use dbus-launch to run window manager.
This commit is contained in:
Collin J. Doering 2023-12-24 23:14:41 -05:00
parent 4923e7e2ca
commit fd2f0d27b5
Signed by: rekahsoft
GPG Key ID: 7B4DEB93212B3022
1 changed files with 10 additions and 4 deletions

View File

@ -37,6 +37,12 @@ init_full_session() {
# Allow clipboard to be shared via spice
spice-vdagent &
# Start dbus session here so emacs daemon connects to the users dbus session and not the
# system one
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval "$(dbus-launch --sh-syntax)"
fi
# Determine how to start (or not start) emacs
if [ "$SESSION_WM" = "exwm" ]; then
case "$SESSION_TYPE" in
@ -129,20 +135,20 @@ init_session() {
run_session() {
case "$SESSION_WM" in
xmonad|stumpwm)
exec dbus-launch --exit-with-session "$SESSION_WM"
exec "$SESSION_WM"
;;
exwm)
if [ "$SESSION_TYPE" = "min" ]; then
exec dbus-launch --exit-with-session emacs -f start-as-window-manager
exec emacs -f start-as-window-manager
else
exec emacsclient -c
fi
;;
*)
if [ "$SESSION_TYPE" = "new" ]; then
exec dbus-launch --exit-with-session "$SESSION_WM"
exec "$SESSION_WM"
else
exec dbus-launch --exit-with-session "$DEFAULT_WM"
exec "$DEFAULT_WM"
fi
;;
esac