From f82a7c4c71fbe8a62160957f896809e15fb89acb Mon Sep 17 00:00:00 2001 From: david Date: Sun, 5 Oct 2025 15:08:29 -0500 Subject: [PATCH] Adjust launch-reaper scripts a bit, also add two general scripts --- ref/workflow-and-workspaces-scheme.md | 25 ++++++++-------- src_files/.config/zsh/.zshenv | 4 +-- src_files/.local/bin/launch-reaper | 10 ++++--- src_files/.local/scripts/convert | 33 +++++++++++++++++++++ src_files/.local/scripts/gfind | 14 +++++++++ src_files/bin_overrides_macos/launch-reaper | 10 +++---- 6 files changed, 72 insertions(+), 24 deletions(-) create mode 100755 src_files/.local/scripts/convert create mode 100755 src_files/.local/scripts/gfind diff --git a/ref/workflow-and-workspaces-scheme.md b/ref/workflow-and-workspaces-scheme.md index 94ce1ed..ba3c70e 100644 --- a/ref/workflow-and-workspaces-scheme.md +++ b/ref/workflow-and-workspaces-scheme.md @@ -6,17 +6,17 @@ idea from the ThePrimeagen: designated workspace/label/desktop per app/purpose ### current layout/plan -| workspace number | wm default layout/mode | +| workspace number | wm layout/mode | |--------------------------------------------------------------|------------------------| -| 1. notes/drawing/thinking (notes app, drawing pad, etc) | 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; one-offs & tui apps can be anywhere) | stack (fullscreen) | -| 9. web browser | stack (fullscreen) | +| 1. notes/drawing (stack: nvim, obsidian, gimp) | stack | +| 2. music makeing - misc | stack | +| 3. music making - daw | floating (workaround) | +| 4. music/audio listening | stack | +| 5. general - misc (catch-all) | stack | +| 6. comms (stack: emails, chats, av/calls) | stack | +| 7. programming - misc (whatever is not in terminal) | stack | +| 8. terminal (primary; one-offs & tui apps can be anywhere) | stack | +| 9. web browser | stack | ### ideas/guidelines: - use this consistently accross all machines @@ -37,7 +37,8 @@ idea from the ThePrimeagen: designated workspace/label/desktop per app/purpose menu bar at the top of the screen) - key bindings are set for moving window focus up/down (vim style: mod + k/j) - the mental model here is that every fullscreen window is in a stack, so i can move - focus up and down the stack + focus up and down the stack (and i try to maintain consistent order in stacks, + e.g. in the comms workspace, email is always on the bottom and chat apps are above) - for apps with tabs, pair the above mental model of a stack with a mental model of a circular list being in any position in that stack - so, keybindings are also set for previous/next tab (vim style: mod + h/l) @@ -47,7 +48,7 @@ idea from the ThePrimeagen: designated workspace/label/desktop per app/purpose many windows and/or tabs open at one time; however, with the designated purpose for each workspace and the mental models above, it rarely takes me long to find what i need -## examples cases +## example cases - if i want a particular browser window, i jump to workspace 9, then move focus up or down until i get to the window i want; if the window is right but i need diff --git a/src_files/.config/zsh/.zshenv b/src_files/.config/zsh/.zshenv index c824788..aa08ba2 100644 --- a/src_files/.config/zsh/.zshenv +++ b/src_files/.config/zsh/.zshenv @@ -37,8 +37,8 @@ export OBSIDIAN_WORKSPACES_TO_CONFIGURE=("$DIR_NOTES") # reaper DIR_REAPER_PORTABLE_SHARED="$DIR_USER_OPT/reaper-portable/shared" -DIR_REAPER_PORTABLE_LINUX="$DIR_USER_OPT/reaper-portable/reaper-linux" -DIR_REAPER_PORTABLE_MACOS="$DIR_USER_OPT/reaper-portable/reaper-macos" +DIR_REAPER_PORTABLE_LINUX="$DIR_USER_OPT/reaper-portable/linux" +DIR_REAPER_PORTABLE_MACOS="$DIR_USER_OPT/reaper-portable/macos" # clean-up of home dir export __CF_USER_TEXT_ENCODING="0x0:0x0" diff --git a/src_files/.local/bin/launch-reaper b/src_files/.local/bin/launch-reaper index e404150..2f2d26a 100755 --- a/src_files/.local/bin/launch-reaper +++ b/src_files/.local/bin/launch-reaper @@ -2,16 +2,18 @@ # trying the "portable install" option; using this launch script to point to that source "$XDG_CONFIG_HOME/zsh/.zshenv" -reaper_portable_exec_linux="$DIR_REAPER_PORTABLE_LINUX/REAPER/reaper" -reaper_portable_ini_file_linux="$DIR_REAPER_PORTABLE_LINUX/reaper-config/reaper.ini" +reaper_portable_exec_linux="$DIR_REAPER_PORTABLE_LINUX/REAPER/reaper" [[ ! -x "$reaper_portable_exec_linux" ]] && { echo "reaper missing or not executable: $reaper_portable_exec_linux" >&2 exit 1 } + +reaper_portable_config_linux="$DIR_REAPER_PORTABLE_LINUX/config" +reaper_portable_ini_file_linux="$reaper_portable_config_linux/reaper.ini" [[ ! -r "$reaper_portable_ini_file_linux" ]] && { - echo "reaper.ini missing or not readable: $reaper_portable_ini_file_linux" >&2 - exit 1 + [[ ! -d "$reaper_portable_config_linux" ]] && mkdir -p "$reaper_portable_config_linux" + touch "$reaper_portable_ini_file_linux" } nohup \ diff --git a/src_files/.local/scripts/convert b/src_files/.local/scripts/convert new file mode 100755 index 0000000..c6e0f67 --- /dev/null +++ b/src_files/.local/scripts/convert @@ -0,0 +1,33 @@ +#! /bin/zsh + +# simple unit-conversion util, partly made for fun, not much here so far + +conversionUnits=$1 +inputsToConvert=($argv[2,-1]) + +function cmToIn() { + result=$(( 1 / 2.54 * $1 )) + printf '%.1f cm => %.2f in\n' $1 $result +} + +function inToCm() { + result=$(( 2.54 * $1 )) + printf '%.2f in => %.1f cm\n' $1 $result +} + +function unsupportedUnits() { + echo "unsupported conversion units given: $conversionUnits" + exit 1 +} + +funcRef=exit # not sure what a good default function is, using exit +case $conversionUnits in + (cm|cm-in) funcRef=cmToIn + ;; + (in|in-cm) funcRef=inToCm + ;; + (*) funcRef=unsupportedUnits + ;; +esac + +for i in $inputsToConvert; do $funcRef $i; done diff --git a/src_files/.local/scripts/gfind b/src_files/.local/scripts/gfind new file mode 100755 index 0000000..df3e5cc --- /dev/null +++ b/src_files/.local/scripts/gfind @@ -0,0 +1,14 @@ +#! /bin/zsh + +# simple wrapper to run both find and grep +# usage: gfind [search-directory] +# if no search-directory given, uses . by default + +searchTerm=$1 +searchDirectory=$(if [[ -n $2 ]] then echo $2; else echo "."; fi) + +printf '//// find results for: %s in directory: %s\n' $searchTerm $searchDirectory +find $searchDirectory -iname "*$searchTerm*" + +printf '\n//// grep results for: %s in directory: %s\n' $searchTerm $searchDirectory +grep -rIi $searchTerm $searchDirectory diff --git a/src_files/bin_overrides_macos/launch-reaper b/src_files/bin_overrides_macos/launch-reaper index 0c62574..bbe95ce 100755 --- a/src_files/bin_overrides_macos/launch-reaper +++ b/src_files/bin_overrides_macos/launch-reaper @@ -2,17 +2,15 @@ # trying the "portable install" option; using this launch script to point to that source "$XDG_CONFIG_HOME/zsh/.zshenv" -reaper_portable_exec_macos="$DIR_REAPER_PORTABLE_MACOS/REAPER.app/Contents/MacOS/REAPER" -reaper_portable_ini_file_macos="$DIR_REAPER_PORTABLE_MACOS/reaper.ini" +reaper_portable_exec_macos="$DIR_REAPER_PORTABLE_MACOS/REAPER.app/Contents/MacOS/REAPER" [[ ! -x "$reaper_portable_exec_macos" ]] && { echo "reaper missing or not executable: $reaper_portable_exec_macos" >&2 exit 1 } -[[ ! -r "$reaper_portable_ini_file_macos" ]] && { - echo "reaper.ini missing or not readable: $reaper_portable_ini_file_macos" >&2 - exit 1 -} + +reaper_portable_ini_file_macos="$DIR_REAPER_PORTABLE_MACOS/reaper.ini" +[[ ! -r "$reaper_portable_ini_file_macos" ]] && touch "$reaper_portable_ini_file_macos" nohup \ $reaper_portable_exec_macos \