-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbindings.hypr.lua.example
More file actions
29 lines (26 loc) · 1.24 KB
/
Copy pathbindings.hypr.lua.example
File metadata and controls
29 lines (26 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- Mesh Peek — paste into ~/.config/hypr/bindings.lua
-- Files focused → copy selection then open; otherwise newest-folder confirm picker.
local function meshpeek_open()
return function()
local win = hl.get_active_window()
local class = win and (win.class or win.initialClass or "") or ""
local in_files = type(class) == "string" and class:find("Nautilus") ~= nil
local home = os.getenv("HOME") or ""
local script = home .. "/.config/omarchy/plugins/io.github.monomyth.meshpeek/scripts/open.sh"
if in_files then
hl.dispatch(hl.dsp.exec_cmd("wl-copy --clear"))
hl.timer(function()
hl.dispatch(hl.dsp.send_key_state({ mods = "CTRL", key = "C", state = "down" }))
hl.timer(function()
hl.dispatch(hl.dsp.send_key_state({ mods = "CTRL", key = "C", state = "up" }))
hl.timer(function()
hl.dispatch(hl.dsp.exec_cmd("bash " .. script .. " from-clipboard"))
end, { timeout = 100, type = "oneshot" })
end, { timeout = 50, type = "oneshot" })
end, { timeout = 40, type = "oneshot" })
else
hl.dispatch(hl.dsp.exec_cmd("bash " .. script .. " view"))
end
end
end
o.bind("SUPER + SHIFT + CTRL + V", "Mesh Peek", meshpeek_open(), { release = true })