diff --git a/go b/go new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/go @@ -0,0 +1 @@ + diff --git a/run b/run new file mode 100755 index 0000000..ed4d681 --- /dev/null +++ b/run @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + +if [ -z "$DEV_ENV" ]; then + echo "env var DEV_ENV needs to be present" + exit 1 +fi + +# if i just did DEV_ENV=$(pwd) ./run then this is needed for the rest of the +# scripts +export DEV_ENV="$DEV_ENV" + +grep="" +dry_run="0" +uninstall="0" +create="0" + +while [[ $# -gt 0 ]]; do + echo "ARG: \"$1\"" + + # Handle a --dry or --dry-run argument + if [[ "$1" =~ ^--dry ]]; then + dry_run="1" + # Handle an --uninstall argument + elif [[ "$1" =~ ^--u ]]; then + uninstall="1" + # Handle an --uninstall argument + elif [[ "$1" =~ ^--c ]]; then + create="1" + # Handle an --install argument (default) + elif [[ ! "$1" =~ ^--i ]]; then + grep="$1" + fi + shift +done + +log() { + if [[ $dry_run == "1" ]]; then + echo "[DRY_RUN]: $1" + else + echo "$1" + fi +} + +generate-new-run() { + local file="$script_dir/runs/$1" + if [ -f "$file" ]; then + log "File exists: $file" + exit 1 + fi + + log "Creating new run: $file" + + printf "#!/usr/bin/env bash\n\n" >$file + printf "yay \${1:-\"-S --noconfirm\"} # packages\n" >>$file + + chmod +x $file +} + +run() { + local script=$1 + local flag=$2 + log "running script: $script $flag" + + local actual_flags="-S --noconfirm" + + if [[ $flag == "--uninstall" ]]; then + actual_flags="-Rns" + fi + log "ok, here's the actual script:: $s $actual_flags" + + if [[ $dry_run == "0" ]]; then + $script $actual_flags + fi + +} + +if [[ "$create" == "1" ]]; then + generate-new-run "$grep" + exit 0 +fi + +log "RUN: env: $env -- grep: $grep" + +runs_dir=$(find $script_dir/runs -mindepth 1 -maxdepth 1 -executable) + +for s in $runs_dir; do + if basename $s | grep -vq "$grep"; then + log "grep \"$grep\" filtered out $s" + continue + fi + + if [[ $uninstall == "1" ]]; then + run $s --uninstall + else + run $s --install + fi +done diff --git a/runs/audio b/runs/audio new file mode 100755 index 0000000..91526c5 --- /dev/null +++ b/runs/audio @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} pipewire \ + pavucontrol \ + wireplumber \ + pipewire-jack \ + pipewire-pulse \ + blueberry-wayland diff --git a/runs/chromium b/runs/chromium new file mode 100755 index 0000000..ef9f952 --- /dev/null +++ b/runs/chromium @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} chromium diff --git a/runs/clipse b/runs/clipse new file mode 100755 index 0000000..5e26c19 --- /dev/null +++ b/runs/clipse @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} clipse diff --git a/runs/dev b/runs/dev new file mode 100755 index 0000000..5309793 --- /dev/null +++ b/runs/dev @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +if ! command -v yay >/dev/null 2>&1; then + sudo pacman -S --noconfirm --needed git base-devel + git clone https://aur.archlinux.org/yay.git ~/yay + cd ~/yay + makepkg -si + rm -rf ~/yay +fi + +# Basics +yay -S --noconfirm --needed \ + asahi-desktop-meta \ + bat \ + bc \ + catppuccin-gtk-theme-mocha \ + sddm-theme-catppuccin \ + eza \ + fastfetch \ + fzf \ + git-lfs \ + gum \ + hyprpaper \ + hyrpidle \ + hyprlock \ + jq \ + neovim \ + nodejs \ + npm \ + nwg-look \ + pam-u2f \ + pcsc-tools \ + starship \ + swaync \ + tree-sitter-cli \ + tmux \ + wl-clipboard \ + yubikey-manger \ + zoxide \ + zsh + +# Fonts +yay -S --noconfirm \ + ttf-jetbrains-mono-nerd \ + ttf-firacode \ + ttf-inconsolata-nerd diff --git a/runs/espanso b/runs/espanso new file mode 100755 index 0000000..ed09606 --- /dev/null +++ b/runs/espanso @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} espanso-wayland-git diff --git a/runs/ghostty b/runs/ghostty new file mode 100755 index 0000000..5303abf --- /dev/null +++ b/runs/ghostty @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Flags get passed in from the run script, but if +# ran directly the default is going to be to install. + +yay "${1:-"-S --noconfirm --needed"}" ghostty diff --git a/runs/gopass b/runs/gopass new file mode 100755 index 0000000..c1122db --- /dev/null +++ b/runs/gopass @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm --needed"} gopass-git git-credential-gopass diff --git a/runs/thunderbird b/runs/thunderbird new file mode 100755 index 0000000..1a4491f --- /dev/null +++ b/runs/thunderbird @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} thunderbird diff --git a/runs/walker b/runs/walker new file mode 100755 index 0000000..28fb251 --- /dev/null +++ b/runs/walker @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} walker elephant elephant-calc elephant-symbols diff --git a/runs/waybar b/runs/waybar new file mode 100755 index 0000000..be1dc92 --- /dev/null +++ b/runs/waybar @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} waybar diff --git a/runs/zen b/runs/zen new file mode 100755 index 0000000..7fdf89e --- /dev/null +++ b/runs/zen @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +yay ${1:-"-S --noconfirm"} zen-browser-bin