revert.sh
This commit is contained in:
+13
-1
@@ -47,7 +47,7 @@ check_file() {
|
|||||||
|
|
||||||
if [ ! -e "$dest" ]; then
|
if [ ! -e "$dest" ]; then
|
||||||
echo "✓ $name: New (will be created)"
|
echo "✓ $name: New (will be created)"
|
||||||
return 0
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local src_hash=$(compute_hash "$src")
|
local src_hash=$(compute_hash "$src")
|
||||||
@@ -141,6 +141,11 @@ check_file "$SCRIPT_DIR/elephant/menus/blob_background_selector.lua" "$HOME_DIR/
|
|||||||
check_file "$SCRIPT_DIR/branding/about.txt" "$HOME_DIR/.config/omarchy/branding/about.txt" "branding/about.txt" || check_status=1
|
check_file "$SCRIPT_DIR/branding/about.txt" "$HOME_DIR/.config/omarchy/branding/about.txt" "branding/about.txt" || check_status=1
|
||||||
check_file "$SCRIPT_DIR/branding/screensaver.txt" "$HOME_DIR/.config/omarchy/branding/screensaver.txt" "branding/screensaver.txt" || check_status=1
|
check_file "$SCRIPT_DIR/branding/screensaver.txt" "$HOME_DIR/.config/omarchy/branding/screensaver.txt" "branding/screensaver.txt" || check_status=1
|
||||||
|
|
||||||
|
zen_profile=$(find "$HOME_DIR/.config/zen" -maxdepth 1 -type d -name "*.Default (release)*" 2>/dev/null | head -n 1)
|
||||||
|
if [ -n "$zen_profile" ]; then
|
||||||
|
check_file "$SCRIPT_DIR/zen/userChrome.css" "$zen_profile/chrome/userChrome.css" "zen/userChrome.css" || check_status=1
|
||||||
|
fi
|
||||||
|
|
||||||
for script in "$SCRIPT_DIR/scripts"/*.sh; do
|
for script in "$SCRIPT_DIR/scripts"/*.sh; do
|
||||||
if [ -f "$script" ]; then
|
if [ -f "$script" ]; then
|
||||||
base_name=$(basename "$script" .sh)
|
base_name=$(basename "$script" .sh)
|
||||||
@@ -176,6 +181,13 @@ backup_and_copy "$SCRIPT_DIR/elephant" "$HOME_DIR/.config/elephant" "Elephant co
|
|||||||
backup_and_copy "$SCRIPT_DIR/omarchy/hooks" "$HOME_DIR/.config/omarchy/hooks" "Omarchy hooks"
|
backup_and_copy "$SCRIPT_DIR/omarchy/hooks" "$HOME_DIR/.config/omarchy/hooks" "Omarchy hooks"
|
||||||
backup_and_copy "$SCRIPT_DIR/wallpapers" "$HOME_DIR/wallpapers" "Custom wallpapers"
|
backup_and_copy "$SCRIPT_DIR/wallpapers" "$HOME_DIR/wallpapers" "Custom wallpapers"
|
||||||
|
|
||||||
|
zen_profile=$(find "$HOME_DIR/.config/zen" -maxdepth 1 -type d -name "*.Default (release)*" 2>/dev/null | head -n 1)
|
||||||
|
if [ -n "$zen_profile" ]; then
|
||||||
|
backup_and_copy "$SCRIPT_DIR/zen" "$zen_profile/chrome" "Zen Browser config"
|
||||||
|
else
|
||||||
|
echo "[WARN] Zen Browser profile not found. Skipping Zen theme."
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$HOME_DIR/scripts"
|
mkdir -p "$HOME_DIR/scripts"
|
||||||
backup_and_copy "$SCRIPT_DIR/scripts" "$HOME_DIR/scripts" "Custom scripts"
|
backup_and_copy "$SCRIPT_DIR/scripts" "$HOME_DIR/scripts" "Custom scripts"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
HOME_DIR="$(eval echo ~$(whoami))"
|
||||||
|
FORCE=false
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [OPTIONS]"
|
||||||
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
|
echo " --force Revert without prompting"
|
||||||
|
echo " --help Show this help message"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
--force) FORCE=true; shift ;;
|
||||||
|
--help) usage ;;
|
||||||
|
*) echo "Unknown option: $1"; usage ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "=== Omarchy Config Reverter ==="
|
||||||
|
echo ""
|
||||||
|
echo "Reverting for user: $(whoami)"
|
||||||
|
echo "Home directory: $HOME_DIR"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$FORCE" = false ]; then
|
||||||
|
read -p "This will overwrite current configs with their .bak versions. Are you sure? (y/N) " -n 1 -r
|
||||||
|
echo ""
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
echo "Revert cancelled."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
revert_dir() {
|
||||||
|
local dest="$1"
|
||||||
|
local name="$2"
|
||||||
|
local bak_dir="${dest}.bak"
|
||||||
|
|
||||||
|
if [ -d "$bak_dir" ]; then
|
||||||
|
echo "[REVERT] Restoring $name from $bak_dir..."
|
||||||
|
rm -rf "$dest"
|
||||||
|
cp -r "$bak_dir" "$dest"
|
||||||
|
echo "✓ Restored $name"
|
||||||
|
else
|
||||||
|
echo "[SKIP] No backup found for $name at $bak_dir"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "=== Reverting changes ==="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
revert_dir "$HOME_DIR/.config/waybar" "Waybar config"
|
||||||
|
revert_dir "$HOME_DIR/.config/ags" "AGS config"
|
||||||
|
revert_dir "$HOME_DIR/.config/hypr" "Hyprland config"
|
||||||
|
revert_dir "$HOME_DIR/.config/omarchy/branding" "Branding files"
|
||||||
|
revert_dir "$HOME_DIR/.config/elephant" "Elephant configs"
|
||||||
|
revert_dir "$HOME_DIR/.config/omarchy/hooks" "Omarchy hooks"
|
||||||
|
revert_dir "$HOME_DIR/wallpapers" "Custom wallpapers"
|
||||||
|
revert_dir "$HOME_DIR/scripts" "Custom scripts"
|
||||||
|
|
||||||
|
zen_profile=$(find "$HOME_DIR/.config/zen" -maxdepth 1 -type d -name "*.Default (release)*" 2>/dev/null | head -n 1)
|
||||||
|
if [ -n "$zen_profile" ]; then
|
||||||
|
revert_dir "$zen_profile/chrome" "Zen Browser config"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Restarting Waybar ==="
|
||||||
|
if command -v omarchy-restart-waybar &> /dev/null; then
|
||||||
|
omarchy-restart-waybar
|
||||||
|
else
|
||||||
|
echo "Warning: omarchy-restart-waybar not found. Please restart waybar manually."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Restarting AGS ==="
|
||||||
|
if command -v ags &> /dev/null; then
|
||||||
|
ags quit || true
|
||||||
|
nohup ags run -d "$HOME_DIR/.config/ags" >/dev/null 2>&1 &
|
||||||
|
else
|
||||||
|
echo "Warning: ags not found. Please start ags manually."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== Revert Complete ==="
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/* Import Omarchy Pywal-generated system colors */
|
||||||
|
@import url("file:///home/blob/.cache/wal/colors.css");
|
||||||
|
|
||||||
|
:root {
|
||||||
|
/* Map Omarchy colors to Zen variables */
|
||||||
|
--zen-primary-color: var(--color2) !important;
|
||||||
|
--zen-main-browser-background: var(--background) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Force standard toolbars to match the system background */
|
||||||
|
#toolbar-menubar, #TabsToolbar, #nav-bar {
|
||||||
|
background-color: var(--background) !important;
|
||||||
|
color: var(--foreground) !important;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user