diff --git a/hypr/hyprland/mcsr.lua b/hypr/hyprland/mcsr.lua new file mode 100644 index 0000000..4ded7f4 --- /dev/null +++ b/hypr/hyprland/mcsr.lua @@ -0,0 +1,53 @@ +local function mcsr_submap(window, active) + if window ~= nil and window.class ~= nil and window.class:find("Minecraft") then + hl.dispatch(hl.dsp.submap("mcsr")) + else + hl.dispatch(hl.dsp.submap("reset")) + end +end +hl.on("window.active", mcsr_submap) +hl.bind("mouse:275", function() mcsr_submap(hl.get_active_window(), nil) end) + +local function remap(from, to) + hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "down"}), {transparent = true}) + hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "up"}), {transparent = true, release = true}) +end + +-- #MCSR +hl.define_submap("mcsr", function() + -- Tall macro + hl.bind("KP_END", hl.dsp.window.fullscreen_state({internal = 0, client = 0})) + hl.bind("KP_END", hl.dsp.window.float({action = "on"})) + hl.bind("KP_END", hl.dsp.window.resize({x = 1920, y = 16384})) + hl.bind("KP_END", hl.dsp.window.move({x = 600, y = -7472})) + hl.bind("KP_END", hl.dsp.exec_cmd("quickshell ipc call boateye open")) + + -- Thin macro + hl.bind("KP_DOWN", hl.dsp.window.fullscreen_state({internal = 0, client = 0})) + hl.bind("KP_DOWN", hl.dsp.window.float({action = "on"})) + hl.bind("KP_DOWN", hl.dsp.window.resize({x = 400, y = 1420})) + hl.bind("KP_DOWN", hl.dsp.window.center()) + + -- Wide macro + hl.bind("KP_NEXT", hl.dsp.window.fullscreen_state({internal = 0, client = 0})) + hl.bind("KP_NEXT", hl.dsp.window.float({action = "on"})) + hl.bind("KP_NEXT", hl.dsp.window.resize({x = 2540, y = 400})) + hl.bind("KP_NEXT", hl.dsp.window.center()) + + -- Close boateye + -- FIXME: use hl.on() to couple this to the actions of fullscreening/floating + -- instead of the keybinds + hl.bind("SUPER + F", hl.dsp.exec_cmd("quickshell ipc call boateye close")) + hl.bind("SUPER + M", hl.dsp.exec_cmd("quickshell ipc call boateye close")) + + -- Search crafting mappings + remap("mouse:275", "f3") + remap("SHIFT + mouse:275", "f3") + remap("1", "apostrophe") + remap("apostrophe", "1") + remap("k", "0") + remap("semicolon", "w") + remap("j", "v") + + hl.bind("SUPER_L", hl.dsp.submap("reset")) +end) diff --git a/hypr/hyprland/rules.lua b/hypr/hyprland/rules.lua index 280f6b4..6d71cad 100644 --- a/hypr/hyprland/rules.lua +++ b/hypr/hyprland/rules.lua @@ -41,6 +41,13 @@ hl.window_rule({ float = true, center = true }) +hl.window_rule({ + match = { + class = "ninjabrainbot-Main" + }, + float = true, + move = {10, "monitor_h*0.5 - window_h*0.5"} +}) hl.window_rule({ match = { class = "(mpv|loupe|com.gabm.satty)"