add descriptions to keybinds

This commit is contained in:
2026-08-12 23:27:12 -07:00
parent bfe5419bb9
commit 29f19bb45d
+129 -31
View File
@@ -37,40 +37,71 @@ hl.bind(
hl.dsp.exec_cmd("noctalia msg panel-toggle launcher"), hl.dsp.exec_cmd("noctalia msg panel-toggle launcher"),
{ description = "Toggle Noctalia launcher" } { description = "Toggle Noctalia launcher" }
) )
hl.bind(chord(main, "W"), hl.dsp.window.close()) hl.bind(
hl.bind(chord(main, "Q"), hl.dsp.exec_cmd(commands.uwsm(settings.programs.terminal))) chord(main, "W"),
hl.bind(chord(main, "E"), hl.dsp.exec_cmd(commands.uwsm(settings.programs.file_manager))) hl.dsp.window.close(),
hl.bind(chord(main, "V"), hl.dsp.window.float({ action = "toggle" })) { description = "Close focused window" }
hl.bind(chord(main, "R"), hl.dsp.exec_cmd(settings.programs.launcher)) )
hl.bind(chord(main, "P"), hl.dsp.window.pseudo()) hl.bind(
hl.bind(chord(main, "J"), hl.dsp.layout("togglesplit")) chord(main, "Q"),
hl.dsp.exec_cmd(commands.uwsm(settings.programs.terminal)),
{ description = "Open terminal" }
)
hl.bind(
chord(main, "E"),
hl.dsp.exec_cmd(commands.uwsm(settings.programs.file_manager)),
{ description = "Open file manager" }
)
hl.bind(
chord(main, "V"),
hl.dsp.window.float({ action = "toggle" }),
{ description = "Toggle focused window floating" }
)
hl.bind(
chord(main, "R"),
hl.dsp.exec_cmd(settings.programs.launcher),
{ description = "Open application launcher" }
)
hl.bind(
chord(main, "P"),
hl.dsp.window.pseudo(),
{ description = "Toggle pseudo-tiling for focused window" }
)
hl.bind(
chord(main, "J"),
hl.dsp.layout("togglesplit"),
{ description = "Toggle dwindle split direction" }
)
-- One direction table drives arrow-key focus, Hyper+WASD focus/movement, and -- One direction table drives arrow-key focus, Hyper+WASD focus/movement, and
-- moving the active workspace between adjacent monitors. -- moving the active workspace between adjacent monitors.
local directions = { local directions = {
{ arrow = "left", key = "A", direction = "l" }, { arrow = "left", key = "A", direction = "l", monitor = "left" },
{ arrow = "right", key = "D", direction = "r" }, { arrow = "right", key = "D", direction = "r", monitor = "right" },
{ arrow = "up", key = "W", direction = "u" }, { arrow = "up", key = "W", direction = "u", monitor = "above" },
{ arrow = "down", key = "S", direction = "d" }, { arrow = "down", key = "S", direction = "d", monitor = "below" },
} }
for _, direction in ipairs(directions) do for _, direction in ipairs(directions) do
hl.bind( hl.bind(
chord(main, direction.arrow), chord(main, direction.arrow),
hl.dsp.focus({ direction = direction.arrow }) hl.dsp.focus({ direction = direction.arrow }),
{ description = "Focus window " .. direction.arrow }
) )
hl.bind( hl.bind(
chord(hyper, direction.key), chord(hyper, direction.key),
hl.dsp.focus({ direction = direction.direction }) hl.dsp.focus({ direction = direction.direction }),
{ description = "Focus window " .. direction.arrow }
) )
hl.bind( hl.bind(
chord(hyper, "CTRL", direction.key), chord(hyper, "CTRL", direction.key),
hl.dsp.window.move({ direction = direction.direction }) hl.dsp.window.move({ direction = direction.direction }),
{ description = "Move focused window " .. direction.arrow }
) )
hl.bind( hl.bind(
chord(hyper, main, direction.key), chord(hyper, main, direction.key),
hl.dsp.workspace.move({ monitor = direction.direction }), hl.dsp.workspace.move({ monitor = direction.direction }),
{ description = "Move workspace " .. direction.direction } { description = "Move workspace to monitor " .. direction.monitor }
) )
end end
@@ -78,28 +109,94 @@ bind_numbered_workspaces(main, "SHIFT", 10)
bind_numbered_workspaces(hyper, "CTRL", 9) bind_numbered_workspaces(hyper, "CTRL", 9)
-- Cycle workspaces with the wheel and manipulate windows with mouse buttons. -- Cycle workspaces with the wheel and manipulate windows with mouse buttons.
hl.bind(chord(main, "mouse_down"), hl.dsp.focus({ workspace = "e+1" })) hl.bind(
hl.bind(chord(main, "mouse_up"), hl.dsp.focus({ workspace = "e-1" })) chord(main, "mouse_down"),
hl.bind(chord(main, "mouse:272"), hl.dsp.window.drag(), { mouse = true }) hl.dsp.focus({ workspace = "e+1" }),
hl.bind(chord(main, "mouse:273"), hl.dsp.window.resize(), { mouse = true }) { description = "Switch to next workspace" }
)
hl.bind(
chord(main, "mouse_up"),
hl.dsp.focus({ workspace = "e-1" }),
{ description = "Switch to previous workspace" }
)
hl.bind(
chord(main, "mouse:272"),
hl.dsp.window.drag(),
{ mouse = true, description = "Drag focused window" }
)
hl.bind(
chord(main, "mouse:273"),
hl.dsp.window.resize(),
{ mouse = true, description = "Resize focused window" }
)
-- Locked media keys also work while the session is locked. Volume and -- Locked media keys also work while the session is locked. Volume and
-- brightness binds repeat while held; playback controls fire once. -- brightness binds repeat while held; playback controls fire once.
local media_binds = { local media_binds = {
{ "XF86AudioRaiseVolume", "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+", { locked = true, repeating = true } }, {
{ "XF86AudioLowerVolume", "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-", { locked = true, repeating = true } }, key = "XF86AudioRaiseVolume",
{ "XF86AudioMute", "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", { locked = true, repeating = true } }, command = "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+",
{ "XF86AudioMicMute", "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle", { locked = true, repeating = true } }, description = "Increase output volume",
{ "XF86MonBrightnessUp", "brightnessctl -e4 -n2 set 5%+", { locked = true, repeating = true } }, repeating = true,
{ "XF86MonBrightnessDown", "brightnessctl -e4 -n2 set 5%-", { locked = true, repeating = true } }, },
{ "XF86AudioNext", "playerctl next", { locked = true } }, {
{ "XF86AudioPause", "playerctl play-pause", { locked = true } }, key = "XF86AudioLowerVolume",
{ "XF86AudioPlay", "playerctl play-pause", { locked = true } }, command = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-",
{ "XF86AudioPrev", "playerctl previous", { locked = true } }, description = "Decrease output volume",
repeating = true,
},
{
key = "XF86AudioMute",
command = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
description = "Toggle output mute",
repeating = true,
},
{
key = "XF86AudioMicMute",
command = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle",
description = "Toggle microphone mute",
repeating = true,
},
{
key = "XF86MonBrightnessUp",
command = "brightnessctl -e4 -n2 set 5%+",
description = "Increase display brightness",
repeating = true,
},
{
key = "XF86MonBrightnessDown",
command = "brightnessctl -e4 -n2 set 5%-",
description = "Decrease display brightness",
repeating = true,
},
{
key = "XF86AudioNext",
command = "playerctl next",
description = "Play next media track",
},
{
key = "XF86AudioPause",
command = "playerctl play-pause",
description = "Toggle media playback",
},
{
key = "XF86AudioPlay",
command = "playerctl play-pause",
description = "Toggle media playback",
},
{
key = "XF86AudioPrev",
command = "playerctl previous",
description = "Play previous media track",
},
} }
for _, bind in ipairs(media_binds) do for _, bind in ipairs(media_binds) do
hl.bind(bind[1], hl.dsp.exec_cmd(bind[2]), bind[3]) hl.bind(bind.key, hl.dsp.exec_cmd(bind.command), {
locked = true,
repeating = bind.repeating,
description = bind.description,
})
end end
-- Generate focus/move shortcuts for every named workspace in settings.lua. -- Generate focus/move shortcuts for every named workspace in settings.lua.
@@ -128,7 +225,8 @@ hl.bind(
chord(hyper, "SPACE"), chord(hyper, "SPACE"),
function() function()
hl.plugin.hyprtasking.toggle("all") hl.plugin.hyprtasking.toggle("all")
end end,
{ description = "Toggle all-workspace window overview" }
) )
-- Toggle a focused client into an 80%-sized centered floating mode. Returning -- Toggle a focused client into an 80%-sized centered floating mode. Returning