From fd2f0d27b55e45829ddf51cc7615b87babeb34ee Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Sun, 24 Dec 2023 23:14:41 -0500 Subject: [PATCH] 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. --- user-config/xorg/.xinitrc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/user-config/xorg/.xinitrc b/user-config/xorg/.xinitrc index 464ddd8..8dd006a 100755 --- a/user-config/xorg/.xinitrc +++ b/user-config/xorg/.xinitrc @@ -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