From 54b209016645a304b0a320ae62fe055c8e8ee72a Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 25 May 2023 23:06:07 +0200 Subject: Added sent slideshow utility --- external | 1 + sent/.SRCINFO | 20 +++++++++++++++++++ sent/PKGBUILD | 35 +++++++++++++++++++++++++++++++++ sent/font_scale.patch | 17 ++++++++++++++++ sent/slide_numbers.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ sent/solarized.patch | 14 ++++++++++++++ 6 files changed, 137 insertions(+) create mode 100644 sent/.SRCINFO create mode 100644 sent/PKGBUILD create mode 100644 sent/font_scale.patch create mode 100644 sent/slide_numbers.patch create mode 100644 sent/solarized.patch diff --git a/external b/external index 0be2c16..63b93b0 100644 --- a/external +++ b/external @@ -1,4 +1,5 @@ https://aur.archlinux.org/entt.git +https://aur.archlinux.org/farbfeld.git https://aur.archlinux.org/lua-gumbo-git.git https://aur.archlinux.org/mingw-w64-cmake.git https://aur.archlinux.org/mingw-w64-environment.git diff --git a/sent/.SRCINFO b/sent/.SRCINFO new file mode 100644 index 0000000..17460e7 --- /dev/null +++ b/sent/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = sent + pkgdesc = Simple plaintext presentation tool + pkgver = 1 + pkgrel = 1 + arch = x86_64 + arch = i686 + license = ISC + depends = libxft + depends = libx11 + depends = farbfeld + source = https://dl.suckless.org/tools/sent-1.tar.gz + source = solarized.patch + source = slide_numbers.patch + source = font_scale.patch + sha256sums = 7bf3de9311ce291ff36adf5315b78fa72373e3ab80ca71387fb5884bcbd7be33 + sha256sums = 9e69d6b3690b5e96cac533ee75b1a5ff73e85840eb4b2557aaba53200f773690 + sha256sums = 7ce2f4a50fa5dbaa94c4301ae51c4e79ba3aad97f8ad93c166dbe30f0c86e9e9 + sha256sums = 1221885592ffb5df9817de2aac862e0de393d880326e67ad7b723863a4958907 + +pkgname = sent diff --git a/sent/PKGBUILD b/sent/PKGBUILD new file mode 100644 index 0000000..d1ec109 --- /dev/null +++ b/sent/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Aki +pkgname=sent +pkgver=1 +pkgrel=1 +license=(ISC) +pkgdesc='Simple plaintext presentation tool' +arch=(x86_64 i686) +depends=(libxft libx11 farbfeld) +source=( + "https://dl.suckless.org/tools/${pkgname}-${pkgver}.tar.gz" + 'solarized.patch' + 'slide_numbers.patch' + 'font_scale.patch') +sha256sums=( + '7bf3de9311ce291ff36adf5315b78fa72373e3ab80ca71387fb5884bcbd7be33' + '9e69d6b3690b5e96cac533ee75b1a5ff73e85840eb4b2557aaba53200f773690' + '7ce2f4a50fa5dbaa94c4301ae51c4e79ba3aad97f8ad93c166dbe30f0c86e9e9' + '1221885592ffb5df9817de2aac862e0de393d880326e67ad7b723863a4958907') + + +prepare() { + patch --forward --strip=1 --input=solarized.patch + patch --forward --strip=1 --input=slide_numbers.patch + patch --forward --strip=1 --input=font_scale.patch +} + + +build() { + make +} + + +package() { + make DESTDIR="${pkgdir}" PREFIX=/usr install +} diff --git a/sent/font_scale.patch b/sent/font_scale.patch new file mode 100644 index 0000000..72d4b2a --- /dev/null +++ b/sent/font_scale.patch @@ -0,0 +1,17 @@ +diff '--color=auto' --unified --recursive --text src.orig/config.def.h src.new/config.def.h +--- src.orig/config.def.h 2023-05-25 23:02:38.884269251 +0200 ++++ src.new/config.def.h 2023-05-25 23:02:44.684269426 +0200 +@@ -5,7 +5,7 @@ + "roboto", + "ubuntu", + }; +-#define NUMFONTSCALES 42 ++#define NUMFONTSCALES 16 + #define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */ + #define SLIDENUMBERSCALE 5 + +Only in src.new: drw.o +Only in src.new: sent +Only in src.orig: sent-1.tar.gz +Only in src.new: sent.o +Only in src.new: util.o diff --git a/sent/slide_numbers.patch b/sent/slide_numbers.patch new file mode 100644 index 0000000..51fa876 --- /dev/null +++ b/sent/slide_numbers.patch @@ -0,0 +1,50 @@ +diff '--color=auto' --unified --recursive --text src.orig/config.def.h src.new/config.def.h +--- src.orig/config.def.h 2023-05-25 23:01:23.204266978 +0200 ++++ src.new/config.def.h 2023-05-25 23:00:47.904265895 +0200 +@@ -7,6 +7,7 @@ + }; + #define NUMFONTSCALES 42 + #define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */ ++#define SLIDENUMBERSCALE 5 + + static const char *colors[] = { + "#eee8d5", /* foreground color */ +Only in src.new: drw.o +Only in src.new: sent +Only in src.orig: sent-1.tar.gz +diff '--color=auto' --unified --recursive --text src.orig/sent.c src.new/sent.c +--- src.orig/sent.c 2017-09-03 23:57:26.000000000 +0200 ++++ src.new/sent.c 2023-05-25 22:57:14.934259453 +0200 +@@ -513,8 +513,9 @@ + void + xdraw() + { +- unsigned int height, width, i; ++ unsigned int height, width, i, numw; + Image *im = slides[idx].img; ++ char num[12] = {0}; + + getfontsize(&slides[idx], &width, &height); + XClearWindow(xw.dpy, xw.win); +@@ -530,6 +531,19 @@ + 0, + slides[idx].lines[i], + 0); ++ if (idx >= 0) { ++ snprintf(num, 12, "%d", idx + 1); ++ drw_setfontset(d, fonts[SLIDENUMBERSCALE]); ++ numw = drw_fontset_getwidth(d, num); ++ drw_text(d, ++ d->fonts->h / 2, ++ xw.h - d->fonts->h - d->fonts->h / 2, ++ numw, ++ d->fonts->h, ++ 0, ++ num, ++ 0); ++ } + drw_map(d, xw.win, 0, 0, xw.w, xw.h); + } else { + if (!(im->state & SCALED)) +Only in src.new: sent.o +Only in src.new: util.o diff --git a/sent/solarized.patch b/sent/solarized.patch new file mode 100644 index 0000000..bd67b1f --- /dev/null +++ b/sent/solarized.patch @@ -0,0 +1,14 @@ +diff '--color=auto' --unified --recursive --text sent.orig/config.def.h sent.new/config.def.h +--- sent.orig/config.def.h 2023-05-25 21:41:50.267455627 +0200 ++++ sent.new/config.def.h 2023-05-25 21:55:50.960814507 +0200 +@@ -9,8 +9,8 @@ + #define FONTSZ(x) ((int)(10.0 * powf(1.1288, (x)))) /* x in [0, NUMFONTSCALES-1] */ + + static const char *colors[] = { +- "#000000", /* foreground color */ +- "#FFFFFF", /* background color */ ++ "#eee8d5", /* foreground color */ ++ "#073642", /* background color */ + }; + + static const float linespacing = 1.4; -- cgit v1.1