aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Animations.sh
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
committerPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
commit24de2a31a52d17b6f7214197bdbfeab7428742dd (patch)
treef7736c4712d5a394525a3da2f2b4294e81ba9540 /config/hypr/scripts/Animations.sh
parent861bf5be200bfcf2440fec4cda911d29ec18493f (diff)
parentbca86bbec4757cec1f6f5bdea2ed210542f10fae (diff)
Merge remote-tracking branch 'upstream'
Diffstat (limited to 'config/hypr/scripts/Animations.sh')
-rwxr-xr-xconfig/hypr/scripts/Animations.sh42
1 files changed, 32 insertions, 10 deletions
diff --git a/config/hypr/scripts/Animations.sh b/config/hypr/scripts/Animations.sh
index 5fb77750..ae93429b 100755
--- a/config/hypr/scripts/Animations.sh
+++ b/config/hypr/scripts/Animations.sh
@@ -13,22 +13,44 @@ if pidof rofi > /dev/null; then
fi
# Variables
-iDIR="$HOME/.config/swaync/images"
-SCRIPTSDIR="$HOME/.config/hypr/scripts"
-animations_dir="$HOME/.config/hypr/animations"
-UserConfigs="$HOME/.config/hypr/UserConfigs"
-rofi_theme="$HOME/.config/rofi/config-Animations.rasi"
-msg='❗NOTE:❗ This will copy animations into UserAnimations.conf'
+iDIR="${XDG_CONFIG_HOME:-$HOME/.config}/swaync/images"
+SCRIPTSDIR="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/scripts"
+animations_dir="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/animations"
+UserConfigs="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/UserConfigs"
+rofi_theme="${XDG_CONFIG_HOME:-$HOME/.config}/rofi/config-Animations.rasi"
+config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
+hypr_dir="$config_home/hypr"
+lua_entry="$hypr_dir/hyprland.lua"
+legacy_lua_entry="$config_home/hyprland.lua"
+
+# Detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes)
+if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then
+ hypr_config_mode="lua"
+ animation_ext="lua"
+ target_animation_file="$UserConfigs/user_animations.lua"
+ msg='❗NOTE:❗ This will copy animations into user_animations.lua'
+else
+ hypr_config_mode="conf"
+ animation_ext="conf"
+ target_animation_file="$UserConfigs/UserAnimations.conf"
+ msg='❗NOTE:❗ This will copy animations into UserAnimations.conf'
+fi
+
# list of animation files, sorted alphabetically with numbers first
-animations_list=$(find -L "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V)
+animations_list=$(find -L "$animations_dir" -maxdepth 1 -type f -name "*.${animation_ext}" | sed 's/.*\///' | sed "s/\.${animation_ext}$//" | sort -V)
+
+if [[ -z "$animations_list" ]]; then
+ notify-send -u normal -i "$iDIR/ja.png" "No animation presets found" "Expected *.${animation_ext} in $animations_dir"
+ exit 0
+fi
# Rofi Menu
-chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config $rofi_theme -mesg "$msg")
+chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config "$rofi_theme" -mesg "$msg")
# Check if a file was selected
if [[ -n "$chosen_file" ]]; then
- full_path="$animations_dir/$chosen_file.conf"
- cp "$full_path" "$UserConfigs/UserAnimations.conf"
+ full_path="$animations_dir/$chosen_file.$animation_ext"
+ cp "$full_path" "$target_animation_file"
notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Hyprland Animation Loaded"
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage