Files

119 lines
5.8 KiB
Lua

-- Set default applications
local terminal = "kitty"
local fileManager = "nautilus"
local menu = "wofi --show drun, run"
local lockscreen = "hyprlock"
-- open Software
hl.bind("SUPER + SHIFT + Q", hl.dsp.exec_cmd("firefox"))
hl.bind("SUPER+RETURN", hl.dsp.exec_cmd(terminal))
hl.bind("SUPER+D", hl.dsp.exec_cmd(menu))
hl.bind("SUPER+E", hl.dsp.exec_cmd(fileManager))
hl.bind("SUPER+L", hl.dsp.exec_cmd(lockscreen), { locked = true })
-- Hyprland hl.binds
-- Manipulating Windows/Software
hl.bind("SUPER+W", hl.dsp.window.close())
hl.bind("SUPER+Q", hl.dsp.window.close())
hl.bind("SUPER+SHIFT+Q", hl.dsp.window.kill())
hl.bind("SUPER+F", hl.dsp.window.fullscreen("maximized", "toggle"))
hl.bind("SUPER+V", hl.dsp.window.float({ action = "toggle" }))
hl.bind("SUPER+SHIFT+D", hl.dsp.window.pseudo)
-- Interacting with Workspaces
for i = 1, 9 do
if not (HOSTNAME == "honney-main" and i >= 1 and i <= 4) then
hl.bind("SUPER+" .. tostring(i), hl.dsp.focus({ workspace = tostring(i) }))
hl.bind("SUPER+CTRL+" .. tostring(i), hl.dsp.window.move({workspace = tostring(i), follow = false}))
hl.bind("SUPER+SHIFT+" .. tostring(i), hl.dsp.window.move({workspace = tostring(i), follow = true}))
end
end
hl.bind("SUPER+0", hl.dsp.focus({ workspace = "10" }))
hl.bind("SUPER+CTRL+0", hl.dsp.window.move({workspace = "10", follow = false}))
hl.bind("SUPER+SHIFT+0", hl.dsp.window.move({workspace = "10", follow = true}))
hl.bind("SUPER+F1", hl.dsp.focus({ workspace = "401" }))
hl.bind("SUPER+CTRL+F1", hl.dsp.window.move({workspace = "401", follow = false}))
hl.bind("SUPER+SHIFT+F1", hl.dsp.window.move({workspace = "401", follow = true}))
-- Scrolling
hl.bind("SUPER+CTRL+left", hl.dsp.layout("move -col"))
hl.bind("SUPER+CTRL+right", hl.dsp.layout("move +col"))
hl.bind("SUPER+mouse_left", hl.dsp.layout("move -col"))
hl.bind("SUPER+mouse_right", hl.dsp.layout("move +col"))
hl.bind("SUPER+CTRL+SHIFT+left", hl.dsp.layout("swapcol l"))
hl.bind("SUPER+CTRL+SHIFT+right", hl.dsp.layout("swapcol r"))
-- -- Resizing windows
-- hl.bind("SUPER+SHIFT+right", "resizeactive", "30 0")
-- hl.bind("SUPER+SHIFT+left", "resizeactive", "-30 0")
-- hl.bind("SUPER+SHIFT+up", "resizeactive", "0 -30")
-- hl.bind("SUPER+SHIFT+down", "resizeactive", "0 30")
-- Mouse Commands for moving windows
hl.bind("SUPER+mouse_down", hl.dsp.focus({ workspace = "e+1", on_current_monitor = false }))
hl.bind("SUPER+mouse_up", hl.dsp.focus({ workspace = "e+1", on_current_monitor = false }))
hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true })
hl.bind("SUPER + SHIFT + mouse:272", hl.dsp.window.resize(), { mouse = true })
-- Move between workspaces/screens
hl.bind("SUPER+left" , hl.dsp.focus({ direction = "l" }))
hl.bind("SUPER+right", hl.dsp.focus({ direction = "r" }))
hl.bind("SUPER+up" , hl.dsp.focus({ direction = "u" }))
hl.bind("SUPER+down" , hl.dsp.focus({ direction = "d" }))
hl.bind("SUPER+TAB" , hl.dsp.focus({ workspace = "e+1", on_current_monitor = false }))
-- Screenshots
hl.bind("SUPER+P", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot/screenshot_window.sh"))
hl.bind("SUPER+ALT+P", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot/screenshot_monitor.sh"))
hl.bind("SUPER+SHIFT+P", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot/screenshot_area.sh"))
hl.bind("SUPER+SHIFT+S", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot/screenshot_area_2.sh"))
-- Audio Control
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"))
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"))
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"))
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"))
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause || playerctl play-pause"))
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"))
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"))
-- German Umlaute
hl.bind("SUPER+a", hl.dsp.exec_cmd("wtype \"ä\""))
hl.bind("SUPER+SHIFT+a", hl.dsp.exec_cmd("wtype \"Ä\""))
hl.bind("SUPER+o", hl.dsp.exec_cmd("wtype \"ö\""))
hl.bind("SUPER+SHIFT+o", hl.dsp.exec_cmd("wtype \"Ö\""))
hl.bind("SUPER+u", hl.dsp.exec_cmd("wtype \"ü\""))
hl.bind("SUPER+SHIFT+u", hl.dsp.exec_cmd("wtype \"Ü\""))
hl.bind("SUPER+s", hl.dsp.exec_cmd("wtype \"ß\""))
hl.bind("SUPER+SHIFT+e", hl.dsp.exec_cmd("wtype \"\""))
-- Opening coder
hl.bind("SUPER+SHIFT+C", hl.dsp.exec_cmd("code --password-store=gnome-libsecret"))
hl.bind("SUPER+SHIFT+V", hl.dsp.exec_cmd("vscodium"))
-- device specifics
if HOSTNAME == "honney-main" then
for i = 1, 12 do
hl.bind("SUPER+SHIFT+CTRL+F"..tostring(i), hl.dsp.exec_cmd("~/.config/hypr/scripts/makropad/button"..string.format("%02d", i)..".sh"))
end
hl.bind("ALT+T", hl.dsp.exec_cmd("~/.config/hypr/scripts/writing/todo.sh"))
hl.bind("ALT+Y", hl.dsp.exec_cmd("~/.config/hypr/scripts/writing/tmdb.sh"))
end
if HOSTNAME == "honney-main" then
local script = "~/.config/hypr/scripts/cycle_workspace.sh"
for i = 1, 4 do
hl.bind("SUPER+" .. i, hl.dsp.exec_cmd(script .. " " .. i .. " focus"))
hl.bind("SUPER+CTRL+" .. i, hl.dsp.exec_cmd(script .. " " .. i .. " move"))
hl.bind("SUPER+SHIFT+" .. i, hl.dsp.exec_cmd(script .. " " .. i .. " move_follow"))
end
end
-- Quickshell
hl.bind("SUPER + SHIFT + W", hl.dsp.global("quickshell:Wallpaper"))
hl.bind("SUPER + SHIFT + J", hl.dsp.global("quickshell:JLearner"))
hl.bind("SUPER + SHIFT + L", hl.dsp.global("quickshell:WLogout"))