This commit is contained in:
2026-05-15 21:10:42 +03:00
parent 15091b4efb
commit 3a0b8f5fc6
7 changed files with 316 additions and 40 deletions

185
.config/hypr/hyprland.lua Normal file
View File

@@ -0,0 +1,185 @@
-- Hyprland Lua Config
-- Migrated from hyprland.conf + keymaps.conf
-- Environment Variables
hl.env("XDG_CURRENT_DESKTOP", "Hyprland")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("XDG_SESSION_DESKTOP", "Hyprland")
hl.env("XDG_SCREENSHOTS_DIR", os.getenv("HOME") .. "/Pictures/Screenshots")
hl.env("AQ_DRM_DEVICES", "/dev/dri/card2:/dev/dri/card1")
hl.env("GDK_BACKEND", "wayland,x11,*")
hl.env("CLUTTER_BACKEND", "wayland")
hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
hl.env("QT_QPA_PLATFORM", "wayland;xcb")
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct")
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24")
-- Monitor
hl.monitor({
output = "",
mode = "preferred",
position = "auto",
scale = "auto",
})
require("keymaps")
-- Autostart
hl.on("hyprland.start", function()
hl.exec_cmd("~/.config/hypr/start.sh")
hl.exec_cmd("wl-paste --type text --watch cliphist store")
hl.exec_cmd("wl-paste --type image --watch cliphist store")
end)
-- Look and Feel
hl.config({
general = {
gaps_in = 3,
gaps_out = 5,
border_size = 2,
col = {
active_border = "0xffd3869b",
inactive_border = "0xff45475a",
},
resize_on_border = false,
allow_tearing = false,
layout = "dwindle",
},
cursor = {
no_hardware_cursors = true,
},
decoration = {
rounding = 10,
active_opacity = 0.9,
inactive_opacity = 0.9,
shadow = {
enabled = true,
range = 4,
render_power = 3,
color = 0x33000000,
color_inactive = 0x22000000,
},
blur = {
enabled = true,
size = 2,
passes = 4,
vibrancy = 0.1696,
},
},
animations = {
enabled = true,
},
})
-- Bezier curves
hl.curve(
"myBezier",
{ type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } }
)
hl.curve(
"default",
{ type = "bezier", points = { { 0.25, 0.1 }, { 0.25, 1 } } }
)
-- Animations
hl.animation({
leaf = "windows",
enabled = true,
speed = 7,
bezier = "myBezier",
})
hl.animation({
leaf = "windowsOut",
enabled = true,
speed = 7,
bezier = "default",
style = "popin 80%",
})
hl.animation({
leaf = "border",
enabled = true,
speed = 10,
bezier = "default",
})
hl.animation({
leaf = "borderangle",
enabled = true,
speed = 8,
bezier = "default",
})
hl.animation({
leaf = "fade",
enabled = true,
speed = 7,
bezier = "default",
})
hl.animation({
leaf = "workspaces",
enabled = true,
speed = 6,
bezier = "default",
})
-- Dwindle layout
hl.config({
dwindle = {
preserve_split = true,
force_split = 2,
},
})
-- Master layout
hl.config({
master = {
new_status = "master",
},
})
-- Misc
hl.config({
misc = {
animate_manual_resizes = true,
animate_mouse_windowdragging = true,
enable_swallow = true,
disable_hyprland_logo = true,
},
})
-- Input
hl.config({
input = {
kb_layout = "us,eg",
kb_variant = "",
kb_model = "",
kb_options = "grp:alt_shift_toggle",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = true,
},
},
})
-- Per-device config
hl.device({
name = "epic-mouse-v1",
sensitivity = -0.5,
})
-- Window rules
hl.window_rule({
name = "suppress-maximize",
match = { class = ".*" },
suppress_event = "maximize",
})
-- Gestures
hl.gesture({
fingers = 3,
direction = "horizontal",
action = "workspace",
})

105
.config/hypr/keymaps.lua Normal file
View File

@@ -0,0 +1,105 @@
-- Keybindings
local terminal = "alacritty"
local fileManager = "dolphin"
local menu = "wofi --show drun"
local browser = "zen-browser"
local mainMod = "SUPER"
-- Launch/close
hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + Q", hl.dsp.window.close())
hl.bind(mainMod .. " + ALT + Q", hl.dsp.exit())
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + W", hl.dsp.exec_cmd(browser))
hl.bind(mainMod .. " + T", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen())
hl.bind(
mainMod .. " + V",
hl.dsp.exec_cmd("cliphist list | wofi --dmenu | cliphist decode | wl-copy")
)
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"))
-- Move focus with mainMod + arrow keys
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "l" }))
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "r" }))
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "u" }))
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "d" }))
-- Swap windows with mainMod + SHIFT + arrow keys
hl.bind(mainMod .. " + SHIFT + left", hl.dsp.window.swap({ direction = "l" }))
hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.swap({ direction = "r" }))
hl.bind(mainMod .. " + SHIFT + up", hl.dsp.window.swap({ direction = "u" }))
hl.bind(mainMod .. " + SHIFT + down", hl.dsp.window.swap({ direction = "d" }))
-- Resize windows with mainMod + CTRL + arrow keys
hl.bind(mainMod .. " + CTRL + left", hl.dsp.window.resize({ x = -60, y = 0 }))
hl.bind(mainMod .. " + CTRL + right", hl.dsp.window.resize({ x = 60, y = 0 }))
hl.bind(mainMod .. " + CTRL + up", hl.dsp.window.resize({ x = 0, y = -60 }))
hl.bind(mainMod .. " + CTRL + down", hl.dsp.window.resize({ x = 0, y = 60 }))
-- Switch / move workspaces with mainMod + [0-9]
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, silent = true })
)
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
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Brightness
hl.bind(
"XF86MonBrightnessDown",
hl.dsp.exec_cmd("brightnessctl set 5%-"),
{ locked = true, repeating = true }
)
hl.bind(
"XF86MonBrightnessUp",
hl.dsp.exec_cmd("brightnessctl set 5%+"),
{ locked = true, repeating = true }
)
-- Audio
hl.bind(
"XF86AudioRaiseVolume",
hl.dsp.exec_cmd("wpctl set-volume @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 }
)
hl.bind(
"XF86AudioPlay",
hl.dsp.exec_cmd("playerctl play-pause"),
{ locked = true }
)
hl.bind(
"XF86AudioPrev",
hl.dsp.exec_cmd("playerctl previous"),
{ locked = true }
)
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
-- Misc binds
hl.bind(
mainMod .. " + SHIFT + C",
hl.dsp.exec_cmd(terminal .. " -e sh -c 'nvim ~/.config/'")
)
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("grimblast copysave area"))