Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions configs/i3/scripts/cheatsheet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
93 changes: 56 additions & 37 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ""
Expand Down