Update the keybindings and actions
This commit is contained in:
28
planar.lua
28
planar.lua
@@ -17,11 +17,23 @@ local required_globals = {
|
|||||||
|
|
||||||
local Mods = wau.river_seat_v1.Modifiers
|
local Mods = wau.river_seat_v1.Modifiers
|
||||||
|
|
||||||
|
local term = "foot"
|
||||||
|
local launcher = "rofi -show drun" -- broken on my end. pls check.
|
||||||
local xkb_bindings = {
|
local xkb_bindings = {
|
||||||
{"space", Mods.MOD1, "spawn-foot"},
|
{"t", Mods.MOD1, {"spawn", term}},
|
||||||
{"q", Mods.MOD1, "close"},
|
{"f", Mods.MOD1, {"spawn", launcher}}, -- broken on my end. pls check.
|
||||||
|
{"e", Mods.MOD1, "close"},
|
||||||
|
{"q", Mods.MOD1, "exit"},
|
||||||
{"r", Mods.MOD1, "reset-view"},
|
{"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 = {
|
local pointer_bindings = {
|
||||||
@@ -254,9 +266,15 @@ function Seat:pointer_resize(window, edges)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Seat:action(action)
|
function Seat:action(action)
|
||||||
if action == "spawn-foot" then
|
if type(action) == "table" then
|
||||||
|
if action[1] == "spawn" then
|
||||||
if posix.unistd.fork() == 0 then
|
if posix.unistd.fork() == 0 then
|
||||||
posix.unistd.execp("foot", {})
|
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
|
end
|
||||||
elseif action == "reset-view" then
|
elseif action == "reset-view" then
|
||||||
wm.cam.x = 0
|
wm.cam.x = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user