install.zsh (2536B)
1 # {{{ - Install 2 # install mime-types, bells and whistles for the desktop 3 # see http://developers.sun.com/solaris/articles/integrating_gnome.html 4 # and freedesktop specs 5 install_tomb() { 6 7 # TODO: distro package deps (for binary) 8 # debian: zsh, cryptsetup, sudo 9 _message "updating mimetypes..." 10 cat <<EOF > /tmp/dyne-tomb.xml 11 <?xml version="1.0"?> 12 <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> 13 <mime-type type="application/x-tomb-volume"> 14 <comment>Tomb crypto volume</comment> 15 <glob pattern="*.tomb"/> 16 </mime-type> 17 <mime-type type="application/x-tomb-key"> 18 <comment>Tomb crypto key</comment> 19 <glob pattern="*.tomb.key"/> 20 </mime-type> 21 </mime-info> 22 EOF 23 xdg-mime install /tmp/dyne-tomb.xml 24 xdg-icon-resource install --context mimetypes --size 32 monmort.xpm monmort 25 xdg-icon-resource install --size 32 monmort.xpm dyne-monmort 26 27 rm /tmp/dyne-tomb.xml 28 29 _message "updating desktop..." 30 cat <<EOF > /usr/share/applications/tomb.desktop 31 [Desktop Entry] 32 Version=1.0 33 Type=Application 34 Name=Tomb crypto undertaker 35 GenericName=Crypto undertaker 36 Comment=Keep your bones safe 37 Exec="${TOMBOPENEXEC}" %U 38 TryExec=tomb-open 39 Icon=monmort.xpm 40 Terminal=true 41 Categories=Utility;Security;Archiving;Filesystem; 42 MimeType=application/x-tomb-volume; 43 X-AppInstall-Package=tomb 44 EOF 45 update-desktop-database 46 47 _message "updating menus..." 48 cat <<EOF > /etc/menu/tomb 49 ?package(tomb):command="tomb" icon="/usr/share/pixmaps/monmort.xpm" needs="text" \ 50 section="Applications/Accessories" title="Tomb" hints="Crypto" \ 51 hotkey="Tomb" 52 EOF 53 update-menus 54 55 _message "updating mime info..." 56 cat <<EOF > /usr/share/mime-info/tomb.keys 57 # actions for encrypted tomb storage 58 application/x-tomb-volume: 59 open="${TOMBOPENEXEC}" %f 60 view=tomb-open %f 61 icon-filename=monmort.xpm 62 short_list_application_ids_for_novice_user_level=tomb 63 EOF 64 cat <<EOF > /usr/share/mime-info/tomb.mime 65 # mime type for encrypted tomb storage 66 application/x-tomb-volume 67 ext: tomb 68 69 application/x-tomb-key 70 ext: tomb.key 71 EOF 72 cat <<EOF > /usr/lib/mime/packages/tomb 73 application/x-tomb-volume; tomb-open '%s'; priority=8 74 EOF 75 update-mime 76 77 _message "updating application entry..." 78 79 cat <<EOF > /usr/share/application-registry/tomb.applications 80 tomb 81 command=tomb-open 82 name=Tomb - Crypto Undertaker 83 can_open_multiple_files=false 84 expects_uris=false 85 requires_terminal=true 86 mime-types=application/x-tomb-volume,application/x-tomb-key 87 EOF 88 _message "Tomb is now installed." 89 } 90 # }}}