mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
refactor(Hyprland): updated the default close/kill keybinds for lua
This commit is contained in:
@@ -732,7 +732,7 @@ func luaActionStringFromKnownHyprlandAction(action string) (string, bool) {
|
||||
case "execr":
|
||||
return fmt.Sprintf(`hl.dsp.exec_raw(%s)`, strconv.Quote(params)), true
|
||||
case "killactive":
|
||||
return `hl.dsp.window.kill()`, true
|
||||
return `hl.dsp.window.close()`, true
|
||||
case "forcekillactive":
|
||||
return `hl.dsp.window.kill()`, true
|
||||
case "closewindow":
|
||||
|
||||
@@ -1074,7 +1074,7 @@ func luaExprToDispatcherParams(expr string) (dispatcher, params string) {
|
||||
if arg := luaCallStringArgValue(expr, "hl.dsp.window.close"); arg != "" {
|
||||
return "closewindow", arg
|
||||
}
|
||||
return "closewindow", ""
|
||||
return "killactive", ""
|
||||
case strings.HasPrefix(expr, "hl.dsp.window.kill("):
|
||||
if window := luaTableStringField(expr, "window"); window != "" {
|
||||
return "killwindow", window
|
||||
@@ -1082,7 +1082,7 @@ func luaExprToDispatcherParams(expr string) (dispatcher, params string) {
|
||||
if arg := luaCallStringArgValue(expr, "hl.dsp.window.kill"); arg != "" {
|
||||
return "killwindow", arg
|
||||
}
|
||||
return "killactive", ""
|
||||
return "forcekillactive", ""
|
||||
case strings.HasPrefix(expr, "hl.dsp.window.fullscreen("):
|
||||
switch luaTableStringField(expr, "mode") {
|
||||
case "maximized", "maximize":
|
||||
|
||||
@@ -75,6 +75,8 @@ func TestHyprlandLuaBindRoundTripHelpers(t *testing.T) {
|
||||
{`hl.dispatch([[customdispatcher arg one]])`, "customdispatcher", "arg one"},
|
||||
{`hl.dsp.window.fullscreen({ mode = "maximized", action = "toggle" })`, "fullscreen", "1"},
|
||||
{`hl.dsp.window.float({ action = "on" })`, "setfloating", ""},
|
||||
{`hl.dsp.window.close()`, "killactive", ""},
|
||||
{`hl.dsp.window.kill()`, "forcekillactive", ""},
|
||||
{`hl.dsp.window.close({ window = "class:^(kitty)$" })`, "closewindow", "class:^(kitty)$"},
|
||||
{`hl.dsp.focus({ workspace = "e+1" })`, "workspace", "e+1"},
|
||||
{`hl.dsp.focus({ workspace = "2", on_current_monitor = true })`, "focusworkspaceoncurrentmonitor", "2"},
|
||||
@@ -162,6 +164,8 @@ func TestLuaActionStringFromHyprlangActionUsesNativeDispatchers(t *testing.T) {
|
||||
action string
|
||||
want string
|
||||
}{
|
||||
{"killactive", `hl.dsp.window.close()`},
|
||||
{"forcekillactive", `hl.dsp.window.kill()`},
|
||||
{"workspace 1", `hl.dsp.focus({ workspace = "1" })`},
|
||||
{"movetoworkspace 2", `hl.dsp.window.move({ workspace = "2" })`},
|
||||
{"movetoworkspacesilent special:magic", `hl.dsp.window.move({ workspace = "special:magic", follow = false })`},
|
||||
|
||||
Reference in New Issue
Block a user