diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-02-22 02:09:23 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-02-22 02:09:23 +0900 |
| commit | 7d89d2547c00a32f102292f31e2fa1ad89b5461b (patch) | |
| tree | 2c93ec6150ca2a46b7a3dbd2211b32da185f0779 /copy.sh | |
| parent | eb18f06d8cb34b529567016812c9b3a454280859 (diff) | |
improved copy.sh. Will restore previous waybar styles and layouts
Diffstat (limited to 'copy.sh')
| -rwxr-xr-x | copy.sh | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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} |
