Better window management
This commit is contained in:
+43
-11
@@ -113,20 +113,52 @@ bind('SUPER + CTRL + L', function()
|
||||
end
|
||||
end
|
||||
|
||||
if workspace.special then
|
||||
hl.workspace_rule { workspace = tostring(workspace.name), layout = next_layout }
|
||||
else
|
||||
hl.workspace_rule { workspace = tostring(workspace.id), layout = next_layout }
|
||||
end
|
||||
hl.workspace_rule { workspace = 'name:' .. tostring(workspace.name), layout = next_layout }
|
||||
|
||||
notify(' Workspace layout set to ' .. next_layout)
|
||||
end, 'Toggle workspace layout')
|
||||
|
||||
local get_current_layout = function()
|
||||
local workspace = hl.get_active_workspace()
|
||||
if hl.get_active_special_workspace() then
|
||||
workspace = hl.get_active_special_workspace()
|
||||
end
|
||||
if not workspace then
|
||||
return 'dwindle'
|
||||
end
|
||||
|
||||
return workspace.tiled_layout
|
||||
end
|
||||
|
||||
-- Move focus with SUPER + arrow keys
|
||||
bind('SUPER + H', hl.dsp.focus { direction = 'left' }, 'Move window focus left')
|
||||
bind('SUPER + L', hl.dsp.focus { direction = 'right' }, 'Move window focus right')
|
||||
bind('SUPER + K', hl.dsp.focus { direction = 'up' }, 'Move window focus up')
|
||||
bind('SUPER + J', hl.dsp.focus { direction = 'down' }, 'Move window focus down')
|
||||
bind('SUPER + H', function()
|
||||
if get_current_layout() == 'monocle' then
|
||||
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = false })
|
||||
else
|
||||
hl.dispatch(hl.dsp.focus { direction = 'left' })
|
||||
end
|
||||
end, 'Move window focus left')
|
||||
bind('SUPER + L', function()
|
||||
if get_current_layout() == 'monocle' then
|
||||
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = true })
|
||||
else
|
||||
hl.dispatch(hl.dsp.focus { direction = 'right' })
|
||||
end
|
||||
end, 'Move window focus right')
|
||||
bind('SUPER + K', function()
|
||||
if get_current_layout() == 'monocle' then
|
||||
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = false })
|
||||
else
|
||||
hl.dispatch(hl.dsp.focus { direction = 'up' })
|
||||
end
|
||||
end, 'Move window focus up')
|
||||
bind('SUPER + J', function()
|
||||
if get_current_layout() == 'monocle' then
|
||||
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = true })
|
||||
else
|
||||
hl.dispatch(hl.dsp.focus { direction = 'down' })
|
||||
end
|
||||
end, 'Move window focus down')
|
||||
bind('SUPER + SHIFT + H', hl.dsp.window.move { direction = 'left' }, 'Move window left')
|
||||
bind('SUPER + SHIFT + L', hl.dsp.window.move { direction = 'right' }, 'Move window right')
|
||||
bind('SUPER + SHIFT + K', hl.dsp.window.move { direction = 'up' }, 'Move window up')
|
||||
@@ -162,8 +194,8 @@ bind('SUPER + D', function()
|
||||
end, 'Toggle comms workspace')
|
||||
|
||||
-- Cycle through applications on active workspace
|
||||
bind('SUPER + TAB', hl.dsp.window.cycle_next { next = true }, 'Cycle to next window')
|
||||
bind('SUPER + SHIFT + TAB', hl.dsp.window.cycle_next { next = false }, 'Cycle to prev window')
|
||||
bind('SUPER + TAB', hl.dsp.window.cycle_next { tiled = true, next = true }, 'Cycle to next window')
|
||||
bind('SUPER + SHIFT + TAB', hl.dsp.window.cycle_next { tiled = true, next = false }, 'Cycle to prev window')
|
||||
-- bind("SUPER + TAB", /*bringactivetotop*/, "Reveal active window on top")
|
||||
-- bind("SUPER SHIFT + TAB", /*bringactivetotop*/, "Reveal active window on top")
|
||||
|
||||
|
||||
+43
-42
@@ -1,11 +1,11 @@
|
||||
-- Variables
|
||||
|
||||
local colors = dofile(os.getenv("HOME") .. "/.cache/wal/colors-hypr.lua")
|
||||
local colors = dofile(os.getenv 'HOME' .. '/.cache/wal/colors-hypr.lua')
|
||||
|
||||
local activeBorderColor = colors.color14
|
||||
local inactiveBorderColor = colors.background
|
||||
|
||||
hl.config({
|
||||
hl.config {
|
||||
-- https://wiki.hyprland.org/Configuring/Variables/#general
|
||||
general = {
|
||||
gaps_in = 5,
|
||||
@@ -26,7 +26,7 @@ hl.config({
|
||||
allow_tearing = false,
|
||||
|
||||
-- layout = scrolling, # Change to niri-like side-scrolling layout
|
||||
layout = "dwindle",
|
||||
layout = 'dwindle',
|
||||
},
|
||||
|
||||
-- https://wiki.hyprland.org/Configuring/Variables/#decoration
|
||||
@@ -42,7 +42,7 @@ hl.config({
|
||||
enabled = true,
|
||||
range = 2,
|
||||
render_power = 3,
|
||||
color = "rgba(1a1a1aee)",
|
||||
color = 'rgba(1a1a1aee)',
|
||||
},
|
||||
|
||||
-- https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||
@@ -66,9 +66,9 @@ hl.config({
|
||||
|
||||
groupbar = {
|
||||
font_size = 12,
|
||||
font_family = "monospace",
|
||||
font_weight_active = "ultraheavy",
|
||||
font_weight_inactive = "normal",
|
||||
font_family = 'monospace',
|
||||
font_weight_active = 'ultraheavy',
|
||||
font_weight_inactive = 'normal',
|
||||
|
||||
indicator_height = 0,
|
||||
indicator_gap = 5,
|
||||
@@ -76,11 +76,11 @@ hl.config({
|
||||
gaps_in = 5,
|
||||
gaps_out = 0,
|
||||
|
||||
text_color = "rgb(ffffff)",
|
||||
text_color_inactive = "rgba(ffffff90)",
|
||||
text_color = 'rgb(ffffff)',
|
||||
text_color_inactive = 'rgba(ffffff90)',
|
||||
col = {
|
||||
active = "rgba(00000040)",
|
||||
inactive = "rgba(00000020)",
|
||||
active = 'rgba(00000040)',
|
||||
inactive = 'rgba(00000020)',
|
||||
},
|
||||
|
||||
gradients = true,
|
||||
@@ -91,7 +91,7 @@ hl.config({
|
||||
-- https://wiki.hyprland.org/Configuring/Variables/#animations
|
||||
animations = {
|
||||
-- enabled = no # Disable all animations
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
},
|
||||
-- See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
dwindle = {
|
||||
@@ -102,7 +102,7 @@ hl.config({
|
||||
|
||||
-- See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
master = {
|
||||
new_status = "master",
|
||||
new_status = 'master',
|
||||
},
|
||||
|
||||
-- https://wiki.hyprland.org/Configuring/Variables/#misc
|
||||
@@ -131,39 +131,40 @@ hl.config({
|
||||
-- Avoid overly wide single-window layouts on wide screens
|
||||
-- single_window_aspect_ratio = 1 1,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
-- Default curves and animations, see https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/
|
||||
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('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 } } })
|
||||
|
||||
-- Default springs
|
||||
hl.curve("easy", { type = "spring", mass = 1, stiffness = 71.2633, dampening = 15.8273644 })
|
||||
hl.curve('easy', { type = 'spring', mass = 1, stiffness = 71.2633, dampening = 15.8273644 })
|
||||
|
||||
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 = "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" })
|
||||
hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" })
|
||||
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 = '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' }
|
||||
hl.animation { leaf = 'zoomFactor', enabled = true, speed = 7, bezier = 'quick' }
|
||||
|
||||
-- Style Gum confirm to match terminal theme
|
||||
hl.env("GUM_CONFIRM_PROMPT_FOREGROUND", "6") -- Cyan
|
||||
hl.env("GUM_CONFIRM_SELECTED_FOREGROUND", "0") -- Black
|
||||
hl.env("GUM_CONFIRM_SELECTED_BACKGROUND", "2") -- Green
|
||||
hl.env("GUM_CONFIRM_UNSELECTED_FOREGROUND", "7") -- White
|
||||
hl.env("GUM_CONFIRM_UNSELECTED_BACKGROUND", "8") -- Dark grey
|
||||
hl.env('GUM_CONFIRM_PROMPT_FOREGROUND', '6') -- Cyan
|
||||
hl.env('GUM_CONFIRM_SELECTED_FOREGROUND', '0') -- Black
|
||||
hl.env('GUM_CONFIRM_SELECTED_BACKGROUND', '2') -- Green
|
||||
hl.env('GUM_CONFIRM_UNSELECTED_FOREGROUND', '7') -- White
|
||||
hl.env('GUM_CONFIRM_UNSELECTED_BACKGROUND', '8') -- Dark grey
|
||||
|
||||
|
||||
@@ -77,3 +77,21 @@ hl.bind('switch:on:Lid Switch', function()
|
||||
setup_monitors()
|
||||
end)
|
||||
|
||||
hl.on('monitor.focused', function()
|
||||
local workspace = hl.get_active_workspace()
|
||||
if hl.get_active_special_workspace() then
|
||||
workspace = hl.get_active_special_workspace()
|
||||
end
|
||||
if not workspace then
|
||||
return
|
||||
end
|
||||
|
||||
local layout = workspace.tiled_layout
|
||||
|
||||
local monitor = hl.get_active_monitor()
|
||||
|
||||
if monitor.description == 'BOE NE160QDM-NZ6' then
|
||||
hl.workspace_rule { workspace = 'name:' .. tostring(workspace.name), layout = 'monocle' }
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user