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
2 changes: 1 addition & 1 deletion mac-manual/content/06-keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ On Macs with an ambient light sensor, the keyboard backlight follows the room: l

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.

Swipe sideways with three fingers to move between workspaces, as in macOS. 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`:
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`:

```lua
omarchy_workspace_gesture = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ for _, gesture in ipairs(o.registered_gestures or {}) do
end
end

-- Step by number, so the swipe reaches empty workspaces as Spaces do in macOS.
-- Hyprland's default steps only through workspaces that exist and never out of
-- an empty one into a new one. A user's own gesture keeps Hyprland's stepping.
hl.config({ gestures = { workspace_swipe_use_r = true } })
hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
19 changes: 19 additions & 0 deletions test/shell.d/hyprland-apple-workspace-gesture-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ end

hl = setmetatable({
dsp = proxy(),
config = function(config)
if config.gestures and config.gestures.workspace_swipe_use_r ~= nil then
use_r = config.gestures.workspace_swipe_use_r
end
end,
gesture = function(gesture)
local direction = gesture.direction:lower()
direction = aliases[direction] or direction
Expand Down Expand Up @@ -110,6 +115,9 @@ hl = setmetatable({
})

dofile(os.getenv("HOME") .. "/.config/hypr/hyprland.lua")
if os.getenv("SHOW_USE_R") then
print("workspace_swipe_use_r " .. tostring(use_r == true))
end
LUA
}

Expand Down Expand Up @@ -157,6 +165,17 @@ output=$(load_config apple 'omarchy_workspace_gesture = false')
[[ -z $output ]] || fail "omarchy_workspace_gesture = false turns the default off" "$output"
pass "omarchy_workspace_gesture = false turns the default off"

[[ $(SHOW_USE_R=1 load_config apple) == "$swipe"$'\nworkspace_swipe_use_r true' ]] ||
fail "a Mac swipe steps by number, into empty workspaces" "$(SHOW_USE_R=1 load_config apple)"
[[ $(SHOW_USE_R=1 load_config other) == "workspace_swipe_use_r false" ]] ||
fail "x86 and Snapdragon keep Hyprland's own workspace stepping" "$(SHOW_USE_R=1 load_config other)"
output=$(SHOW_USE_R=1 load_config apple "$shipped_line")
[[ $output == "$swipe"$'\nworkspace_swipe_use_r false' ]] ||
fail "a user's own workspace gesture keeps Hyprland's stepping" "$output"
output=$(SHOW_USE_R=1 load_config apple 'omarchy_workspace_gesture = false')
[[ $output == "workspace_swipe_use_r false" ]] || fail "turning the Mac gesture off keeps Hyprland's stepping" "$output"
pass "the Mac swipe steps into empty workspaces; a user's own gesture keeps Hyprland's stepping"

grep -Fq 'omarchy_workspace_gesture = false' "$ROOT/mac-manual/content/06-keyboard.md" ||
fail "the manual documents how to turn the Mac gesture off"
pass "the manual documents how to turn the Mac gesture off"
Loading