use GTK2_RC_FILES (thanks fgiunchedi)

This commit is contained in:
Jaromil 2011-02-25 00:10:09 +01:00
parent e355625ac5
commit 0089f43a4d
4 changed files with 14 additions and 20 deletions

View File

@ -115,7 +115,7 @@ base root of the tomb.
.IP "bind-hooks"
This hook file consists of a simple two column list of files or
directories inside the tomb to be made directly accessible inside the
current user's home directory. Tomb will use the "mount -o bind"
current user's home directory. Tomb will use the "mount \-o bind"
command to bind locations inside the tomb to locations found in $HOME
so in the first column are indicated paths relative to the tomb and in
the second column are indicated paths relative to $HOME contents, for

View File

@ -25,7 +25,11 @@ install-data-hook:
@mkdir -p $(prefix)/lib/mime/packages
@echo "application/x-tomb-volume; tomb-open '%s'; priority=8" > $(prefix)/lib/mime/packages/tomb
@echo "installing icons";
@if ! [ -n `which xdg-icon-resource install` ]; then xdg-icon-resource install --context mimetypes --size 32 ../src/monmort.xpm monmort; xdg-icon-resource install --size 32 ../src/monmort.xpm dyne-monmort; fi
@if ! [ -n `which xdg-icon-resource` ]; then \
xdg-icon-resource install --context mimetypes --size 32 ../src/monmort.xpm monmort; \
xdg-icon-resource install --size 32 ../src/monmort.xpm dyne-monmort; fi
mkdir -p $(datadir)/themes/tomb/gtk-2.0-key
sed -e 's@\%prefix\%@'"$(datadir)"'@' gtkrc-2.0 > $(datadir)/themes/tomb/gtk-2.0-key/gtkrc
@if ! [ -n `which update-desktop-database` ]; then echo update-desktop-database; update-desktop-database; fi
@if ! [ -n `which update-menus` ]; then echo update-menus; update-menus; fi
@if ! [ -n `which update-mime` ]; then echo update-mime; update-mime; fi

3
share/gtkrc-2.0 Normal file
View File

@ -0,0 +1,3 @@
pixmap_path "%prefix%/pixmaps"
style "normal" { stock["gtk-dialog-authentication"] = {{"monmort.xpm"}} }
widget "*" style "normal"

View File

@ -56,32 +56,19 @@ ask_password() {
# pinentry has no custom icon setting
# so we need to temporary modify the gtk theme
if [ -r ~/.gtkrc-2.0 ]; then
cp ~/.gtkrc-2.0 ~/.gtkrc-2.0.tomb.bak
else
touch ~/.gtkrc-2.0
if [ -r /usr/local/share/themes/tomb/gtk-2.0-key/gtkrc ]; then
GTK2_RC=/usr/local/share/themes/tomb/gtk-2.0-key/gtkrc
elif [ -r /usr/share/themes/tomb/gtk-2.0-key/gtkrc ]; then
GTK2_RC=/usr/share/themes/tomb/gtk-2.0-key/gtkrc
fi
cat <<EOF >> ~/.gtkrc-2.0
pixmap_path "/usr/local/share/pixmaps"
style "normal" { stock["gtk-dialog-authentication"] = {{"monmort.xpm"}} }
widget "*" style "normal"
EOF
cat <<EOF | pinentry | awk '/^D/ { print $2 }'
cat <<EOF | GTK2_RC_FILES=${GTK2_RC} pinentry | awk '/^D/ { print $2 }'
SETTITLE Insert tomb password
SETDESC Open tomb: $1
SETPROMPT Password:
GETPIN
EOF
# restore gtk as it was
if [ -r ~/.gtkrc-2.0.tomb.bak ]; then
cp ~/.gtkrc-2.0.tomb.bak ~/.gtkrc-2.0
rm ~/.gtkrc-2.0.tomb.bak
else
rm -f ~/.gtkrc-2.0
fi
}