summaryrefslogtreecommitdiff
path: root/home/home.nix
diff options
context:
space:
mode:
authorstuebinm2024-12-05 01:09:05 +0100
committerstuebinm2024-12-05 01:09:05 +0100
commit26698aeffeeefe8d384032a836edb9dca741529b (patch)
treed1dc76401c5edd0641bfc61c3ba2f24f373a0eb0 /home/home.nix
parentd0a9ffee08c0c9bfe2ab9238d56b8409f6d4501a (diff)
home/fish: scanify alias
a function to make things look 'scanned', taken from notes.moira.is
Diffstat (limited to 'home/home.nix')
-rw-r--r--home/home.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/home/home.nix b/home/home.nix
index be50d2d..6e18726 100644
--- a/home/home.nix
+++ b/home/home.nix
@@ -181,6 +181,19 @@
scp $argv[(seq 2 2 (expr $n + 1))].png flora:/var/lib/containers/pleroma/var/lib/akkoma/static/emoji/unsorted/
ssh flora machinectl shell pleroma /bin/sh -c \"pleroma_ctl emoji reload\"
'';
+ # source: https://notes.moira.is/Computer+Stuff/Useful+commands/Make+it+look+scanned
+ functions.scanify.body = ''
+ if [ (expr (count $argv) % 2) != 0 ]
+ echo usage: scanify input.pdf output.pdf
+ return 1
+ end
+ if [ test -e tmp.pdf ]
+ echo error: would override tmp.pdf
+ return 1
+ end
+ convert -density 150 $argv[1] -blur .1 -rotate .2 -attenuate .3 +noise gaussian tmp.pdf
+ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$argv[2] tmp.pdf
+ '';
};
programs.kitty = {