diff --git a/README.md b/README.md index 22376f0..92920e3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# repo containing configs and scripts to set up a box +# dotfiles plus scripts to copy them and also install stuff ### script run - fulfill prerequisites below diff --git a/copy_configs b/copy_configs index 5b731de..c997961 100755 --- a/copy_configs +++ b/copy_configs @@ -43,7 +43,8 @@ copy_dir src_files/.config $XDG_CONFIG_HOME copy_dir src_files/.local/bin $DIR_BIN copy_dir src_files/.local/scripts $DIR_SCRIPTS -# on macos, gimp defaults to app-support, so sym-link to actual config [[ "$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 link_dir "$XDG_CONFIG_HOME/GIMP" "$HOME/Library/Application Support/GIMP" diff --git a/make_dirs b/make_dirs index e68b2de..50f24be 100755 --- a/make_dirs +++ b/make_dirs @@ -17,7 +17,10 @@ source ./src_files/.config/zsh/.zshenv # ensure env vars set for use below # dirs for how i'm organizing my system [[ ! -d "$DIR_HOME_BOX" ]] && mkdir $DIR_HOME_BOX +[[ ! -d "$DIR_MUSIC" ]] && mkdir $DIR_MUSIC [[ ! -d "$DIR_DEV" ]] && mkdir $DIR_DEV -[[ ! -d "$DIR_DEV/git" ]] && mkdir $DIR_DEV/git -[[ ! -d "$DIR_DEV/git/me" ]] && mkdir $DIR_DEV/git/me -[[ ! -d "$DIR_DEV/git/other" ]] && mkdir $DIR_DEV/git/other +[[ ! -d "$DIR_GIT_PROJECTS" ]] && mkdir $DIR_GIT_PROJECTS +[[ ! -d "$DIR_GIT_PROJECTS/me" ]] && mkdir $DIR_DEV/git/me +[[ ! -d "$DIR_GIT_PROJECTS/other" ]] && mkdir $DIR_DEV/git/other +[[ ! -d "$DIR_SCRATCH_NOTES" ]] && mkdir -p $DIR_SCRATCH_NOTES +[[ ! -d "$DIR_SCRATCH_DRAWINGS" ]] && mkdir -p $DIR_SCRATCH_DRAWINGS diff --git a/ref/workflow-desktops-scheme.txt b/ref/workflow-desktops-scheme.txt new file mode 100644 index 0000000..9392830 --- /dev/null +++ b/ref/workflow-desktops-scheme.txt @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////////////////// +// idea from the primeagen, designated label/workspace/desktop per app/purpose + +// current layout/plan // wm default layout/mode +1. drawing/thinking (scratch pads for text and images) stack (fullscreen) +2. music makeing - misc stack (fullscreen) +3. music making - daw floating +4. music/audio listening stack (fullscreen) +5. general misc (catch-all) stack (fullscreen) +6. comms (email, chats, etc) stack (fullscreen) +7. dev - misc stack (fullscreen) +8. terminal (primary, but audio/one-off/etc can be anywhere) stack (fullscreen) +9. web browser stack (fullscreen) + +// ideas/guidelines: +- use this consistently accross all machines + - if something not applicable for a given machine, just don't have apps or screens + present, but maintain absolute position/numbering of each screen +- structure the above so that programs which i'm likely to use with one hand off of the + keyboard (i.e. to use a trackpad, mouse, stylus, etc) are on the screens that allow + for one hand (i.e. the one still on the keyboard) to navigate those screens + - for me, using peripherals with right hand, so put programs likely to be used with + peripherals where my left hand can switch to them single-handedly (screens 1 to 5) + diff --git a/src_files/.config/nvim/lua/david_standard/key_mappings.lua b/src_files/.config/nvim/lua/david_standard/key_mappings.lua index 09e18d6..4f016c8 100644 --- a/src_files/.config/nvim/lua/david_standard/key_mappings.lua +++ b/src_files/.config/nvim/lua/david_standard/key_mappings.lua @@ -5,11 +5,13 @@ vim.keymap.set("n", "n", vim.cmd.Ex) vim.keymap.set("v", "J", ":m '>+1gv") vim.keymap.set("v", "K", ":m '<-2gv") --- vertically center cursor with half-page jumps iterating search results +-- vertically center cursor with half-page jumps vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "n", "nzzzv") -vim.keymap.set("n", "N", "Nzzzv") + +-- open folds when iterating search results +vim.keymap.set("n", "n", "nzv") +vim.keymap.set("n", "N", "Nzv") -- maintain cursor position after paragraph formatting vim.keymap.set("n", "=ap", "ma=ap'a") @@ -21,6 +23,7 @@ vim.keymap.set("x", "P", [["_dP]]) -- replace selected text, keep main r -- shortcuts for using + register (system clipboard) vim.keymap.set({ "n", "v" }, "y", [["+y]]) vim.keymap.set("n", "Y", [["+Y]]) +vim.keymap.set("n", "D", [["+D]]) vim.keymap.set("n", "p", [["+p]]) -- search-and-replace shortcuts diff --git a/src_files/.config/skhd/skhdrc b/src_files/.config/skhd/skhdrc index 72cf925..9f42940 100755 --- a/src_files/.config/skhd/skhdrc +++ b/src_files/.config/skhd/skhdrc @@ -21,12 +21,14 @@ alt + shift - 7 : yabai -m window --space 7 --focus alt + shift - 8 : yabai -m window --space 8 --focus alt + shift - 9 : yabai -m window --space 9 --focus -# all windows in a space to fullscreen in a single stack +# all windows in a space to stack mode (each fullscreen) alt + shift - s : yabai -m space --layout stack -# all windows in a space back to the grid (managed) +# all windows in a space to grid mode alt + shift - g : yabai -m space --layout bsp +# all windows in a space to float mode +alt + shift - f : yabai -m space --layout float # toggle float on/off for the focused window -alt + shift - f : yabai -m window --toggle float +alt + shift - F : yabai -m window --toggle float # balance window sizes alt + shift - 0 : yabai -m space --balance # TODO: figure out better key option diff --git a/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-default b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-default new file mode 100644 index 0000000..79cc297 --- /dev/null +++ b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-default @@ -0,0 +1,13 @@ +local omitted_dirs=( + $HOME + $DIR_HOME_BOX + $DIR_DEV + $DIR_GIT_PROJECTS +) +[[ ! ${omitted_dirs[(re)$(pwd)]} ]] && + tmux new-window -d -n cmd && + tmux rename-window $EDITOR && + $EDITOR . + +clear + diff --git a/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-example b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-example new file mode 100644 index 0000000..571dc61 --- /dev/null +++ b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-example @@ -0,0 +1,11 @@ +## example template + +tmux new-window -d -n cmd +tmux send-keys -t :cmd "echo 'in cmd'" c-M + +tmux new-window -d -n another +tmux send-keys -t :another "echo 'in another'" c-M + +tmux rename-window $EDITOR +$EDITOR . +clear diff --git a/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-listening b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-listening new file mode 100644 index 0000000..6a43cbb --- /dev/null +++ b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-listening @@ -0,0 +1,7 @@ +tmux new-window -d -n ncspot + +tmux new-window -d -n fitness +tmux send-keys -t :fitness "cd $DIR_HOME_BOX/life/fitness/audio" c-M + +tmux rename-window ncmpcpp +ncmpcpp diff --git a/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-thinking b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-thinking new file mode 100644 index 0000000..8282747 --- /dev/null +++ b/src_files/.config/tmux/session-hydrate-files/.tmux-session-hydrate-thinking @@ -0,0 +1,8 @@ +tmux rename-window drawing + +tmux new-window -n thinking +tmux send-keys -t :thinking "$EDITOR $(date "+%Y%m%d")-scratch" c-M + +tmux send-keys -t :drawing "cd $DIR_SCRATCH_DRAWINGS" c-M +tmux send-keys -t :drawing "gimp" c-M + diff --git a/src_files/.config/tmux/tmux.conf b/src_files/.config/tmux/tmux.conf index adec689..34091c7 100644 --- a/src_files/.config/tmux/tmux.conf +++ b/src_files/.config/tmux/tmux.conf @@ -8,7 +8,7 @@ set -g status-style 'bg=#111111 fg=#22cc00' set -g base-index 0 # unbind keys -unbind-key f; unbind-key C-f; unbind-key C-s +unbind-key f; unbind-key C-f; unbind-key s; unbind-key C-s unbind-key c; unbind-key n; unbind-key p unbind-key C-o; unbind-key C-n; unbind-key C-p; unbind-key C-l; unbind-key C-h @@ -35,7 +35,8 @@ bind-key n new-window # find and switching for sessions, include using tmux-session-init bind-key C-f run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init" -bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing" +# bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing" +bind-key C-s choose-session bind-key C-h run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init hub" bind-key -r C-l switch-client -l bind-key -r C-o last-window diff --git a/src_files/.config/zsh/.zprofile b/src_files/.config/zsh/.zprofile index e69de29..2e3bd9e 100644 --- a/src_files/.config/zsh/.zprofile +++ b/src_files/.config/zsh/.zprofile @@ -0,0 +1 @@ +# source "$XDG_CONFIG_HOME/shell/profile" # TODO: where to put this? diff --git a/src_files/.config/zsh/.zshenv b/src_files/.config/zsh/.zshenv index ecf4149..644967d 100644 --- a/src_files/.config/zsh/.zshenv +++ b/src_files/.config/zsh/.zshenv @@ -4,8 +4,11 @@ export EDITOR='nvim' # env vars used for my organization structure export DIR_HOME_BOX="$HOME/dbox" +export DIR_MUSIC="$DIR_HOME_BOX/media/music" export DIR_DEV="$HOME/dev" export DIR_GIT_PROJECTS="$DIR_DEV/git" +export DIR_SCRATCH_NOTES="$DIR_HOME_BOX/life/scratchpad/notes" +export DIR_SCRATCH_DRAWINGS="$DIR_HOME_BOX/life/scratchpad/drawings" # util dirs; do not change without checking impact on xdg base dirs export DIR_LOCAL="$HOME/.local" diff --git a/src_files/.config/zsh/zsh-general-dev b/src_files/.config/zsh/zsh-general-dev index 5c8fe71..7d7ec29 100644 --- a/src_files/.config/zsh/zsh-general-dev +++ b/src_files/.config/zsh/zsh-general-dev @@ -11,6 +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 gpdev='git-push-to-temp' alias gpo='git pull origin' +git config --global user.email "$EMAIL_PERSONAL_DEV" # code/test/linter run and build commands alias bel='bundle exec standardrb' diff --git a/src_files/.local/bin/.placeholder b/src_files/.local/bin/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/src_files/.local/bin/mvd b/src_files/.local/bin/mvd new file mode 100755 index 0000000..6e04ec8 --- /dev/null +++ b/src_files/.local/bin/mvd @@ -0,0 +1,5 @@ +#!/bin/zsh + +local target_dir=$(dirname "${@: -1}") +[[ ! -d "$target_dir" ]] && mkdir -p "$target_dir" +exec mv "$@" diff --git a/src_files/.local/scripts/.tmux-session-hydrate-default b/src_files/.local/scripts/.tmux-session-hydrate-default deleted file mode 100644 index d958de9..0000000 --- a/src_files/.local/scripts/.tmux-session-hydrate-default +++ /dev/null @@ -1,21 +0,0 @@ -local omitted_dirs=( - $HOME - $DIR_HOME_BOX - $DIR_DEV - $DIR_GIT_PROJECTS -) -[[ ! ${omitted_dirs[(re)$(pwd)]} ]] && - tmux new-window -d -n cmd && - tmux rename-window $EDITOR && - $EDITOR . - -clear - -## example template for custom override -# tmux new-window -d -n cmd -# tmux send-keys -t :cmd "echo 'in cmd'" c-M -# tmux new-window -d -n another -# tmux send-keys -t :another "echo 'in another'" c-M -# tmux rename-window $EDITOR -# $EDITOR . -# clear diff --git a/src_files/.local/scripts/tmux-session-init b/src_files/.local/scripts/tmux-session-init index 7197afb..41b1b9f 100755 --- a/src_files/.local/scripts/tmux-session-init +++ b/src_files/.local/scripts/tmux-session-init @@ -5,13 +5,15 @@ switch_to() { } hydrate() { - local tmux_hydrate_path="$DIR_SCRIPTS/.tmux-session-hydrate-default" + local tmux_hydrate_files_dir="$XDG_CONFIG_HOME/tmux/session-hydrate-files" + local tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-default" + [[ $1 = "thinking" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-thinking" + [[ $1 = "listening" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-listening" [[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate" [[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M } -local name_regex="^\([-_A-Za-z0-9]*\):.*$" -local existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions | sed "s/$name_regex/\1/" || echo '') +local existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions || echo '') local search_dirs=( $DIR_HOME_BOX $DIR_DEV @@ -23,8 +25,10 @@ local target_path='' [[ $# -eq 1 ]] && target_path=$1 || target_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf) -if [[ $target_path = "find-existing" ]]; then target_name=$(echo $existing_sessions | fzf); +if [[ $target_path = "." ]]; then target_name=$(basename $(pwd)) && target_path=$(pwd); elif [[ $target_path = "hub" ]]; then target_name="hub" && target_path="$HOME"; +elif [[ $target_path = "thinking" ]]; then target_name="thinking" && target_path="$DIR_SCRATCH_NOTES"; +elif [[ $target_path = "listening" ]]; then target_name="listening" && target_path="$DIR_MUSIC"; elif [[ -n $target_path ]]; then target_name=$(basename "$target_path" | tr . _); fi diff --git a/src_files/executable_wrappers_macos/gimp b/src_files/executable_wrappers_macos/gimp new file mode 100755 index 0000000..e4dfa44 --- /dev/null +++ b/src_files/executable_wrappers_macos/gimp @@ -0,0 +1,3 @@ +#!/bin/sh + +/Applications/GIMP.app/Contents/MacOS/gimp