From 0089f43a4d2b6d786aaf49de2b5cde54650b7154 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Fri, 25 Feb 2011 00:10:09 +0100 Subject: [PATCH] use GTK2_RC_FILES (thanks fgiunchedi) --- doc/tomb.1 | 2 +- share/Makefile.am | 6 +++++- share/gtkrc-2.0 | 3 +++ src/tomb | 23 +++++------------------ 4 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 share/gtkrc-2.0 diff --git a/doc/tomb.1 b/doc/tomb.1 index 9fd190f..f18d698 100644 --- a/doc/tomb.1 +++ b/doc/tomb.1 @@ -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 diff --git a/share/Makefile.am b/share/Makefile.am index 2589a13..ebb4ab0 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -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 diff --git a/share/gtkrc-2.0 b/share/gtkrc-2.0 new file mode 100644 index 0000000..3d48481 --- /dev/null +++ b/share/gtkrc-2.0 @@ -0,0 +1,3 @@ +pixmap_path "%prefix%/pixmaps" +style "normal" { stock["gtk-dialog-authentication"] = {{"monmort.xpm"}} } +widget "*" style "normal" diff --git a/src/tomb b/src/tomb index 9e85201..08f5ecd 100755 --- a/src/tomb +++ b/src/tomb @@ -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 <> ~/.gtkrc-2.0 - pixmap_path "/usr/local/share/pixmaps" - style "normal" { stock["gtk-dialog-authentication"] = {{"monmort.xpm"}} } - widget "*" style "normal" -EOF - - cat <