1(define-module (nmeum packages desktop)
2 #:use-module (guix)
3 #:use-module (guix gexp)
4 #:use-module (guix git-download)
5 #:use-module (guix build-system gnu)
6 #:use-module (guix build-system zig)
7 #:use-module ((guix licenses) #:prefix license:)
8 #:use-module (gnu packages)
9 #:use-module (gnu packages audio)
10 #:use-module (gnu packages fonts)
11 #:use-module (gnu packages zig)
12 #:use-module (gnu packages zig-xyz)
13 #:use-module (gnu packages freedesktop)
14 #:use-module (gnu packages linux)
15 #:use-module (gnu packages xdisorg)
16 #:use-module (gnu packages pkg-config)
17 #:use-module (gnu packages fontutils)
18 #:use-module (gnu packages textutils))
19
20(define-public dumb-runtime-dir
21 (package
22 (name "dumb-runtime-dir")
23 (version "1.0.4")
24 (source
25 (origin
26 (method git-fetch)
27 (uri (git-reference
28 (url "https://github.com/ifreund/dumb_runtime_dir")
29 (commit (string-append "v" version))))
30 (file-name (git-file-name name version))
31 (sha256
32 (base32 "0nrxhvbh3bs4pi4f5h03zw1p1ys19qmmlx263ysly8302wkxk1m4"))))
33 (build-system gnu-build-system)
34 (arguments
35 (list
36 #:tests? #f
37 #:make-flags #~(list (string-append "CC="
38 #$(cc-for-target))
39 (string-append "PREFIX=")
40 (string-append "DESTDIR="
41 #$output))
42 #:phases #~(modify-phases %standard-phases
43 (delete 'configure))))
44 (inputs (list linux-pam))
45 (native-inputs (list pkg-config))
46 (home-page "https://github.com/ifreund/dumb_runtime_dir")
47 (synopsis "Creates an XDG_RUNTIME_DIR via PAM")
48 (description
49 "Provides a acronym{PAM, Pluggable Authentication Module} for
50creating a primitve @code{XDG_RUNTIME_DIR} that is never removed. This
51is useful in conjuction with simple seat managers like @code{seatd}
52which do not set @code{XDG_RUNTIME_DIR}.")
53 (license license:bsd-0)))
54
55(define-public zig-fcft
56 (package
57 (name "zig-fcft")
58 (version "1.1.0")
59 (source
60 (origin
61 (method git-fetch)
62 (uri (git-reference
63 (url "https://git.sr.ht/~novakane/zig-fcft")
64 (commit version)))
65 (file-name (git-file-name name version))
66 (sha256
67 (base32 "0im0rdwww7xxvhmibfp3459h8wwdmihjb9m7vmzxkgqs4x77l114"))))
68 (build-system zig-build-system)
69 (arguments
70 (list
71 #:skip-build? #t
72 #:tests? #f))
73 (propagated-inputs (list zig-pixman fcft))
74 (native-inputs (list pkg-config))
75 (synopsis "Zig bindings for the fcft font library")
76 (description "")
77 (home-page "https://git.sr.ht/~novakane/zig-fcft")
78 (license license:expat)))
79
80(define-public creek
81 (package
82 (name "creek")
83 (version "0.4.2")
84 (source
85 (origin
86 (method git-fetch)
87 (uri (git-reference
88 (url "https://github.com/nmeum/creek")
89 (commit (string-append "v" version))
90 (recursive? #t)))
91 (file-name (git-file-name name version))
92 (sha256
93 (base32 "0b1gpxgi207cqrls6qp0pd6749g60yfcrjii8nagm00c678bs3nx"))))
94 (build-system zig-build-system)
95 (arguments
96 (list
97 #:zig-release-type "safe"
98 #:tests? #f))
99 (native-inputs (list fcft
100 pixman
101 pkg-config
102 zig-wayland
103 zig-fcft
104 zig-pixman))
105 (home-page "https://github.com/nmeum/leeve")
106 (synopsis
107 "A minimalistic and malleable status bar for the River compositor.")
108 (description "A fork of the creek status bar which intended to be
109more mallable then the original version. For example,
110supporting custom status bar information via stdin.")
111 (license license:expat)))
112
113(define-public ustatus
114 (let ((commit "4032e2010de049472b7af57e85b7e4728fdde5e7")
115 (revision "0"))
116 (package
117 (name "ustatus")
118 (version (git-version "20190721" revision commit))
119 (source
120 (origin
121 (method git-fetch)
122 (uri (git-reference
123 (url "https://github.com/nmeum/ustatus")
124 (commit commit)))
125 (file-name (git-file-name name version))
126 (sha256
127 (base32 "0a9pf51c2j68s7limdhw8ccqhyc1lk3q0iddfh1y65m18jh1vmn1"))))
128 (build-system gnu-build-system)
129 (arguments
130 (list
131 #:tests? #f
132 #:make-flags
133 #~(list (string-append "CC="
134 #$(cc-for-target)))
135 #:phases
136 #~(modify-phases %standard-phases
137 (replace 'configure
138 (lambda _
139 (with-output-to-file "config.h"
140 (lambda _
141 (display
142 "static const int delay = 5;
143 static const char *statsep = \" | \";
144 static const char *timefmt = \"%a %d %b -- %H:%M:%S\";
145 static const char *sysbat = \"/sys/class/power_supply/BAT0\";
146 static const char *syscur = \"charge_now\";
147 static const char *sysfull = \"charge_full_design\";
148 static const unsigned int sndcrd = 0;
149 static const char* swtchname = \"Master Playback Switch\";
150 static const char* volumname = \"Master Playback Volume\";
151
152 static size_t batcapmay(char *dest, size_t n) {
153 size_t ret;
154 static int hasbat = -1;
155
156 if (hasbat == -1) {
157 if (access(sysbat, F_OK)) {
158 hasbat = 0;
159 return 0;
160 }
161 hasbat = 1;
162 } else if (!hasbat) {
163 return 0;
164 }
165
166 ret = batcap(dest, n);
167 if (ret)
168 ret += separator(&dest[ret], n - ret);
169
170 return ret;
171 }
172
173 static size_t (* const sfuncs[])(char*, size_t) = {
174 batcapmay,
175 loadavg,
176 separator,
177 curtime,
178 };
179 ")))))
180 (replace 'install
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((outdir (assoc-ref outputs "out"))
183 (bindir (string-append outdir "/bin")))
184 (mkdir-p bindir)
185 (copy-file "ustatus"
186 (string-append bindir "/ustatus"))))))))
187 (inputs (list tinyalsa))
188 (native-inputs (list pkg-config))
189 (home-page "https://git.8pit.net/ustatus")
190 (synopsis "Minimal status tool for dwm-like status bars")
191 (description "")
192 (license license:wtfpl2))))
193
194(define-public dam
195 (let ((commit "e6eb713fb3239aad3c534502d8c0e42e4e514c8f")
196 (revision "1"))
197 (package
198 (name "dam")
199 (version (git-version "0" revision commit))
200 (source
201 (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://codeberg.org/sewn/dam")
205 (commit commit)))
206 (file-name (git-file-name name version))
207 (sha256
208 (base32 "0ybhyvv3n1xdy5hb1xw7l2rzy73n5vhh8r60gfbf61crhggnzh8k"))))
209 (build-system gnu-build-system)
210 (arguments
211 (list
212 #:tests? #f
213 #:make-flags #~(list (string-append "PREFIX=" #$output))
214 #:phases #~(modify-phases %standard-phases
215 (add-before 'configure 'set-cc-command
216 (lambda _
217 (setenv "CC" #$(cc-for-target))))
218 (delete 'configure))))
219 (inputs (list fcft pixman wayland wayland-protocols))
220 (native-inputs (list pkg-config))
221 (home-page "https://codeberg.org/sewn/dam")
222 (synopsis "A itsy-bitsy dwm-esque bar for the river compositor")
223 (description "")
224 (license license:expat))))
225
226(define-public font-terminus-patched
227 (package
228 (inherit font-terminus)
229 (name "font-terminus-patched")
230 (arguments
231 (substitute-keyword-arguments (package-arguments font-terminus)
232 ((#:phases phases
233 '%standard-phases)
234 #~(modify-phases #$phases
235 (add-after 'unpack 'patch-font
236 (lambda _
237 (invoke "patch" "-p0" "-i" "alt/td1.diff")
238 (invoke "patch" "-p0" "-i" "alt/ll2.diff")))))))))