From 482543771ab2596ad4c3532d491c9c5e1ef41224 Mon Sep 17 00:00:00 2001 From: Franco Pellicciotti Date: Sat, 16 May 2026 22:43:47 -0400 Subject: [PATCH] Initial commit --- deep-focus.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 deep-focus.sh diff --git a/deep-focus.sh b/deep-focus.sh new file mode 100755 index 0000000..fcba483 --- /dev/null +++ b/deep-focus.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# @raycast.schemaVersion 1 +# @raycast.title Deep Focus +# @raycast.mode silent +# @raycast.packageName Focus Engine +# +# @raycast.argument1 { "type": "text", "placeholder": "Work, Home, Study, or Clear", "optional": false } + +PROFILE=$1 +HS_CLI="/opt/homebrew/bin/hs" + +PROFILE_LOWER=$(echo "$PROFILE" | tr '[:upper:]' '[:lower:]') + +if [ "$PROFILE_LOWER" = "clear" ] || [ "$PROFILE_LOWER" = "off" ]; then + $HS_CLI -c "ClearDeepFocus()" +else + # Format string to CamelCase (e.g., "work" -> "Work") + FIRST_LETTER=$(echo "${PROFILE:0:1}" | tr '[:lower:]' '[:upper:]') + REST_LETTERS=$(echo "${PROFILE:1}" | tr '[:upper:]' '[:lower:]') + TARGET_PROFILE="${FIRST_LETTER}${REST_LETTERS}" + + $HS_CLI -c "ActivateDeepFocus('${TARGET_PROFILE}')" +fi