aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-22 02:09:23 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-22 02:09:23 +0900
commit7d89d2547c00a32f102292f31e2fa1ad89b5461b (patch)
tree2c93ec6150ca2a46b7a3dbd2211b32da185f0779
parenteb18f06d8cb34b529567016812c9b3a454280859 (diff)
improved copy.sh. Will restore previous waybar styles and layouts
-rwxr-xr-xconfig/hypr/initial-boot.sh11
-rwxr-xr-xcopy.sh16
2 files changed, 17 insertions, 10 deletions
diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh
index b2d5bce5..43856e04 100755
--- a/config/hypr/initial-boot.sh
+++ b/config/hypr/initial-boot.sh
@@ -52,14 +52,13 @@ if [ ! -f ~/.config/hypr/.initial_startup_done ]; then
# initiate the kb_layout (for some reason) waybar cant launch it
"$scriptsDir/SwitchKeyboardLayout.sh" > /dev/null 2>&1 &
- # Initial waybar style
- if [ -f "$waybar_style" ]; then
- ln -sf "$waybar_style" "$HOME/.config/waybar/style.css"
-
- # Refreshing waybar, swaync, rofi etc.
- "$scriptsDir/Refresh.sh" > /dev/null 2>&1 &
+ # waybar style
+ if [ -L "$HOME/.config/waybar/config" ]; then
+ ln -sf "$waybar_style" "$HOME/.config/waybar/style.css"
+ "$scriptsDir/Refresh.sh" > /dev/null 2>&1 &
fi
+
# Create a marker file to indicate that the script has been executed.
touch ~/.config/hypr/.initial_startup_done
diff --git a/copy.sh b/copy.sh
index 97240e2b..ddac1208 100755
--- a/copy.sh
+++ b/copy.sh
@@ -493,7 +493,10 @@ for DIR2 in $DIRS; do
# restoring waybar config and style automatically
if [ "$DIR2" = "waybar" ]; then
- cp "$DIRPATH-backup-$BACKUP_DIR/config" ~/.config/waybar/ && cp "$DIRPATH-backup-$BACKUP_DIR/style.css" ~/.config/waybar/
+ rm -f "$HOME/.config/waybar/config" "$HOME/.config/waybar/style.css" || true
+ cp -L "$DIRPATH-backup-$BACKUP_DIR/config" "$HOME/.config/waybar/config" || true
+ cp -L "$DIRPATH-backup-$BACKUP_DIR/style.css" "$HOME/.config/waybar/style.css" || true
+
echo -e "${OK} - waybar config and style restored automatically" 2>&1 | tee -a "$LOG"
fi
break
@@ -768,7 +771,10 @@ else
config_remove=""
fi
-ln -sf "$config_file" "$HOME/.config/waybar/config" 2>&1 | tee -a "$LOG" || true
+# Check if ~/.config/waybar/config is a symlink
+if [ -L "$HOME/.config/waybar/config" ]; then
+ ln -sf "$config_file" "$HOME/.config/waybar/config" 2>&1 | tee -a "$LOG"
+fi
# Remove inappropriate waybar configs
rm -rf "$HOME/.config/waybar/configs/[TOP] Default$config_remove" \
@@ -900,8 +906,10 @@ cleanup_backups() {
# Execute the cleanup function
cleanup_backups
-# symlinks for waybar style
-ln -sf "$waybar_style" "$HOME/.config/waybar/style.css" && \
+# Check if ~/.config/waybar/style is a symlink
+if [ -L "$HOME/.config/waybar/style.css" ]; then
+ ln -sf "$waybar_style" "$HOME/.config/waybar/style.css" 2>&1 | tee -a "$LOG"
+fi
printf "\n%.0s" {1..1}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage