wmstartup, xob: Clean up initialization, use XDG_RUNTIME_DIR
This commit is contained in:
@@ -36,10 +36,6 @@ unset PB_MODULE_WLAN_INTERFACE
|
||||
# bspwm monitorset.sh
|
||||
unset BSPWM_DESKTOPS_TOTAL
|
||||
unset BSPWM_DESKTOPS_PRIMARY
|
||||
# xob
|
||||
unset XOB_PIPE_BRIGHTNESS
|
||||
unset XOB_PIPE_VOLUME
|
||||
unset XOB_PIPE_MISC
|
||||
|
||||
## Patch path, if not already done
|
||||
if [[ "$PATH" != "*$HOME/.local/bin*" ]]; then
|
||||
@@ -47,6 +43,11 @@ if [[ "$PATH" != "*$HOME/.local/bin*" ]]; then
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
## Set the runtime directory, if not already
|
||||
if [[ "$XDG_RUNTIME_DIR" == "" ]]; then
|
||||
export XDG_RUNTIME_DIR="/run/user/$UID"
|
||||
fi
|
||||
|
||||
## Load device-specific scripts
|
||||
if [[ -x "$HOME/.config/dtfscripts/$(hostname).rc" ]]; then
|
||||
printf "[INFO] Sourcing ~/.config/dtfscripts/$(hostname).rc\n"
|
||||
@@ -129,20 +130,9 @@ fi
|
||||
# XOB
|
||||
if which xob > /dev/null 2>&1; then
|
||||
printf " [INFO] Starting xob instances\n"
|
||||
pipes="XOB_PIPE_BRIGHTNESS XOB_PIPE_VOLUME XOB_PIPE_MISC"
|
||||
# Clean up earlier temp folders
|
||||
for file in /tmp/$USER-xob-*; do
|
||||
printf " [INFO] Found old xob directory \"$file\"\n"
|
||||
for pipe in $pipes; do
|
||||
if [ -p "$file/$pipe" ]; then
|
||||
printf " [INFO] Contained old pipe \"$pipe\". Removing\n"
|
||||
rm "$file/$pipe"
|
||||
fi
|
||||
done
|
||||
rmdir "$file" && printf " [INFO] Successfully cleaned up\n" || printf " [WARN] Failed to clean up\n"
|
||||
done
|
||||
# Set up new pipes
|
||||
export XOB_PIPE_DIR="/tmp/$USER-xob-$(date +%s)-$(uuidgen)"
|
||||
pipes="brightness volume misc"
|
||||
# Set up pipes
|
||||
export XOB_PIPE_DIR="$XDG_RUNTIME_DIR/xob"
|
||||
printf " [INFO] Using pipe directory \"$XOB_PIPE_DIR\"\n"
|
||||
mkdir -m 700 "$XOB_PIPE_DIR"
|
||||
for pipe in $pipes; do
|
||||
|
Reference in New Issue
Block a user