wmstartup, xob: Clean up initialization, use XDG_RUNTIME_DIR
This commit is contained in:
		@@ -81,7 +81,6 @@ shadow-opacity = 0.5;
 | 
				
			|||||||
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
 | 
					# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
 | 
				
			||||||
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
 | 
					# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
 | 
				
			||||||
shadow-exclude = [
 | 
					shadow-exclude = [
 | 
				
			||||||
    "! name~=''",
 | 
					 | 
				
			||||||
    "name = 'oneko'",
 | 
					    "name = 'oneko'",
 | 
				
			||||||
    "name = 'Notification'",
 | 
					    "name = 'Notification'",
 | 
				
			||||||
    "name = 'Plank'",
 | 
					    "name = 'Plank'",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,10 +36,6 @@ unset PB_MODULE_WLAN_INTERFACE
 | 
				
			|||||||
# bspwm monitorset.sh
 | 
					# bspwm monitorset.sh
 | 
				
			||||||
unset BSPWM_DESKTOPS_TOTAL
 | 
					unset BSPWM_DESKTOPS_TOTAL
 | 
				
			||||||
unset BSPWM_DESKTOPS_PRIMARY
 | 
					unset BSPWM_DESKTOPS_PRIMARY
 | 
				
			||||||
# xob
 | 
					 | 
				
			||||||
unset XOB_PIPE_BRIGHTNESS
 | 
					 | 
				
			||||||
unset XOB_PIPE_VOLUME
 | 
					 | 
				
			||||||
unset XOB_PIPE_MISC
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Patch path, if not already done
 | 
					## Patch path, if not already done
 | 
				
			||||||
if [[ "$PATH" != "*$HOME/.local/bin*" ]]; then
 | 
					if [[ "$PATH" != "*$HOME/.local/bin*" ]]; then
 | 
				
			||||||
@@ -47,6 +43,11 @@ if [[ "$PATH" != "*$HOME/.local/bin*" ]]; then
 | 
				
			|||||||
	export PATH="$HOME/.local/bin:$PATH"
 | 
						export PATH="$HOME/.local/bin:$PATH"
 | 
				
			||||||
fi
 | 
					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
 | 
					## Load device-specific scripts
 | 
				
			||||||
if [[ -x "$HOME/.config/dtfscripts/$(hostname).rc" ]]; then
 | 
					if [[ -x "$HOME/.config/dtfscripts/$(hostname).rc" ]]; then
 | 
				
			||||||
	printf "[INFO] Sourcing ~/.config/dtfscripts/$(hostname).rc\n"
 | 
						printf "[INFO] Sourcing ~/.config/dtfscripts/$(hostname).rc\n"
 | 
				
			||||||
@@ -129,20 +130,9 @@ fi
 | 
				
			|||||||
# XOB
 | 
					# XOB
 | 
				
			||||||
if which xob > /dev/null 2>&1; then
 | 
					if which xob > /dev/null 2>&1; then
 | 
				
			||||||
	printf "  [INFO] Starting xob instances\n"
 | 
						printf "  [INFO] Starting xob instances\n"
 | 
				
			||||||
	pipes="XOB_PIPE_BRIGHTNESS XOB_PIPE_VOLUME XOB_PIPE_MISC"
 | 
						pipes="brightness volume misc"
 | 
				
			||||||
	# Clean up earlier temp folders
 | 
						# Set up pipes
 | 
				
			||||||
	for file in /tmp/$USER-xob-*; do
 | 
						export XOB_PIPE_DIR="$XDG_RUNTIME_DIR/xob"
 | 
				
			||||||
		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)"
 | 
					 | 
				
			||||||
	printf "    [INFO] Using pipe directory \"$XOB_PIPE_DIR\"\n"
 | 
						printf "    [INFO] Using pipe directory \"$XOB_PIPE_DIR\"\n"
 | 
				
			||||||
	mkdir -m 700 "$XOB_PIPE_DIR"
 | 
						mkdir -m 700 "$XOB_PIPE_DIR"
 | 
				
			||||||
	for pipe in $pipes; do
 | 
						for pipe in $pipes; do
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ default = {
 | 
				
			|||||||
		};
 | 
							};
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
XOB_PIPE_VOLUME = {
 | 
					volume = {
 | 
				
			||||||
	x = {
 | 
						x = {
 | 
				
			||||||
		relative = 0.5;
 | 
							relative = 0.5;
 | 
				
			||||||
		offset = 0;
 | 
							offset = 0;
 | 
				
			||||||
@@ -80,7 +80,7 @@ XOB_PIPE_VOLUME = {
 | 
				
			|||||||
		};
 | 
							};
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
XOB_PIPE_BRIGHTNESS = {
 | 
					brightness = {
 | 
				
			||||||
	x = {
 | 
						x = {
 | 
				
			||||||
		relative = 0.5;
 | 
							relative = 0.5;
 | 
				
			||||||
		offset = 0;
 | 
							offset = 0;
 | 
				
			||||||
@@ -111,7 +111,7 @@ XOB_PIPE_BRIGHTNESS = {
 | 
				
			|||||||
		};
 | 
							};
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
XOB_PIPE_MISC = {
 | 
					misc = {
 | 
				
			||||||
	x = {
 | 
						x = {
 | 
				
			||||||
		relative = 0.5;
 | 
							relative = 0.5;
 | 
				
			||||||
		offset = 0;
 | 
							offset = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user