Need help creating a new keymap
- Dominant language
- C
- Stars
- 8.1k
- Forks
- 241
- PR merge metrics
- No merged PRs in 30d
Description
I am on MacOs. I want to create a keymap, that on press
1. If firefox not running -> open it.
2. If firefox running, but not active -> activate it.
3. If firefox running, and active -> cycle through all the open firefox windows.
I've tried implementing this with applescript, but it is not working with skhd for some reason. Only 1 and 2 is working, but 3 is not working for some reason.
### skhdrc
```
alt - f : $HOME/firefox.sh
```
### firefox.sh
```
osascript -e '
tell application "System Events" to set appList to name of processes
if "Firefox" is not in appList then
do shell script "open -a Firefox"
else
tell application "Firefox"
if frontmost then
tell application "System Events"
keystroke "`" using {command down}
end tell
else
activate
end if
end tell
end if'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the skhdrc binding and the referenced firefox.sh script, then reproduce the keypress behavior on macOS with Firefox running in each stated condition. Check whether skhd invokes the script as expected and whether the AppleScript window-cycling action is reached; done means one keypress opens, activates, or cycles Firefox windows as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, shell
- Domain
- desktop-dev, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100