update htop config & add fish pdf extract function

This commit is contained in:
2026-04-26 15:16:05 +03:00
parent ac43db9769
commit d7f33a54b0
3 changed files with 27 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
function pdf_extract
if test (count $argv) -lt 4
echo "Usage: pdf_extract <input_file> <from_page> <to_page> <output_file>"
return 1
end
set input_file $argv[1]
set from_page $argv[2]
set to_page $argv[3]
set output_file $argv[4]
if not test -f $input_file
echo "Error: input file '$input_file' not found"
return 1
end
set tmp_prefix (string replace -r '\.pdf$' '' $input_file)_extract_tmp_
pdfseparate -f $from_page -l $to_page $input_file "$tmp_prefix%04d.pdf" &&
pdfunite $tmp_prefix*.pdf $output_file &&
rm $tmp_prefix*.pdf
end