diff --git a/box_setup.sh b/box_setup.sh index 5d410be..8d4233c 100755 --- a/box_setup.sh +++ b/box_setup.sh @@ -2,44 +2,52 @@ [[ $1 = "--help" ]] && { echo "\nusage: ./box_setup.sh [system-type]" - echo "\nsystem-type options: work" - echo "\nexamples:\n ./box_setup.sh\n ./box_setup.sh work\n" + echo "\nsystem-type options: music_studio, programming" + echo "\nexamples:\n ./box_setup.sh\n ./box_setup.sh music_studio\n" exit 0 } echo "---- settings vars for system type -----" -# determine OS and, if linux, distro -[[ "$OSTYPE" = *"darwin"* ]] && setup_os="macos" || { - [[ "$OSTYPE" = *"linux"* ]] && setup_os="linux" && { +# determine OS and distro +case "$OSTYPE" in + (*linux*) + setup_os="linux" [[ -f /etc/os-release ]] && . /etc/os-release setup_distro=$(echo "${NAME%% *}" | tr '[:upper:]' '[:lower:]') - [[ -z "$setup_distro" ]] && echo "OS: linux; distro not detected" && exit 1 - } -} -[[ -z "$setup_os" ]] && echo "OS not detected" && exit 1 + ;; + (*darwin*) + setup_os="macos" + setup_distro="macos" # just repeat macos, but maybe there is some better value + ;; +esac + +# ensure OS and distro are set before proceeding +[[ -z "$setup_os" ]] && echo "setup OS not detected" && exit 1 +[[ -z "$setup_distro" ]] && echo "setup distro not detected" && exit 1 # set package manager commands for installs -[[ "$setup_os" = "macos" ]] && { - install_cmd="brew install" - update_pkg_manager_and_defs_cmd='brew update' - update_pkgs_cmd='brew upgrade' -} || { - [[ "$setup_os" = "linux" ]] && { +case "$setup_os" in + (linux) case $setup_distro in (arch | artix) install_cmd="sudo pacman -S --noconfirm" update_pkg_manager_and_defs_cmd='' # don't; update system instead update_pkgs_cmd='sudo pacman -Syu' - ;; + ;; (debian) install_cmd="sudo apt install" update_pkg_manager_and_defs_cmd='sudo apt update' update_pkgs_cmd='sudo apt upgrade' - ;; + ;; esac - } -} + ;; + (macos) + install_cmd="brew install" + update_pkg_manager_and_defs_cmd='brew update' + update_pkgs_cmd='brew upgrade' + ;; +esac # export vars for scripts export BOX_SETUP_OS="$setup_os" diff --git a/docs/attribution.md b/docs/attribution.md index 88c7c05..fd89a03 100644 --- a/docs/attribution.md +++ b/docs/attribution.md @@ -16,12 +16,6 @@ for the code contained within these sources, but I wanted to give attribution no - [YouTube video - neovim config video](https://www.youtube.com/watch?v=w7i4amO_zaE) - [FrontEnd Masters course - dev productivity v2](https://frontendmasters.com/courses/developer-productivity-v2/) -## Idea of using a list of programs in a file for build/install - -The idea of using a file with a list of programs in it for building and/or -installing programs was inspired by Luke Smith's -[LARBS project](https://github.com/LukeSmithxyz/LARBS/tree/master). - ## Theme-swtiching/setting logic and some themes Much of the "theme-switching" or "theme-setting" logic and scripts are derived from diff --git a/docs/todo.md b/docs/todo.md index 60568cd..d5ff64c 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -8,16 +8,14 @@ - xresources working? use from/within theme-changing logic? - finished artix/dinit setup - include figuring out wiregaurd/vpn stuff -- switch install approach from csv file to: - - checking for custom file for os/distro - - then checking custom file for overall - - then just installing via package manager -- web browsers config and install (primary: qutebrowser, alt1: brave, alt2: tor) +- web browsers config and install (primary: qutebrowser, alt1: brave, alt2: tor?) - config for mpd, and client(s), (mpd clients to consider: mpc, ncmpcpp, ncmpc, inori) - get find, xargs, and awk (use nawk) as unified as i can across system types ## optional -- pick rss reader; newsboat? others? option with inbox and separate queues? +- configured neomutt +- picked and configured rss reader + - newsboat? others? option with inbox and separate queues? - make all these scripts POSIX-compliant (or at least usable in ksh/oksh) diff --git a/install_programs.sh b/install_programs.sh index 405027a..27683eb 100755 --- a/install_programs.sh +++ b/install_programs.sh @@ -1,26 +1,16 @@ #!/bin/zsh -apply_overrides() { - name="$1" - kind="$2" - echo $3 | - sed -E 's/; */\n/g' | - while IFS=$'\n ' read -r override_key override_values; do - [[ -z $override_values ]] && continue - override_key=$(echo $override_key | sed 's/[: ]//g') - [[ $override_key = $BOX_SETUP_OS ]] && eval $override_values - [[ $override_key = $BOX_SETUP_DISTRO ]] && eval $override_values - [[ $4 =~ $override_key ]] && eval $override_values - done - [[ -z $name || -z $kind ]] && echo "zz_skip,zz_skip" || echo "$name,$kind" -} +build_install() { + echo "-- installing $1" -build_custom() { - target=$(echo "custom_$BOX_SETUP_OS-$BOX_SETUP_DISTRO-$1" | tr '-' '_') + target=$(echo "custom-$1-$BOX_SETUP_OS-$BOX_SETUP_DISTRO" | tr '-' '_') [[ ! -e ./installs_and_builds/$target ]] && - target=$(echo "custom_default_$1" | tr '-' '_') + target=$(echo "custom-$1-$BOX_SETUP_OS-default" | tr '-' '_') [[ ! -e ./installs_and_builds/$target ]] && - echo "custom build/install script not found for: $1" && + target=$(echo "custom-$1-default" | tr '-' '_') + + [[ ! -e ./installs_and_builds/$target ]] && + ${=BOX_SETUP_INSTALL_COMMAND} "$1" && return tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/$1.XXXXXXXX") || { @@ -40,19 +30,14 @@ echo "---- updating package manager / packages" echo "---- installing programs ---------------" [[ -z $1 ]] && system_types_list="base" || system_types_list="base,$1" -echo "-------- for system types: $system_types_list" -sed 1d "installs_and_builds/programs.csv" | - while IFS=, read -r name kind os_overrides distro_overrides system_overrides notes; do - apply_overrides $name $kind $os_overrides '' | IFS=, read -r name kind - apply_overrides $name $kind $distro_overrides '' | IFS=, read -r name kind - apply_overrides $name $kind $system_overrides $system_types_list | - IFS=, read -r name kind - - [[ $name = 'zz_skip' || $kind = 'zz_skip' ]] && continue - - echo "-- installing $name" - [[ $kind = 'package_manager' ]] && ${=BOX_SETUP_INSTALL_COMMAND} ${=name} - [[ $kind = 'build_custom' ]] && build_custom $name +echo "$system_types_list" | + sed -E "s/,/\n/g" | + while IFS="\n" read -r system_type; do + echo "-------- install for system type: $system_type" + cat "installs_and_builds/programs_$system_type.txt" | + while IFS="\n" read -r program_name; do + build_install "$program_name" + done done diff --git a/installs_and_builds/custom_aerospace_default b/installs_and_builds/custom_aerospace_default new file mode 100755 index 0000000..bff0182 --- /dev/null +++ b/installs_and_builds/custom_aerospace_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "program not applicable for this OS or distro, skipping build/installation" diff --git a/installs_and_builds/custom_aerospace_macos_default b/installs_and_builds/custom_aerospace_macos_default new file mode 100755 index 0000000..d813c50 --- /dev/null +++ b/installs_and_builds/custom_aerospace_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# use normal package manager for macos install, since default is noop for other OSs +${=BOX_SETUP_INSTALL_COMMAND} --cask nikitabobko/tap/aerospace diff --git a/installs_and_builds/custom_bitwig_studio_linux_default b/installs_and_builds/custom_bitwig_studio_linux_default new file mode 100755 index 0000000..2bfb9cb --- /dev/null +++ b/installs_and_builds/custom_bitwig_studio_linux_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "TODO: custom script for bitwig not yet implemented; may just want manual install" diff --git a/installs_and_builds/custom_bitwig_studio_macos_default b/installs_and_builds/custom_bitwig_studio_macos_default new file mode 100755 index 0000000..2bfb9cb --- /dev/null +++ b/installs_and_builds/custom_bitwig_studio_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "TODO: custom script for bitwig not yet implemented; may just want manual install" diff --git a/installs_and_builds/custom_clang_macos_default b/installs_and_builds/custom_clang_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_clang_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_coreutils_default b/installs_and_builds/custom_coreutils_default new file mode 100755 index 0000000..bff0182 --- /dev/null +++ b/installs_and_builds/custom_coreutils_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "program not applicable for this OS or distro, skipping build/installation" diff --git a/installs_and_builds/custom_coreutils_macos_default b/installs_and_builds/custom_coreutils_macos_default new file mode 100755 index 0000000..f286649 --- /dev/null +++ b/installs_and_builds/custom_coreutils_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# use normal package manager for macos install, since default is noop for other OSs +${=BOX_SETUP_INSTALL_COMMAND} coreutils diff --git a/installs_and_builds/custom_dmenu_default b/installs_and_builds/custom_dmenu_default new file mode 100755 index 0000000..f0a20bc --- /dev/null +++ b/installs_and_builds/custom_dmenu_default @@ -0,0 +1,8 @@ +#!/bin/sh + +# for now, use luke's build; i can make my own fork later if desired +git clone https://github.com/LukeSmithxyz/dmenu.git + +pushd dmenu > /dev/null +sudo make clean install +popd > /dev/null diff --git a/installs_and_builds/custom_dmenu_macos_default b/installs_and_builds/custom_dmenu_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_dmenu_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_dwm_default b/installs_and_builds/custom_dwm_default new file mode 100755 index 0000000..cad8e11 --- /dev/null +++ b/installs_and_builds/custom_dwm_default @@ -0,0 +1,7 @@ +#!/bin/sh + +git clone https://git.drinkingtea.net/david/dwm.git + +pushd dwm > /dev/null +sudo make clean install +popd > /dev/null diff --git a/installs_and_builds/custom_dwm_macos_default b/installs_and_builds/custom_dwm_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_dwm_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_findutils_default b/installs_and_builds/custom_findutils_default new file mode 100755 index 0000000..bff0182 --- /dev/null +++ b/installs_and_builds/custom_findutils_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "program not applicable for this OS or distro, skipping build/installation" diff --git a/installs_and_builds/custom_findutils_macos_default b/installs_and_builds/custom_findutils_macos_default new file mode 100755 index 0000000..12e0639 --- /dev/null +++ b/installs_and_builds/custom_findutils_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# use normal package manager for macos install, since default is noop for other OSs +${=BOX_SETUP_INSTALL_COMMAND} findutils diff --git a/installs_and_builds/custom_gcc_macos_default b/installs_and_builds/custom_gcc_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_gcc_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_gimp_macos_default b/installs_and_builds/custom_gimp_macos_default new file mode 100755 index 0000000..c09be91 --- /dev/null +++ b/installs_and_builds/custom_gimp_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# adjust prefix for package manager before install +${=BOX_SETUP_INSTALL_COMMAND} --cask gimp diff --git a/installs_and_builds/custom_kitty_macos_default b/installs_and_builds/custom_kitty_macos_default new file mode 100755 index 0000000..9def0da --- /dev/null +++ b/installs_and_builds/custom_kitty_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# adjust prefix for package manager before install +${=BOX_SETUP_INSTALL_COMMAND} --cask kitty diff --git a/installs_and_builds/custom_default_ksh b/installs_and_builds/custom_ksh_default similarity index 99% rename from installs_and_builds/custom_default_ksh rename to installs_and_builds/custom_ksh_default index 97251df..4e08ebd 100755 --- a/installs_and_builds/custom_default_ksh +++ b/installs_and_builds/custom_ksh_default @@ -1,6 +1,7 @@ #!/bin/zsh git clone https://github.com/ibara/oksh.git + pushd oksh > /dev/null ./configure make && sudo make install diff --git a/installs_and_builds/custom_linux_debian_bitwig_studio b/installs_and_builds/custom_linux_debian_bitwig_studio deleted file mode 100755 index f6bde75..0000000 --- a/installs_and_builds/custom_linux_debian_bitwig_studio +++ /dev/null @@ -1,2 +0,0 @@ -echo 'hello from bitwig custom build!' -echo 'custom script for bitwig is not yet implemented, these echos just here for testing' diff --git a/installs_and_builds/custom_default_mise b/installs_and_builds/custom_mise_default similarity index 100% rename from installs_and_builds/custom_default_mise rename to installs_and_builds/custom_mise_default diff --git a/installs_and_builds/custom_musl_macos_default b/installs_and_builds/custom_musl_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_musl_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_pandoc_linux_arch b/installs_and_builds/custom_pandoc_linux_arch new file mode 100755 index 0000000..52bbf44 --- /dev/null +++ b/installs_and_builds/custom_pandoc_linux_arch @@ -0,0 +1,4 @@ +#!/bin/zsh + +# change package name; on arch it is 'pandoc-cli' +${=BOX_SETUP_INSTALL_COMMAND} pandoc-cli diff --git a/installs_and_builds/custom_pandoc_linux_artix b/installs_and_builds/custom_pandoc_linux_artix new file mode 100755 index 0000000..7951b5a --- /dev/null +++ b/installs_and_builds/custom_pandoc_linux_artix @@ -0,0 +1,4 @@ +#!/bin/zsh + +# change package name; on artix it is 'pandoc-bin' +${=BOX_SETUP_INSTALL_COMMAND} pandoc-bin diff --git a/installs_and_builds/custom_reference_neovim b/installs_and_builds/custom_reference_neovim deleted file mode 100755 index 03605bf..0000000 --- a/installs_and_builds/custom_reference_neovim +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/zsh - -# from primeagen's examples and dev repo -# currnetly not used, but keeping for reference in case i need this soon for debian - -install_neovim_dir=$HOME/.local/build/neovim -install_neovim_version="v0.10.3" -[ ! -z $NVIM_VERSION ] && install_neovim_version="$NVIM_VERSION" -echo "install_neovim_version: \"$install_neovim_version\"" - -[ ! -d $install_neovim_dir ] && git clone https://github.com/neovim/neovim.git $install_neovim_dir -git -C $install_neovim_dir fetch --all -git -C $install_neovim_dir checkout $install_neovim_version - -make -C $install_neovim_dir clean -make -C $install_neovim_dir CMAKE_BUILD_TYPE=RelWithDebInfo -sudo make -C $install_neovim_dir install - diff --git a/installs_and_builds/custom_sed_macos_default b/installs_and_builds/custom_sed_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_sed_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_skhd_default b/installs_and_builds/custom_skhd_default new file mode 100755 index 0000000..bff0182 --- /dev/null +++ b/installs_and_builds/custom_skhd_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "program not applicable for this OS or distro, skipping build/installation" diff --git a/installs_and_builds/custom_skhd_macos_default b/installs_and_builds/custom_skhd_macos_default new file mode 100755 index 0000000..bbaaae7 --- /dev/null +++ b/installs_and_builds/custom_skhd_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# use normal package manager for macos install, since default is noop for other OSs +${=BOX_SETUP_INSTALL_COMMAND} koekeishiya/formulae/skhd diff --git a/installs_and_builds/custom_st_default b/installs_and_builds/custom_st_default new file mode 100755 index 0000000..f7032f5 --- /dev/null +++ b/installs_and_builds/custom_st_default @@ -0,0 +1,9 @@ +#!/bin/sh + +# git clone https://git.drinkingtea.net/david/st.git + +# pushd st > /dev/null +# sudo make clean install +# popd > /dev/null + +echo "TODO: st build not yet done, skipping this install for now" diff --git a/installs_and_builds/custom_st_macos_default b/installs_and_builds/custom_st_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_st_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/custom_tenacity_macos_default b/installs_and_builds/custom_tenacity_macos_default new file mode 100755 index 0000000..c39117d --- /dev/null +++ b/installs_and_builds/custom_tenacity_macos_default @@ -0,0 +1,4 @@ +#!/bin/zsh + +# tenacity is not readily available on macos, so just use audacity for now +${=BOX_SETUP_INSTALL_COMMAND} --cask audacity diff --git a/installs_and_builds/custom_zathura_macos_default b/installs_and_builds/custom_zathura_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_zathura_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/programs.csv b/installs_and_builds/programs.csv deleted file mode 100644 index 8210364..0000000 --- a/installs_and_builds/programs.csv +++ /dev/null @@ -1,38 +0,0 @@ -name,kind,os_overrides,distro_overrides,system_type_overrides,notes -gcc,package_manager,macos: name='',,, -clang,package_manager,macos: name='',,, -musl,package_manager,macos: name='',,, -coreutils,package_manager,linux: name='',,, -findutils,package_manager,linux: name='',,, -make,package_manager,,,, -cmake,package_manager,,,, -mise,build_custom,,,,TODO implement the build_custom script for this -mpv,package_manager,,,, -kitty,package_manager,macos: name='--cask kitty',,, -zsh,package_manager,,,, -ksh,build_custom,,,, -tmux,package_manager,,,, -neovim,package_manager,,,, -mutt,package_manager,,,, -podman,package_manager,,,, -curl,package_manager,,,, -grep,package_manager,,,, -ripgrep,package_manager,,,, -sed,package_manager,macos: name='',,, -fzf,package_manager,,,, -jq,package_manager,,,, -parallel,package_manager,,,, -gettext,package_manager,,,, -htop,package_manager,,,, -ffmpeg,package_manager,,,work: name='', -mpd,package_manager,,,, -ncmpcpp,package_manager,,,, -git,package_manager,,,, -calcurse,package_manager,,,, -zathura,package_manager,macos: name='',,, -tenacity,package_manager,macos: name='--cask audacity',,work: name='',tenacity not available via homebrew; use audacity in macos -bitwig-studio,package_manager,macos: name='--cask bitwig-studio',artix: kind='aur'; arch: kind='aur'; debian: kind='build_custom';,work: name='', -gimp,package_manager,macos: name='--cask gimp',,, ---cask nikitabobko/tap/aerospace,package_manager,linux: name='',,, -koekeishiya/formulae/skhd,package_manager,linux: name='',,, -pandoc,package_manager,,arch: name='pandoc-cli'; artix: name='pandoc-bin';,work: name='', diff --git a/installs_and_builds/programs_base.txt b/installs_and_builds/programs_base.txt new file mode 100644 index 0000000..f27311c --- /dev/null +++ b/installs_and_builds/programs_base.txt @@ -0,0 +1,30 @@ +gcc +musl +coreutils +findutils +make +mpv +kitty +zsh +ksh +tmux +neovim +neomutt +curl +grep +ripgrep +sed +fzf +jq +parallel +gettext +htop +ffmpeg +mpd +ncmpcpp +git +calcurse +zathura +gimp +aerospace +skhd diff --git a/installs_and_builds/programs_music_studio.txt b/installs_and_builds/programs_music_studio.txt new file mode 100644 index 0000000..da5ea90 --- /dev/null +++ b/installs_and_builds/programs_music_studio.txt @@ -0,0 +1,2 @@ +tenacity +bitwig-studio diff --git a/installs_and_builds/programs_programming.txt b/installs_and_builds/programs_programming.txt new file mode 100644 index 0000000..85d7472 --- /dev/null +++ b/installs_and_builds/programs_programming.txt @@ -0,0 +1,5 @@ +clang +cmake +mise +podman +pandoc