Files
system-config/home-manager/features/hypr/config/hyprland.lua

385 lines
11 KiB
Lua

local browser = "zen --new-window"
local mainMod = "SUPER + ALT"
local menu = "rofi -show combi -combi-modes drun,ssh,run -theme ~/.config/rofi/launcher/style.rasi"
local terminal = "foot"
local split = require("hyprsplit")
split.config({
num_workspaces = 10,
persistent_workspaces = true,
})
hl.config({
general = {
allow_tearing = false,
border_size = 2,
col = {
active_border = {
colors = { "rgba(eeeeffee)", "rgba(3366ffee)" },
angle = 45,
},
inactive_border = "rgba(595959aa)",
},
gaps_in = 5,
gaps_out = 10,
layout = "hy3",
resize_on_border = true,
},
decoration = {
active_opacity = 1.000000,
blur = {
enabled = true,
passes = 1,
size = 3,
vibrancy = 0.169600,
},
inactive_opacity = 1.000000,
rounding = 5,
shadow = {
color = "rgba(1a1a1aee)",
enabled = true,
range = 5,
render_power = 3,
},
},
input = {
follow_mouse = 1,
kb_layout = "us",
kb_options = "compose:ralt",
sensitivity = 0,
touchpad = {
natural_scroll = false,
},
},
misc = {
disable_hyprland_logo = true,
force_default_wallpaper = 0,
vrr = 1,
},
debug = {
disable_logs = false,
},
cursor = {
no_hardware_cursors = true,
},
animations = {
enabled = true,
},
-- plugin = {
-- hy3 = {
-- group_inset = 10,
-- no_gaps_when_only = 0,
-- node_collapse_policy = 2,
-- tab_first_window = false,
-- tabs = {
-- height = 20,
-- rounding = 2,
-- text_height = 10,
-- },
-- },
-- },
})
hl.device({
name = "logitech-g502-1",
sensitivity = -0.200000,
})
hl.monitor({
output = "DP-2",
mode = "3440x1440@164",
position = "0x0",
})
hl.monitor({
output = "DP-1",
mode = "2560x1440",
position = "-1440x-510",
-- 0 -> normal (no transforms)
-- 1 -> 90 degrees
-- 2 -> 180 degrees
-- 3 -> 270 degrees
-- 4 -> flipped
-- 5 -> flipped + 90 degrees
-- 6 -> flipped + 180 degrees
-- 7 -> flipped + 270 degrees
transform = 1,
})
hl.workspace_rule({ workspace = "1" })
hl.workspace_rule({ workspace = "2" })
hl.workspace_rule({ workspace = "3" })
hl.workspace_rule({ workspace = "4" })
hl.workspace_rule({ workspace = "5" })
hl.workspace_rule({ workspace = "6" })
hl.workspace_rule({ workspace = "7" })
hl.workspace_rule({ workspace = "8" })
hl.workspace_rule({ workspace = "9" })
hl.workspace_rule({ workspace = "10" })
hl.workspace_rule({ workspace = "11" })
hl.workspace_rule({ workspace = "12" })
hl.workspace_rule({ workspace = "13" })
hl.workspace_rule({ workspace = "14" })
hl.workspace_rule({ workspace = "15" })
hl.workspace_rule({ workspace = "16" })
hl.workspace_rule({ workspace = "17" })
hl.workspace_rule({ workspace = "18" })
hl.workspace_rule({ workspace = "19" })
hl.workspace_rule({ workspace = "20" })
hl.window_rule({ match = "match:class Rofi", stay_focused = true })
-- hl.window_rule({ match = { class = "suppress_event maximize" }, "match:class" = ".*" })
-- hl.window_rule({ match = { class = "fullscreen 1" }, "match:class" = "^steam_app_d+$" })
-- PATTERN: MERGED with line 208
-- MIGRATION_WARNING: Window rule conflict for 'center on': 'match:class ^steam_app_d+$' (line 199) vs 'match:class Rofi' (line 208)
-- hl.window_rule({ match = { class = "center on" }, match:class = "^steam_app_d+$", match:class = "Rofi" })
-- PATTERN: MERGED with line 202
-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Battle.net$' (line 202)
-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Balatro$' (line 204)
-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:class steam_app_1091500' (line 206)
-- hl.window_rule({
-- match = { class = "monitor 1" },
-- match:title = "^World of Warcraft$",
-- match:title = "^Battle.net$",
-- match:title = "^Balatro$",
-- match:class = "steam_app_1091500",
-- })
-- PATTERN: MERGED with line 207
-- MIGRATION_WARNING: Window rule conflict for 'fullscreen on': 'match:title ^World of Warcraft$' (line 201) vs 'match:class steam_app_1091500' (line 207)
-- hl.window_rule({ match = { class = "fullscreen on" }, match:title = "^World of Warcraft$", match:class = "steam_app_1091500" })
-- hl.window_rule({ match = { class = "float on" }, match:title = "^Battle.net$" })
-- hl.window_rule({ match = { class = "tile on" }, match:title = "^Balatro$" })
hl.bind("SUPER + ALT + T", function()
hl.exec_cmd(terminal)
end)
hl.bind("SUPER + ALT + B", function()
hl.exec_cmd(browser)
end)
hl.bind("SUPER + ALT + D", function()
hl.exec_cmd(menu)
end)
hl.bind("SUPER + ALT + SHIFT + S", function()
hl.exec_cmd("hyprshot -m region --clipboard-only")
end)
hl.bind("SUPER + ALT + CTRL + SHIFT + S", function()
hl.exec_cmd("hyprshot -m region -o ~/Pictures")
end)
hl.bind("SUPER + ALT + C", function()
hl.exec_cmd("swaync-client -t")
end)
hl.bind("SUPER + ALT + CTRL + Q", function()
hl.exec_cmd("/home/drew/.config/rofi/powermenu/powermenu.sh")
end)
hl.bind("SUPER + ALT + X", function()
hl.exec_cmd("/home/drew/.config/rofi/powermenu/powermenu.sh")
end)
hl.bind("SUPER + ALT + F", hl.dsp.window.float({ action = "toggle" }))
hl.bind("SUPER + ALT + SHIFT + F", hl.dsp.window.fullscreen({ action = "toggle" }))
hl.bind("SUPER + ALT + CTRL + left", hl.dsp.window.resize({ x = -20, y = 0 }))
hl.bind("SUPER + ALT + CTRL + right", hl.dsp.window.resize({ x = 20, y = 0 }))
hl.bind("SUPER + ALT + CTRL + down", hl.dsp.window.resize({ x = 0, y = 20 }))
hl.bind("SUPER + ALT + CTRL + up", hl.dsp.window.resize({ x = 0, y = -20 }))
hl.bind("SUPER + ALT + R", hl.dsp.focus({ monitor = "next" }))
--
hl.bind("SUPER + ALT + r", hl.dsp.focus({ monitor = "l" }))
hl.bind("SUPER + ALT + s", hl.dsp.focus({ monitor = "r" }))
local hy3 = hl.plugin.hy3
hl.bind("SUPER + ALT + Q", hy3.kill_active())
hl.bind("SUPER + ALT + G", hy3.make_group("opposite"))
hl.bind("SUPER + ALT + W", hy3.make_group("tab", { toggle = true }))
hl.bind("SUPER + ALT + A", hy3.change_focus("raise"))
hl.bind("SUPER + ALT + Z", hy3.change_focus("lower"))
hl.bind("SUPER + ALT + O", hy3.change_group("opposite"))
hl.bind("SUPER + ALT + left", hy3.move_focus("left"))
hl.bind("SUPER + ALT + right", hy3.move_focus("right"))
hl.bind("SUPER + ALT + up", hy3.move_focus("up"))
hl.bind("SUPER + ALT + down", hy3.move_focus("down"))
hl.bind("SUPER + ALT + SHIFT + left", hy3.move_window("left"))
hl.bind("SUPER + ALT + SHIFT + right", hy3.move_window("right"))
hl.bind("SUPER + ALT + SHIFT + up", hy3.move_window("up"))
hl.bind("SUPER + ALT + SHIFT + down", hy3.move_window("down"))
-- Workspace binds
for i = 1, 10 do
hl.bind("SUPER + ALT + " .. (i % 10), split.dsp.focus({ workspace = tostring(i) }))
hl.bind("SUPER + ALT + SHIFT + " .. (i % 10), hy3.move_to_workspace(tostring(i)))
end
hl.bind("SUPER + ALT + SHIFT + r", hl.dsp.window.move({ monitor = "+1" }))
hl.bind(" + XF86AudioRaiseVolume", function()
hl.exec_cmd("swayosd-client --output-volume raise")
end, { locked = true })
hl.bind(" + XF86AudioLowerVolume", function()
hl.exec_cmd("swayosd-client --output-volume lower")
end, { locked = true })
hl.bind(" + XF86AudioMute", function()
hl.exec_cmd("swayosd-client --output-volume mute-toggle")
end, { locked = true })
hl.bind(" + XF86AudioMicMute", function()
hl.exec_cmd("swayosd-client --input-volume mute-toggle")
end, { locked = true })
hl.bind(" + XF86MonBrightnessUp", function()
hl.exec_cmd("brightnessctl s 10%+")
end, { locked = true })
hl.bind(" + XF86MonBrightnessDown", function()
hl.exec_cmd("brightnessctl s 10%-")
end, { locked = true })
hl.bind(" + XF86AudioNext", function()
hl.exec_cmd("playerctl next")
end, { locked = true })
hl.bind(" + XF86AudioPause", function()
hl.exec_cmd("playerctl play-pause")
end, { locked = true })
hl.bind(" + XF86AudioPlay", function()
hl.exec_cmd("playerctl play-pause")
end, { locked = true })
hl.bind(" + XF86AudioPrev", function()
hl.exec_cmd("playerctl previous")
end, { locked = true })
hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouce = true })
-- hl.bind(" + mouse:272", hl.dsp.hy3:focustab({ mouse })) --, { non_consuming = true }
hl.on("hyprland.start", function()
hl.exec_cmd("hyprctl plugin load /nix/store/faphbyy63c9v1m6a7dl3ash30vy8bap9-hy3-0.55.0/lib/libhy3.so")
hl.exec_cmd("nm-applet")
hl.exec_cmd("sleep 2 && hyprpm reload -n")
hl.exec_cmd("systemctl --user start hyprpolkitagent")
hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'")
hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'")
hl.exec_cmd("wpaperd")
hl.exec_cmd("sleep 2 && eww open-many primary-statusbar secondary-statusbar")
hl.exec_cmd("xrandr --output DP-2 --primary")
end)
hl.curve("easeOutQuint", {
type = "bezier",
points = { { 0.23, 1.0 }, { 0.32, 1.0 } },
})
hl.curve("easeInOutCubic", {
type = "bezier",
points = { { 0.65, 0.05 }, { 0.36, 1.0 } },
})
hl.curve("linear", {
type = "bezier",
points = { { 0.0, 0.0 }, { 1.0, 1.0 } },
})
hl.curve("almostLinear", {
type = "bezier",
points = { { 0.5, 0.5 }, { 0.75, 1.0 } },
})
hl.curve("quick", {
type = "bezier",
points = { { 0.15, 0.0 }, { 0.1, 1.0 } },
})
hl.animation({
leaf = "global",
enabled = true,
speed = 10.0,
bezier = "default",
})
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.0,
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",
})
-- Additional configs
require("config.autostart")