summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2020-08-10 20:29:56 -0700
committerkitty piapiac <kcp@bsd.computer>2020-08-10 20:29:56 -0700
commit92baae67185f19c71c99134a06d5d42a43e83703 (patch)
tree4c402915dbad2ea38bd3fcbb65e5deef61102dba
parent1ff1a0f51255958e83ee7c3f17fd0be8c628fc51 (diff)
(。ヘ°) actually... fuck custom layouts
ill deal with them later
-rw-r--r--TODO6
-rw-r--r--src/config.def.nim4
-rw-r--r--src/layouts.nim17
-rw-r--r--src/objects.nim2
4 files changed, 7 insertions, 22 deletions
diff --git a/TODO b/TODO
index d59e06d..a8d6b16 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,6 @@
Todo:
[ ] Better configuration
- [ ] More layouts
- [x] Tiling \ No newline at end of file
+ [ ] Layout system (Allow for easy custom layouts)
+ [x] Tiling
+ [ ] Gaps
+ [ ] Tags or workspaces \ No newline at end of file
diff --git a/src/config.def.nim b/src/config.def.nim
index d62caf7..39de9e5 100644
--- a/src/config.def.nim
+++ b/src/config.def.nim
@@ -15,11 +15,11 @@ const
# in pixels
frameWidth* = 2
- init* = @[
+ init* = [
"xsetroot -solid \"" & colours.background & "\""]
# store keybindings here
- keybindings*: seq[Key] = @[
+ keybindings* = [
# alt + shift + q will close the focused window
initKey( closeWindow,
key = "q",
diff --git a/src/layouts.nim b/src/layouts.nim
deleted file mode 100644
index 3de5da4..0000000
--- a/src/layouts.nim
+++ /dev/null
@@ -1,17 +0,0 @@
-import objects, x11/xlib
-
-proc masterStack* (wm: WindowManager, w: cuint, h: cuint, offset: cuint) =
- var
- n = cuint wm.clients.len
- leftoverPixels = h - ((n-1) * (h div (n-1)))
- lastEnd: cint = 0
-
- for i in 1..n-1:
- var height = (h div (n-1))
- if leftoverPixels > 0:
- height += 1
- leftoverPixels -= 1
-
- discard wm.display.XMoveResizeWindow(wm.clients[i], cint w div 2, lastEnd, (w div 2)-offset, height-offset)
-
- lastEnd += cint height \ No newline at end of file
diff --git a/src/objects.nim b/src/objects.nim
index ed83fa8..1c8ed35 100644
--- a/src/objects.nim
+++ b/src/objects.nim
@@ -23,7 +23,7 @@ type
focused*: int
keys*: Table[cuint, objects.Key]
-proc initKey* (keyfunc: KeyFunc, mods: cuint, key: string, command = ""): Key =
+proc key* (mods: cuint, key: string, keyfunc: KeyFunc, command = ""): Key =
return Key(
mods: mods,
key: key,