#!/bin/bash

# omarchy:summary=Remove all the named packages from the system if they're installed (otherwise ignore).
# omarchy:args=<packages...>
# omarchy:requires-sudo=true

for pkg in "$@"; do
  if pacman -Q "$pkg" &>/dev/null; then
    sudo pacman -Rns --noconfirm "$pkg"
  fi
done
