local main_mod = MainMod or 'SUPER' local task_e = TaskE or '' local utils = require('land.utils') local dropdown = require('land.tools.dropdown') local deskentry = require('land.tools.deskentry') ------------- -- Hyprland ------------- -- -- base -- hl.bind(main_mod .. ' + R', hl.dsp.reload_config()) hl.bind(main_mod .. ' + SHIFT + E', hl.dsp.exec_raw('tofi-power --height=240')) --hl.bind(main_mod .. ' + SHIFT + E', tofipower.dsp.run()) -- -- window -- hl.bind(main_mod .. ' + Q', hl.dsp.window.close()) hl.bind(main_mod .. ' + SHIFT + Q', hl.dsp.window.kill()) hl.bind(main_mod .. ' + F', hl.dsp.window.fullscreen { mode = 'maximized', action = 'toggle' }) hl.bind(main_mod .. ' + SHIFT + F', hl.dsp.window.fullscreen { mode = 'fullscreen', action = 'toggle' }) hl.bind(main_mod .. ' + SHIFT + P', hl.dsp.window.float { action = 'toggle' }) hl.bind(main_mod .. ' + mouse:272', hl.dsp.window.drag(), { mouse = true }) hl.bind(main_mod .. ' + mouse:273', hl.dsp.window.resize(), { mouse = true }) hl.bind(main_mod .. ' + SHIFT + mouse:273', hl.dsp.window.resize { keep_aspect_ratio = true }, { mouse = true }) hl.bind(main_mod .. ' + H', utils.layout_bind { monocle = hl.dsp.layout('cycleprev'), default = hl.dsp.focus { direction = 'l' }, }) hl.bind(main_mod .. ' + L', utils.layout_bind { monocle = hl.dsp.layout('cyclenext'), default = hl.dsp.focus { direction = 'r' } }) hl.bind(main_mod .. ' + J', hl.dsp.focus { direction = 'd' }) hl.bind(main_mod .. ' + K', hl.dsp.focus { direction = 'u' }) hl.bind(main_mod .. ' + SHIFT + H', utils.layout_bind { scrolling = hl.dsp.window.swap { direction = 'l' }, default = hl.dsp.window.move { direction = 'l' }, }) hl.bind(main_mod .. ' + SHIFT + H', hl.dsp.window.move { direction = 'l' }, { long_press = true }) hl.bind(main_mod .. ' + SHIFT + L', utils.layout_bind { scrolling = hl.dsp.window.swap { direction = 'r' }, default = hl.dsp.window.move { direction = 'r' }, }) hl.bind(main_mod .. ' + SHIFT + L', hl.dsp.window.move { direction = 'r' }, { long_press = true }) hl.bind(main_mod .. ' + SHIFT + J', utils.layout_bind { default = hl.dsp.window.move { direction = 'd' }, }) hl.bind(main_mod .. ' + SHIFT + K', utils.layout_bind { default = hl.dsp.window.move { direction = 'u' }, }) hl.bind(main_mod .. ' + SHIFT + comma', hl.dsp.window.move { workspace = 'm-1' }) hl.bind(main_mod .. ' + SHIFT + period', hl.dsp.window.move { workspace = 'm+1' }) hl.bind(main_mod .. ' + S', hl.dsp.window.toggle_swallow()) hl.bind(main_mod .. ' + P', hl.dsp.window.pin { action = 'toggle' }) for w = 1, 10 do local k = w % 10 hl.bind(main_mod .. ' + ' .. k, hl.dsp.focus { workspace = w, on_current_monitor = false }) hl.bind(main_mod .. ' + SHIFT + ' .. k, hl.dsp.window.move { workspace = w }) end -- -- workspace -- hl.bind(main_mod .. ' + comma', hl.dsp.focus { workspace = 'm-1' }) hl.bind(main_mod .. ' + period', hl.dsp.focus { workspace = 'm+1' }) hl.bind(main_mod .. ' + N', hl.dsp.workspace.toggle_special()) hl.bind(main_mod .. ' + M', hl.dsp.window.move { workspace = 'special' }) ----------- -- Layout ----------- hl.bind(main_mod .. ' + minus', hl.dsp.layout('colresize -conf')) hl.bind(main_mod .. ' + equal', hl.dsp.layout('colresize +conf')) -- -- monitor -- hl.bind('ALT + H', hl.dsp.focus {monitor = 'l'}) hl.bind('ALT + L', hl.dsp.focus {monitor = 'r'}) hl.bind('ALT + J', hl.dsp.focus {monitor = 'd'}) hl.bind('ALT + K', hl.dsp.focus {monitor = 'u'}) hl.bind(main_mod .. ' + CTRL + H', hl.dsp.focus {monitor = 'l'}) hl.bind(main_mod .. ' + CTRL + L', hl.dsp.focus {monitor = 'r'}) hl.bind(main_mod .. ' + CTRL + J', hl.dsp.focus {monitor = 'd'}) hl.bind(main_mod .. ' + CTRL + K', hl.dsp.focus {monitor = 'u'}) hl.bind(main_mod .. ' + TAB', hl.dsp.focus { monitor = '+1' }) hl.bind('ALT + TAB', hl.dsp.focus { monitor = '+1' }) hl.bind(main_mod .. ' + F1', hl.dsp.window.move { monitor = 'DP-1' }) hl.bind(main_mod .. ' + F2', hl.dsp.window.move { monitor = 'DP-2' }) hl.bind(main_mod .. ' + F4', hl.dsp.window.move { monitor = 'DP-4' }) for i = 1, 9 do hl.bind(main_mod .. ' + CTRL + ' .. i, hl.dsp.dpms { action = 'toggle', monitor = 'DP-' .. i }) -- toggle monitors on/off(not physically, as in idle-screensaver.) end hl.bind(main_mod .. ' + CTRL + 0', hl.dsp.dpms()) -- -- group -- -- -- cursor -- --------- -- Apps --------- -- launcher local cmd_kill_drun='pkill tofi-drun' local cmd_drun='tofi-drun --drun-launch=true --fuzzy-match=true' hl.bind(main_mod .. ' + SUPER_L', hl.dsp.exec_raw(cmd_kill_drun .. ' || ' .. task_e .. cmd_drun), { release = true }) hl.bind(main_mod .. ' + SPACE', hl.dsp.exec_raw(cmd_kill_drun .. ' || ' .. cmd_drun)) -- volume hl.bind('XF86AudioLowerVolume', hl.dsp.exec_raw('wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-'), { repeating = true }) hl.bind('XF86AudioRaiseVolume', hl.dsp.exec_raw('wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 1%+'), { repeating = true }) -- player hl.bind(main_mod .. ' + bracketleft', hl.dsp.exec_raw('playerctl previous')) hl.bind(main_mod .. ' + bracketright', hl.dsp.exec_raw('playerctl next')) hl.bind(main_mod .. ' + SHIFT + bracketleft', hl.dsp.exec_raw('playerctl position 5-'), { repeating = true }) hl.bind(main_mod .. ' + SHIFT + bracketright', hl.dsp.exec_raw('playerctl position 5+'), { repeating = true }) -- waybar hl.bind(main_mod .. ' + T', hl.dsp.exec_raw('pkill -USR1 waybar')) -- terminal hl.bind(main_mod .. ' + Return', hl.dsp.exec_raw(task_e .. 'kitty')) hl.bind(main_mod .. ' + SHIFT + Return', hl.dsp.exec_cmd(task_e .. 'kitty', { float = true, center = true, size = {1200, 800} })) hl.bind('XF86AudioMute', dropdown.dsp.toggle(task_e .. 'kitty --class kitty-musicfox musicfox')) hl.bind(main_mod .. ' + F9', dropdown.dsp.toggle(task_e .. 'kitty --class kitty-musicfox musicfox')) -- browser --hl.bind(main_mod .. ' + B', hl.dsp.exec_cmd('dex /var/lib/flatpak/exports/share/applications/app.zen_browser.zen.desktop', { workspace = 3 })) hl.bind(main_mod .. ' + B', deskentry.dsp.exec('/var/lib/flatpak/exports/share/applications/app.zen_browser.zen.desktop', nil, { workspace = 3 })) hl.bind(main_mod .. ' + SHIFT + B', hl.dsp.exec_cmd('chromany', { workspace = 3 })) hl.bind(main_mod .. ' + Y', function () if hl.get_window('') then hl.notification.create { text = 'true', timeout = 5000 } else hl.notification.create { text = 'false', timeout = 5000 } end end)