From e95ea8a8535f05f7647e86af6a7fc326c3bda3af Mon Sep 17 00:00:00 2001 From: kitty piapiac Date: Wed, 29 Jul 2020 09:06:19 -0700 Subject: =?UTF-8?q?(=E3=80=82=E3=83=98=C2=B0)=20init=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ILL WORK ON TILING AFTER THIS I PROMISE --- src/windowmanager.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/windowmanager.nim') diff --git a/src/windowmanager.nim b/src/windowmanager.nim index df00b6c..a4e2058 100644 --- a/src/windowmanager.nim +++ b/src/windowmanager.nim @@ -2,7 +2,7 @@ import x11/[x, xlib], config, /types, logging, /logger, - tables + tables, os type WindowManager* = ref object @@ -16,6 +16,7 @@ type # Initialiazation stuff proc initKeybindings (wm: WindowManager) proc initButtons (wm: WindowManager) +proc initCommands (wm: WindowManager) # KeyFunc Handlers proc procFromFunc (wm: WindowManager, keyfunc: KeyFunc): proc (wm: WindowManager) @@ -66,6 +67,7 @@ proc createWindowManager*: WindowManager = proc run* (wm: WindowManager) = initKeybindings wm initButtons wm + initCommands wm discard XSetErrorHandler onWMDetected # Temporary error handler if there is another window manager running @@ -129,6 +131,10 @@ proc initButtons (wm: WindowManager) = None, None) +proc initCommands (wm: WindowManager) = + for cmd in config.init: + discard execShellCmd cmd + # KeyFunc Handlers proc procFromFunc (wm: WindowManager, keyfunc: KeyFunc): proc (wm: WindowManager) = let procFuncTable = { -- cgit v1.2.3