SHARE
TWEET

cb-openoffice-pipemenu

Kimarite Dec 27th, 2015 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # ---------------------------------------------------------------------
  3. # An Openbox pipemenu for use with Apache OpenOffice and CrunchBang Linux.
  4. # Written for CrunchBang Linux <http://crunchbang.org/>
  5. # by Philip Newborough (aka corenominal) <mail@philipnewborough.co.uk>
  6. # ---------------------------------------------------------------------
  7.  
  8. pathto=$(readlink -f "$0" | sed 's%/*[^/]\+/*$%%')
  9.  
  10. if [[ -f $pathto/cb-include.cfg ]]
  11. then
  12.     source "$pathto/cb-include.cfg"
  13. else
  14.     echo "  Failed to locate cb-include.cfg"
  15.     exit 1
  16. fi
  17.  
  18. # Set flag
  19. INSTALLED=false
  20.  
  21. # Start pipemenu
  22. echo "    <openbox_pipe_menu>"
  23.  
  24. # Writer
  25. if [ -x "/opt/openoffice4/program/swriter" ];then
  26.     I=$((I+1))
  27.     cat << _menu_
  28.         <item label="Writer">
  29.             <action name="Execute">
  30.                 <command>
  31.                     /opt/openoffice4/program/swriter
  32.                 </command>
  33.             </action>
  34.         </item>
  35. _menu_
  36. fi
  37.  
  38. # Calc
  39. if [ -x "/opt/openoffice4/program/scalc" ];then
  40.     I=$((I+1))
  41.     cat << _menu_
  42.         <item label="Calc">
  43.             <action name="Execute">
  44.                 <command>
  45.                     /opt/openoffice4/program/scalc
  46.                 </command>
  47.             </action>
  48.         </item>
  49. _menu_
  50. fi
  51.  
  52. # Impress
  53. if [ -x "/opt/openoffice4/program/simpress" ];then
  54.     I=$((I+1))
  55.     cat << _menu_
  56.         <item label="Impress">
  57.             <action name="Execute">
  58.                 <command>
  59.                     /opt/openoffice4/program/simpress
  60.                 </command>
  61.             </action>
  62.         </item>
  63. _menu_
  64. fi
  65.  
  66. # Draw
  67. if [ -x "/opt/openoffice4/program/sdraw" ];then
  68.     I=$((I+1))
  69.     cat << _menu_
  70.         <item label="Draw">
  71.             <action name="Execute">
  72.                 <command>
  73.                     /opt/openoffice4/program/sdraw
  74.                 </command>
  75.             </action>
  76.         </item>
  77. _menu_
  78. fi
  79.  
  80. # Base
  81. if [ -x "/opt/openoffice4/program/sbase" ];then
  82.     I=$((I+1))
  83.     cat << _menu_
  84.         <item label="Base">
  85.             <action name="Execute">
  86.                 <command>
  87.                     /opt/openoffice4/program/sbase
  88.                 </command>
  89.             </action>
  90.         </item>
  91. _menu_
  92. fi
  93.  
  94. # End pipemenu
  95. echo "    </openbox_pipe_menu>"
  96. exit 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top