diff --git a/configs/i3/scripts/cheatsheet.sh b/configs/i3/scripts/cheatsheet.sh index f40f97f..4699c2c 100755 --- a/configs/i3/scripts/cheatsheet.sh +++ b/configs/i3/scripts/cheatsheet.sh @@ -41,8 +41,8 @@ show_categories() { done } | sort | rofi -dmenu -i -p "Category" \ -no-show-icons \ - -theme-str 'window {width: 25%;}' \ - -theme-str 'listview {lines: 10;}' + -theme-str 'window {location: center; anchor: center; width: 300px;}' \ + -theme-str 'listview {lines: 12; scrollbar: true;}' } # Show i3 keybindings - execute on select @@ -53,8 +53,8 @@ show_i3() { awk -F ' // ' '{printf "%-12s │ %-25s │ %s\n", $1, $2, $3}' | \ rofi -dmenu -i -p "i3 (Enter to execute)" \ -no-show-icons \ - -theme-str 'window {width: 65%;}' \ - -theme-str 'listview {lines: 20;}' \ + -theme-str 'window {location: center; anchor: center; width: 800px; height: 70%;}' \ + -theme-str 'listview {lines: 15; scrollbar: true; fixed-height: false;}' \ -no-custom) if [[ -n "$selected" ]]; then @@ -76,8 +76,8 @@ show_cheatsheet() { if [[ -f "$file" ]]; then selected=$(cat "$file" | rofi -dmenu -i -p "$name (Enter to copy)" \ -no-show-icons \ - -theme-str 'window {width: 70%;}' \ - -theme-str 'listview {lines: 20;}' \ + -theme-str 'window {location: center; anchor: center; width: 850px; height: 70%;}' \ + -theme-str 'listview {lines: 15; scrollbar: true; fixed-height: false;}' \ -no-custom) if [[ -n "$selected" ]]; then diff --git a/uninstall.sh b/uninstall.sh index 56ad80c..f741f40 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -70,11 +70,11 @@ check_installed() { fi } -# Remove config symlinks and files +# Remove config symlinks (ONLY symlinks pointing to draphyOS, not restored files!) remove_configs() { - print_step "Removing draphyOS configs..." + print_step "Removing draphyOS config symlinks..." - # Symlinks created by install.sh + # Symlinks created by install.sh - ONLY remove if they're symlinks to draphyOS SYMLINKS=( "$HOME/.config/i3/config" "$HOME/.config/i3/lock.sh" @@ -94,36 +94,42 @@ remove_configs() { ) for link in "${SYMLINKS[@]}"; do + # ONLY remove symlinks - regular files might be restored backups! if [ -L "$link" ]; then - rm -f "$link" - elif [ -f "$link" ]; then - # If it's a regular file (not symlink), might be from failed install - rm -f "$link" + # Verify it points to draphyOS before removing + local target + target=$(readlink -f "$link" 2>/dev/null) + if [[ "$target" == *"draphyOS"* ]] || [[ "$target" == *".draphyOS"* ]]; then + rm -f "$link" + fi fi done - # Remove cheatsheets directory (copied, not symlinked) + # Remove cheatsheets directory (copied by draphyOS, safe to remove) rm -rf "$HOME/.config/i3/scripts/cheatsheets" 2>/dev/null || true - # Remove wallpaper (copied, not symlinked) - rm -f "$HOME/.config/wallpaper.png" 2>/dev/null || true + # Remove draphyOS wallpaper only (not user's wallpaper) + # Check if it's the draphyOS wallpaper before removing + if [ -f "$HOME/.config/wallpaper.png" ]; then + # Only remove if no backup exists (meaning it's draphyOS wallpaper) + local has_backup=false + for backup_wp in "$HOME"/.config-backup-*/wallpaper.png; do + if [ -f "$backup_wp" ]; then + has_backup=true + break + fi + done + if [ "$has_backup" = false ]; then + rm -f "$HOME/.config/wallpaper.png" 2>/dev/null || true + fi + fi - # Remove empty directories created by install (only if empty) + # Remove empty directories ONLY if they're truly empty rmdir "$HOME/.config/i3/scripts" 2>/dev/null || true - rmdir "$HOME/.config/i3" 2>/dev/null || true rmdir "$HOME/.config/polybar/scripts" 2>/dev/null || true - rmdir "$HOME/.config/polybar" 2>/dev/null || true - rmdir "$HOME/.config/rofi" 2>/dev/null || true - rmdir "$HOME/.config/dunst" 2>/dev/null || true - rmdir "$HOME/.config/picom" 2>/dev/null || true - rmdir "$HOME/.config/fish" 2>/dev/null || true - rmdir "$HOME/.config/gtk-3.0" 2>/dev/null || true - rmdir "$HOME/.config/redshift" 2>/dev/null || true - rmdir "$HOME/.config/xfce4/xfconf/xfce-perchannel-xml" 2>/dev/null || true - rmdir "$HOME/.config/xfce4/xfconf" 2>/dev/null || true - rmdir "$HOME/.config/xfce4" 2>/dev/null || true - - print_success "Configs removed" + # Don't remove main config dirs - they might have restored configs! + + print_success "draphyOS symlinks removed" } # Revert fish shell to bash (optional) @@ -273,22 +279,32 @@ remove_battery_limit() { fi } -# Remove LightDM customization +# Remove LightDM customization (careful not to break graphical login) remove_lightdm() { + # Detect base system + local base_system="" + if [ -f "$MARKER_FILE" ]; then + base_system=$(grep "^BASE_SYSTEM=" "$MARKER_FILE" 2>/dev/null | cut -d= -f2) + fi + + # Only touch LightDM if we have a backup to restore if [ -f /etc/lightdm/lightdm-gtk-greeter.conf.backup ]; then print_step "Restoring original LightDM config..." sudo mv /etc/lightdm/lightdm-gtk-greeter.conf.backup /etc/lightdm/lightdm-gtk-greeter.conf 2>/dev/null || true print_success "LightDM restored from backup" - elif [ -f /etc/lightdm/lightdm-gtk-greeter.conf ]; then - print_step "Resetting LightDM to defaults..." - sudo tee /etc/lightdm/lightdm-gtk-greeter.conf > /dev/null << 'EOF' -[greeter] -#background= -#theme-name= -#icon-theme-name= -#font-name= -EOF - print_success "LightDM reset" + else + # For Fedora i3 Spin, DON'T reset LightDM - it needs to work! + if [ "$base_system" = "fedora-i3" ]; then + print_step "Keeping current LightDM config (required for i3 Spin)" + else + # For other systems, only remove draphyOS customization if it exists + if grep -q "draphyOS" /etc/lightdm/lightdm-gtk-greeter.conf 2>/dev/null; then + print_step "Removing draphyOS LightDM customization..." + # Keep a working config, just remove draphyOS-specific parts + sudo sed -i '/draphyOS/d' /etc/lightdm/lightdm-gtk-greeter.conf 2>/dev/null || true + print_success "LightDM customization removed" + fi + fi fi # Remove draphyOS wallpaper from system @@ -533,13 +549,16 @@ main() { check_installed - # Removal steps (reverse order of install) + # IMPORTANT: Restore backup FIRST so user has working configs + # before we remove draphyOS configs + restore_backup + + # Now safe to remove draphyOS configs (backup already restored) remove_configs remove_battery_limit remove_lightdm revert_shell remove_packages - restore_backup remove_install_dir echo ""