diff --git a/.notion/mod_switch_or_create_ws.lua b/.notion/mod_switch_or_create_ws.lua new file mode 100644 index 0000000..e97b589 --- /dev/null +++ b/.notion/mod_switch_or_create_ws.lua @@ -0,0 +1,17 @@ +-- create ws (if not present) and switch +function ws_switch_or_create(ws) + if not WScreen.switch_nth(_, ws) then + ioncore.create_ws(_, ws) + WScreen.switch_nth(_, ws) + end +end + +-- ideally, if I leave a workspace with nothing but an empty frame, it could be deleted. +-- but that's for another year. + +-- later mapped to META..0-9 +ioncore.defbindings("WScreen", { + kpress(META.."5", "ws_switch_or_create(5)"), + kpress(META.."6", "ws_switch_or_create(6)"), + kpress(META.."7", "ws_switch_or_create(7)"), +})