mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-19 08:07:14 +02:00
fish: Add epub2pdf function
This is part of migrating scripts from ~/.local/bin to the nix-config. Note that this also lets us use packages that aren't available in a user's $PATH.
This commit is contained in:
parent
c40055a515
commit
2fbad70214
@ -1,3 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
@ -157,6 +159,15 @@
|
||||
|
||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||
'';
|
||||
|
||||
epub2pdf = /* fish */ ''
|
||||
if string match -qe -- ".epub" "$argv";
|
||||
set BASE (string split -f 1 ".epub" "$argv")
|
||||
${pkgs.calibre}/bin/ebook-convert "$argv" "$BASE.pdf"; and trash "$argv"
|
||||
else
|
||||
echo "Usage: epub2pdf [file.epub]"
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user