mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Prevent modifier keys being stuck on Super + C / V / X
This commit is contained in:
@@ -1 +1 @@
|
||||
command = 'wl-copy && (hyprctl dispatch "hl.dsp.send_shortcut({ mods = \"SHIFT\", key = \"Insert\" })" || hyprctl dispatch sendshortcut "SHIFT, Insert,")'
|
||||
command = 'wl-copy && ((hyprctl dispatch "hl.dsp.send_key_state({ mods = \"SHIFT\", key = \"Insert\", state = \"down\", window = \"activewindow\" })" && sleep 0.05 && hyprctl dispatch "hl.dsp.send_key_state({ mods = \"SHIFT\", key = \"Insert\", state = \"up\", window = \"activewindow\" })") || hyprctl dispatch sendshortcut "SHIFT, Insert, activewindow")'
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
hl.bind("SUPER + C", hl.dsp.send_shortcut({ mods = "CTRL", key = "Insert" }), { description = "Universal copy" })
|
||||
hl.bind("SUPER + V", hl.dsp.send_shortcut({ mods = "SHIFT", key = "Insert" }), { description = "Universal paste" })
|
||||
hl.bind("SUPER + X", hl.dsp.send_shortcut({ mods = "CTRL", key = "X" }), { description = "Universal cut" })
|
||||
-- Work around Hyprland send_shortcut sometimes leaving synthetic key state stuck/repeating.
|
||||
-- https://github.com/hyprwm/Hyprland/discussions/14099
|
||||
local function send_shortcut_once(mods, key)
|
||||
return function()
|
||||
hl.dispatch(hl.dsp.send_key_state({ mods = mods, key = key, state = "down", window = "activewindow" }))
|
||||
|
||||
hl.timer(function()
|
||||
hl.dispatch(hl.dsp.send_key_state({ mods = mods, key = key, state = "up", window = "activewindow" }))
|
||||
end, { timeout = 50, type = "oneshot" })
|
||||
end
|
||||
end
|
||||
|
||||
hl.bind("SUPER + C", send_shortcut_once("CTRL", "Insert"), { description = "Universal copy" })
|
||||
hl.bind("SUPER + V", send_shortcut_once("SHIFT", "Insert"), { description = "Universal paste" })
|
||||
hl.bind("SUPER + X", send_shortcut_once("CTRL", "X"), { description = "Universal cut" })
|
||||
hl.bind("SUPER + CTRL + V", hl.dsp.exec_cmd("omarchy-launch-walker -m clipboard"), { description = "Clipboard manager" })
|
||||
|
||||
Reference in New Issue
Block a user