refactor: extract terminal launch logic into shared script
Add terminal-launcher script as a single entry point for launching foot-based terminals with a given class and command. Migrate all .desktop files to use it instead of inline foot invocations. Simplify hyprland keybindings by replacing inline focus_or_launch with hl.dsp.exec_cmd
This commit is contained in:
+17
-14
@@ -274,21 +274,24 @@ function toggle_master()
|
||||
hl.dispatch(hl.dsp.layout("mfact exact " .. mfact))
|
||||
end
|
||||
|
||||
hl.bind(LEADER .. "return", function()
|
||||
focus_or_launch({
|
||||
match = "tmux",
|
||||
field = "class",
|
||||
cmd = "gtk-launch tmux.desktop",
|
||||
})
|
||||
end, { description = "Open tmux terminal" })
|
||||
-- hl.bind(LEADER .. "return", function()
|
||||
-- focus_or_launch({
|
||||
-- match = "terminal-tmux",
|
||||
-- field = "class",
|
||||
-- cmd = "gtk-launch tmux.desktop",
|
||||
-- })
|
||||
-- end, { description = "Open tmux terminal" })
|
||||
|
||||
hl.bind(LEADER .. "SHIFT + return", function()
|
||||
focus_or_launch({
|
||||
match = "herdr",
|
||||
field = "class",
|
||||
cmd = "gtk-launch herdr.desktop",
|
||||
})
|
||||
end, { description = "Open herdr terminal" })
|
||||
-- hl.bind(LEADER .. "SHIFT + return", function()
|
||||
-- focus_or_launch({
|
||||
-- match = "terminal-herdr",
|
||||
-- field = "class",
|
||||
-- cmd = "gtk-launch herdr.desktop",
|
||||
-- })
|
||||
-- end, { description = "Open herdr terminal" })
|
||||
|
||||
hl.bind(LEADER .. "SHIFT + return", hl.dsp.exec_cmd("gtk-launch herdr.desktop"), { description = "Open herdr terminal" })
|
||||
hl.bind(LEADER .. "return", hl.dsp.exec_cmd("gtk-launch tmux.desktop"), { description = "Open tmux terminal" })
|
||||
|
||||
hl.bind(LEADER .. "B", hl.dsp.exec_raw(browser), { description = "Open browser" })
|
||||
hl.bind(LEADER .. "T", hl.dsp.exec_raw(terminal .. " -e btop"), { description = "Open system monitor" })
|
||||
|
||||
Reference in New Issue
Block a user