commit 3dd7dabbcecea949027db9900020aa25ed8f0d85
parent aea44290b168de5cf46b5e048d215aa36074c6fb
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 14 Feb 2019 06:56:02 +0100
Only show short-ish fortunes
Diffstat:
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/links/bin/xlock b/links/bin/xlock
@@ -1,5 +1,16 @@
#!/bin/bash
#mpc stop
+
+function get_short_fortune {
+ while :; do
+ text="$(fortune)"
+ if [[ "$(echo "$text" | wc -l)" -lt 8 ]]; then
+ echo "$text"
+ break
+ fi
+ done
+}
+
img=/tmp/screenshot.png
maim $img
#gm convert $img -blur 0x10 $img
@@ -16,6 +27,6 @@ convert $img \
-font 'PragmataPro' \
-pointsize 22 \
-annotate +0+160 \
- "$(fortune)" \
+ "$(get_short_fortune)" \
$img
i3lock -i $img