diff --git a/hyprland.lua b/hyprland.lua new file mode 100644 index 0000000..6eff12e --- /dev/null +++ b/hyprland.lua @@ -0,0 +1,232 @@ +------------------ +---- MONITORS ---- +------------------ + +-- monitor = DP-3, preferred, 0x0 ,auto +hl.monitor({ + output = "DP-3", + mode = "preferred", + position = "0x0", + scale = "auto", +}) + +-- monitor = HDMI-A-1, preferred, -1080x0, auto, transform, 3 +hl.monitor({ + output = "HDMI-A-1", + mode = "preferred", + position = "-1080x0", + scale = "auto", + transform = 3, +}) + +-- xwayland { force_zero_scaling = true } +hl.config({ + xwayland = { + force_zero_scaling = true, + }, +}) + +--------------------- +---- MY PROGRAMS ---- +--------------------- + +local terminal = "kitty" +local fileManager = "dolphin" +local menu = "tofi-drun --drun-launch=true" + +------------------- +---- AUTOSTART ---- +------------------- + +hl.on("hyprland.start", function() + -- exec-once & exec commands + hl.exec_cmd("eww daemon & eww open-many bar widget_window resource_monitor") + hl.exec_cmd("systemctl --user start hyprpolkitagent") + hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'YOUR_DARK_GTK3_THEME'") + hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'") + + -- Wallpapers + hl.exec_cmd("awww-daemon") + hl.exec_cmd("awww img -o 'DP-3' /home/Downloads/Wallpapers/oceanside.png") + hl.exec_cmd("awww img -o 'HDMI-A-1' /home/Downloads/Wallpapers/arch.png") +end) + +------------------------------- +---- ENVIRONMENT VARIABLES ---- +------------------------------- + +hl.env("HYPRCURSOR_THEME", "rose-pine-hyprcursor") +hl.env("HYPRCURSOR_SIZE", "30") +hl.env("QT_QPA_PLATFORMTHEME", "qt6ct") + +----------------------- +----- LOOK AND FEEL ---- +----------------------- + +hl.config({ + general = { + gaps_in = 2, + gaps_out = 5, + border_size = 2, + col = { + active_border = "rgba(ffffffee)", + inactive_border = "rgba(696969aa)", + }, + resize_on_border = false, + allow_tearing = false, + layout = "dwindle", + }, + + decoration = { + rounding = 9, + rounding_power = 5, + active_opacity = 1.0, + inactive_opacity = 0.90, + + shadow = { + enabled = true, + range = 8, + render_power = 2, + color = "rgba(000000ee)", + color_inactive = "rgba(00000000)", + }, + + blur = { + enabled = false, + size = 3, + passes = 1, + vibrancy = 0.1696, + }, + }, + + animations = { + enabled = true, + }, + + master = { + new_status = "master", + }, + + misc = { + force_default_wallpaper = -1, + disable_hyprland_logo = true, + }, +}) + +----------------------- +---- BEZIER CURVES ---- +----------------------- + +hl.curve("easeOutQuint", { type = "bezier", points = { {0.23, 1}, {0.32, 1} } }) +hl.curve("easeInOutCubic", { type = "bezier", points = { {0.65, 0.05}, {0.36, 1} } }) +hl.curve("linear", { type = "bezier", points = { {0, 0}, {1, 1} } }) +hl.curve("almostLinear", { type = "bezier", points = { {0.5, 0.5}, {0.75, 1} } }) +hl.curve("quick", { type = "bezier", points = { {0.15, 0}, {0.1, 1} } }) + +hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "easeOutQuint" }) +hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" }) +hl.animation({ leaf = "windows", enabled = true, speed = 4.79, bezier = "easeOutQuint" }) +hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, bezier = "easeOutQuint", style = "popin 87%" }) +hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 87%" }) +hl.animation({ leaf = "fadeIn", enabled = true, speed = 1.73, bezier = "almostLinear" }) +hl.animation({ leaf = "fadeOut", enabled = true, speed = 1.46, bezier = "almostLinear" }) +hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" }) +hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" }) +hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" }) +hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" }) +hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" }) +hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" }) +hl.animation({ leaf = "workspaces", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" }) +hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "fade" }) +hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" }) + +----------------------- +---- INPUT ---- +----------------------- + +hl.config({ + input = { + kb_layout = "us", + kb_variant = "", + kb_model = "", + kb_options = "", + kb_rules = "", + follow_mouse = 1, + sensitivity = 0, + accel_profile = "flat", + }, +}) + +--------------------- +---- KEYBINDINGS ---- +--------------------- + +local mainMod = "SUPER" + +hl.bind(mainMod .. " + CTRL + RETURN", hl.dsp.exec_cmd(terminal)) +hl.bind(mainMod .. " + ESCAPE", hl.dsp.window.close()) +hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd("exit")) +hl.bind(mainMod .. " + F", hl.dsp.exec_cmd(fileManager)) +hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" })) +hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd(menu)) +hl.bind(mainMod .. " + TAB", hl.dsp.focus({ workspace = "previous" })) + +-- Move focus with mainMod + arrow keys +hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" })) +hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" })) +hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" })) +hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" })) + +-- Switch workspaces with mainMod + [0-9] +-- Move active window to a workspace with mainMod + SHIFT + [0-9] +for i = 1, 10 do + local key = i % 10 -- 10 maps to key 0 + hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i})) + hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i })) +end + +-- Scroll through existing workspaces with mainMod + scroll +hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) +hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" })) + +-- Move/resize windows with mainMod + LMB/RMB and dragging +hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) + +-- Laptop multimedia keys (Commented out as per original config) +-- hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) +-- hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) +-- hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true }) +-- hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true }) +-- hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true }) +-- hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true }) +-- hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true }) +-- hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +-- hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true }) +-- hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true }) + +-------------------------------- +---- WINDOWS AND WORKSPACES ---- +-------------------------------- + +-- Fix some dragging issues with XWayland +hl.window_rule({ + name = "fix-xwayland-drags", + match = { + class = "^$", + title = "^$", + xwayland = true, + float = true, + fullscreen = false, + pin = false, + }, + no_focus = true, +}) + +hl.window_rule({ + name = "move-hyprland-run", + match = { class = "hyprland-run" }, + move = "20 monitor_h-120", + float = true, +}) +