3
#C- This program is free software; you can redistribute it and/or
4
#C- modify it under the terms of the GNU General Public License,
5
#C- either Version 2 of the License or (at your option) any later
6
#C- version. The license should have accompanied the program
7
#C- or you may obtain a copy of the license from the Free Software
8
#C- Foundation at http://www.fsf.org.
10
#C- This program is distributed in the hope that it will be useful,
11
#C- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
#C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
#C- GNU General Public License for more details.
15
#C- $Id: register-djvu-mime.in,v 1.8 2007/03/25 20:48:22 leonb Exp $
19
xdg_icon_resource=XDG_ICON_RESOURCE
20
xdg_desktop_menu=XDG_DESKTOP_MENU
29
echo 1>&2 "Unable to find directory ${mydir}"
34
# check presence of xdg utils
35
test -n "$xdg_mime" || xdg_mime=`which xdg-mime`
36
test -n "$xdg_icon_resource" || xdg_icon_resource=`which xdg-icon-resource`
37
test -n "$xdg_desktop_menu" || xdg_desktop_menu=`which xdg-desktop-menu`
39
if test -x "$xdg_mime" &&
40
test -x "$xdg_icon_resource" &&
41
test -x "$xdg_desktop_menu"
45
echo 1>&2 "Unable to find the Xdg Portland utils"
46
echo 1>&2 " These are needed to run $0".
47
echo 1>&2 " Please check http://portland.freedesktop.org."
51
if test -n "$XDG_DATA_DIRS" ; then
52
XDG_DATA_DIRS="$datadir:$XDG_DATA_DIRS"
54
XDG_DATA_DIRS="$datadir:/usr/local/share:/usr/share"
61
"$xdg_icon_resource" install --noupdate --context mimetypes \
62
--size 22 ./hi22-djvu.png image-vnd.djvu
63
"$xdg_icon_resource" install --noupdate --context mimetypes \
64
--size 32 ./hi32-djvu.png image-vnd.djvu
65
"$xdg_icon_resource" install --noupdate --context mimetypes \
66
--size 48 ./hi48-djvu.png image-vnd.djvu
67
"$xdg_icon_resource" forceupdate
68
"$xdg_mime" install ./djvulibre-mime.xml
71
"$xdg_icon_resource" uninstall --noupdate --context mimetypes \
72
--size 22 image-vnd.djvu
73
"$xdg_icon_resource" uninstall --noupdate --context mimetypes \
74
--size 32 image-vnd.djvu
75
"$xdg_icon_resource" uninstall --noupdate --context mimetypes \
76
--size 48 image-vnd.djvu
77
"$xdg_icon_resource" forceupdate
78
"$xdg_mime" uninstall ./djvulibre-mime.xml
81
echo 1>&2 "Usage: $0 {install|uninstall}"