mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2025-04-21 12:27:27 +03:00
dsv/dsv: change viewer default from xpdf to xdg-open; introduce DSV_VIEWER; add README
This commit is contained in:
14
dsv/dsv
14
dsv/dsv
@@ -2,8 +2,8 @@
|
||||
#
|
||||
# dsv - Improved data sheet viewer
|
||||
#
|
||||
# Written 2010, 2011 by Werner Almesberger
|
||||
# Copyright 2010, 2011 Werner Almesberger
|
||||
# Written 2010-2012 by Werner Almesberger
|
||||
# Copyright 2010-2012 Werner Almesberger
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -67,8 +67,12 @@ flush()
|
||||
# @@@ should handle error
|
||||
else
|
||||
url=${url%`echo x"$inside" | sed 's/./?/g'`}
|
||||
wget -nv -O "$DSV_DIR/_tmp" "$url"
|
||||
unzip -p "$DSV_DIR/_tmp" "$inside" >"$DSV_DIR/$ds" ||
|
||||
zip=$nm-`basename "$url"`
|
||||
if [ ! -r "$DSV_DIR/$zip" ]; then
|
||||
wget -nv -O "$DSV_DIR/$zip" "$url"
|
||||
# @@@ should handle error
|
||||
fi
|
||||
unzip -p "$DSV_DIR/$zip" "$inside" >"$DSV_DIR/$ds" ||
|
||||
{ rm -f "$DSV_DIR/$ds"; exit 1; }
|
||||
fi
|
||||
fi
|
||||
@@ -161,7 +165,7 @@ search()
|
||||
if $path; then
|
||||
echo "`pwd`/$DSV_DIR/$file"
|
||||
else
|
||||
${DSV_PDFVIEWER:-xpdf} "$DSV_DIR/$file"
|
||||
${DSV_VIEWER:-${DSV_PDFVIEWER:-xdg-open}} "$DSV_DIR/$file"
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user