1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: add some scripts for reading pdfs

This commit is contained in:
2021-11-19 13:40:32 +01:00
parent c0efacd6ce
commit 06125303b8
2 changed files with 17 additions and 0 deletions

6
.bin/sample-pdf.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
filepath="$(shuf --head-count=1)"
pages="$(pdfinfo "$filepath" | awk '/^Pages:/{print $2}')"
random_page="$(shuf --input-range="1-$pages" --head-count=1)"
zathura --page="$random_page" "$filepath"

View File

@@ -17,6 +17,17 @@
services.nextcloud-client.enable = true;
};
environment.systemPackages = [
(pkgs.writers.writeDashBin "read" ''
set -efu
book="$({
${pkgs.findutils}/bin/find ${config.users.users.me.home}/cloud/syncthing/library -type f
${pkgs.findutils}/bin/find ${config.users.users.me.home}/cloud/Seafile/Books -type f
} | ${pkgs.fzf}/bin/fzf)"
${pkgs.zathura}/bin/zathura "$book"
'')
];
fileSystems."/media/moodle" = {
device = "zaatar.r:/moodle";
fsType = "nfs";