Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/events.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import
std/[os, osproc],
x11/[x, xlib],
wm,
log,
events/[
buttonpress,
buttonrelease,
Expand Down Expand Up @@ -33,10 +31,6 @@ proc dispatchEvent*(self: var Wm; ev: XEvent) =
else: discard

proc eventLoop*(self: var Wm) =
if fileExists expandTilde "~/.config/worm/rc":
log "config file found, loading..."
discard startProcess expandTilde "~/.config/worm/rc"
log "config file loaded!"
while true:
discard self.dpy.XNextEvent(unsafeAddr self.currEv)
self.dispatchEvent self.currEv
Expand Down
24 changes: 23 additions & 1 deletion src/worm.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
import
std/[os, osproc, parseopt],
wm,
events
events,
log

when isMainModule:
var instance = initWm()

var rcFile = "~/.config/worm/rc"

var p = initOptParser("")
while true:
p.next()
case p.kind
of cmdEnd: break
of cmdLongOption:
case p.key
of "rcfile":
rcFile = p.val
else: discard
else: discard

if fileExists expandTilde rcFile:
log "config file found, loading..."
discard startProcess expandTilde rcFile
log "config file loaded!"

instance.eventLoop()