chore: migrate omarchy state from ~/.config to ~/.local/state
Move all omarchy runtime state (themes, backgrounds, current theme) from ~/.config/omarchy/current to ~/.local/state/omarchy/current to keep the config dir free of generated files. Add mise task for recreating symlinks and update credential helpers for tea.
This commit is contained in:
@@ -9,7 +9,7 @@ offset=0
|
||||
[[ "$1" =~ [1-9][0-9]*$ ]] && offset=$1
|
||||
|
||||
BACKGROUNDS_DIR="$HOME/Sync/Shared/wallpapers"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.local/state/omarchy/current/background"
|
||||
|
||||
url_preffix="http://www.bing.com"
|
||||
xml_url="https://cn.bing.com/HPImageArchive.aspx?format=xml&idx=$offset&n=10&nc=1612409408851&pid=hp&FORM=BEHPTB&uhd=1&uhdwidth=3840&uhdheight=2160"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# omarchy:summary=Cycle to the next background for the current theme
|
||||
# omarchy:examples=omarchy theme bg next
|
||||
|
||||
THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
|
||||
THEME_BACKGROUNDS_PATH="$HOME/.config/omarchy/current/theme/backgrounds/"
|
||||
THEME_NAME=$(cat "$HOME/.local/state/omarchy/current/theme.name" 2>/dev/null)
|
||||
THEME_BACKGROUNDS_PATH="$HOME/.local/state/omarchy/current/theme/backgrounds/"
|
||||
USER_BACKGROUNDS_PATH="$HOME/.config/omarchy/backgrounds/$THEME_NAME/"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.local/state/omarchy/current/background"
|
||||
|
||||
mapfile -d '' -t BACKGROUNDS < <(find -L "$USER_BACKGROUNDS_PATH" "$THEME_BACKGROUNDS_PATH" -maxdepth 1 -type f -print0 2>/dev/null | sort -z)
|
||||
TOTAL=${#BACKGROUNDS[@]}
|
||||
|
||||
@@ -10,7 +10,7 @@ if [[ -z $1 ]]; then
|
||||
fi
|
||||
|
||||
BACKGROUND="$(realpath "$1")"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.local/state/omarchy/current/background"
|
||||
|
||||
if [[ ! -f "$BACKGROUND" ]]; then
|
||||
echo "File does not exist: $BACKGROUND" >&2
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Show current theme
|
||||
# omarchy:examples=omarchy theme current
|
||||
|
||||
THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"
|
||||
THEME_NAME_PATH="$HOME/.local/state/omarchy/current/theme.name"
|
||||
|
||||
if [[ -f $THEME_NAME_PATH ]]; then
|
||||
cat $THEME_NAME_PATH | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Refresh the current theme from its templates.
|
||||
|
||||
THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"
|
||||
THEME_NAME_PATH="$HOME/.local/state/omarchy/current/theme.name"
|
||||
|
||||
if [[ -f $THEME_NAME_PATH ]]; then
|
||||
OMARCHY_THEME_SKIP_BACKGROUND=1 omarchy-theme-set "$(cat $THEME_NAME_PATH)"
|
||||
|
||||
@@ -18,7 +18,7 @@ else
|
||||
fi
|
||||
|
||||
THEMES_DIR="$HOME/.config/omarchy/themes"
|
||||
CURRENT_DIR="$HOME/.config/omarchy/current"
|
||||
CURRENT_DIR="$HOME/.local/state/omarchy/current"
|
||||
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
||||
|
||||
# Ensure a theme was set
|
||||
|
||||
@@ -9,8 +9,8 @@ if [[ -z $1 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURRENT_THEME_PATH="$HOME/.config/omarchy/current/theme"
|
||||
NEXT_THEME_PATH="$HOME/.config/omarchy/current/next-theme"
|
||||
CURRENT_THEME_PATH="$HOME/.local/state/omarchy/current/theme"
|
||||
NEXT_THEME_PATH="$HOME/.local/state/omarchy/current/next-theme"
|
||||
USER_THEMES_PATH="$HOME/.config/omarchy/themes"
|
||||
OMARCHY_THEMES_PATH="${DOTFILES_DIR}/themes"
|
||||
|
||||
@@ -42,7 +42,7 @@ rm -rf "$CURRENT_THEME_PATH"
|
||||
mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH"
|
||||
|
||||
# Store theme name for reference
|
||||
echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name"
|
||||
echo "$THEME_NAME" >"$HOME/.local/state/omarchy/current/theme.name"
|
||||
|
||||
# Change background with theme
|
||||
if [[ $OMARCHY_THEME_SKIP_BACKGROUND != "1" ]]; then
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Apply the current theme color to Chromium, Chrome, Edge, and Brave
|
||||
# omarchy:hidden=true
|
||||
|
||||
CHROMIUM_THEME=~/.config/omarchy/current/theme/chromium.theme
|
||||
CHROMIUM_THEME=~/.local/state/omarchy/current/theme/chromium.theme
|
||||
|
||||
if [[ -f $CHROMIUM_THEME ]]; then
|
||||
THEME_RGB_COLOR=$(<$CHROMIUM_THEME)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Apply current Omarchy theme colors to running Foot terminals
|
||||
# omarchy:hidden=true
|
||||
|
||||
foot_theme=~/.config/omarchy/current/theme/foot.ini
|
||||
foot_theme=~/.local/state/omarchy/current/theme/foot.ini
|
||||
|
||||
if [[ ! -f $foot_theme ]] || ! pgrep -x foot >/dev/null; then
|
||||
exit 0
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Apply the current theme to GNOME color mode and icon settings
|
||||
# omarchy:hidden=true
|
||||
|
||||
if [[ -f ~/.config/omarchy/current/theme/light.mode ]]; then
|
||||
if [[ -f ~/.local/state/omarchy/current/theme/light.mode ]]; then
|
||||
gsettings set org.gnome.desktop.interface color-scheme "prefer-light"
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
|
||||
else
|
||||
@@ -12,7 +12,7 @@ else
|
||||
fi
|
||||
|
||||
# Change gnome icon theme color
|
||||
GNOME_ICONS_THEME=~/.config/omarchy/current/theme/icons.theme
|
||||
GNOME_ICONS_THEME=~/.local/state/omarchy/current/theme/icons.theme
|
||||
if [[ -f $GNOME_ICONS_THEME ]]; then
|
||||
gsettings set org.gnome.desktop.interface icon-theme "$(<$GNOME_ICONS_THEME)"
|
||||
else
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Apply the current theme keyboard color to ASUS ROG keyboards
|
||||
# omarchy:hidden=true
|
||||
|
||||
ASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb
|
||||
ASUSCTL_THEME=~/.local/state/omarchy/current/theme/keyboard.rgb
|
||||
|
||||
if omarchy-cmd-present asusctl; then
|
||||
asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Apply the current theme keyboard color to Framework Laptop 16 keyboards
|
||||
# omarchy:hidden=true
|
||||
|
||||
FRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb
|
||||
FRAMEWORK16_THEME=~/.local/state/omarchy/current/theme/keyboard.rgb
|
||||
|
||||
if omarchy-cmd-present qmk_hid && [[ -f $FRAMEWORK16_THEME ]]; then
|
||||
hex=$(cat "$FRAMEWORK16_THEME")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Sync Omarchy theme to all Obsidian vaults
|
||||
# omarchy:hidden=true
|
||||
|
||||
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
|
||||
CURRENT_THEME_DIR="$HOME/.local/state/omarchy/current/theme"
|
||||
|
||||
[[ -f $CURRENT_THEME_DIR/obsidian.css ]] || exit 0
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
TEMPLATES_DIR="$DOTFILES_DIR/default/themed"
|
||||
USER_TEMPLATES_DIR="$HOME/.config/omarchy/themed"
|
||||
NEXT_THEME_DIR="$HOME/.config/omarchy/current/next-theme"
|
||||
NEXT_THEME_DIR="$HOME/.local/state/omarchy/current/next-theme"
|
||||
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"
|
||||
THEME_MODE="$NEXT_THEME_DIR/light.mode"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Sync Omarchy theme to VS Code, VSCodium, and Cursor
|
||||
# omarchy:hidden=true
|
||||
|
||||
VS_CODE_THEME="$HOME/.config/omarchy/current/theme/vscode.json"
|
||||
VS_CODE_THEME="$HOME/.local/state/omarchy/current/theme/vscode.json"
|
||||
|
||||
set_theme() {
|
||||
local editor_cmd="$1"
|
||||
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
# Paths
|
||||
BACKGROUNDS_DIR="$HOME/Sync/Shared/wallpapers"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
||||
CURRENT_BACKGROUND_LINK="$HOME/.local/state/omarchy/current/background"
|
||||
|
||||
[ -d "$BACKGROUNDS_DIR" ] || mkdir -p "$BACKGROUNDS_DIR"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user