aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib_copy.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmal.com>2026-07-24 17:04:04 -0400
committerPinapelz <yukais@pinapelz.com>2026-08-29 21:41:34 -0700
commitbeceab7fb97654483b5d505ee6d251b206143aed (patch)
tree28993072f211310d366a2a0110fedc2c2ff47b07 /scripts/lib_copy.sh
parent84ed728735d7d2d550675a072879e285a6ebf9f8 (diff)
copy.sh was enablling lua workflow
Added additional checks Signed-off-by: Don Williams <don.e.williams@gmal.com> On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/UserConfigs/01-UserDefaults.conf modified: config/hypr/configs/Startup_Apps.conf modified: config/hypr/lua/startup.lua modified: config/hypr/scripts/WallpaperDaemon.sh modified: config/hypr/scripts/WaybarStartup.sh modified: config/rofi/.current_wallpaper modified: copy.sh modified: scripts/lib_copy.sh
Diffstat (limited to 'scripts/lib_copy.sh')
-rw-r--r--scripts/lib_copy.sh33
1 files changed, 19 insertions, 14 deletions
diff --git a/scripts/lib_copy.sh b/scripts/lib_copy.sh
index d496f2d7..0c065ca9 100644
--- a/scripts/lib_copy.sh
+++ b/scripts/lib_copy.sh
@@ -184,30 +184,35 @@ restore_hypr_assets() {
local base="${DOTFILES_DIR:-.}"
local HYPR_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/hypr"
- local CONFIG_HOME="${XDG_CONFIG_HOME:-${XDG_CONFIG_HOME:-$HOME/.config}}"
local BACKUP_DIR
BACKUP_DIR=$(get_backup_dirname)
local BACKUP_HYPR_PATH="$HYPR_DIR-backup-$BACKUP_DIR"
if [ -d "$BACKUP_HYPR_PATH" ]; then
local backup_mode="conf"
- if [ -f "$BACKUP_HYPR_PATH/hyprland.lua" ] || [ -f "$CONFIG_HOME/hyprland.lua" ]; then
+ local backup_lua_entry="$BACKUP_HYPR_PATH/hyprland.lua"
+ local backup_lua_disabled="$BACKUP_HYPR_PATH/hyprland.lua.disable"
+ if [ -f "$backup_lua_entry" ]; then
backup_mode="lua"
+ elif [ -f "$backup_lua_disabled" ]; then
+ # Explicit conf marker used by migrate-hypr-to-lua.sh while Lua is disabled.
+ backup_mode="conf"
fi
- # Preserve Lua entrypoint after upgrade, preferring the current template
- # shipped in the repo to avoid restoring stale/broken entrypoints.
+ # Preserve Lua entrypoint only when the backup was already using Lua mode.
+ # Do not auto-enable Lua on conf-based hosts.
local LUA_ENTRY_TEMPLATE="$base/config/hypr/hyprland.lua"
- local LUA_ENTRY_TEMPLATE_DISABLED="$base/config/hypr/hyprland.lua.disable"
- if [ -f "$LUA_ENTRY_TEMPLATE" ]; then
- cp -f "$LUA_ENTRY_TEMPLATE" "$HYPR_DIR/hyprland.lua" 2>&1 | tee -a "$log"
- echo "${OK:-[OK]} - Restored file: ${MAGENTA:-}hyprland.lua${RESET:-} (from repo template)" 2>&1 | tee -a "$log"
- elif [ -f "$LUA_ENTRY_TEMPLATE_DISABLED" ]; then
- cp -f "$LUA_ENTRY_TEMPLATE_DISABLED" "$HYPR_DIR/hyprland.lua" 2>&1 | tee -a "$log"
- echo "${OK:-[OK]} - Restored file: ${MAGENTA:-}hyprland.lua${RESET:-} (from repo .disable template)" 2>&1 | tee -a "$log"
- elif [ -f "$BACKUP_HYPR_PATH/hyprland.lua" ]; then
- cp -f "$BACKUP_HYPR_PATH/hyprland.lua" "$HYPR_DIR/hyprland.lua" 2>&1 | tee -a "$log"
- echo "${OK:-[OK]} - Restored file: ${MAGENTA:-}hyprland.lua${RESET:-} (from backup)" 2>&1 | tee -a "$log"
+ if [ "$backup_mode" = "lua" ]; then
+ if [ -f "$LUA_ENTRY_TEMPLATE" ]; then
+ cp -f "$LUA_ENTRY_TEMPLATE" "$HYPR_DIR/hyprland.lua" 2>&1 | tee -a "$log"
+ echo "${OK:-[OK]} - Restored file: ${MAGENTA:-}hyprland.lua${RESET:-} (lua mode preserved from repo template)" 2>&1 | tee -a "$log"
+ elif [ -f "$BACKUP_HYPR_PATH/hyprland.lua" ]; then
+ cp -f "$BACKUP_HYPR_PATH/hyprland.lua" "$HYPR_DIR/hyprland.lua" 2>&1 | tee -a "$log"
+ echo "${OK:-[OK]} - Restored file: ${MAGENTA:-}hyprland.lua${RESET:-} (lua mode preserved from backup)" 2>&1 | tee -a "$log"
+ fi
+ else
+ rm -f "$HYPR_DIR/hyprland.lua" 2>/dev/null || true
+ echo "${NOTE:-[NOTE]} - Conf mode detected; skipping Lua entrypoint restore." 2>&1 | tee -a "$log"
fi
if [ "$express_mode" -eq 1 ]; then
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage