feat: Begin incorporating utility scripts into windowctl

This commit is contained in:
2025-10-07 08:37:52 -04:00
parent 7024182f49
commit 931903d18c
2 changed files with 69 additions and 54 deletions

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env bash
set -e
set -o nounset
set -o pipefail
THIS_FILE=${BASH_SOURCE[0]}
THIS=$(basename $THIS_FILE)
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
@@ -111,6 +115,13 @@ log() {
logging log --source "$THIS_FILE" "$@"
}
# Launch in a new terminal window.
launch() {
ghostty --class="$window_class" --window-padding-x="$window_padding_x" \
--keybind="ctrl+c=quit" \
-e "${BASH_SOURCE[0]}" "${launch_args[@]}"
}
# Reset flags and selection.
reset_flags() {
selected_value=""
@@ -271,9 +282,7 @@ setup-logging "/tmp/$THIS.log" "$THIS"
log "Starting with selected value: '$selected_value'"
if [[ $launch_flag == "1" ]]; then
ghostty --class="$window_class" --window-padding-x="$window_padding_x" \
--keybind="ctrl+c=quit" \
-e "${BASH_SOURCE[0]}" "${launch_args[@]}"
launch && exit 0
else
# Load colors if they haven't been loaded already.