diff options
Diffstat (limited to 'hypr/hyprland.lua')
| -rw-r--r-- | hypr/hyprland.lua | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/hypr/hyprland.lua b/hypr/hyprland.lua new file mode 100644 index 0000000..c139368 --- /dev/null +++ b/hypr/hyprland.lua @@ -0,0 +1,184 @@ +local mod = "SUPER" +local terminal = "kitty" + +hl.env("DISPLAY", ":0") +hl.env("GRIM_DEFAULT_DIR", "$HOME/Imagens/screenshots") +hl.env("LIBVA_DRIVER_NAME", "nvidia") +hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") +hl.env("NVD_BACKEND", "direct") + +hl.config({ + general = { + border_size = 2, + col = { + active_border = 0x799df6, + inactive_border = 0xdfdfdf, + }, + gaps_in = 0, + gaps_out = 0, + layout = "master", + }, + input = { + follow_mouse = 2, + kb_layout = "br,us", + kb_options = "compose:ralt,grp:win_space_toggle", + repeat_delay = 250, + repeat_rate = 40, + touchpad = { + natural_scroll = true, + }, + }, + xwayland = { + force_zero_scaling = true, + }, + master = { + mfact = 0.600000, + new_on_top = true, + new_status = "inherit", + }, +}) + +hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) +hl.gesture({ fingers = 3, direction = "down", action = "float", threshold = 0 }) +hl.gesture({ fingers = 3, direction = "up", action = "float", threshold = 0 }) +hl.gesture({ fingers = 3, direction = "down", mods = mod, action = "close", threshold = 0 }) + +hl.window_rule({ + match = { class = "org.nicotine_plus.Nicotine" }, + workspace = "2 silent" +}) +hl.window_rule({ + match = { class = "org.nicotine_plus.Nicotine" }, + workspace = "2 silent" +}) +hl.window_rule({ + match = { class = "steam" }, + workspace = "3 silent" +}) +hl.window_rule({ + match = { class = "^Steam" }, + workspace = "3 silent" +}) +hl.window_rule({ + match = { class = "^PEAK.exe" }, + workspace = "3 silent" +}) +hl.window_rule({ + match = { class = "vesktop" }, + workspace = "3 silent" +}) +hl.window_rule({ + match = { class = "firefox" }, + workspace = "4 silent" +}) + +hl.bind(mod .. " + ALT + q", function() + hl.exec_cmd("hyprshutdown") +end) +hl.bind(mod .. " + TAB", hl.dsp.focus({ workspace = "previous" })) +hl.bind(mod .. " + q", hl.dsp.window.kill(activewindow)) +hl.bind(mod .. " + f", hl.dsp.window.fullscreen()) +hl.bind(mod .. " + SHIFT + f", function() + hl.dsp.togglefloating() + hl.dsp.pin() +end) +hl.bind(mod .. " + ALT + l", function() + hl.exec_cmd("hyprlock") +end) +hl.bind(mod .. " + j", hl.dsp.window.cycle_next()) +hl.bind(mod .. " + k", hl.dsp.window.cycle_next({ prev })) +hl.bind(mod .. " + SHIFT + j", hl.dsp.window.swap({ next = true })) +hl.bind(mod .. " + SHIFT + k", hl.dsp.window.swap({ prev = true })) +hl.bind(mod .. " + Period", hl.dsp.focus({ monitor = "+1" })) +hl.bind(mod .. " + Comma", hl.dsp.focus({ monitor = "-1" })) +hl.bind(mod .. " + SHIFT + Period", hl.dsp.window.move({ monitor = "+1 silent" })) +hl.bind(mod .. " + SHIFT + Comma", hl.dsp.window.move({ monitor = "-1 silent" })) +hl.bind(mod .. " + h", hl.dsp.layout("mfact -0.1")) +hl.bind(mod .. " + l", hl.dsp.layout("mfact +0.1")) +hl.bind(mod .. " + m", hl.dsp.layout("swapwithmaster")) +hl.bind(mod .. " + e", function() + hl.exec_cmd(terminal) +end) +hl.bind(mod .. " + SHIFT + e", function() + hl.exec_cmd("[float] " .. terminal) +end) +hl.bind(" + F24", function() + hl.exec_cmd("kitten quick-access-terminal") +end) +hl.bind("CTRL + SHIFT + space", function() + hl.exec_cmd("anyrun") +end) +hl.bind(mod .. " + SHIFT + c", function() + hl.exec_cmd("cliphist wipe") +end) +hl.bind(mod .. " + v", function() + hl.exec_cmd("cliphist list | anyrun --plugins libstdin.so | cliphist decode | wl-copy") +end) +hl.bind(" + Print", function() + hl.exec_cmd("slurp | grim -g -") +end) +hl.bind("ALT + Print", function() + hl.exec_cmd("grim") +end) +hl.bind("XF86AudioMute", function() + hl.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle") +end) +hl.bind("XF86AudioLowerVolume", function() + hl.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-") +end) +hl.bind("XF86AudioRaiseVolume", function() + hl.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+") +end) +hl.bind("XF86AudioMicMute", function() + hl.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle") +end) +hl.bind("XF86AudioStop", function() + hl.exec_cmd("playerctl stop") +end) +hl.bind("XF86AudioPlay", function() + hl.exec_cmd("playerctl play-pause") +end) +hl.bind("XF86AudioPrev", function() + hl.exec_cmd("playerctl previous") +end) +hl.bind("XF86AudioNext", function() + hl.exec_cmd("playerctl next") +end) +hl.bind("XF86MonBrightnessDown", function() + hl.exec_cmd("brightnessctl s 10%-") +end) +hl.bind("XF86MonBrightnessUp", function() + hl.exec_cmd("brightnessctl s 10%+") +end) +hl.bind("SHIFT + F11", function() + hl.exec_cmd("brightnessctl s 10%-") +end) +hl.bind("SHIFT + F12", function() + hl.exec_cmd("brightnessctl s 10%+") +end) + +for i = 1, 4 do + local key = i % 10 + hl.bind(mod .. " + " .. key, hl.dsp.focus({ workspace = tostring(i) })) + hl.bind(mod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = tostring(i) })) +end + +hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) +hl.bind(mod .. " + mouse:274", hl.dsp.window.float(), { mouse = true }) + +hl.on("hyprland.start", function() + hl.exec_cmd("anyrun daemon") + hl.exec_cmd("ashell") + hl.exec_cmd( + "dbus-update-activation-environment --systemd --all WAYLAND_DISPLAY XDG_CURRENT_DESKTOP MOZ_ENABLE_WAYLAND PASSWORD_STORE_DIR && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target") + hl.exec_cmd("hyprctl setcursor LyraB-cursors 32") + hl.exec_cmd("hypridle") + hl.exec_cmd("hyprsunset") + hl.exec_cmd("kanshi") + hl.exec_cmd("systemctl --user start opentabletdriver.service") + hl.exec_cmd("wl-paste -t text --watch cliphist store") + hl.exec_cmd("wpaperd") + hl.exec_cmd("xwayland-satellite") + hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") +end) |
