Add system-type filters, add git-clone handling to main script
This commit is contained in:
28
README.md
28
README.md
@@ -1,18 +1,25 @@
|
|||||||
# dotfiles plus scripts to copy them and also install stuff
|
# dotfiles, plus scripts for box setup
|
||||||
|
|
||||||
### script run
|
### instructions
|
||||||
- fulfill prerequisites below
|
- fulfill prerequisites (see below)
|
||||||
- git clone this repo
|
- script run options:
|
||||||
- from the repo's root directory, run `./box_setup <OS name>`
|
- if repo present on system, run from the repo's root:
|
||||||
|
- ```
|
||||||
|
./box_setup.sh <OS-name>
|
||||||
|
```
|
||||||
|
- if repo not present, run:
|
||||||
|
- ```
|
||||||
|
curl -LO https://git.drinkingtea.net/david/box-setup/src/branch/master/box_setup.sh
|
||||||
|
sh box_setup.sh <OS-name>
|
||||||
|
```
|
||||||
|
- then delete the script file afterwards (repo should have been copied to dev dir)
|
||||||
|
|
||||||
### prerequisites
|
### prerequisites
|
||||||
- package manager is configured (i.e. source repos, mirrors, etc. configured)
|
|
||||||
- zsh is installed (scripts are written for zsh)
|
- zsh is installed (scripts are written for zsh)
|
||||||
- sudo access is configured for current user (as of 2025-01-27, not needed on macos)
|
|
||||||
- system-specific items below are fulfilled
|
- system-specific items below are fulfilled
|
||||||
|
|
||||||
##### prereqs, os specific, linux-placeholder
|
##### prereqs, os specific, linux distros
|
||||||
- (currently none)
|
- sudo access is configured for current user
|
||||||
|
|
||||||
##### prereqs, os specific, macos
|
##### prereqs, os specific, macos
|
||||||
- install the package manager, [homebrew](https://brew.sh/)
|
- install the package manager, [homebrew](https://brew.sh/)
|
||||||
@@ -28,7 +35,6 @@
|
|||||||
- `show files on desktop`: enabled
|
- `show files on desktop`: enabled
|
||||||
|
|
||||||
### todo items
|
### todo items
|
||||||
- add logic to the main run script to handle cloning of this repo
|
|
||||||
- config for window manager for linux (first, decide which wm to use)
|
- config for window manager for linux (first, decide which wm to use)
|
||||||
- config for terminal emulator (currently ghostty)
|
- config for terminal emulator (currently ghostty)
|
||||||
- config for mpd, mpc, ncmpcpp
|
- config for mpd, mpc, ncmpcpp
|
||||||
@@ -36,8 +42,6 @@
|
|||||||
- config for gimp, `src_files/.config/GIMP` (dir)
|
- config for gimp, `src_files/.config/GIMP` (dir)
|
||||||
- set things in gtkrc only? still need to nest that within a sub dir?
|
- set things in gtkrc only? still need to nest that within a sub dir?
|
||||||
- or configure in gimp, copy resulting dir to `src_files/.config/GIMP`, call it a day
|
- or configure in gimp, copy resulting dir to `src_files/.config/GIMP`, call it a day
|
||||||
- maybe build in flags/logic for skipping certain installs/builds (and maybe configs?)
|
|
||||||
on a given system (i.e. don't install on a company box, on a server, etc.)
|
|
||||||
- decide on and implement approach for languages and versioning
|
- decide on and implement approach for languages and versioning
|
||||||
- asdf, or language-specific version managers?
|
- asdf, or language-specific version managers?
|
||||||
- docker? or alternatives like podman? any license concerns?
|
- docker? or alternatives like podman? any license concerns?
|
||||||
|
@@ -1,9 +1,29 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
[[ -z $1 ]] &&
|
[[ -z $1 ]] && {
|
||||||
echo "OS must be passed as an arg (options: arch, artix, debian, macos)" &&
|
echo "OS must be passed as an arg, run \`./box_setup.sh --help\` for more info"
|
||||||
echo "example: ./box_setup arch" &&
|
|
||||||
exit 1
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $1 = "--help" ]] && {
|
||||||
|
echo "usage: ./box_setup.sh <OS-name> [system-type]\n"
|
||||||
|
echo "OS-name options: arch, artix, debian, macos"
|
||||||
|
echo "system-type options: personal, studio-music, work-placeholder\n"
|
||||||
|
echo "examples:\n./box_setup.sh arch studio-music\n./box_setup.sh macos\n"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: test this git stuff, see if it works
|
||||||
|
local temp_placement_git_dir="no"
|
||||||
|
[[ ! -d ".git" && "$(basename $(pwd))" != "box-setup" ]] && {
|
||||||
|
temp_placement_git_dir="yes"
|
||||||
|
git clone "https://git.drinkingtea.net/david/box-setup.git" || {
|
||||||
|
echo "failed to clone box-setup git repo"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
pushd box-setup > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# set env vars for installs
|
# set env vars for installs
|
||||||
local install_cmd=''
|
local install_cmd=''
|
||||||
@@ -33,10 +53,15 @@ export BOX_SETUP_UPDATE_PKGS_CMD="$update_pkgs_cmd"
|
|||||||
|
|
||||||
# make dirs and copy configs/dotfiles
|
# make dirs and copy configs/dotfiles
|
||||||
source ./src_files/.config/zsh/.zshenv
|
source ./src_files/.config/zsh/.zshenv
|
||||||
./make_dirs
|
./make_dirs.sh
|
||||||
./copy_configs
|
./copy_configs.sh $2
|
||||||
|
|
||||||
# install programs
|
# install programs
|
||||||
source $ZDOTDIR/.zshenv
|
source $ZDOTDIR/.zshenv
|
||||||
source $ZDOTDIR/.zshrc
|
source $ZDOTDIR/.zshrc
|
||||||
./install_programs
|
./install_programs.sh $2
|
||||||
|
|
||||||
|
[[ $temp_placement_git_dir == "yes" ]] && {
|
||||||
|
popd > /dev/null
|
||||||
|
mv "box-setup" "$DIR_GIT/me/"
|
||||||
|
}
|
@@ -35,7 +35,7 @@ link_dir() {
|
|||||||
ln -s $src_dir $link_dir
|
ln -s $src_dir $link_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "---- copying dotfiles -------------------------"
|
echo "---- copying dotfiles ------------------------------------------------"
|
||||||
|
|
||||||
copy_file src_files/.config/zsh/.zshenv $HOME # duplicate, copy anyway, ensures $ZDOTDIR
|
copy_file src_files/.config/zsh/.zshenv $HOME # duplicate, copy anyway, ensures $ZDOTDIR
|
||||||
|
|
||||||
@@ -43,8 +43,12 @@ copy_dir src_files/.config $XDG_CONFIG_HOME
|
|||||||
copy_dir src_files/.local/bin $DIR_BIN
|
copy_dir src_files/.local/bin $DIR_BIN
|
||||||
copy_dir src_files/.local/scripts $DIR_SCRIPTS
|
copy_dir src_files/.local/scripts $DIR_SCRIPTS
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] &&
|
[[ "$BOX_SETUP_OS" = "macos" ]] && {
|
||||||
# link_dir "$XDG_CONFIG_HOME/REAPER" "$HOME/Library/Application Support/REAPER" && # TODO: get reaper config set up
|
|
||||||
copy_dir src_files/executable_wrappers_macos $DIR_BIN
|
copy_dir src_files/executable_wrappers_macos $DIR_BIN
|
||||||
link_dir "$XDG_CONFIG_HOME/GIMP" "$HOME/Library/Application Support/GIMP"
|
link_dir "$XDG_CONFIG_HOME/GIMP" "$HOME/Library/Application Support/GIMP"
|
||||||
|
}
|
||||||
|
|
||||||
|
# [[ $1 = "studio-music" ]] &&
|
||||||
|
# [[ "$BOX_SETUP_OS" = "macos" ]] &&
|
||||||
|
# link_dir "$XDG_CONFIG_HOME/REAPER" "$HOME/Library/Application Support/REAPER" && # TODO: get reaper config set up
|
||||||
|
|
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
local single_script_filter=""
|
|
||||||
|
|
||||||
while [[ $# > 0 ]]; do
|
|
||||||
single_script_filter="$1" # if using param, export BOX_SETUP_OS first if needed
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "---- installing programs ----------------------"
|
|
||||||
|
|
||||||
local scripts=$(find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f | sort)
|
|
||||||
for script in ${=scripts}; do
|
|
||||||
if [[ -x $script ]]; then
|
|
||||||
if echo "$script" | grep -qv "$single_script_filter"; then
|
|
||||||
continue # $single_script_filter set, ignore others
|
|
||||||
fi
|
|
||||||
echo "executing: $script"
|
|
||||||
./$script
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
33
install_programs.sh
Executable file
33
install_programs.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
install_scripts_from_dir() {
|
||||||
|
for script in $1; do
|
||||||
|
if [[ -x $script ]]; then
|
||||||
|
echo "executing: $script"
|
||||||
|
./$script
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "---- installing programs, base ---------------------------------------"
|
||||||
|
local scripts=$(find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f | sort)
|
||||||
|
install_scripts_from_dir(${=scripts})
|
||||||
|
|
||||||
|
[[ $1 = "personal" ]] && {
|
||||||
|
echo "---- installing programs, personal -----------------------------------"
|
||||||
|
scripts=$(find ./installs_and_builds/personal -maxdepth 1 -mindepth 1 -type f | sort)
|
||||||
|
install_scripts_from_dir(${=scripts})
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $1 = "studio-music" ]] && {
|
||||||
|
echo "---- installing programs, studio-music -------------------------------"
|
||||||
|
scripts=$(find ./installs_and_builds/studio_music -maxdepth 1 -mindepth 1 -type f | sort)
|
||||||
|
install_scripts_from_dir(${=scripts})
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $1 = "work-placeholder" ]] && {
|
||||||
|
echo "---- installing programs, work-placeholder ---------------------------"
|
||||||
|
scripts=$(find ./installs_and_builds/work_placeholder -maxdepth 1 -mindepth 1 -type f | sort)
|
||||||
|
install_scripts_from_dir(${=scripts})
|
||||||
|
}
|
||||||
|
|
0
installs_and_builds/personal/placeholder-TODO
Normal file
0
installs_and_builds/personal/placeholder-TODO
Normal file
0
installs_and_builds/studio_music/placeholder-TODO
Normal file
0
installs_and_builds/studio_music/placeholder-TODO
Normal file
@@ -2,4 +2,4 @@
|
|||||||
defaultBranch = master
|
defaultBranch = master
|
||||||
[user]
|
[user]
|
||||||
name = david
|
name = david
|
||||||
email = david@silverwolf.studio
|
email = placeholder
|
||||||
|
@@ -7,8 +7,8 @@ export DIR_HOME_BOX="$HOME/dbox"
|
|||||||
export DIR_MUSIC="$DIR_HOME_BOX/media/music"
|
export DIR_MUSIC="$DIR_HOME_BOX/media/music"
|
||||||
export DIR_DEV="$HOME/dev"
|
export DIR_DEV="$HOME/dev"
|
||||||
export DIR_GIT_PROJECTS="$DIR_DEV/git"
|
export DIR_GIT_PROJECTS="$DIR_DEV/git"
|
||||||
export DIR_SCRATCH_NOTES="$DIR_HOME_BOX/life/scratchpad/notes"
|
export DIR_SCRATCH_NOTES="$DIR_HOME_BOX/scratchpad/notes"
|
||||||
export DIR_SCRATCH_DRAWINGS="$DIR_HOME_BOX/life/scratchpad/drawings"
|
export DIR_SCRATCH_DRAWINGS="$DIR_HOME_BOX/scratchpad/drawings"
|
||||||
|
|
||||||
# util dirs; do not change without checking impact on xdg base dirs
|
# util dirs; do not change without checking impact on xdg base dirs
|
||||||
export DIR_LOCAL="$HOME/.local"
|
export DIR_LOCAL="$HOME/.local"
|
||||||
|
@@ -16,9 +16,8 @@ alias nv='nvim'
|
|||||||
alias n='nvim'
|
alias n='nvim'
|
||||||
alias tms='tmux-session-init'
|
alias tms='tmux-session-init'
|
||||||
|
|
||||||
# executable name overrides
|
# executable overrides
|
||||||
alias ls='ls -F'
|
alias ls='ls -F'
|
||||||
alias yt-dlp='yt-dlp --write-info-json'
|
|
||||||
|
|
||||||
# misc commands
|
# misc commands
|
||||||
alias cal='khal calendar'
|
alias cal='khal calendar'
|
||||||
|
@@ -11,7 +11,7 @@ alias gfo='git fetch origin'
|
|||||||
alias git-push-to-temp='git branch -D temp; git checkout -b temp; git push origin temp -uf; git checkout -'
|
alias git-push-to-temp='git branch -D temp; git checkout -b temp; git push origin temp -uf; git checkout -'
|
||||||
alias gpdev='git-push-to-temp'
|
alias gpdev='git-push-to-temp'
|
||||||
alias gpo='git pull origin'
|
alias gpo='git pull origin'
|
||||||
git config --global user.email "$EMAIL_PERSONAL_DEV"
|
git config --global user.email "$EMAIL_PERSONAL_DEV" # TODO: maybe fit this into system-type filters?
|
||||||
|
|
||||||
# code/test/linter run and build commands
|
# code/test/linter run and build commands
|
||||||
alias bel='bundle exec standardrb'
|
alias bel='bundle exec standardrb'
|
||||||
|
Reference in New Issue
Block a user