local apps = require("modules.apps") local commands = require("modules.commands") local osd = require("modules.hypr_osd") local workspaces = require("modules.workspaces") local mod = "SUPER" local function bind(key, action, description, opts) opts = opts or {} opts.description = opts.description or description return hl.bind(key, commands.to_dispatcher(action), opts) end bind(mod .. " + Return", apps.terminal, "terminal: wezterm") bind(mod .. " + Space", apps.launcher, "launcher: hyprlauncher") bind(mod .. " + B", apps.browser, "browser: firefox") bind(mod .. " + E", apps.file_manager, "files: yazi") bind(mod .. " + N", apps.wifi, "wifi: impala") bind(mod .. " + U", apps.bluetooth, "bluetooth: bluetui") bind(mod .. " + Q", hl.dsp.window.close(), "close window") bind(mod .. " + V", apps.clipboard, "clipboard history") bind(mod .. " + ALT + L", osd.session.lock, "lock") bind(mod .. " + ALT + S", osd.session.suspend, "lock + suspend") bind(mod .. " + SHIFT + R", osd.session.reload, "reload hypr") bind(mod .. " + Escape", osd.notifications.clear_all, "dismiss notifications") bind("CTRL + ALT + Delete", apps.logout, "graceful hyprland logout") bind(mod .. " + H", hl.dsp.focus({ direction = "left" }), "focus left") bind(mod .. " + L", hl.dsp.focus({ direction = "right" }), "focus right") bind(mod .. " + K", hl.dsp.focus({ direction = "up" }), "focus up") bind(mod .. " + J", hl.dsp.focus({ direction = "down" }), "focus down") bind(mod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }), "move left") bind(mod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }), "move right") bind(mod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }), "move up") bind(mod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }), "move down") bind(mod .. " + CTRL + H", hl.dsp.window.resize({ x = -24, y = 0, relative = true }), "resize left") bind(mod .. " + CTRL + L", hl.dsp.window.resize({ x = 24, y = 0, relative = true }), "resize right") bind(mod .. " + CTRL + K", hl.dsp.window.resize({ x = 0, y = -24, relative = true }), "resize up") bind(mod .. " + CTRL + J", hl.dsp.window.resize({ x = 0, y = 24, relative = true }), "resize down") bind(mod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), "fullscreen") bind(mod .. " + T", hl.dsp.window.float({ action = "toggle" }), "toggle floating") bind(mod .. " + P", hl.dsp.window.pseudo({ action = "toggle" }), "pseudo tile") bind(mod .. " + G", hl.dsp.group.toggle(), "toggle group") bind(mod .. " + SHIFT + G", hl.dsp.group.next(), "next group tab") for _, ws in ipairs(workspaces.list) do bind(mod .. " + " .. ws.key, hl.dsp.focus({ workspace = ws.id }), "workspace " .. ws.name) bind(mod .. " + SHIFT + " .. ws.key, hl.dsp.window.move({ workspace = ws.id }), "move to " .. ws.name) end bind(mod .. " + SHIFT + V", hl.dsp.window.move({ workspace = "special:scratch" }), "send to scratch") bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }), "workspace next") bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }), "workspace prev") bind(mod .. " + mouse:272", hl.dsp.window.drag(), "drag window", { mouse = true }) bind(mod .. " + mouse:273", hl.dsp.window.resize(), "resize window", { mouse = true }) bind("XF86AudioRaiseVolume", osd.controls.volume_up, "volume up", { locked = true, repeating = true }) bind("XF86AudioLowerVolume", osd.controls.volume_down, "volume down", { locked = true, repeating = true }) bind("XF86AudioMute", osd.controls.mute, "mute", { locked = true }) bind("XF86AudioMicMute", osd.controls.mic_mute, "mic mute", { locked = true }) bind("XF86MonBrightnessUp", osd.controls.brightness_up, "brightness up", { locked = true, repeating = true }) bind("XF86MonBrightnessDown", osd.controls.brightness_down, "brightness down", { locked = true, repeating = true }) bind("XF86AudioNext", osd.controls.media_next, "media next", { locked = true }) bind("XF86AudioPause", osd.controls.media_toggle, "media play/pause", { locked = true }) bind("XF86AudioPlay", osd.controls.media_toggle, "media play/pause", { locked = true }) bind("XF86AudioPrev", osd.controls.media_prev, "media prev", { locked = true }) bind("Print", osd.capture.region(apps.screenshot_region), "screenshot region") bind("SHIFT + Print", osd.capture.window(apps.screenshot_window), "screenshot window") bind("CTRL + Print", osd.capture.output(apps.screenshot_output), "screenshot output") bind(mod .. " + Print", osd.capture.annotate(apps.screenshot_annotate), "screenshot annotate") bind(mod .. " + SHIFT + Print", osd.capture.color("hyprpicker -a"), "pick color")