diff --git a/README.md b/README.md index 7b1916d..b98d599 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ - complete manual actions specified in [ref/post-run](ref/post-run.md) +## todo items + +see [ref/todo.md](ref/todo.md) + ## attribution ### Original pattern/approach and some key config logic @@ -44,6 +48,10 @@ wanted to give attribution nonetheless. Author: ThePrimeagen (Michael Paulson) +### 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 to build and/or install was inspired by Luke Smith's [LARBS project](https://github.com/LukeSmithxyz/LARBS/tree/master). + ### Some themes and theme-swtiching/setting logic The theme configuration files in this repository under diff --git a/install_programs.sh b/install_programs.sh index 77af424..65afbb8 100755 --- a/install_programs.sh +++ b/install_programs.sh @@ -1,34 +1,41 @@ #!/bin/zsh -find_scripts_in_dir() { - echo $(find $1 -maxdepth 1 -mindepth 1 -type f | sort) +apply_overrides() { + 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" } -install_scripts_from_list() { - for script in $@; do - if [[ -x $script ]]; then - echo "executing: $script" - ./$script - fi - done -} - -system_types_list="base" -scripts_from_dir=($(find_scripts_in_dir "./installs_and_builds")) -[[ $1 = "personal" ]] && { - system_types_list+=", personal" - scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/personal")) -} -[[ $1 = "studio-music" ]] && { - system_types_list+=", studio-music" - scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/studio_music")) -} -[[ $1 = "work-placeholder" ]] && { - system_types_list+=", work-placeholder" - scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/work_placeholder")) -} +echo "---- updating package manager / packages" +[[ -n "$BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD" ]] && + ${=BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD} +[[ -n "$BOX_SETUP_UPDATE_PKGS_CMD" ]] && ${=BOX_SETUP_UPDATE_PKGS_CMD} echo "---- installing programs ---------------" +[[ -z $1 ]] && system_types_list="base" || system_types_list="base,$1" echo "-------- for system types: $system_types_list" -install_scripts_from_list "${scripts_from_dir[@]}" + +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 + + [[ $kind = 'package_manager' ]] && ${=BOX_SETUP_INSTALL_COMMAND} ${=name} || { + [[ $kind = 'build_custom' ]] && { + target=$(echo "custom_$BOX_SETUP_OS-$BOX_SETUP_DISTRO-$name" | tr '-' '_') + "./installs_and_builds/$target" + } + } + done diff --git a/installs_and_builds/custom_linux_alpine_bitwig_studio b/installs_and_builds/custom_linux_alpine_bitwig_studio new file mode 100755 index 0000000..f6bde75 --- /dev/null +++ b/installs_and_builds/custom_linux_alpine_bitwig_studio @@ -0,0 +1,2 @@ +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/manual_runs/s99_neovim_from_source b/installs_and_builds/custom_reference_neovim similarity index 100% rename from installs_and_builds/manual_runs/s99_neovim_from_source rename to installs_and_builds/custom_reference_neovim diff --git a/installs_and_builds/personal/placeholder-TODO b/installs_and_builds/personal/placeholder-TODO deleted file mode 100644 index e69de29..0000000 diff --git a/installs_and_builds/programs.csv b/installs_and_builds/programs.csv new file mode 100644 index 0000000..444ca16 --- /dev/null +++ b/installs_and_builds/programs.csv @@ -0,0 +1,36 @@ +name,kind,os_overrides,distro_overrides,system_type_overrides,notes +mpv,package_manager,,,, +zsh,package_manager,,,, +mutt,package_manager,,,, +docker,package_manager,,,,may need special logic for debian https://docs.docker.com/engine/install/debian/ +curl,package_manager,,,, +grep,package_manager,,,, +ripgrep,package_manager,,,, +sed,package_manager,macos: name='',,, +fzf,package_manager,,,, +jq,package_manager,,,, +parallel,package_manager,,,, +make,package_manager,,,, +cmake,package_manager,,,, +gettext,package_manager,,,, +htop,package_manager,,,, +neovim,package_manager,,,, +mpd,package_manager,,,, +ncmpcpp,package_manager,,,, +ffmpeg,package_manager,,,work: name='', +git,package_manager,,,, +tmux,package_manager,,,, +khal,package_manager,,,, +zathura,package_manager,macos: name='',,, +gcc,package_manager,macos: name='',,, +g++,package_manager,macos: name='',,, +clang,package_manager,macos: name='',,, +clang++,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'; alpine: kind='build_custom'; debian: kind='build_custom';,work: name='', +kitty,package_manager,macos: name='--cask kitty',,, +gimp,package_manager,macos: name='--cask gimp',,, +coreutils,package_manager,linux: name='',,, +findutils,package_manager,linux: name='',,, +--cask nikitabobko/tap/aerospace,package_manager,linux: name='',,, +pandoc,package_manager,,arch: name='pandoc-cli'; artix: name='pandoc-bin'; alpine: name='pandoc-cli';,work: name='', diff --git a/installs_and_builds/s00_package_manager_updates b/installs_and_builds/s00_package_manager_updates deleted file mode 100755 index cdd1723..0000000 --- a/installs_and_builds/s00_package_manager_updates +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/zsh - -[[ -n "$BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD" ]] && - ${=BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD} - -[[ -n "$BOX_SETUP_UPDATE_PKGS_CMD" ]] && - ${=BOX_SETUP_UPDATE_PKGS_CMD} - diff --git a/installs_and_builds/s01_libs b/installs_and_builds/s01_libs deleted file mode 100755 index f4256b3..0000000 --- a/installs_and_builds/s01_libs +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -# ${=BOX_SETUP_INSTALL_COMMAND} zxcv_placeholder diff --git a/installs_and_builds/s02_utils b/installs_and_builds/s02_utils deleted file mode 100755 index 203ac04..0000000 --- a/installs_and_builds/s02_utils +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/zsh - -# likely on unix systems already: find, xargs, awk? (maybe get alternative like nawk?) -${=BOX_SETUP_INSTALL_COMMAND} \ - curl \ - grep \ - ripgrep \ - sed \ - fzf \ - jq \ - parallel \ - make \ - cmake \ - gettext \ - htop - -utils_package_name_pandoc="pandoc" -case $BOX_SETUP_DISTRO in - (arch | alpine) - utils_package_name_pandoc="pandoc-cli" - ;; - (artix) - utils_package_name_pandoc="pandoc-bin" - ;; -esac -${=BOX_SETUP_INSTALL_COMMAND} $utils_package_name_pandoc - -[[ "$BOX_SETUP_OS" = "macos" ]] && - ${=BOX_SETUP_INSTALL_COMMAND} coreutils findutils diff --git a/installs_and_builds/s03_shell b/installs_and_builds/s03_shell deleted file mode 100755 index 6fcbba3..0000000 --- a/installs_and_builds/s03_shell +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} zsh diff --git a/installs_and_builds/s04_terminal b/installs_and_builds/s04_terminal deleted file mode 100755 index 55cc7ad..0000000 --- a/installs_and_builds/s04_terminal +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/zsh - -install_option_prefix='' -[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask' -# NOTE: ghostty not currently in debian repos, maybe build from source -${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" ghostty diff --git a/installs_and_builds/s05_terminal_multiplexer b/installs_and_builds/s05_terminal_multiplexer deleted file mode 100755 index fd76e87..0000000 --- a/installs_and_builds/s05_terminal_multiplexer +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} tmux diff --git a/installs_and_builds/s06_window_manager b/installs_and_builds/s06_window_manager deleted file mode 100755 index e154398..0000000 --- a/installs_and_builds/s06_window_manager +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/zsh - -linux_wm_and_utils() { - # TODO: pick wm for linux; options: dwm, i3, others? - echo "TODO: linux_wm_and_utils not yet implemented" -} - -macos_wm_and_utils() { - brew install --cask nikitabobko/tap/aerospace -} - -[[ "$BOX_SETUP_OS" = "macos" ]] && macos_wm_and_utils || linux_wm_and_utils diff --git a/installs_and_builds/s07_text_editor b/installs_and_builds/s07_text_editor deleted file mode 100755 index 84f1954..0000000 --- a/installs_and_builds/s07_text_editor +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} neovim diff --git a/installs_and_builds/s10_mail_client b/installs_and_builds/s10_mail_client deleted file mode 100755 index c006c1e..0000000 --- a/installs_and_builds/s10_mail_client +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} mutt diff --git a/installs_and_builds/s11_calendar_and_time b/installs_and_builds/s11_calendar_and_time deleted file mode 100755 index f2ca454..0000000 --- a/installs_and_builds/s11_calendar_and_time +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} khal diff --git a/installs_and_builds/s12_web_browser b/installs_and_builds/s12_web_browser deleted file mode 100755 index 37e5664..0000000 --- a/installs_and_builds/s12_web_browser +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/zsh - -# TODO: get browser config and install set up -# current idea: qutebrowser for general, tor for sensitive, brave as a backup option - -# install_option_prefix='' -# [[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask' -# firefox_package_name='firefox' -# [[ "$BOX_SETUP_DISTRO" = "debian" ]] && firefox_package_name='firefox-esr' -# ${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" "$firefox_package_name" diff --git a/installs_and_builds/s13_rss b/installs_and_builds/s13_rss deleted file mode 100755 index 7a8f6c5..0000000 --- a/installs_and_builds/s13_rss +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -# TODO: pick rss reader; newsboat? others? option with inbox and separate queues? -# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder diff --git a/installs_and_builds/s14_audio_player b/installs_and_builds/s14_audio_player deleted file mode 100755 index fcff41a..0000000 --- a/installs_and_builds/s14_audio_player +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/zsh - -# local music -${=BOX_SETUP_INSTALL_COMMAND} mpd mpc ncmpcpp -# possible mpd clients to consider: ncmpc, inori - -# spotify -# TODO: decide if i want to use the package-manager install below, or build from source -# ${=BOX_SETUP_INSTALL_COMMAND} ncspot diff --git a/installs_and_builds/s15_video_player b/installs_and_builds/s15_video_player deleted file mode 100755 index ecd26a6..0000000 --- a/installs_and_builds/s15_video_player +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} mpv diff --git a/installs_and_builds/s16_image_viewer b/installs_and_builds/s16_image_viewer deleted file mode 100755 index 7397805..0000000 --- a/installs_and_builds/s16_image_viewer +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -[[ "$BOX_SETUP_OS" = "macos" ]] && exit 0 # TODO: maybe find an option for macos -${=BOX_SETUP_INSTALL_COMMAND} nsxiv diff --git a/installs_and_builds/s17_doc_viewer b/installs_and_builds/s17_doc_viewer deleted file mode 100755 index c35d365..0000000 --- a/installs_and_builds/s17_doc_viewer +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -[[ "$BOX_SETUP_OS" = "macos" ]] && exit 0 # TODO: maybe find an option for macos -${=BOX_SETUP_INSTALL_COMMAND} zathura diff --git a/installs_and_builds/s18_file_manager b/installs_and_builds/s18_file_manager deleted file mode 100755 index 30f1e98..0000000 --- a/installs_and_builds/s18_file_manager +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -# TODO: do i even want a filemanager? if yes, pick one; consider: lf, ranger, others? -# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder diff --git a/installs_and_builds/s20_audio_editor b/installs_and_builds/s20_audio_editor deleted file mode 100755 index 78e69be..0000000 --- a/installs_and_builds/s20_audio_editor +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/zsh - -# only audio editor(s) in this file; daws are handled separately -install_option_prefix='' -[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask' -${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" audacity diff --git a/installs_and_builds/s21_video_editor b/installs_and_builds/s21_video_editor deleted file mode 100755 index 932ad85..0000000 --- a/installs_and_builds/s21_video_editor +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -# TODO: set this up; likely using ffmpeg (work on macos?), maybe others -# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder diff --git a/installs_and_builds/s22_image_editor b/installs_and_builds/s22_image_editor deleted file mode 100755 index 74e4e0d..0000000 --- a/installs_and_builds/s22_image_editor +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/zsh - -install_option_prefix='' -[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask' -${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" gimp - -# ${=BOX_SETUP_INSTALL_COMMAND} imagemagick # TODO: consider this program too diff --git a/installs_and_builds/s30_git b/installs_and_builds/s30_git deleted file mode 100755 index ffafe57..0000000 --- a/installs_and_builds/s30_git +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -${=BOX_SETUP_INSTALL_COMMAND} git diff --git a/installs_and_builds/s31_docker b/installs_and_builds/s31_docker deleted file mode 100755 index 25f5375..0000000 --- a/installs_and_builds/s31_docker +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/zsh - -setup_docker_on_debian() { - # refer to https://docs.docker.com/engine/install/debian/ - # build this function based on that - # in that, could use BOX_SETUP_INSTALL_COMMAND or just apt install - echo "setup_docker_on_debian function not implemented" -} - -# TODO: decide on docker vs others -[[ "$BOX_SETUP_DISTRO" = "debian" ]] && setup_docker_on_debian || { - ${=BOX_SETUP_INSTALL_COMMAND} docker -} diff --git a/installs_and_builds/s49_languages_general b/installs_and_builds/s49_languages_general deleted file mode 100755 index fbbbcdd..0000000 --- a/installs_and_builds/s49_languages_general +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/zsh - -[[ "$BOX_SETUP_OS" != "macos" ]] && { - ${=BOX_SETUP_INSTALL_COMMAND} gcc g++ clang clang++ -} - -# TODO: review and decide if the things below are needed -# install_lua_package="lua5.1" -#[[ "$BOX_SETUP_OS" = "macos" ]] && install_lua_package="lua@5.1" -#${=BOX_SETUP_INSTALL_COMMAND} "$install_lua_package" liblua5.1-0-dev - -# TODO: do i want to install luarocks? lazy.nvim plugin manager currently expects it -#luarocks install luacheck diff --git a/installs_and_builds/studio_music/placeholder-TODO b/installs_and_builds/studio_music/placeholder-TODO deleted file mode 100644 index e69de29..0000000 diff --git a/todo.md b/ref/todo.md similarity index 52% rename from todo.md rename to ref/todo.md index 7cf74d2..8a0d79a 100644 --- a/todo.md +++ b/ref/todo.md @@ -2,7 +2,7 @@ - config for: terminal (kitty? havoc?) - config for shell (if keeping zsh, may not need anything beyond what i've already done) -- config for mpd, mpc, ncmpcpp +- config for mpd, and client(s), (mpd clients to consider: mpc, ncmpcpp, ncmpc, inori) - config for mpv (if any, may not need anything) - hyprland config and install on linux - web browsers config and install @@ -11,11 +11,4 @@ - pick rss reader; newsboat? others? option with inbox and separate queues? - decide if i even want a filemanager; if yes, pick one and configure - decide what i'm doing for music streaming; spotify official? web? tui option? -- switch installation approach, use csv file with programs to install, install types, - any extra flags/opts, comments - - regarding the system-types idea i'd started to build in already, maybe have a - column for filtering in the csv file, or just have multiple csv files corresponding - to a base/core install, a music-studio install, a employer/work machine, etc. - - alternate idea: columns for "include_in_systems" and/or "excluded_from_systems" - - if both, likely apply the include column first, then the exclude (priority)