feat(config/hypr/configs): add layout cycling, enhance workspace swipe, adjust monitor and env configs

Introduce programmable layout switching, improve split scaling, update monitor resolution and environment variables, and enable new swipe behavior.

- New Features:
  - Added `cycle_layout` function and keybindings (MOD+Tab / MOD+Shift+Tab) to cycle through workspace layouts with on-screen notifications.
  - Enabled `workspace_swipe_create_new` to create a new workspace on swipe.
- Enhancements:
  - Updated `dwindle` and `master` split configuration with revised `special_scale_factor`.
  - Set monitor `output` to fixed "1920x1080@144" mode.
  - Refactored environment variable definitions into a table and added Nvidia-specific settings.
  - Adjusted `master` new status to "master" and `new_on_top` to true.
- Bug Fixes:
  - Cleaned up dead code and comments, removed unused `kb_options` line, fixed formatting.
This commit is contained in:
sankalp committed 2026-05-12 01:32:47 +05:45
1 parent 602dc3cd24
commit 73c51e16ac
4 files changed
+66 -45

No files matched your search

+38 -3
View File
@@ -15,12 +15,48 @@ local function layout_bind(bind_table)
end
end
local layouts = { "scrolling", "dwindle", "monocle" }
-- Cycles through layouts for the current workspace
local function cycle_layout(dir)
return function()
local ws = hl.get_active_workspace()
local i = 1
for idx, l in ipairs(layouts) do
if l == ws.tiled_layout then
i = idx
break
end
end
local target = layouts[(dir == "prev" and (i - 2) % #layouts or i % #layouts) + 1]
if hl.workspace_rule then
hl.workspace_rule({ workspace = tostring(ws.id), layout = target })
end
local display_name = target:sub(1, 1):upper() .. target:sub(2)
hl.dispatch(
hl.dsp.exec_cmd(
string.format(
"notify-send -u low -t 1200 -a 'Hyprland' -i 'preferences-desktop-display' 'Workspace %s' 'Layout: %s'",
ws.name,
display_name
)
)
)
end
end
-- apps launch
hl.bind(mainMod .. " + return", hl.dsp.exec_cmd("uwsm app -- " .. terminal))
hl.bind("ALT + SHIFT + return", hl.dsp.exec_cmd("uwsm app -- " .. terminal), { float = true })
hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd("uwsm app -- " .. terminal))
hl.bind("ALT + SHIFT + Return", hl.dsp.exec_cmd("uwsm app -- " .. terminal, { float = true }))
hl.bind("ALT + E", hl.dsp.exec_cmd("uwsm app -- " .. file_manager))
hl.bind(mainMod .. " + B", hl.dsp.exec_cmd("uwsm app -- " .. browser))
-- Cycle Layout in Specific workspace
hl.bind(mainMod .. " + Tab", cycle_layout("next"))
hl.bind(mainMod .. " + SHIFT + Tab", cycle_layout("prev"))
-- Increases / Decreases active window by x, y relatively
hl.bind("ALT + SHIFT + Z", hl.dsp.window.resize({ x = -80, y = -75, relative = true }))
hl.bind("ALT + SHIFT + C", hl.dsp.window.resize({ x = 80, y = 75, relative = true }))
@@ -131,4 +167,3 @@ for key, cmd in pairs({
}) do
hl.bind("XF86" .. key, hl.dsp.exec_cmd("playerctl " .. cmd), { locked = true })
end
+5 -23
View File
@@ -1,5 +1,3 @@
-- Misc
hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
hl.gesture({ fingers = 3, direction = "vertical", action = "workspace" })
hl.gesture({ fingers = 4, direction = "down", action = "float" })
@@ -9,7 +7,7 @@ hl.config({
kb_layout = us,
kb_variant = "",
kb_model = "",
kb_options = "",
-- kb_options = "caps:swapescape",
kb_rules = "",
repeat_rate = 50,
repeat_delay = 300,
@@ -38,36 +36,20 @@ hl.config({
dwindle = {
preserve_split = true,
smart_resizing = true,
use_active_for_splits = true,
smart_split = false,
default_split_ratio = 1.0,
split_bias = 0,
precise_mouse_move = false,
special_scale_factor = 0.8,
special_scale_factor = 0.95,
},
master = {
new_status = "slave",
new_on_top = false,
new_on_active = "none",
orientation = "left",
mfact = 0.55,
slave_count_for_center_master = 2,
center_master_fallback = "left",
smart_resizing = true,
drop_at_cursor = true,
always_keep_position = false,
new_on_top = true,
new_status = "master",
special_scale_factor = 0.95,
},
scrolling = {
explicit_column_widths = "0.5, 0.6, 1.0",
column_width = 0.6,
fullscreen_on_one_column = true,
direction = "right",
follow_min_visible = 1,
-- focus_fit_method = 0,
follow_focus = true,
},
xwayland = {
+22 -18
View File
@@ -2,28 +2,32 @@
hl.monitor({
output = "eDP-1",
mode = "preferred",
mode = "1920x1080@144",
position = "auto",
scale = 1,
})
-- Env Vars
hl.env("XCURSOR_SIZE", "6")
hl.env("CLUTTER_BACKEND", "wayland")
hl.env("GDK_BACKEND", "wayland,x11,*")
hl.env("QT_QPA_PLATFORM", "wayland;xcb")
hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct")
hl.env("QT_QPA_PLATFORMTHEME", "qt6ct")
hl.env("GDK_SCALE", "1")
hl.env("QT_SCALE_FACTOR", "1")
hl.env("MOZ_ENABLE_WAYLAND", "1")
hl.env("ELECTRON_OZONE_PLATFORM_HINT", "auto")
hl.env("ELECTRON_ARGS", "--enable-features=UseOzonePlatform --ozone-platform=wayland")
for key, val in pairs({
XCURSOR_SIZE = "6",
CLUTTER_BACKEND = "wayland",
GDK_BACKEND = "wayland,x11,*",
QT_QPA_PLATFORM = "wayland;xcb",
QT_AUTO_SCREEN_SCALE_FACTOR = "1",
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1",
QT_QPA_PLATFORMTHEME = "qt6ct",
SDL_VIDEODRIVER = "wayland",
GDK_SCALE = "1",
QT_SCALE_FACTOR = "1",
MOZ_ENABLE_WAYLAND = "1",
ELECTRON_OZONE_PLATFORM_HINT = "auto",
ELECTRON_ARGS = "--enable-features=UseOzonePlatform --ozone-platform=wayland",
-- nvidia
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
hl.env("LIBVA_DRIVER_NAME", "nvidia")
hl.env("SDL_VIDEODRIVER", "wayland")
-- nvidia
GBM_BACKEND = "nvidia-drm",
__GLX_VENDOR_LIBRARY_NAME = "nvidia",
LIBVA_DRIVER_NAME = "nvidia",
}) do
hl.env(key, val)
end
+1 -1
View File
@@ -16,7 +16,7 @@ hl.config({
workspace_swipe_distance = 1000,
workspace_swipe_min_speed_to_force = 1000,
workspace_swipe_direction_lock = false,
workspace_swipe_create_new = false,
workspace_swipe_create_new = true,
workspace_swipe_cancel_ratio = 0.1,
},
})