Update the keybindings and actions
This commit is contained in:
30
planar.lua
30
planar.lua
@@ -17,11 +17,23 @@ local required_globals = {
|
||||
|
||||
local Mods = wau.river_seat_v1.Modifiers
|
||||
|
||||
local term = "foot"
|
||||
local launcher = "rofi -show drun" -- broken on my end. pls check.
|
||||
local xkb_bindings = {
|
||||
{"space", Mods.MOD1, "spawn-foot"},
|
||||
{"q", Mods.MOD1, "close"},
|
||||
{"t", Mods.MOD1, {"spawn", term}},
|
||||
{"f", Mods.MOD1, {"spawn", launcher}}, -- broken on my end. pls check.
|
||||
{"e", Mods.MOD1, "close"},
|
||||
{"q", Mods.MOD1, "exit"},
|
||||
{"r", Mods.MOD1, "reset-view"},
|
||||
{"Escape", Mods.MOD1, "exit"},
|
||||
{"F1", Mods.MOD1, {"goto"}, -2000, -2000},
|
||||
{"F2", Mods.MOD1, {"goto"}, 2000, -2000},
|
||||
{"F3", Mods.MOD1, {"goto"}, -2000, 2000},
|
||||
{"F4", Mods.MOD1, {"goto"}, 2000, 2000}
|
||||
}
|
||||
|
||||
local pointer_bindings = {
|
||||
{"left", Mods.MOD1, "move"},
|
||||
{"right", Mods.MOD1, "resize"},
|
||||
}
|
||||
|
||||
local pointer_bindings = {
|
||||
@@ -254,9 +266,15 @@ function Seat:pointer_resize(window, edges)
|
||||
end
|
||||
|
||||
function Seat:action(action)
|
||||
if action == "spawn-foot" then
|
||||
if posix.unistd.fork() == 0 then
|
||||
posix.unistd.execp("foot", {})
|
||||
if type(action) == "table" then
|
||||
if action[1] == "spawn" then
|
||||
if posix.unistd.fork() == 0 then
|
||||
posix.unistd.execp(action[2], {})
|
||||
end
|
||||
elseif action[1] == "goto" then
|
||||
wm.cam.x = action[2]
|
||||
wm.cam.y = action[3]
|
||||
wm.cam.dirty = true;
|
||||
end
|
||||
elseif action == "reset-view" then
|
||||
wm.cam.x = 0
|
||||
|
||||
Reference in New Issue
Block a user