kgtk-qt3 – TDE dialogs in GTK 2.x applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kgtk-wrapper 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/bash
  2. #
  3. # This script is part of the KGtk package.
  4. #
  5. # (C) Craig Drummond, 2007
  6. #
  7. # Craig.Drummond@lycos.co.uk
  8. #
  9. # --
  10. # Released under the GPL v2 or later
  11. # --
  12. #
  13. # This script attempts to determine which KGtk library (if any) should
  14. # be used when launching the app
  15. #
  16. if [ "`locale | grep 'LANG=' | grep -i 'utf-8' | wc -l`" = "0" ] ; then
  17. export G_BROKEN_FILENAMES=1
  18. fi
  19. app=`basename $0`
  20. useApp=1
  21. if [ "$app" = "kgtk-wrapper" ] ; then
  22. app=`basename $1`
  23. useApp=0
  24. fi
  25. dir=$(cd "$(dirname "$0")"; pwd)
  26. if [ $useApp -eq 1 ] ; then
  27. oldPath=$PATH
  28. PATH=`echo $PATH | sed s:$dir::g | sed "s|::*|:|g"`
  29. fi
  30. realApp=`which $app`
  31. if [ -z $realApp ] ; then
  32. realApp=`which ./$app`
  33. fi
  34. if [ $useApp -eq 1 ] ; then
  35. PATH=$oldPath
  36. fi
  37. toolkit=`kreadconfig --file kgtkrc --group 'Apps' --key "$app"`
  38. if [ "$toolkit" = "" ] ; then
  39. case $app in
  40. eclipse | gimp | inkscape | firefox | kino | iceweasel | swiftfox | azureus | mozilla* )
  41. toolkit="gtk2" ;;
  42. scribus | scribus-ng | opera | designer-qt3 )
  43. toolkit="qt3" ;;
  44. designer-qt4 )
  45. toolkit="qt4" ;;
  46. abiword) # Non-working
  47. toolkit="x" ;;
  48. esac
  49. fi
  50. if [ "$toolkit" = "" ] && [ ! -z "$realApp" ] ; then
  51. libs=`ldd $realApp 2>/dev/null`
  52. if [ ! -z "$libs" ] ; then
  53. if [ "0" != "`echo $libs | grep libgtk-x11-2 | wc -l`" ] ; then
  54. toolkit="gtk2"
  55. elif [ "0" != "`echo $libs | grep libtqt-mt | wc -l`" ] ; then
  56. toolkit="qt3"
  57. elif [ "0" != "`echo $libs | grep libQtGui | wc -l`" ] ; then
  58. toolkit="qt4"
  59. fi
  60. if [ "$toolkit" = "qt3" ] || [ "$toolkit" = "qt4" ] ; then
  61. if [ "0" != "`echo $libs | grep libtdeio | wc -l`" ] ; then
  62. toolkit=""
  63. fi
  64. fi
  65. if [ -z "`which k$toolkit-wrapper`" ] ; then
  66. toolkit=""
  67. fi
  68. fi
  69. fi
  70. if [ "$toolkit" = "x" ] ; then
  71. toolkit=""
  72. fi
  73. if [ $useApp -eq 1 ] ; then
  74. if [ "$toolkit" = "" ] ; then
  75. $realApp "$@"
  76. else
  77. k$toolkit-wrapper $realApp "$@"
  78. fi
  79. else
  80. if [ "$toolkit" = "" ] ; then
  81. "$@"
  82. else
  83. k$toolkit-wrapper "$@"
  84. fi
  85. fi