diff --git a/default/bash/functions b/default/bash/functions index 84ebf16..e074f46 100644 --- a/default/bash/functions +++ b/default/bash/functions @@ -66,3 +66,53 @@ img2png() { "${1%.*}.png" } + +pkg-present() { + for pkg in "$@"; do + pacman -Q "$pkg" &>/dev/null || return 1 + done + + return 0 +} + +pkg-missing() { + for pkg in "$@"; do + if ! pacman -Q "$pkg" &>/dev/null; then + return 0 + fi + done + + return 1 +} + +pkg-add() { + for pkg in "$@"; do + if ! pacman -Q "$pkg" &>/dev/null; then + sudo pacman -S --noconfirm --needed "$pkg" + fi + done +} + +pkg-remove() { + for pkg in "$@"; do + if pacman -Q "$pkg" &>/dev/null; then + sudo pacman -Rns --noconfirm "$pkg" + fi + done +} + +cmd-present() { + for cmd in "$@"; do + command -v "$cmd" &>/dev/null || return 1 + done + return 0 +} + +cmd-missing() { + for cmd in "$@"; do + if ! command -v "$cmd" &>/dev/null; then + return 0 + fi + done + return 1 +} diff --git a/migrations/1751134562.sh b/migrations/1751134562.sh new file mode 100644 index 0000000..8291842 --- /dev/null +++ b/migrations/1751134562.sh @@ -0,0 +1,3 @@ +echo "Ensure new pkg/cmd functions are available to old-run migrations" + +source $OMARCHY_PATH/default/bash/functions diff --git a/migrations/1751135253.sh b/migrations/1751135253.sh index 92e9144..821dd6b 100644 --- a/migrations/1751135253.sh +++ b/migrations/1751135253.sh @@ -1,5 +1,3 @@ echo "Add missing installation of bat (used by the ff alias)" -if ! command -v bat &>/dev/null; then - # Add missing installation of bat - sudo pacman -S --noconfirm --needed bat -fi + +pkg-add bat diff --git a/migrations/1751510848.sh b/migrations/1751510848.sh index 8bdc855..d1485e9 100644 --- a/migrations/1751510848.sh +++ b/migrations/1751510848.sh @@ -1,5 +1,3 @@ echo "Installing missing fd terminal tool for finding files" -if ! command -v fd &>/dev/null; then - sudo pacman -S --noconfirm --needed fd -fi +pkg-add fd diff --git a/migrations/1751667620.sh b/migrations/1751667620.sh index a45252e..d19aafa 100644 --- a/migrations/1751667620.sh +++ b/migrations/1751667620.sh @@ -1,8 +1,9 @@ echo "Switching from vlc to mpv for the default video player" -if ! command -v mpv &>/dev/null; then - sudo pacman -Rns --noconfirm vlc +if cmd-missing mpv; then + pkg-remove vlc rm ~/.local/share/applications/vlc.desktop - sudo pacman -S --noconfirm mpv + + pkg-add mpv xdg-mime default mpv.desktop video/mp4 xdg-mime default mpv.desktop video/x-msvideo xdg-mime default mpv.desktop video/x-matroska diff --git a/migrations/1751672984.sh b/migrations/1751672984.sh index 9b0308a..e423526 100644 --- a/migrations/1751672984.sh +++ b/migrations/1751672984.sh @@ -1,5 +1,3 @@ echo "Add LocalSend as new default application" -if ! command -v localsend &>/dev/null; then - sudo pacman -S --noconfirm --needed localsend -fi +pkg-add localsend diff --git a/migrations/1751679069.sh b/migrations/1751679069.sh index a2f437f..cee3def 100644 --- a/migrations/1751679069.sh +++ b/migrations/1751679069.sh @@ -1,5 +1,3 @@ echo "Install ffmpegthumbnailer for video thumbnails in the file manager" -if ! command -v ffmpegthumbnailer &>/dev/null; then - sudo pacman -S --noconfirm --needed ffmpegthumbnailer -fi +pkg-add ffmpegthumbnailer diff --git a/migrations/1751821819.sh b/migrations/1751821819.sh index f8d616f..0b78cd2 100644 --- a/migrations/1751821819.sh +++ b/migrations/1751821819.sh @@ -1,5 +1,3 @@ echo "Install bash-completion" -if ! pacman -Q bash-completion &>/dev/null; then - sudo pacman -S --noconfirm --needed bash-completion -fi +pkg-add bash-completion diff --git a/migrations/1751887718.sh b/migrations/1751887718.sh index ac1894f..a3643ea 100644 --- a/migrations/1751887718.sh +++ b/migrations/1751887718.sh @@ -1,6 +1,6 @@ echo "Install Impala as new wifi selection TUI" -if ! command -v impala &>/dev/null; then - sudo pacman -S --noconfirm --needed impala - echo "You need to update the Waybar config to use Impala Wi-Fi selector in top bar." + +if cmd-missing impala; then + pkg-add impala omarchy-refresh-waybar fi diff --git a/migrations/1752081088.sh b/migrations/1752081088.sh index 6eb49a2..727988f 100644 --- a/migrations/1752081088.sh +++ b/migrations/1752081088.sh @@ -1,2 +1,3 @@ echo "Permanently fix F-keys on Apple-mode keyboards (like Lofree Flow84)" -source ~/.local/share/omarchy/install/config/hardware/fix-fkeys.sh + +source $OMARCHY_PATH/install/config/hardware/fix-fkeys.sh diff --git a/migrations/1752082381.sh b/migrations/1752082381.sh index 561fa7e..3f3a88e 100644 --- a/migrations/1752082381.sh +++ b/migrations/1752082381.sh @@ -1,5 +1,3 @@ echo "Adding gnome-keyring to make 1password work with 2FA codes" -if ! command -v gnome-keyring &>/dev/null; then - sudo pacman -S --noconfirm --needed gnome-keyring -fi +pkg-add gnome-keyring diff --git a/migrations/1752091783.sh b/migrations/1752091783.sh index 6d7160b..e0339ea 100644 --- a/migrations/1752091783.sh +++ b/migrations/1752091783.sh @@ -1,4 +1,4 @@ echo "Install Plymouth splash screen" -sudo pacman -S --needed --noconfirm uwsm plymouth -source "$HOME/.local/share/omarchy/install/login/plymouth.sh" +pkg-add uwsm plymouth +source "$OMARCHY_PATH/install/login/plymouth.sh" diff --git a/migrations/1752104271.sh b/migrations/1752104271.sh index a602fe3..dcbda81 100644 --- a/migrations/1752104271.sh +++ b/migrations/1752104271.sh @@ -1,4 +1,5 @@ echo "Switching to polkit-gnome for better fingerprint authentication compatibility" + if ! command -v /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &>/dev/null; then sudo pacman -S --noconfirm --needed polkit-gnome systemctl --user stop hyprpolkitagent diff --git a/migrations/1752153188.sh b/migrations/1752153188.sh index fca5ebf..ec4beea 100644 --- a/migrations/1752153188.sh +++ b/migrations/1752153188.sh @@ -1,4 +1,5 @@ echo "Migrate to the modular implementation of hyprlock" + if [ -L ~/.config/hypr/hyprlock.conf ]; then rm ~/.config/hypr/hyprlock.conf cp ~/.local/share/omarchy/config/hypr/hyprlock.conf ~/.config/hypr/hyprlock.conf diff --git a/migrations/1752188554.sh b/migrations/1752188554.sh index ffec2a2..13c5d54 100644 --- a/migrations/1752188554.sh +++ b/migrations/1752188554.sh @@ -1,7 +1,5 @@ echo "Update chromium.desktop to ensure we are always using wayland" -if [[ ! -f ~/.local/share/applications/chromium.desktop ]]; then - cp ~/.local/share/omarchy/applications/chromium.desktop ~/.local/share/applications/ - xdg-settings set default-web-browser chromium.desktop - xdg-mime default chromium.desktop x-scheme-handler/http - xdg-mime default chromium.desktop x-scheme-handler/https -fi + +xdg-settings set default-web-browser chromium.desktop +xdg-mime default chromium.desktop x-scheme-handler/http +xdg-mime default chromium.desktop x-scheme-handler/https diff --git a/migrations/1752251002.sh b/migrations/1752251002.sh index 39cb487..cea7a61 100644 --- a/migrations/1752251002.sh +++ b/migrations/1752251002.sh @@ -1,4 +1,5 @@ echo "Migrate to the modular, variable-based implementation of waybar style.css" + if [ -L ~/.config/waybar/style.css ]; then rm ~/.config/waybar/style.css cp ~/.local/share/omarchy/config/waybar/style.css ~/.config/waybar/style.css diff --git a/migrations/1752292967.sh b/migrations/1752292967.sh index ad649ce..b91bae5 100644 --- a/migrations/1752292967.sh +++ b/migrations/1752292967.sh @@ -1,5 +1,6 @@ echo "Update to use UWSM and seamless login" -if ! command -v uwsm &>/dev/null; then + +if cmd-missing uwsm; then sudo rm -f /etc/systemd/system/getty@tty1.service.d/override.conf sudo rmdir /etc/systemd/system/getty@tty1.service.d/ 2>/dev/null || true @@ -14,5 +15,5 @@ if ! command -v uwsm &>/dev/null; then sed -i 's/^GTK_IM_MODULE=fcitx$//' "$HOME/.config/environment.d/fcitx.conf" fi - source ~/.local/share/omarchy/install/login/plymouth.sh + source $OMARCHY_PATH/install/login/plymouth.sh fi diff --git a/migrations/1752543801.sh b/migrations/1752543801.sh index d1e5bfd..7c068ad 100644 --- a/migrations/1752543801.sh +++ b/migrations/1752543801.sh @@ -1,3 +1,4 @@ echo "Add color and animation to pacman installs" + grep -q '^Color' /etc/pacman.conf || sudo sed -i '/^\[options\]/a Color' /etc/pacman.conf grep -q '^ILoveCandy' /etc/pacman.conf || sudo sed -i '/^\[options\]/a ILoveCandy' /etc/pacman.conf diff --git a/migrations/1752678932.sh b/migrations/1752678932.sh index 1aa8c85..8fdb22a 100644 --- a/migrations/1752678932.sh +++ b/migrations/1752678932.sh @@ -1,5 +1,3 @@ echo "Install missing docker-buildx package for out-of-the-box Kamal compatibility" -if ! docker buildx version &>/dev/null; then - sudo pacman -S --noconfirm --needed docker-buildx -fi +pkg-add docker-buildx diff --git a/migrations/1752725616.sh b/migrations/1752725616.sh index 5dddefe..5f94c05 100644 --- a/migrations/1752725616.sh +++ b/migrations/1752725616.sh @@ -1,4 +1,5 @@ echo "Make light themes possible" + if [[ -f ~/.local/share/applications/blueberry.desktop ]]; then rm -f ~/.local/share/applications/blueberry.desktop rm -f ~/.local/share/applications/org.pulseaudio.pavucontrol.desktop diff --git a/migrations/1752793122.sh b/migrations/1752793122.sh index fad0646..9429d92 100644 --- a/migrations/1752793122.sh +++ b/migrations/1752793122.sh @@ -1,4 +1,5 @@ echo "Rename waybar config file for syntax highlighting" + if [[ -f ~/.config/waybar/config ]]; then mv ~/.config/waybar/config ~/.config/waybar/config.jsonc fi diff --git a/migrations/1752797704.sh b/migrations/1752797704.sh index f51aa70..b59111f 100644 --- a/migrations/1752797704.sh +++ b/migrations/1752797704.sh @@ -1,4 +1,5 @@ echo "Prevent docker from requiring network readiness on boot" + if [[ ! -f /etc/systemd/system/docker.service.d/no-block-boot.conf ]]; then sudo mkdir -p /etc/systemd/system/docker.service.d/ sudo tee /etc/systemd/system/docker.service.d/no-block-boot.conf <<'EOF' diff --git a/migrations/1752874371.sh b/migrations/1752874371.sh index 649adc7..669c3b7 100644 --- a/migrations/1752874371.sh +++ b/migrations/1752874371.sh @@ -1,4 +1,5 @@ echo "Add Catppuccin Latte light theme" + if [[ ! -L "~/.config/omarchy/themes/catppuccin-latte" ]]; then ln -snf ~/.local/share/omarchy/themes/catppuccin-latte ~/.config/omarchy/themes/ fi diff --git a/migrations/1752885858.sh b/migrations/1752885858.sh index 8720878..797af4a 100644 --- a/migrations/1752885858.sh +++ b/migrations/1752885858.sh @@ -1,5 +1,3 @@ echo "Install slurp + wl-screenrec for new ALT+PrintScreen screen recorder" -if ! command -v wl-screenrec &>/dev/null || ! command -v slurp &>/dev/null; then - sudo pacman -S --noconfirm --needed slurp wl-screenrec -fi +pkg-add slurp wl-screenrec diff --git a/migrations/1752896442.sh b/migrations/1752896442.sh index 1b154e3..71df10a 100644 --- a/migrations/1752896442.sh +++ b/migrations/1752896442.sh @@ -1,9 +1,8 @@ echo "Replace volume control GUI with a TUI" -if ! command -v wiremix &>/dev/null; then - sudo pacman -S --noconfirm --needed wiremix - sudo pacman -Rns --noconfirm pavucontrol - +if cmd-missing wiremix; then + pkg-add wiremix + pkg-remove pavucontrol omarchy-refresh-applications omarchy-refresh-waybar fi diff --git a/migrations/1752897642.sh b/migrations/1752897642.sh index e1f844d..119d419 100644 --- a/migrations/1752897642.sh +++ b/migrations/1752897642.sh @@ -1,4 +1,3 @@ echo "Remove needless fcitx5-configtool package" -if pacman -Qe fcitx5-configtool &>/dev/null; then - sudo pacman -Rns --noconfirm fcitx5-configtool -fi + +pkg-remove fcitx5-configtool diff --git a/migrations/1752899588.sh b/migrations/1752899588.sh index ba778cd..562c6bd 100644 --- a/migrations/1752899588.sh +++ b/migrations/1752899588.sh @@ -1,2 +1,3 @@ echo "Update .config/hypr/hyprlock.conf to include failed attempt counter" + omarchy-refresh-hyprlock diff --git a/migrations/1752955912.sh b/migrations/1752955912.sh index 0933cb1..f3d3285 100644 --- a/migrations/1752955912.sh +++ b/migrations/1752955912.sh @@ -1,5 +1,3 @@ echo "Install satty for the new screenshot flow" -if ! command -v satty &>/dev/null; then - sudo pacman -S --noconfirm --needed satty -fi +pkg-add satty diff --git a/migrations/1752981883.sh b/migrations/1752981883.sh index bac71ab..3bb6b21 100644 --- a/migrations/1752981883.sh +++ b/migrations/1752981883.sh @@ -1,9 +1,9 @@ echo "Replace wofi with walker as the default launcher" -if ! command -v walker &>/dev/null; then - sudo pacman -S --noconfirm --needed walker-bin libqalculate +if cmd-missing walker; then + pkg-add walker-bin libqalculate - sudo pacman -Rns --noconfirm wofi + pkg-remove wofi rm -rf ~/.config/wofi mkdir -p ~/.config/walker diff --git a/migrations/1753138691.sh b/migrations/1753138691.sh index 53f5471..79928c9 100644 --- a/migrations/1753138691.sh +++ b/migrations/1753138691.sh @@ -1,6 +1,6 @@ echo "Install swayOSD to show volume status" -if ! command -v swayosd-server &>/dev/null; then - sudo pacman -S --noconfirm --needed swayosd +if cmd-missing swayosd-server; then + pkg-add swayosd setsid uwsm app -- swayosd-server &>/dev/null & fi diff --git a/migrations/1753176520.sh b/migrations/1753176520.sh index e26abf2..c6ae1dd 100644 --- a/migrations/1753176520.sh +++ b/migrations/1753176520.sh @@ -1,7 +1,3 @@ echo "Install wf-recorder for screen recording for nvidia" -if lspci | grep -qi 'nvidia'; then - if ! command -v wf-recorder &>/dev/null; then - sudo pacman -S --noconfirm --needed wf-recorder - fi -fi +pkg-add wf-recorder diff --git a/migrations/1753468218.sh b/migrations/1753468218.sh deleted file mode 100644 index 8fa3ba5..0000000 --- a/migrations/1753468218.sh +++ /dev/null @@ -1,5 +0,0 @@ -echo "Add Terminal Text Effects for rizzing Omarchy" - -if ! pacman -Q python-terminaltexteffects &>/dev/null; then - sudo pacman -S --noconfirm python-terminaltexteffects -fi diff --git a/migrations/1753495989.sh b/migrations/1753495989.sh index 5c0efcd..2a25942 100644 --- a/migrations/1753495989.sh +++ b/migrations/1753495989.sh @@ -1,5 +1,6 @@ echo "Allow updating of timezone by right-clicking on the clock (or running omarchy-cmd-tzupdate)" -if ! command -v tzupdate &>/dev/null; then - bash ~/.local/share/omarchy/install/config/timezones.sh + +if cmd-missing tzupdate; then + $OMARCHY_PATH/install/config/timezones.sh omarchy-refresh-waybar fi diff --git a/migrations/1753558374.sh b/migrations/1753558374.sh deleted file mode 100644 index b961d3e..0000000 --- a/migrations/1753558374.sh +++ /dev/null @@ -1,4 +0,0 @@ -echo "Update Walker config to include = as the leader key for the calculator" -if ! grep -q 'prefix = "="' ~/.config/walker/config.toml; then - omarchy-refresh-walker -fi diff --git a/migrations/1753998861.sh b/migrations/1753998861.sh deleted file mode 100644 index 4751dee..0000000 --- a/migrations/1753998861.sh +++ /dev/null @@ -1,4 +0,0 @@ -echo "Update Walker config to include . as the leader key for the finder" -if ! grep -q 'prefix = "\."' ~/.config/walker/config.toml; then - omarchy-refresh-walker -fi diff --git a/migrations/1754208139.sh b/migrations/1754208139.sh deleted file mode 100644 index b95c744..0000000 --- a/migrations/1754208139.sh +++ /dev/null @@ -1,5 +0,0 @@ -echo "Ensure screensaver doesn't start while the computer is locked" - -if ! grep -q "pidof hyprlock || omarchy-launch-screensaver" ~/.config/hypr/hypridle.conf; then - omarchy-refresh-hypridle -fi diff --git a/migrations/1754215439.sh b/migrations/1754215439.sh deleted file mode 100644 index 90651bb..0000000 --- a/migrations/1754215439.sh +++ /dev/null @@ -1,5 +0,0 @@ -echo "Update app launcher config to allow enough entries to show all keybindings on SUPER+K" - -if ! grep "max_entries = 200" ~/.config/walker/config.toml; then - omarchy-refresh-walker -fi diff --git a/migrations/1754215533.sh b/migrations/1754215533.sh index 05a0774..a034dff 100644 --- a/migrations/1754215533.sh +++ b/migrations/1754215533.sh @@ -1,7 +1,7 @@ echo "Enable auto-discovery of network printers" if [[ ! -f /etc/systemd/resolved.conf.d/10-disable-multicast.conf ]]; then - sudo pacman -S --noconfirm avahi nss-mdns + pkg-add avahi nss-mdns # Disable multicast dns in resolved. Avahi will provide this for better network printer discovery sudo mkdir -p /etc/systemd/resolved.conf.d @@ -10,7 +10,7 @@ if [[ ! -f /etc/systemd/resolved.conf.d/10-disable-multicast.conf ]]; then fi if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then - sudo pacman -S --noconfirm cups-browsed + pkg-add cups-browsed # Enable automatically adding remote printers echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf sudo systemctl enable --now cups-browsed.service diff --git a/migrations/1754221967.sh b/migrations/1754221967.sh index 7a13507..24ef64c 100644 --- a/migrations/1754221967.sh +++ b/migrations/1754221967.sh @@ -1,2 +1,3 @@ echo "Add support for accessing Android phone data via file manager" -sudo pacman -S --noconfirm --needed gvfs-mtp + +pkg-add gvfs-mtp diff --git a/migrations/1754228679.sh b/migrations/1754228679.sh deleted file mode 100644 index 2a80234..0000000 --- a/migrations/1754228679.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "Increase time before screensaver starts to 2.5 minutes (from 1 minute)" -omarchy-refresh-hypridle diff --git a/migrations/1754265453.sh b/migrations/1754265453.sh index 412d75e..ab2d092 100644 --- a/migrations/1754265453.sh +++ b/migrations/1754265453.sh @@ -1,2 +1,3 @@ echo "Add chromium-flags.conf" + omarchy-refresh-config chromium-flags.conf diff --git a/migrations/1754302123.sh b/migrations/1754302123.sh index 5e7ff59..b9b72ee 100644 --- a/migrations/1754302123.sh +++ b/migrations/1754302123.sh @@ -1,4 +1,5 @@ echo "Change update-available icon in top bar from  to " + if grep -q '"format": "",' ~/.config/waybar/config.jsonc; then sed -i 's/"format": ""/"format": ""/' ~/.config/waybar/config.jsonc fi diff --git a/migrations/1754305112.sh b/migrations/1754305112.sh deleted file mode 100644 index e23ea5d..0000000 --- a/migrations/1754305112.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "Restart Walker to pick up menu selections" -omarchy-restart-walker diff --git a/migrations/1754332200.sh b/migrations/1754332200.sh index fc9c350..4e92daa 100644 --- a/migrations/1754332200.sh +++ b/migrations/1754332200.sh @@ -1,2 +1,3 @@ echo "Remove old Omarchy TUI app now that we have the Omarchy Menu" -rm -rf ~/.local/share/applications/omarchy.desktop + +rm -f ~/.local/share/applications/omarchy.desktop diff --git a/migrations/1754509222.sh b/migrations/1754509222.sh index ced63c6..b9daaaa 100644 --- a/migrations/1754509222.sh +++ b/migrations/1754509222.sh @@ -1,3 +1,3 @@ echo "Add xmlstarlet needed for updating fonts via Omarchy menu" -sudo pacman -S --noconfirm --needed xmlstarlet +pkg-add xmlstarlet diff --git a/migrations/1754666868.sh b/migrations/1754666868.sh deleted file mode 100644 index db311ae..0000000 --- a/migrations/1754666868.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "Update OS icon in About from Windows to Arch" - -omarchy-refresh-config fastfetch/config.jsonc diff --git a/migrations/1754668999.sh b/migrations/1754668999.sh index b7966ed..7361dcd 100644 --- a/migrations/1754668999.sh +++ b/migrations/1754668999.sh @@ -1,4 +1,3 @@ echo "Tune MTU probing for more reliable SSH" -# Solve common flakiness with SSH echo "net.ipv4.tcp_mtu_probing=1" | sudo tee -a /etc/sysctl.d/99-sysctl.conf diff --git a/migrations/1754679822.sh b/migrations/1754679822.sh deleted file mode 100644 index 3787c64..0000000 --- a/migrations/1754679822.sh +++ /dev/null @@ -1,5 +0,0 @@ -echo "Lock 1password on screen lock" - -if ! grep -q "omarchy-lock-screen" ~/.config/hypr/hypridle.conf; then - omarchy-refresh-hypridle -fi diff --git a/migrations/1754828680.sh b/migrations/1754828680.sh deleted file mode 100644 index 6deb7c4..0000000 --- a/migrations/1754828680.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "Update Walker config" -omarchy-refresh-walker diff --git a/migrations/1754860578.sh b/migrations/1754860578.sh index afd4beb..c384c7a 100644 --- a/migrations/1754860578.sh +++ b/migrations/1754860578.sh @@ -1,4 +1,5 @@ echo "Update polkit policy to yield to fingerprint and fido2" + # If fprint exists in polkit, it was wrong and needs reset if [ -f /etc/pam.d/polkit-1 ] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' diff --git a/migrations/1754929475.sh b/migrations/1754929475.sh index f6089a8..ac4f650 100644 --- a/migrations/1754929475.sh +++ b/migrations/1754929475.sh @@ -1,4 +1,5 @@ echo "Add start burst limit to login" + if [ -f /etc/systemd/system/omarchy-seamless-login.service ]; then cat </dev/null; then - sudo pacman -Rns --noconfirm chromium || true - sudo pacman -S --noconfirm omarchy-chromium +if cmd-present chromium; then + pkg-remove chromium + pkg-add omarchy-chromium if pgrep -x chromium; then if gum confirm "Chromium must be restarted. Ready?"; then diff --git a/migrations/1755436367.sh b/migrations/1755436367.sh index b3de9b4..38fd6f3 100644 --- a/migrations/1755436367.sh +++ b/migrations/1755436367.sh @@ -1,6 +1,6 @@ echo "Add minimal starship prompt to terminal" -if ! command -v starship &>/dev/null; then - sudo pacman -S --noconfirm starship +if cmd-missing starship; then + pkg-add starship cp $OMARCHY_PATH/config/starship.toml ~/.config/starship.toml fi diff --git a/migrations/1755455095.sh b/migrations/1755455095.sh index 4aed9d5..6246dcf 100644 --- a/migrations/1755455095.sh +++ b/migrations/1755455095.sh @@ -1,9 +1,3 @@ echo "Ensure TTE and dependencies are installed" -if ! pacman -Q python-poetry-core &>/dev/null; then - sudo pacman -S --noconfirm python-poetry-core -fi - -if ! pacman -Q python-terminaltexteffects &>/dev/null; then - sudo pacman -S --noconfirm python-terminaltexteffects -fi +pkg-add python-poetry-core python-terminaltexteffects diff --git a/migrations/1755459930.sh b/migrations/1755459930.sh index 2b9c2f3..7d04c0c 100644 --- a/migrations/1755459930.sh +++ b/migrations/1755459930.sh @@ -1,5 +1,3 @@ echo "Add potentially missing dependency for power profile controls" -if ! pacman -Q python-gobject &>/dev/null; then - sudo pacman -S --noconfirm python-gobject -fi +pkg-add python-gobject diff --git a/migrations/1755512354.sh b/migrations/1755512354.sh deleted file mode 100644 index ffbee83..0000000 --- a/migrations/1755512354.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "Update fastfetch config to include current theme name and colors" - -omarchy-refresh-config fastfetch/config.jsonc diff --git a/migrations/1755527220.sh b/migrations/1755527220.sh deleted file mode 100644 index 845c3fe..0000000 --- a/migrations/1755527220.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "Turn on the screensaver by default again now that TTE has been fixed" - -omarchy-refresh-hypridle diff --git a/migrations/1755548643.sh b/migrations/1755548643.sh index 3f5367b..051e542 100644 --- a/migrations/1755548643.sh +++ b/migrations/1755548643.sh @@ -1,5 +1,3 @@ echo "Install wf-recorder for intel based device" -if lspci | grep -Eqi 'nvidia|intel.*graphics'; then - sudo pacman -S --noconfirm --needed wf-recorder -fi +pkg-add wf-recorder diff --git a/migrations/1755865046.sh b/migrations/1755865046.sh index b07766a..92a2312 100644 --- a/migrations/1755865046.sh +++ b/migrations/1755865046.sh @@ -1,6 +1,4 @@ echo "Switch from lazydocker-bin to lazydocker official" -if pacman -Q lazydocker-bin >/dev/null; then - sudo pacman -Rns --noconfirm lazydocker-bin - sudo pacman -S --noconfirm lazydocker -fi +pkg-remove lazydocker-bin +pkg-add lazydocker diff --git a/migrations/1756060611.sh b/migrations/1756060611.sh index fd22620..a26039b 100644 --- a/migrations/1756060611.sh +++ b/migrations/1756060611.sh @@ -1,15 +1,13 @@ echo "Migrate AUR packages to official repos where possible" reinstall_package_opr() { - if pacman -Q $1 >/dev/null; then + if pkg-present $1; then sudo pacman -Rns --noconfirm $1 sudo pacman -S --noconfirm ${2:-$1} fi } -if pacman -Q yay-bin-debug >/dev/null; then - sudo pacman -Rns --noconfirm yay-bin-debug -fi +pkg-remove yay-bin-debug reinstall_package_opr yay-bin yay reinstall_package_opr obsidian-bin obsidian diff --git a/migrations/1756062808.sh b/migrations/1756062808.sh deleted file mode 100644 index 3618320..0000000 --- a/migrations/1756062808.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "Update Hypridle to prevent flash of unlocked screen after sleep" -omarchy-refresh-hypridle diff --git a/migrations/1756115364.sh b/migrations/1756115364.sh index cdd8113..dd2ade5 100644 --- a/migrations/1756115364.sh +++ b/migrations/1756115364.sh @@ -1,6 +1,6 @@ echo "Replace buggy native Zoom client with webapp" -if pacman -Q zoom >/dev/null; then - sudo pacman -Rns --noconfirm zoom +if pkg-present zoom; then + pkg-remove zoom omarchy-webapp-install "Zoom" https://app.zoom.us/wc/home https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/zoom.png fi diff --git a/migrations/1756410649.sh b/migrations/1756410649.sh index 5a11b22..71f8585 100644 --- a/migrations/1756410649.sh +++ b/migrations/1756410649.sh @@ -1,12 +1,6 @@ echo "Remove any Chaotic-AUR infrastructure packages" -if pacman -Q chaotic-keyring 2>/dev/null; then - sudo pacman -Rns --noconfirm chaotic-keyring -fi - -if pacman -Q chaotic-mirrorlist 2>/dev/null; then - sudo pacman -Rns --noconfirm chaotic-mirrorlist -fi +pkg-remove chaotic-keyring chaotic-mirrorlist if sudo pacman-key --list-keys 3056513887B78AEB >/dev/null 2>&1; then sudo pacman-key --delete 3056513887B78AEB diff --git a/migrations/1756411865.sh b/migrations/1756411865.sh index 9d93562..dc26393 100644 --- a/migrations/1756411865.sh +++ b/migrations/1756411865.sh @@ -1,5 +1,3 @@ echo "Add back ttf-ia-writer if it was missing" -if ! pacman -Q ttf-ia-writer 2>/dev/null; then - sudo pacman -S --noconfirm ttf-ia-writer -fi +pkg-add ttf-ia-writer