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:
6
.bin/sample-pdf.sh
Executable file
6
.bin/sample-pdf.sh
Executable 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"
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user