aboutsummaryrefslogtreecommitdiff
path: root/module/vulgar/info.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-06-01 21:56:52 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-06-01 21:56:58 +0200
commitb0d552ffe3e336606de907897181a0f0718b3149 (patch)
treef08d02b8bdead2106f1ca2377cd422f3694e3aa2 /module/vulgar/info.scm
parentRename {terminal => vulgar}. (diff)
downloadcalp-b0d552ffe3e336606de907897181a0f0718b3149.tar.gz
calp-b0d552ffe3e336606de907897181a0f0718b3149.tar.xz
Reword terminal output to better modularization.
Diffstat (limited to 'module/vulgar/info.scm')
-rw-r--r--module/vulgar/info.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/module/vulgar/info.scm b/module/vulgar/info.scm
new file mode 100644
index 00000000..86abf0a0
--- /dev/null
+++ b/module/vulgar/info.scm
@@ -0,0 +1,9 @@
+(define-module (vulgar info)
+ :use-module (util))
+
+(define-public (get-terminal-size)
+ (let* (((rpipe . wpipe) (pipe)))
+ (system (format #f "stty size > /proc/~s/fd/~s"
+ (getpid) (port->fdes wpipe)))
+ (values (read rpipe)
+ (read rpipe))))