asmvik / asmvik/skhd

Bring desktop to foreground and move focus

Open
#303 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.1k
Forks
241
PR merge metrics
No merged PRs in 30d

Description

Hey! First of all, awesome project. I've been tinkering around with it in the past few days and it's been a blast.

I have the following configuration to both switch to a specific desktop and switch the focus as well:

```
# move focus to space #
hyper - 1 : osascript -e 'tell application "System Events" to key code 18 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 1 | jq .display); yabai -m space --focus 1
hyper - 2 : osascript -e 'tell application "System Events" to key code 19 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 2 | jq .display); yabai -m space --focus 2
hyper - 3 : osascript -e 'tell application "System Events" to key code 20 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 3 | jq .display); yabai -m space --focus 3
hyper - 4 : osascript -e 'tell application "System Events" to key code 21 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 4 | jq .display); yabai -m space --focus 4
hyper - 5 : osascript -e 'tell application "System Events" to key code 23 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 5 | jq .display); yabai -m space --focus 5
hyper - 6 : osascript -e 'tell application "System Events" to key code 22 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 6 | jq .display); yabai -m space --focus 6
hyper - 7 : osascript -e 'tell application "System Events" to key code 26 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 7 | jq .display); yabai -m space --focus 7
hyper - 8 : osascript -e 'tell application "System Events" to key code 28 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 8 | jq .display); yabai -m space --focus 8
hyper - 9 : osascript -e 'tell application "System Events" to key code 25 using control down'; yabai -m display --focus $(yabai -m query --spaces --space 9 | jq .display); yabai -m space --focus 9
```

This is working great, other than for desktops 7, 8 and 9.

I have 4 displays all together. The desktops are divided as follows:
macos display: desktop 1, 2, 3, 4
external display number 1: desktop 5
external display number 2: desktop 6, 7
external display number 3: desktop 8, 9

I'm pretty sure this is a MacOS issue since ctrl+number isn't working on its own for numbers 7-9, but I was wondering if there is a better way to achieve bringing desktop to foreground + move focus using skhd.

Thanks in advance!

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository files, tests, or code entry points are mentioned. Reproduce the skhd bindings and the macOS shortcuts for spaces 7–9, then inspect how skhd could support bringing a space and its display to the foreground; done means a documented or implemented approach that works for the described multi-display layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos, shell
Domain
desktop, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.