From 3324e669bbf361c51738948c636eeda3a65b8c72 Mon Sep 17 00:00:00 2001 From: The_miro Date: Sat, 4 Jul 2026 14:50:10 +0200 Subject: [PATCH] feat(hyprlua): spawn filepicker dialog at cursor via +at-cursor tag Add a dedicated at-cursor window rule (float + move to cursor) and point the Super+F / Super+Shift+F filepicker binds at it, so the zenity dialog opens centered on the mouse instead of mid-screen. Co-Authored-By: Claude Opus 4.8 --- desktopenvs/hyprlua/hypr/usr/binds.lua | 4 ++-- desktopenvs/hyprlua/hypr/usr/windowrules.lua | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/desktopenvs/hyprlua/hypr/usr/binds.lua b/desktopenvs/hyprlua/hypr/usr/binds.lua index 9812f40..279ef16 100644 --- a/desktopenvs/hyprlua/hypr/usr/binds.lua +++ b/desktopenvs/hyprlua/hypr/usr/binds.lua @@ -52,8 +52,8 @@ hl.bind(mainMod .. " + SHIFT + R", hl.dsp.exec_cmd("wofi --show drun")) hl.bind("CTRL + SHIFT + R", hl.dsp.exec_cmd(menu)) -- File picker dialog -> clipboard (path / contents) -hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("[tag +centered] ~/.config/scripts/filepicker-clipboard.sh path")) -hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("[tag +centered] ~/.config/scripts/filepicker-clipboard.sh content")) +hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("[tag +at-cursor] ~/.config/scripts/filepicker-clipboard.sh path")) +hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("[tag +at-cursor] ~/.config/scripts/filepicker-clipboard.sh content")) -- old: -- hl.bind(mainMod .. " + F", hl.dsp.exec_cmd("~/.config/scripts/wofi-file-search.sh")) -- hl.bind(mainMod .. " + SHIFT + F", hl.dsp.exec_cmd("~/.config/scripts/foldersearch.sh")) diff --git a/desktopenvs/hyprlua/hypr/usr/windowrules.lua b/desktopenvs/hyprlua/hypr/usr/windowrules.lua index bce7ac6..36fa420 100644 --- a/desktopenvs/hyprlua/hypr/usr/windowrules.lua +++ b/desktopenvs/hyprlua/hypr/usr/windowrules.lua @@ -73,6 +73,14 @@ hl.window_rule({ size = "(monitor_w*0.2) (monitor_h*0.2)", }) +-- filepicker — float centred at cursor +hl.window_rule({ + name = "at-cursor", + match = { tag = "at-cursor" }, + float = true, + move = "(cursor_x-(window_w/2)) (cursor_y-(window_h/2))", +}) + -- spotify floating hl.window_rule({ name = "spotify-float",