Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mac-manual/content/06-keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ On Macs with an ambient light sensor, the keyboard backlight follows the room: l

## Trackpad

The built-in trackpad scrolls naturally, as in macOS, and tap-to-click is off, because a palm brushing the trackpad while typing would otherwise click. Click by pressing the trackpad. Change either in `~/.config/hypr/input.lua`, as [Keyboard, mouse, trackpad](https://omarchy.org/manual/keyboard-mouse-trackpad/) describes; a value you set yourself is kept.
The built-in trackpad scrolls naturally, as in macOS, and tap-to-click is off, because a palm brushing the trackpad while typing would otherwise click. Click by pressing the trackpad. Tapping is off for every touchpad on a Mac, an external one included. Change either in the `touchpad` section of `~/.config/hypr/input.lua`, as [Keyboard, mouse, trackpad](https://omarchy.org/manual/keyboard-mouse-trackpad/) describes; a value you set yourself is kept. To tap to click, set `tap_to_click = true` there (setup writes `tap_to_click = false` into that file on a new install), or add this line at the end of the file:

```lua
hl.config({ input = { touchpad = { tap_to_click = true } } })
```

Swipe sideways with three fingers to move between workspaces, as in macOS, including empty ones: swiping past the last workspace opens the next one. A three-finger sideways gesture of your own in `~/.config/hypr/input.lua` takes its place. To turn the swipe off, add this line to `~/.config/hypr/input.lua`:

Expand Down
2 changes: 1 addition & 1 deletion packages/omarchy-mac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ System setup also wraps Chromium, 1Password and Cursor where they are installed:

The Mac's desktop defaults live in the platform root, `/usr/share/omarchy-platform`, which Omarchy reads at that fixed path and ships nothing in, so Omarchy's own config carries no Apple branch. The three Lua files re-check the platform; the other three are data.

- `hypr/settings/apple.lua`, loaded after Omarchy's defaults and before the theme and the user's files: tap-to-click off on the built-in trackpad (`hl.device` for `apple-mtp-multi-touch` and `apple-spi-trackpad`; the same line with `tap_to_click = true` in `~/.config/hypr/input.lua` turns it back on), and workspace swipes stepping by number into empty workspaces (`workspace_swipe_use_r = true`; `false` in `~/.config/hypr/input.lua` turns it off). A runtime without the settings slot (no `default.hypr.platform` loader) gets it from `hypr/defaults/apple.lua` instead.
- `hypr/settings/apple.lua`, loaded after Omarchy's defaults and before the theme and the user's files: tap-to-click off (`hl.config` `input.touchpad.tap_to_click = false`, global rather than per device so the user's own global `tap_to_click = true` in `~/.config/hypr/input.lua` wins; an external touchpad on a Mac starts with tapping off too), and workspace swipes stepping by number into empty workspaces (`workspace_swipe_use_r = true`; `false` in `~/.config/hypr/input.lua` turns it off). A runtime without the settings slot (no `default.hypr.platform` loader) gets it from `hypr/defaults/apple.lua` instead.
- `hypr/defaults/apple.lua`, loaded before Omarchy's defaults: with Omarchy's default bindings, the SMC lid switch ("Apple SMC power/lid events", which Omarchy's "Lid Switch" binds never match), capture on SUPER+F10-F12 and the same chords on the top row's media keys (no Print Screen key), and Shift+brightness on the keyboard backlight in place of Omarchy's display maximum and minimum; and a bind decorator that makes a menu or panel typed on the MacBook's own keyboard open on the built-in screen, apps and the pasting pickers staying on the focused one.
- `hypr/gestures/apple-gestures.lua`, loaded after the user's files: the three-finger workspace swipe, unless the user set a three-finger sideways gesture of their own or `omarchy_workspace_gesture = false` in `~/.config/hypr/input.lua`, so Hyprland never sees a duplicate.
- `key-names`: the keybindings menu shows `XF86MonBrightnessUp` and `Down` as the F2 and F1 they are.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ if not (o and o.shell_succeeds and o.shell_succeeds("omarchy-hw-apple-silicon"))
end

-- The built-in trackpad clicks physically; Asahi's disable-while-typing does
-- not stop stray taps, so tap-to-click stays off. The user's input.lua can turn
-- it back on with the same line and tap_to_click = true.
hl.device({ name = "apple-mtp-multi-touch", tap_to_click = false })
hl.device({ name = "apple-spi-trackpad", tap_to_click = false })
-- not stop stray taps, so tap-to-click stays off. It is set with hl.config, as
-- anything a user may set globally is: Hyprland lets an hl.device value beat
-- the global one whatever the order, so a per-device default would keep the
-- user's own global tap_to_click = true from working. An external touchpad on
-- a Mac starts with tapping off too.
hl.config({ input = { touchpad = { tap_to_click = false } } })

-- A workspace swipe steps by number, so it reaches empty workspaces as Spaces
-- do in macOS. Hyprland's default steps only through workspaces that exist and
Expand Down
33 changes: 20 additions & 13 deletions test/shell.d/apple-platform-hooks-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ chmod +x "$tmpdir"/*-bin/omarchy-hw-apple-silicon

# Loads the runtime's hyprland.lua against a user's ~/.config/hypr and prints
# every bind ("bind<TAB>keys<TAB>command", "global <name>" for the shell's
# global shortcut, or "focus <keyboards>" for a bind scoped to keyboards) and
# device setting ("device<TAB>name<TAB>tap_to_click").
# global shortcut, or "focus <keyboards>" for a bind scoped to keyboards), every
# device setting ("device<TAB>name") and every global tap-to-click setting
# ("tap_to_click<TAB>value").
load_config() {
local platform=$1 staged=${2:-$packaged} edit=${3:-} home platform_vars
mapfile -t platform_vars < <(platform_env "$staged")
Expand Down Expand Up @@ -82,7 +83,13 @@ hl = setmetatable({
end
end,
unbind = function(keys) print("unbind\t" .. keys) end,
device = function(device) print("device\t" .. device.name .. "\t" .. tostring(device.tap_to_click)) end,
device = function(device) print("device\t" .. device.name) end,
config = function(config)
local touchpad = config.input and config.input.touchpad
if touchpad and touchpad.tap_to_click ~= nil then
print("tap_to_click\t" .. tostring(touchpad.tap_to_click))
end
end,
get_config = function() return nil end,
get_active_window = function() return nil end,
get_monitors = function() return {} end,
Expand Down Expand Up @@ -120,28 +127,28 @@ bound "$apple" "SHIFT + XF86MonBrightnessUp" "omarchy-brightness-keyboard up" &&
fail "Shift+brightness drives a Mac's keyboard backlight" "$apple"
(( $(grep -c $'^bind\tSHIFT + XF86MonBrightnessUp\t' <<<"$apple") == 1 )) ||
fail "the Mac's Shift+brightness replaces Omarchy's display maximum instead of joining it" "$apple"
grep -Fxq $'device\tapple-mtp-multi-touch\tfalse' <<<"$apple" && grep -Fxq $'device\tapple-spi-trackpad\tfalse' <<<"$apple" ||
fail "a Mac's built-in trackpad does not tap to click" "$apple"
# A runtime with the settings slot loads settings/apple.lua itself; an older
# one gets it through defaults/apple.lua. Either way each device is set once.
(( $(grep -c $'^device\tapple-spi-trackpad\t' <<<"$apple") == 1 && $(grep -c $'^device\tapple-mtp-multi-touch\t' <<<"$apple") == 1 )) ||
fail "the Mac's trackpad settings load once" "$apple"
# one gets it through defaults/apple.lua. Either way tapping is turned off once,
# globally, and no device setting outranks the user's global one.
[[ $(grep '^tap_to_click' <<<"$apple") == $'tap_to_click\tfalse' ]] ||
fail "a Mac's touchpads do not tap to click, set once" "$apple"
! grep -q '^device' <<<"$apple" || fail "the Mac sets no per-device value the user's global one could not replace" "$apple"
if [[ -f $runtime/default/hypr/platform.lua ]]; then
trackpad_line=$(grep -n $'^device\tapple-spi-trackpad\t' <<<"$apple" | cut -d: -f1)
trackpad_line=$(grep -n '^tap_to_click' <<<"$apple" | cut -d: -f1)
terminal_line=$(grep -n $'^bind\tSUPER + RETURN\t' <<<"$apple" | cut -d: -f1)
[[ -n $trackpad_line && -n $terminal_line ]] && (( trackpad_line > terminal_line )) ||
fail "with the settings slot, the Mac's trackpad settings follow Omarchy's defaults" "$apple"
fi
pass "a Mac gets its lid switch, capture chords, keyboard backlight chords and trackpad from omarchy-mac"

tapping=$(load_config apple "$packaged" 'hl.device({ name = "apple-spi-trackpad", tap_to_click = true })') ||
tapping=$(load_config apple "$packaged" 'hl.config({ input = { touchpad = { tap_to_click = true } } })') ||
fail "the config loads with the user's tap-to-click" "$tapping"
[[ $(grep $'^device\tapple-spi-trackpad\t' <<<"$tapping" | tail -n 1) == $'device\tapple-spi-trackpad\ttrue' ]] ||
fail "the user's input.lua turns tap-to-click back on" "$tapping"
[[ $(grep '^tap_to_click' <<<"$tapping") == $'tap_to_click\tfalse\ntap_to_click\ttrue' ]] ||
fail "the user's global tap_to_click = true in input.lua comes after the Mac's and wins" "$tapping"
pass "the user's input.lua replaces the Mac's trackpad settings"

for output in "$other" "$bare"; do
! grep -q 'Apple SMC\|omarchy-capture-screenshot \(fullscreen\|region\|windows\)$\|SHIFT + XF86MonBrightness.*brightness-keyboard\|^device\|focus apple' <<<"$output" ||
! grep -q 'Apple SMC\|omarchy-capture-screenshot \(fullscreen\|region\|windows\)$\|SHIFT + XF86MonBrightness.*brightness-keyboard\|^device\|^tap_to_click\|focus apple' <<<"$output" ||
fail "no Mac default without a Mac or without omarchy-mac" "$output"
bound "$output" "SHIFT + XF86MonBrightnessUp" "omarchy-brightness-display 100%" || fail "Omarchy's Shift+brightness stays elsewhere" "$output"
bound "$output" "PRINT" "omarchy-capture-screenshot" || fail "Omarchy's own capture bind stays" "$output"
Expand Down
Loading