Added tmux window creation, movement and exit
This commit is contained in:
parent
8920459d22
commit
90dccf616d
|
@ -1,4 +1,4 @@
|
||||||
local tm = {}
|
local tm = _G.tm or {}
|
||||||
local mb = require("snippets/multibow")
|
local mb = require("snippets/multibow")
|
||||||
--[[
|
--[[
|
||||||
The Keybow layout is as follows when in landscape orientation, with the USB
|
The Keybow layout is as follows when in landscape orientation, with the USB
|
||||||
|
@ -33,11 +33,33 @@ tm.D1 = tm.D1 or 2
|
||||||
tm.D2 = tm.D2 or 1
|
tm.D2 = tm.D2 or 1
|
||||||
tm.D3 = tm.D3 or 0
|
tm.D3 = tm.D3 or 0
|
||||||
|
|
||||||
|
function tm.command(cmd)
|
||||||
|
mb.tap("`")
|
||||||
|
keybow.sleep(50)
|
||||||
|
mb.tap(cmd)
|
||||||
|
end
|
||||||
|
|
||||||
|
function tm.exit()
|
||||||
|
keybow.text("exit")
|
||||||
|
keybow.tap_enter()
|
||||||
|
end
|
||||||
|
|
||||||
tm.keymap = {
|
tm.keymap = {
|
||||||
name="tmux",
|
name="tmux",
|
||||||
[8] = { c={r=0, g=1, b=1}, press=function() mb.tap("`", "b") end},
|
[tm.A2] = { c={r=0, g=1, b=1}, press=function(_) tm.command("v") end},
|
||||||
[10] = { c={r=0, g=1, b=1}, press=function() mb.tap("`", "v") end},
|
[tm.B1] = { c={r=0, g=1, b=1}, press=function(_) tm.command("b") end},
|
||||||
[7] = { c={r=0, g=1, b=1}, press=function() mb.tap("`", "c") end},
|
[tm.B2] = { c={r=0, g=1, b=1}, press=function(_) tm.command("c") end},
|
||||||
|
|
||||||
|
[tm.C1] = { c={r=1, g=1, b=0}, press=function(_) tm.command("h") end},
|
||||||
|
[tm.D1] = { c={r=1, g=1, b=0}, press=function(_) tm.command("l") end},
|
||||||
|
|
||||||
|
[tm.D2] = { c={r=1, g=0, b=1}, press=function(_) tm.command("k") end},
|
||||||
|
[tm.D3] = { c={r=1, g=0, b=1}, press=function(_) tm.command("j") end},
|
||||||
|
|
||||||
|
[tm.B3] = { c={r=0.5, g=1, b=0.5}, press=function(_) tm.command("p") end},
|
||||||
|
[tm.C3] = { c={r=0.5, g=1, b=0.5}, press=function(_) tm.command("n") end},
|
||||||
|
|
||||||
|
[tm.A3] = { c={r=1, g=0, b=0}, press=function(_) tm.exit() end},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue