Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions config/hypr/hyprland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ dofile((os.getenv("OMARCHY_PATH") or "/usr/share/omarchy") .. "/default/hypr/boo
-- Or disable only bindings for Omarchy's preinstalled apps/web apps while
-- keeping core window-manager bindings:
-- omarchy_preinstalled_bindings = false
--
-- Disable Omarchy's default touchpad gestures. Add your own in hypr/input.lua.
-- omarchy_default_gestures = false

-- Load Omarchy defaults.
require("default.hypr.omarchy")
Expand Down
12 changes: 7 additions & 5 deletions config/hypr/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
-- -- Enable the touchpad while typing.
-- disable_while_typing = false,
--
-- -- Left-click-and-drag with three fingers.
-- -- Left-click-and-drag with three fingers. Turn off Omarchy's
-- -- three-finger gestures with omarchy_default_gestures = false first.
-- drag_3fg = 1,
-- },
-- },
Expand All @@ -49,10 +50,11 @@
-- o.window("foot", { scroll_touchpad = 2.0 })
-- o.window("com.mitchellh.ghostty", { scroll_touchpad = 0.2 })

-- Enable touchpad gestures for changing workspaces.
-- Change one of Omarchy's touchpad gestures by unsetting it first, since
-- Hyprland rejects a second gesture on the same fingers and direction. This
-- makes a three-finger swipe move focus instead (helpful on scrolling layout).
-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/
-- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })

-- Enable touchpad gestures for moving focus (helpful on scrolling layout).
-- hl.gesture({ fingers = 3, direction = "left", action = "unset" })
-- hl.gesture({ fingers = 3, direction = "right", action = "unset" })
-- hl.gesture({ fingers = 3, direction = "left", action = function() hl.dispatch(hl.dsp.focus({ direction = "l" })) end })
-- hl.gesture({ fingers = 3, direction = "right", action = function() hl.dispatch(hl.dsp.focus({ direction = "r" })) end })
21 changes: 21 additions & 0 deletions default/hypr/gestures.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Touchpad gestures. See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/
--
-- Hyprland rejects a second gesture on the same fingers and direction, so
-- overriding one of these means unsetting it first:
-- hl.gesture({ fingers = 3, direction = "up", action = "unset" })
-- Or turn them all off with omarchy_default_gestures = false in hyprland.lua.

-- Swipe through workspaces, empty ones included. Workspace switches aren't
-- animated, so the switch lands when the swipe ends rather than dragging the
-- workspace along under the fingers.
hl.gesture({ fingers = 3, direction = "left", action = function() hl.dispatch(hl.dsp.focus({ workspace = "r-1" })) end })
hl.gesture({ fingers = 3, direction = "right", action = function() hl.dispatch(hl.dsp.focus({ workspace = "r+1" })) end })

-- Push up for the AI console, and pull down for the Omarchy menu.
hl.gesture({ fingers = 3, direction = "up", action = "special", workspace_name = "qconsole" })
hl.gesture({ fingers = 3, direction = "down", action = function() hl.dispatch(hl.dsp.global("omarchy:menu.root")) end })

-- Four fingers take the active window along to the neighbouring workspace.
hl.gesture({ fingers = 4, direction = "left", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r-1" })) end })
hl.gesture({ fingers = 4, direction = "right", action = function() hl.dispatch(hl.dsp.window.move({ workspace = "r+1" })) end })
hl.gesture({ fingers = 4, direction = "down", action = "fullscreen" })
3 changes: 3 additions & 0 deletions default/hypr/omarchy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if _G.omarchy_default_bindings ~= false then
require("default.hypr.bindings.dictation")
require_optional.module("default.hypr.bindings.applications")
end
if _G.omarchy_default_gestures ~= false then
require("default.hypr.gestures")
end
require("default.hypr.envs")
require("default.hypr.looknfeel")
require("default.hypr.qconsole")
Expand Down
17 changes: 15 additions & 2 deletions manual/34-keyboard-mouse-trackpad.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,25 @@ hl.config({

### Trackpad gestures

You can also turn on [touchpad gestures](https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/), like swiping with three fingers to change workspaces:
Swipe on the trackpad to move around the desktop:

| Gesture | Action |
| --- | --- |
| Three fingers left / right | Previous / next workspace, including empty ones |
| Three fingers up | Toggle the AI console |
| Three fingers down | Open the Omarchy menu |
| Four fingers left / right | Move the active window to the previous / next workspace |
| Four fingers down | Toggle fullscreen |

To change one, unset it in `~/.config/hypr/input.lua` before adding your own [touchpad gesture](https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/), since Hyprland won't take two gestures on the same fingers and direction:

```lua
hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
hl.gesture({ fingers = 3, direction = "up", action = "unset" })
hl.gesture({ fingers = 3, direction = "up", action = "fullscreen" })
```

To turn all of Omarchy's gestures off, set `omarchy_default_gestures = false` near the top of `~/.config/hypr/hyprland.lua`, before Omarchy's defaults load.

On Dell XPS laptops with a haptic touchpad, you can also set the click strength to low, mid, or high under _Trigger > Hardware > Touchpad Haptics_.

### Typing in Chinese, Japanese, and other languages
Expand Down
14 changes: 14 additions & 0 deletions migrations/1793179949.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
echo "Keep your own touchpad gestures instead of Omarchy's new defaults"

# Hyprland rejects a second gesture on the same fingers and direction, so
# gestures already set up in ~/.config/hypr would now fail against the defaults.
# Leave those setups as they were by turning the defaults off for them.
hypr_dir="$HOME/.config/hypr"
hyprland="$hypr_dir/hyprland.lua"

[[ -f $hyprland ]] || exit 0
grep -qE '^[[:space:]]*omarchy_default_gestures[[:space:]]*=' "$hyprland" && exit 0
grep -qE '^[[:space:]]*hl\.gesture[[:space:]]*\(' "$hypr_dir"/*.lua 2>/dev/null || exit 0
grep -q '^require("default.hypr.omarchy")' "$hyprland" || exit 0
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

sed -i 's/^require("default.hypr.omarchy")/-- Your own gestures replace Omarchy'"'"'s defaults.\nomarchy_default_gestures = false\n\n&/' "$hyprland"
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
Loading