DWL setup clean up after changing user ID

Making UID within legal range in Arch addressed many systemd related
issues
This commit is contained in:
2025-12-20 22:07:49 -08:00
parent 1946b362e8
commit 869ebd595c
4 changed files with 20 additions and 12 deletions

View File

@@ -35,15 +35,15 @@ After=graphical-session-pre.target
[Service]
Type=oneshot
Environment=XDG_RUNTIME_DIR=%I
Environment=DWL_TAGS_FILE=%I/dwl.tags
Environment=DWL_LOG_FILE=%I/dwl.log
Environment=XDG_RUNTIME_DIR=%t
Environment=DWL_TAGS_FILE=%t/dwl.tags
Environment=DWL_LOG_FILE=%t/dwl.log
Environment=DWLTAGS_FMT=DZEN
Environment=XDG_CURRENT_DESKTOP=DWL
Environment=XKB_DEFAULT_VARIANT=altgr-intl
Environment=XKB_DEFAULT_OPTIONS=caps:escape,compose:rctrl
Environment=PIPEWIRE_RUNTIME_DIR=/run/user/501
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/501/bus
Environment=PIPEWIRE_RUNTIME_DIR=%t
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
ExecStart=%h/bin/dwl.session
Restart=on-failure
RestartSec=1

View File

@@ -1,10 +1,12 @@
#!/usr/bin/env bash
export $(dbus-launch)
echo $XDG_RUNTIME_DIR used for Wayland session
export WLR_LIBINPUT_NO_DEVICES=1
export DWL_PATH=/usr/local/bin
# export DWL_PATH=/home/mahesh/git/furnish/heshapps_dwl
# export DWL_PATH=/home/mahesh/git/heshapps_codeberg_dwl
export DWL_BAR_PATH=/usr/local/bin
# export DWL_BAR_PATH=/home/mahesh/git/somebar_20240217/build
export DWL_BAR=$DWL_BAR_PATH/somebar

View File

@@ -1,17 +1,23 @@
#!/usr/bin/env bash
# Start DWL
RUNTIME_DIR=$(mktemp --directory --suffix=.${USER})
RUNTIME_DIR=$(mktemp --dry-run --suffix=.${USER})
# Escape slashes in the path
SNAME=$(systemd-escape ${RUNTIME_DIR}.service)
# SNAME=$(systemd-escape $(basename ${RUNTIME_DIR}).service)
SNAME=${USER}_${XDG_VTNR}
export XDG_SESSION_CLASS=user
echo "#################"
echo "$XDG_RUNTIME_DIR"
echo "#################"
# Start service blocking. Remove runtime directory upon completion.
# Be sure to import XDG session variables for graphical-session to work
systemctl --user import-environment XDG_SEAT && \
systemctl --user import-environment XDG_SESSION_TYPE && \
systemctl --user import-environment XDG_SESSION_CLASS && \
systemctl --user import-environment XDG_VTNR && \
systemctl --user import-environment XDG_RUNTIME_DIR && \
systemctl --user import-environment XDG_SESSION_ID && \
systemctl --wait --user start dwl@${SNAME} && \
rm -rf ${RUNTIME_DIR}
systemctl --wait --user start dwl@${SNAME}
# && \
# rm -rf ${RUNTIME_DIR}

View File

@@ -8,5 +8,5 @@ mkfifo $SOMEBAR_INST_FIFO -m666
# conky -c ~/.conkyrc > $SOMEBAR_INST_FIFO &
nohup unibar --music-progress > $SOMEBAR_INST_FIFO &
$DWL_BAR -s $SOMEBAR_INST_FIFO > $SOMEBAR_INST_FIFO.log 2>&1
dbus-launch --exit-with-session -- $DWL_BAR -s $SOMEBAR_INST_FIFO > $SOMEBAR_INST_FIFO.log 2>&1