From 80431dc70e1cf874135e4c4e3f69957bc8432b4c Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Wed, 8 Nov 2023 11:02:37 +0100 Subject: [PATCH] Update 2023-11-08 11:02 OpenBSD/amd64-x13 --- .notion/mod_switch_or_create_ws.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .notion/mod_switch_or_create_ws.lua 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)"), +})