presentations16 514 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # A script to run Presentations.
  3. GUI=-gui:$( \
  4. if [ -r ~/.smoffice_gui.conf ]; then \
  5. cat ~/.smoffice_gui.conf; \
  6. else \
  7. [ -r /etc/smoffice_gui.conf ] && cat /etc/smoffice_gui.conf; \
  8. fi | grep -o -m1 "gnome\|kde" | head -n1)
  9. case "$GUI" in
  10. -gui:gnome|-gui:kde) cmd="/opt/smoffice2016/presentations $GUI" ;;
  11. *) cmd="/opt/smoffice2016/presentations" ;;
  12. esac
  13. ext="${@##*.}"
  14. shopt -s nocasematch
  15. case "$ext" in
  16. prs|pps|ppsx) $cmd -S\""$@"\";;
  17. * ) $cmd "$@";;
  18. esac