#!/bin/bash
set -x

packages=(
    # ttf-ms-fonts
    aerc
    bat
    broot
    btop
    buildah
    cmus
    devtools
    direnv
    dos2unix
    dunst
    fd
    firefox
    fzf
    gimp
    git
    gopass
    handlr
    helvum
    herbstluftwm
    htop
    imv
    isync
    kid3-qt
    kitty
    kitty-terminfo
    lazygit
    libreoffice-fresh
    maim
    man-db
    mc
    mixxx
    mpv
    msmtp
    msmtp-mta
    mtr
    nix
    noto-fonts
    noto-fonts-cjk
    noto-fonts-emoji
    openssh
    pdfjs
    picom
    pipewire
    pipewire-alsa
    pipewire-jack
    pipewire-pulse
    pipewire-v4l2
    pipewire-zeroconf
    podman
    pulsemixer
    pv
    qutebrowser
    ranger
    ripgrep
    rofi
    rofi-calc
    shellcheck
    skopeo
    slock
    the_silver_searcher
    ttf-hack
    ttf-nerd-fonts-symbols
    ttf-nerd-fonts-symbols-mono
    vim
    visidata
    wget
    xclip
    xorg-xrandr
    xsv
    zathura
    zsh
    go
    nodejs
    unzip
    recordmydesktop
    difftastic
    xorg-xinput
    acpi
    yt-dlp
)

sudo pacman -Syu --needed "${packages[@]}"

if ! pacman -Qi paru &>/dev/null
then
    wget -O /tmp/paru.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/paru.tar.gz
    cd /tmp
    mkdir paru
    bsdtar  -C paru --strip-components=1 -xf paru.tar.gz
    cd paru
    makepkg -si

    sudo sh <<PARU
    cat >> /etc/pacman.conf <<END

[paru]
SigLevel = PackageOptional DatabaseOptional
Server=file:///var/lib/repo/aur

END
PARU
    paru -Ly
fi

paru -Syu rofi-greenclip neovim-git volantes-cursors pinentry-rofi lemonbar-xft-git