commit 8ade3d6

hovercats  ·  2026-09-03 11:21:23 +0000 UTC
parent 306325b
cterm: new package
7 files changed,  +154, -0
+5, -0
1@@ -486,3 +486,8 @@
2 [submodule "pkg/yap/src"]
3 	path = pkg/yap/src
4 	url = https://srcdump.net/shrub/yap.git
5+[submodule "pkg/cterm/src"]
6+	path = pkg/cterm/src
7+	url = https://srcdump.net/uint/cterm.git
8+	ignore = all
9+	shallow = true
+61, -0
 1@@ -0,0 +1,61 @@
 2+#ifndef CONFIG_H
 3+#define CONFIG_H
 4+
 5+#include <stdbool.h>
 6+#include <stdint.h>
 7+#include <stdlib.h>
 8+
 9+static const char font_path[] = "/share/fonts/terminus/ter-u12n.bdf";
10+
11+static const int   win_width = 70;  /* in columns */
12+static const int   win_height = 25; /* in rows */
13+static const char  win_title[] = "cterm";
14+static const int   win_fps = 60;
15+
16+static const int   pad_x = 8;
17+static const int   pad_y = 8;
18+
19+static const char* const shell = "/bin/ksh"; /* NULL uses $SHELL */
20+static const char term_name[] = "vt100";
21+
22+#define CTRL_DOWN  (win->key_syms[MAUS_KEY_CONTROL_L] || win->key_syms[MAUS_KEY_CONTROL_R])
23+#define SHIFT_DOWN (win->key_syms[MAUS_KEY_SHIFT_L] || win->key_syms[MAUS_KEY_SHIFT_R])
24+
25+#define BIND_COPY  (CTRL_DOWN && SHIFT_DOWN && \
26+                   (ev->key.key == MAUS_KEY_C || ev->key.key == MAUS_KEY_C_UP))
27+
28+#define BIND_PASTE (CTRL_DOWN && SHIFT_DOWN && \
29+                   (ev->key.key == MAUS_KEY_V || ev->key.key == MAUS_KEY_V_UP))
30+
31+#define BIND_RELOAD_FONT (win->key_syms[MAUS_KEY_ALT_R] && \
32+                         (ev->key.key == MAUS_KEY_R ||     \
33+                         ev->key.key == MAUS_KEY_R_UP))
34+
35+/* AARRGGBB */
36+static const uint32_t default_fg = 0xffffffff;
37+static const uint32_t default_bg = 0xff000000;
38+static const uint32_t cursor_fg  = 0xff000000;
39+static const uint32_t cursor_bg  = 0xffffffff;
40+
41+static const uint32_t color_table[16] = {
42+	0xff000000, /* black */
43+	0xffcc0000, /* red */
44+	0xff4e9a06, /* green */
45+	0xffc4a000, /* yellow */
46+	0xff3465a4, /* blue */
47+	0xff75507b, /* magenta */
48+	0xff06989a, /* cyan */
49+	0xffd3d7cf, /* white */
50+
51+	0xff555753, /* bright black */
52+	0xffef2929, /* bright red */
53+	0xff8ae234, /* bright green */
54+	0xfffce94f, /* bright yellow */
55+	0xff729fcf, /* bright blue */
56+	0xffad7fa8, /* bright magenta */
57+	0xff34e2e2, /* bright cyan */
58+	0xffffffff, /* bright white */
59+};
60+
61+#endif /* CONFIG_H */
62+
+46, -0
 1@@ -0,0 +1,46 @@
 2+cflags{
 3+	'-std=c99',
 4+	'-pedantic',
 5+	'-D HAVE_CONFIG_H',
 6+	'-D _XOPEN_SOURCE=700',
 7+	'-D BACKEND_WAY',
 8+	'-I $dir',
 9+	'-I $srcdir/include',
10+	'-I $srcdir/libmaus/include',
11+	'-isystem $builddir/pkg/libxkbcommon/include',
12+	'-isystem $builddir/pkg/wayland/include',
13+	'-isystem $builddir/pkg/wayland-protocols/include',
14+}
15+
16+pkg.deps = {
17+	'pkg/libxkbcommon/headers',
18+	'pkg/wayland/headers',
19+	'pkg/wayland-protocols/headers',
20+}
21+
22+lib('libmaus.a', [[libmaus/source/(
23+	maus.c maus_font.c
24+	maus_wayland.c utils.c
25+	)
26+	$builddir/pkg/(
27+		libxkbcommon/libxkbcommon.a
28+		wayland/libwayland-cursor.a.d
29+		wayland/libwayland-client.a.d
30+	)
31+]])
32+
33+exe('cterm', [[source/(
34+	cterm.c utils.c font.c
35+	term.c draw.c
36+	)
37+	$builddir/pkg/(
38+		wayland-protocols/pointer-constraints-unstable-v1-protocol.c.o
39+		wayland-protocols/relative-pointer-unstable-v1-protocol.c.o
40+		wayland-protocols/xdg-shell-protocol.c.o
41+	)
42+	libmaus.a.d
43+]])
44+
45+file('bin/cterm', '755', '$outdir/cterm')
46+
47+fetch 'git'
+39, -0
 1@@ -0,0 +1,39 @@
 2+From 85f70e78d0e589361d873e5463b58bc73898508c Mon Sep 17 00:00:00 2001
 3+From: hovercats <hovercatswithlasereyes@protonmail.com>
 4+Date: Wed, 2 Sep 2026 14:15:15 +0200
 5+Subject: [PATCH] dont use relative path for config.h
 6+
 7+---
 8+ source/cterm.c | 2 +-
 9+ source/term.c  | 2 +-
10+ 2 files changed, 2 insertions(+), 2 deletions(-)
11+
12+diff --git a/source/cterm.c b/source/cterm.c
13+index 08993ce..8c0d734 100644
14+--- a/source/cterm.c
15++++ b/source/cterm.c
16+@@ -19,7 +19,7 @@
17+ 
18+ #include <maus.h>
19+ 
20+-#include "../config.h"
21++#include "config.h"
22+ #include "draw.h"
23+ #include "font.h"
24+ #include "term.h"
25+diff --git a/source/term.c b/source/term.c
26+index d07558a..0af05cb 100644
27+--- a/source/term.c
28++++ b/source/term.c
29+@@ -2,7 +2,7 @@
30+ #include <stdlib.h>
31+ #include <string.h>
32+ 
33+-#include "../config.h"
34++#include "config.h"
35+ #include "term.h"
36+ #include "utils.h"
37+ 
38+-- 
39+2.54.0
40+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 8c67496e9c7b007ba080b1e6da63d1fe23bf5193
+1, -0
1@@ -0,0 +1 @@
2+8c67496
+1, -0
1@@ -12,6 +12,7 @@ subgen 'cacert'
2 subgen 'catgirl'
3 subgen 'chum'
4 subgen 'cproc'
5+subgen 'cterm'
6 subgen 'curl'
7 subgen 'dav1d'
8 subgen 'dmenu'