#!/usr/bin/bash # Upgrade system sudo pacman -Syu # Remove orphans mapfile -t orphans < <(pacman -Qdttq) if (( ${#orphans[@]} )); then sudo pacman -Rns "${orphans[@]}" fi # Remove dropped packages mapfile -t foreign < <(pacman -Qmq) if (( ${#foreign[@]} )); then mapfile -t dropped < \ <(expac '%n %p' "${foreign[@]}" | grep -v 'Justin Gassner' | cut -d' ' -f1) if (( ${#dropped[@]} )); then sudo pacman -Rns "${dropped[@]}" fi fi # Manage .pac* files sudo pacdiff # Update Neovim plugins if [[ -d ~/.config/nvim/pack/ ]]; then find ~/.config/nvim/pack/ -name .git -type d -print -execdir git pull \; fi # Update mpv plugins if [[ -d ~/.config/mpv/scripts/ ]]; then find ~/.config/mpv/scripts/ -name .git -type d -print -execdir git pull \; fi