bookmobile/bookmobile-gui

33 lines
862 B
Fish
Executable File

#!/usr/bin/env fish
#gui wrapper around bookmobile, using yad
if not command -sq yad
echo "Bookmobile-GUI requires yad but it's not installed. Exiting."
exit 1
end
set gui (yad --width=400 --title="" --text="Bookmobile: Download articles for offline reading as simple html, themed html, epub or markdown." \
--title="Bookmobile" \
--form --separator='\t' \
--field="URL" \
--field="Save as Filename" \
--field="Export to format":CB \
"" "" 'html!reader!epub!markdown' \
--field="Theme (reader mode only)":CB \
'medium!github!gmi!now!pandoc' \
--field="Output location":DIR \
--separator="|" )
set gui (string split "|" $gui)
set url $gui[1]
set name $gui[2]
set format $gui[3]
set theme $gui[4]
set output $gui[5]
if test -n "$name"
./bookmobile $url -f $format -t $theme -n $name -o $output
else
./bookmobile $url -f $format -t $theme -o $output
end