mirror of
https://github.com/kmein/niveum
synced 2026-03-30 09:11:10 +02:00
Compare commits
6 Commits
0f432025ad
...
3a21680812
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a21680812 | |||
| 4f962778b7 | |||
| 4006c36f9b | |||
| eb521b2e0e | |||
| f178daaffd | |||
| f23e644417 |
38
.bin/256color
Executable file
38
.bin/256color
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
set -euf
|
||||||
|
|
||||||
|
pl() {
|
||||||
|
for i in $(seq $1 $(expr $2 - 1)); do
|
||||||
|
printf '\e[38;5;%sm%03i\e[m ' $i $i
|
||||||
|
done
|
||||||
|
printf '\e[38;5;%sm%03i\e[m\n' $2 $2
|
||||||
|
}
|
||||||
|
|
||||||
|
p() {
|
||||||
|
printf '\e[38;5;%sm%03i\e[m ' $1 $1
|
||||||
|
}
|
||||||
|
pn() {
|
||||||
|
printf '\e[38;5;%sm%03i\e[m\n' $1 $1
|
||||||
|
}
|
||||||
|
|
||||||
|
p6x6() {
|
||||||
|
for i in $(seq 0 5); do
|
||||||
|
for j in $(seq 0 5); do
|
||||||
|
p $(expr $1 + $i + $j \* 6)
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
pl 0 7
|
||||||
|
pl 8 15
|
||||||
|
|
||||||
|
p6x6 16
|
||||||
|
p6x6 52
|
||||||
|
p6x6 88
|
||||||
|
p6x6 124
|
||||||
|
p6x6 160
|
||||||
|
p6x6 196
|
||||||
|
|
||||||
|
pl 232 243
|
||||||
|
pl 244 255
|
||||||
@@ -15,11 +15,11 @@ candyman() {
|
|||||||
")"
|
")"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $# -eq 2 ] || usage
|
[ $# -ge 2 ] || usage
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
add-reddit|add-telegram|add-youtube|add-twitter|add-twitch)
|
add-reddit|add-telegram|add-youtube|add-twitter|add-twitch)
|
||||||
candyman "$1" "$2"
|
candyman "$@"
|
||||||
;;
|
;;
|
||||||
*) usage;;
|
*) usage;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
13
.bin/countdown
Executable file
13
.bin/countdown
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env -S awk -f
|
||||||
|
function z() {
|
||||||
|
getline < "/proc/uptime"
|
||||||
|
close("/proc/uptime")
|
||||||
|
return $0
|
||||||
|
}
|
||||||
|
BEGIN {
|
||||||
|
x = z()
|
||||||
|
while (1) {
|
||||||
|
y = z()
|
||||||
|
printf "%02d:%05.2f\r", (y - x) / 60, (y - x) % 60
|
||||||
|
}
|
||||||
|
}
|
||||||
23
.bin/pdf-ocr.sh
Executable file
23
.bin/pdf-ocr.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i bash -p poppler_utils tesseract4
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
pdf_path="$(realpath "$1")"
|
||||||
|
|
||||||
|
[ -f "$pdf_path" ] || {
|
||||||
|
echo "Usage: $0 FILE.pdf" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
trap 'rm -rf $tmpdir' EXIT
|
||||||
|
|
||||||
|
cd "$tmpdir"
|
||||||
|
|
||||||
|
pdftoppm -png "$pdf_path" pdf-ocr
|
||||||
|
for png in pdf-ocr*.png; do
|
||||||
|
tesseract "$png" "$png.txt" 2>/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
cat pdf-ocr-*.txt
|
||||||
@@ -21,7 +21,7 @@ in
|
|||||||
telegram = {
|
telegram = {
|
||||||
token = lib.strings.fileContents <system-secrets/telegram/moodle-dl.token>;
|
token = lib.strings.fileContents <system-secrets/telegram/moodle-dl.token>;
|
||||||
chat_id = "18980945";
|
chat_id = "18980945";
|
||||||
send_error_msg = true;
|
send_error_msg = false;
|
||||||
};
|
};
|
||||||
token = lib.strings.fileContents <system-secrets/moodle.token>;
|
token = lib.strings.fileContents <system-secrets/moodle.token>;
|
||||||
moodle_domain = "moodle.hu-berlin.de";
|
moodle_domain = "moodle.hu-berlin.de";
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ in {
|
|||||||
krebs.fetchWallpaper = {
|
krebs.fetchWallpaper = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
|
# unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
|
||||||
url = "http://prism.r/realwallpaper-krebs.png";
|
url = "http://prism.r/realwallpaper-krebs-stars.png"; # http://prism.r/realwallpaper-krebs.png"; # "http://prism.r/realwallpaper-krebs-stars-berlin.png";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
|||||||
@@ -91,6 +91,18 @@ in {
|
|||||||
units = "metric";
|
units = "metric";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
block = "custom";
|
||||||
|
interval = 60 * 60 * 12;
|
||||||
|
command =
|
||||||
|
let
|
||||||
|
area = "states"; # "districts";
|
||||||
|
code = "BE"; # "11007";
|
||||||
|
in pkgs.writers.writeDash "incidence" ''
|
||||||
|
printf "📈"
|
||||||
|
${pkgs.curl}/bin/curl -sSL https://api.corona-zahlen.org/${area}/${code} | ${pkgs.jq}/bin/jq -r '.data.${code}.weekIncidence | round'
|
||||||
|
'';
|
||||||
|
}
|
||||||
{
|
{
|
||||||
block = "custom";
|
block = "custom";
|
||||||
interval = 30;
|
interval = 30;
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ in runCommand "worldradio.m3u" {} ''
|
|||||||
| uniq \
|
| uniq \
|
||||||
> $out
|
> $out
|
||||||
''
|
''
|
||||||
|
|
||||||
|
# anthoer method for running a world radio using Icecast Directory
|
||||||
|
# curl http://dir.xiph.org/ | pup 'a[href^=http]:contains("Play") attr{href}'
|
||||||
|
|||||||
Reference in New Issue
Block a user