|
|
@@ -12,28 +12,29 @@ if [ -n "$1" ]; then |
|
|
|
fi |
|
|
|
|
|
|
|
# Multi-user support: |
|
|
|
state_prefix=${XDG_CACHE_HOME:-"$HOME/.cache"} |
|
|
|
mkdir -p "${state_prefix}" |
|
|
|
# state_prefix=${XDG_CACHE_HOME:-"$HOME/.cache"} |
|
|
|
# mkdir -p "${state_prefix}" |
|
|
|
|
|
|
|
if [ ! -d "${state_prefix}" ]; then |
|
|
|
echo "bspwm-session: cache directory ‘${state_prefix}‘ is missing." |
|
|
|
echo |
|
|
|
exit 1 |
|
|
|
elif [ ! -w "${state_prefix}" ]; then |
|
|
|
echo "bspwm-session: cache directory ‘${state_prefix}‘ is not writable." |
|
|
|
echo |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
# if [ ! -d "${state_prefix}" ]; then |
|
|
|
# echo "bspwm-session: cache directory ‘${state_prefix}‘ is missing." |
|
|
|
# echo |
|
|
|
# exit 1 |
|
|
|
# elif [ ! -w "${state_prefix}" ]; then |
|
|
|
# echo "bspwm-session: cache directory ‘${state_prefix}‘ is not writable." |
|
|
|
# echo |
|
|
|
# exit 1 |
|
|
|
# fi |
|
|
|
|
|
|
|
state_path=$(mktemp -d "${state_prefix}/bspwm-session.XXXXXX") |
|
|
|
# state_path=$(mktemp -d "${state_prefix}/bspwm-session.XXXXXX") |
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
echo "bspwm-session: failed to create state directory ‘${state_path}‘." |
|
|
|
echo |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
# if [ $? -ne 0 ]; then |
|
|
|
# echo "bspwm-session: failed to create state directory ‘${state_path}‘." |
|
|
|
# echo |
|
|
|
# exit 1 |
|
|
|
# fi |
|
|
|
|
|
|
|
export BSPWM_SOCKET=${state_path}/bspwm-socket |
|
|
|
# export BSPWM_SOCKET=${state_path}/bspwm-socket |
|
|
|
export BSPWM_SOCKET=$HOME/.cache/bspwm-socket |
|
|
|
|
|
|
|
# Trap: make sure everything started in ~/.config/bspwm/autostart is |
|
|
|
# signalled when this script exits or dies. Also clean up $state_path. |
|
|
|