Загрузка данных
-- ~/.config/hypr/hyprland.lua
-- Полная конфигурация: красиво, удобно, стабильно
------------------
---- MONITORS ----
------------------
hl.monitor({
output = "", -- автоопределение
mode = "preferred",
position = "auto",
scale = "auto",
})
---------------------
---- PROGRAMS -----
---------------------
local terminal = "kitty"
local fileManager = "dolphin"
local browser = "firefox"
local menu = "wofi --show drun"
local screenshotArea = "grim -g \"$(slurp)\" -"
-------------------
---- AUTOSTART ----
-------------------
-- Правильный способ автозапуска в Lua [[15]]
hl.on("hyprland.start", function()
hl.exec_cmd("nm-applet --indicator")
hl.exec_cmd("waybar")
hl.exec_cmd("swww-daemon") -- для обоев
hl.exec_cmd("mako") -- уведомления
hl.exec_cmd("hyprlock") -- экран блокировки (pre-load)
end)
-------------------------------
---- ENVIRONMENT VARIABLES ----
-------------------------------
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
hl.env("GTK_IM_MODULE", "fcitx")
hl.env("XDG_SESSION_TYPE", "wayland")
-----------------------
---- LOOK AND FEEL ----
-----------------------
hl.config({
general = {
gaps_in = 5,
gaps_out = 20,
border_size = 2,
col = {
active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 },
inactive_border = "rgba(595959aa)",
},
resize_on_border = true,
allow_tearing = false,
layout = "dwindle",
},
decoration = {
rounding = 12,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 0.85, -- эффект "стекла"
fullscreen_opacity = 1.0,
shadow = {
enabled = true,
range = 8,
render_power = 3,
color = "0xee1a1a1a",
},
blur = {
enabled = true,
size = 5,
passes = 2,
vibrancy = 0.2,
new_optimizations = true,
ignore_opacity = true,
xray = true,
},
},
animations = {
enabled = true,
},
})
-- Кривые анимаций [[3]]
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.curve("easy", { type = "spring", mass = 1, stiffness = 71.26, dampening = 15.82 })
-- Анимации [[3]]
hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" })
hl.animation({ leaf = "windows", enabled = true, speed = 4.79, spring = "easy" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, spring = "easy", 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 = "workspaces", enabled = true, speed = 6, bezier = "easeOutQuint", style = "slidefade" })
hl.animation({ leaf = "workspacesIn", enabled = true, speed = 6, bezier = "easeOutQuint", style = "slidefade" })
hl.animation({ leaf = "workspacesOut", enabled = true, speed = 6, bezier = "easeOutQuint", style = "slidefade" })
hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" })
-- Умные отступы (Smart gaps) [[6]]
hl.workspace_rule({ workspace = "w[tv1]", gaps_out = 0, gaps_in = 0 })
hl.workspace_rule({ workspace = "f[1]", gaps_out = 0, gaps_in = 0 })
hl.window_rule({
match = { float = false, workspace = "w[tv1]" },
border_size = 0, rounding = 0,
})
hl.window_rule({
match = { float = false, workspace = "f[1]" },
border_size = 0, rounding = 0,
})
-- Настройки раскладок [[22]]
hl.config({
dwindle = { preserve_split = true },
master = { new_status = "master" },
scrolling = { fullscreen_on_one_column = true },
})
----------------
---- MISC ----
----------------
hl.config({
misc = {
disable_hyprland_logo = true,
force_default_wallpaper = 0,
background_color = "0x111111",
vfr = true,
mouse_move_enables_dpms = false,
key_press_enables_dpms = false,
},
})
---------------
---- INPUT ----
---------------
hl.config({
input = {
kb_layout = "us,ru",
kb_options = "grp:win_space_toggle", -- Win+Space для переключения
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = true,
disable_while_typing = true,
},
},
})
-- Жесты тачпада
hl.gesture({
fingers = 3,
direction = "horizontal",
action = "workspace"
})
---------------------
---- KEYBINDINGS ----
---------------------
local mainMod = "SUPER"
-- Терминал, выход, приложения [[22]]
hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + C", hl.dsp.window.close())
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("hyprctl dispatch exit"))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + B", hl.dsp.exec_cmd(browser))
hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(menu))
hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit"))
-- Блокировка экрана
hl.bind(mainMod .. " + L", hl.dsp.exec_cmd("hyprlock"))
-- Скриншоты [[22]]
hl.bind("Print", hl.dsp.exec_cmd("grim - | wl-copy"))
hl.bind(mainMod .. " + Print", hl.dsp.exec_cmd(screenshotArea .. " | wl-copy"))
-- Навигация
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" }))
-- Воркспейсы 1-10
for i = 1, 10 do
local key = i % 10
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
end
-- Special workspace (scratchpad)
hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
-- Переключение воркспейсов колёсиком
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- Перемещение/изменение размера окон мышью [[22]]
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Мультимедиа (громкость, яркость) [[22]]
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 })
-- Управление медиаплеером (playerctl)
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
--------------------------------
---- WINDOWS AND WORKSPACES ----
--------------------------------
-- Игнорировать запросы на разворачивание окон
hl.window_rule({
name = "suppress-maximize",
match = { class = ".*" },
suppress_event = "maximize",
})
-- Исправление проблем с XWayland
hl.window_rule({
name = "fix-xwayland",
match = { class = "^$", title = "^$", xwayland = true, float = true },
no_focus = true,
})
-- Firefox: открывать в новом воркспейсе
hl.window_rule({
match = { class = "firefox" },
workspace = "2",
})
-- Терминал: плавающее окно для htop/nvim
hl.window_rule({
match = { title = "^(htop|nvim|btop)$" },
float = true,
size = "800 500",
})