wmstartup, xob: Clean up initialization, use XDG_RUNTIME_DIR

This commit is contained in:
Salt 2018-08-24 15:28:52 -05:00
parent 93ef99a929
commit f1c64ec67f
3 changed files with 11 additions and 22 deletions

View File

@ -81,7 +81,6 @@ shadow-opacity = 0.5;
# (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.
shadow-exclude = [
"! name~=''",
"name = 'oneko'",
"name = 'Notification'",
"name = 'Plank'",

View File

@ -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

View File

@ -39,7 +39,7 @@ default = {
};
};
};
XOB_PIPE_VOLUME = {
volume = {
x = {
relative = 0.5;
offset = 0;
@ -80,7 +80,7 @@ XOB_PIPE_VOLUME = {
};
};
};
XOB_PIPE_BRIGHTNESS = {
brightness = {
x = {
relative = 0.5;
offset = 0;
@ -111,7 +111,7 @@ XOB_PIPE_BRIGHTNESS = {
};
};
};
XOB_PIPE_MISC = {
misc = {
x = {
relative = 0.5;
offset = 0;