Move .spool to XDG state directory

This commit is contained in:
John Mertz 2024-03-08 14:23:54 -07:00
parent 87f03742a7
commit 65d15ee745
10 changed files with 15 additions and 15 deletions

View File

@ -21,7 +21,7 @@ Run `${HOME}/scripts/update_configs.pl` to refresh links and dump templates.
This file contains a JSON hash of the configuration files available with either a path to be linked, or the name of a dumper contained within [`${HOME}/scripts/dotfiles`](https://git.john.me.tz/jpm/scripts).
### `${HOME}/.spool/dotfiles.json`
### `${HOME}/.local/state/dotfiles.json`
This file contains a JSON hash of timestamps at which each configuration was last linked or dumped. The `${HOME}/scripts/update_configs.pl` script will use these times to know whether or not they need to be updated. It will do so if:

View File

@ -24,7 +24,7 @@ export GDK_BACKEND="wayland"
export DCONF=".config/dconf/user"
# Suggest session start command if last session is not known
if [ ! -e "${HOME}/.spool/last_login_gui" ]; then
if [ ! -e "${HOME}/.local/state/last_login_gui" ]; then
echo "Use 'startsway' or 'starti3' to launch a GUI"
fi

View File

@ -1,12 +1,12 @@
# vim: ft=sh
## Configure static SSH Agent
export SSH_AUTH_SOCK="$HOME/.spool/ssh-agent.sock"
export SSH_AUTH_SOCK="$HOME/.local/state/ssh-agent.sock"
if [ -e "$SSH_AUTH_SOCK" ]; then
rm "$SSH_AUTH_SOCK"
fi
if [ -e "$HOME/.spool/ssh-agent.env" ]; then
rm "$HOME/.spool/ssh-agent.env"
if [ -e "$HOME/.local/state/ssh-agent.env" ]; then
rm "$HOME/.local/state/ssh-agent.env"
fi
if [[ "$(pgrep ssh-agent)" ]]; then
pkill ssh-agent
@ -14,5 +14,5 @@ fi
. ${HOME}/scripts/ssh-agent.sh
# Static/predictable Sway socket
export SWAYSOCK="$HOME/.spool/sway-ipc.sock"
export SWAYSOCK="$HOME/.local/state/sway-ipc.sock"
#export SWAYSOCK="`sway --get-socketpath`"

View File

@ -3,7 +3,7 @@
if [ ! "$SSH_TTY" ]; then
# Remove socket files
rm "$SSH_AUTH_SOCK"
rm "$HOME/.spool/ssh-agent.env"
rm "$HOME/.local/state/ssh-agent.env"
rm "$SWAYSOCK"
fi

View File

@ -24,8 +24,8 @@ fi
# Still, it does not hurt for later distrohopping
if [ "$(tty)" == '/dev/tty1' ] && [ ! "$SSH_TTY" ]; then
source "${HOME}/.dotfiles/bash/bash_login"
LAST_GUI=$(cat "${HOME}/.spool/last_login_gui" 2>/dev/null)
if [ -f "${HOME}/.spool/last_login_gui" ]; then
LAST_GUI=$(cat "${HOME}/.local/state/last_login_gui" 2>/dev/null)
if [ -f "${HOME}/.local/state/last_login_gui" ]; then
${HOME}/scripts/${LAST_GUI}/start${LAST_GUI}.sh
fi
fi

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Static SSH agent
export SSH_AUTH_SOCK="$HOME/.spool/ssh-agent.sock"
export SSH_AUTH_SOCK="$HOME/.local/state/ssh-agent.sock"
# GUI themes
export GTK_THEME="Gruvbox"

View File

@ -3,7 +3,7 @@
# don't put duplicate lines or lines starting with space in the history.
shopt -s histappend
HISTCONTROL=ignoreboth
HISTFILE=${HOME}/.spool/bash_history
HISTFILE=${HOME}/.local/state/bash_history
# append to the history file, don't overwrite it
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

View File

@ -22,7 +22,7 @@ exec ${HOME}/scripts/ssh-agent.sh &
# Automatically restore last used output configuration
# TODO: Need to add fail-safe to script in case the outputs are unavailable
exec ${HOME}/scripts/sway/displays.pl $(cat ${HOME}/.spool/last_display) &
exec ${HOME}/scripts/sway/displays.pl $(cat ${HOME}/.local/state/last_display) &
# Enable automatic color temperature change
exec ${HOME}/scripts/distrobox/debian/gammastep.pl &

View File

@ -258,7 +258,7 @@ bindsym $mod+Shift+Backspace move container to workspace back_and_forth
### Function row
# Escape: Lock
bindsym $mod+Escape exec /usr/bin/kill -SIGUSR1 `cat ${HOME}/.spool/sway-transparency`
bindsym $mod+Escape exec /usr/bin/kill -SIGUSR1 `cat ${HOME}/.local/state/sway-transparency`
# Add Shift: Blank screen
bindsym $mod+Shift+Escape exec /usr/bin/sh -c "sleep 1 ; /usr/bin/kill -SIGUSR1 $(pgrep swayidle)"

View File

@ -164,7 +164,7 @@
"custom/osk": {
"interval": 1,
"on-click": "${HOME}/scripts/waybar/waybar-keyboard.sh",
"exec": "if [ -e $HOME/.spool/onscreen-keyboard ]; then CLASS='activated'; else CLASS=''; fi; echo '⌨\nToggle onscreen keyboard\n'$CLASS",
"exec": "if [ -e $HOME/.local/state/onscreen-keyboard ]; then CLASS='activated'; else CLASS=''; fi; echo '⌨\nToggle onscreen keyboard\n'$CLASS",
},
"custom/pkg": {
"interval": 60,
@ -184,7 +184,7 @@
"activated": " ",
"deactivated": " "
},
"on-click": "echo {status} > ${HOME}/.spool/idle_inhibitor"
"on-click": "echo {status} > ${HOME}/.local/state/idle_inhibitor"
},
"custom/sleep_modes": {
"interval": 1,