aboutsummaryrefslogtreecommitdiff
path: root/dot_config/hypr/config/binds.lua
diff options
context:
space:
mode:
authorpablu <me@pablu.de>2026-09-17 17:05:03 +0200
committerpablu <me@pablu.de>2026-09-17 17:05:03 +0200
commitf8312a59c775c740d9af173fafa65ab7e731e03e (patch)
treea54a9274376f20bbb35f07bccfeab8aef542fa0e /dot_config/hypr/config/binds.lua
parent0716da5eef605977b804f34f265979cf39be844b (diff)
update codex config to not contain local project dirs, update .tmux.conf only for gentoo, make tmux work with hyprland
Diffstat (limited to 'dot_config/hypr/config/binds.lua')
-rw-r--r--dot_config/hypr/config/binds.lua54
1 files changed, 40 insertions, 14 deletions
diff --git a/dot_config/hypr/config/binds.lua b/dot_config/hypr/config/binds.lua
index a5a9e6b..a72777f 100644
--- a/dot_config/hypr/config/binds.lua
+++ b/dot_config/hypr/config/binds.lua
@@ -52,6 +52,28 @@ local function ask_direct_nvim(win, direction)
return response:find("success", 1, true) ~= nil
end
+local function ask_tmux(win, direction)
+ local pid = tonumber(win.pid)
+
+ if not pid then
+ return false
+ end
+
+ local helper = (os.getenv("HOME") or "")
+ .. "/.config/hypr/scripts/tmux-smart-nav"
+
+ local handle = io.popen(string.format("%s %s %d", helper, direction, pid))
+
+ if not handle then
+ return false
+ end
+
+ local result = handle:read("*a")
+ handle:close()
+
+ return result:find("handled", 1, true) ~= nil
+end
+
local function smart_nav(direction)
return function()
local win = hl.get_active_window()
@@ -67,25 +89,29 @@ local function smart_nav(direction)
local title = (win.title or ""):lower()
- if title == "herdr" then
+ if ask_tmux(win, direction) then
+ return
+ end
+
+ -- Herdr now uses changing window titles. The helper checks whether its
+ -- foreground client belongs to this terminal before attempting navigation.
+ local pid = tonumber(win.pid)
+ if pid then
local helper = (os.getenv("HOME") or "")
.. "/.config/hypr/scripts/herdr-smart-nav"
+ local handle = io.popen(string.format("%q %s %d", helper, direction, pid))
- local handle = io.popen(helper .. " " .. direction)
+ if handle then
+ local result = handle:read("*a"):match("^%s*(.-)%s*$")
+ handle:close()
- if not handle then
- focus_hyprland(direction)
- return
+ if result == "handled" then
+ return
+ elseif result == "hyprland" then
+ focus_hyprland(direction)
+ return
+ end
end
-
- local result = handle:read("*a")
- handle:close()
-
- if result:find("hyprland", 1, true) then
- focus_hyprland(direction)
- end
-
- return
end
if is_direct_nvim(title) and ask_direct_nvim(win, direction) then