forked from Shinonome/dots-hyprland
chore: move more files to XDG_STATE_HOME
This commit is contained in:
@@ -39,10 +39,10 @@ transparentize() {
|
||||
|
||||
get_light_dark() {
|
||||
lightdark=""
|
||||
if [ ! -f "$CACHE_DIR"/user/colormode.txt ]; then
|
||||
echo "" > "$CACHE_DIR"/user/colormode.txt
|
||||
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
|
||||
echo "" > "$STATE_DIR/user/colormode.txt"
|
||||
else
|
||||
lightdark=$(sed -n '1p' "$CACHE_DIR/user/colormode.txt")
|
||||
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
|
||||
fi
|
||||
echo "$lightdark"
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ if [ $# -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if the file $CACHE_DIR/user/colormode.txt exists. if not, create it. else, read it to $lightdark
|
||||
colormodefile="$CACHE_DIR/user/colormode.txt"
|
||||
# check if the file $STATE_DIR/user/colormode.txt exists. if not, create it. else, read it to $lightdark
|
||||
colormodefile="$STATE_DIR/user/colormode.txt"
|
||||
lightdark="dark"
|
||||
transparency="opaque"
|
||||
materialscheme="vibrant"
|
||||
@@ -37,10 +37,10 @@ else
|
||||
fi
|
||||
fi
|
||||
backend="material" # color generator backend
|
||||
if [ ! -f "$CACHE_DIR/user/colorbackend.txt" ]; then
|
||||
echo "material" > "$CACHE_DIR/user/colorbackend.txt"
|
||||
if [ ! -f "$STATE_DIR/user/colorbackend.txt" ]; then
|
||||
echo "material" > "$STATE_DIR/user/colorbackend.txt"
|
||||
else
|
||||
backend=$(cat "$CACHE_DIR/user/colorbackend.txt") # either "" or "-l"
|
||||
backend=$(cat "$STATE_DIR/user/colorbackend.txt") # either "" or "-l"
|
||||
fi
|
||||
|
||||
cd "$CONFIG_DIR/scripts/" || exit
|
||||
@@ -61,7 +61,7 @@ elif [ "$backend" = "material" ]; then
|
||||
color_generation/generate_colors_material.py --path "$1" \
|
||||
--mode "$lightdark" --scheme "$materialscheme" --transparency "$transparency" \
|
||||
--termscheme $terminalscheme --blend_bg_fg \
|
||||
--cache "$CACHE_DIR/user/color.txt" $smartflag \
|
||||
--cache "$STATE_DIR/user/color.txt" $smartflag \
|
||||
> "$CACHE_DIR"/user/generated/material_colors.scss
|
||||
if [ "$2" = "--apply" ]; then
|
||||
cp "$CACHE_DIR"/user/generated/material_colors.scss "$STATE_DIR/scss/_material.scss"
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
|
||||
CACHE_DIR="$XDG_CACHE_HOME/ags"
|
||||
STATE_DIR="$XDG_STATE_HOME/ags"
|
||||
|
||||
if [ "$1" == "--pick" ]; then
|
||||
color=$(hyprpicker --no-fancy)
|
||||
else
|
||||
color=$(cut -f1 "${CACHE_DIR}/user/color.txt")
|
||||
color=$(cut -f1 "$STATE_DIR/user/color.txt")
|
||||
fi
|
||||
|
||||
# Generate colors for ags n stuff
|
||||
|
||||
Reference in New Issue
Block a user