Move from permission setup to .bak process

Means less interaction for folks just riding on the default train
without overwriting the work of people who've made changes.
This commit is contained in:
David Heinemeier Hansson
2025-07-20 21:07:59 -05:00
parent 1f1660f5e4
commit 3634235eee
3 changed files with 35 additions and 9 deletions

View File

@ -1,5 +1,11 @@
#!/bin/bash #!/bin/bash
# Overwrite local Hyprlock settings with the latest in Omarchy, but create a backup # Overwrite local Hyprlock settings with the latest in Omarchy, but create a backup if it differs
cp -f ~/.config/hypr/hyprlock.conf ~/.config/hypr/hyprlock.conf.bak 2>/dev/null cp -f ~/.config/hypr/hyprlock.conf ~/.config/hypr/hyprlock.conf.bak 2>/dev/null
cp -f ~/.local/share/omarchy/config/hypr/hyprlock.conf ~/.config/hypr/ 2>/dev/null cp -f ~/.local/share/omarchy/config/hypr/hyprlock.conf ~/.config/hypr/ 2>/dev/null
if cmp -s ~/.config/hypr/hyprlock.conf.bak ~/.config/hypr/hyprlock.conf; then
rm ~/.config/hypr/hyprlock.conf.bak
else
echo -e "\e[31mExisting .config/hypr/hyprlock.conf replaced with new Omarchy default, but a .bak file was made.\e[0m"
fi

View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
if [[ "$1" == "-y" ]] || gum confirm "Refresh Walker config? This will replace your current settings with Omarchy defaults."; then cp -f ~/.config/walker/config.toml ~/.config/walker/config.toml.bak 2>/dev/null
cp -f ~/.local/share/omarchy/config/walker/config.toml ~/.config/walker/ 2>/dev/null cp -f ~/.local/share/omarchy/config/walker/config.toml ~/.config/walker/ 2>/dev/null
if cmp -s ~/.config/walker/config.toml.bak ~/.config/walker/config.toml; then
rm ~/.config/walker/config.toml.bak
else
echo -e "\e[31mExisting .config/walker/config.toml replaced with new Omarchy default, but a .bak file was made.\e[0m"
fi fi

View File

@ -1,10 +1,25 @@
#!/bin/bash #!/bin/bash
if gum confirm "Refresh Waybar config? This will replace your current settings with Omarchy defaults."; then # Backup existing settings
cp -f ~/.config/waybar/config.jsonc ~/.config/waybar/config.jsonc.bak 2>/dev/null
cp -f ~/.config/waybar/style.css ~/.config/waybar/style.css.bak 2>/dev/null
# Overwrite local waybar settings with the latest in Omarchy # Overwrite local waybar settings with the latest in Omarchy
cp -f ~/.local/share/omarchy/config/waybar/config.jsonc ~/.config/waybar/ 2>/dev/null cp -f ~/.local/share/omarchy/config/waybar/config.jsonc ~/.config/waybar/ 2>/dev/null
cp -f ~/.local/share/omarchy/config/waybar/style.css ~/.config/waybar/ 2>/dev/null cp -f ~/.local/share/omarchy/config/waybar/style.css ~/.config/waybar/ 2>/dev/null
# Remove identical backup files
if cmp -s ~/.config/waybar/config.jsonc.bak ~/.config/waybar/config.jsonc; then
rm ~/.config/waybar/config.jsonc.bak
else
echo -e "\e[31mExisting .config/waybar/config.jsonc replaced with new Omarchy default, but a .bak file was made.\e[0m"
fi
if cmp -s ~/.config/waybar/style.css.bak ~/.config/waybar/style.css; then
rm ~/.config/waybar/style.css.bak
else
echo -e "\e[31mExisting .config/waybar/style.css replaced with new Omarchy default, but a .bak file was made.\e[0m"
fi
# Restart waybar # Restart waybar
pkill -SIGUSR2 waybar pkill -SIGUSR2 waybar
fi