Skip to content

Commit 0cc57e1

Browse files
committed
add lowfi command
1 parent 315385d commit 0cc57e1

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

commands/media/lowfi/lowfi.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title Lowfi
6+
# @raycast.mode compact
7+
# @raycast.packageName Music
8+
9+
# Optional parameters:
10+
# @raycast.icon
11+
12+
export PATH="$HOME/.cargo/bin:$PATH"
13+
14+
# Check if lowfi is already running
15+
if pgrep -f "lowfi$" > /dev/null; then
16+
echo "Found existing lowfi process"
17+
18+
# Use AppleScript to find and focus the lowfi window
19+
osascript -e '
20+
-- First activate WezTerm application
21+
tell application "WezTerm" to activate
22+
23+
-- Then focus the specific window
24+
tell application "System Events"
25+
tell process "wezterm-gui"
26+
-- Get all windows
27+
set allWindows to every window
28+
repeat with w in allWindows
29+
if title of w contains "lowfi" then
30+
-- Try multiple methods to bring window to front
31+
set frontmost to true
32+
set value of attribute "AXMain" of w to true
33+
perform action "AXRaise" of w
34+
set position of w to {0, 40}
35+
-- Click the window to ensure focus
36+
click w
37+
return "Found and focused lowfi window"
38+
end if
39+
end repeat
40+
end tell
41+
end tell
42+
return "Could not find lowfi window"
43+
'
44+
else
45+
echo "Starting new lowfi instance"
46+
/Applications/WezTerm.app/Contents/MacOS/wezterm start -- lowfi
47+
fi

0 commit comments

Comments
 (0)