hime-env 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #!/bin/sh
  2. # Copyright and license see bottom of this file
  3. echo "====Detecting hime install===="
  4. HIME_BINARY=$(whereis hime | cut -d ' ' -f 2)
  5. if [ -x "$HIME_BINARY" ]; then
  6. echo "==>Hime binary found."
  7. else
  8. echo
  9. echo "==>Your hime is not installed properly. Bye."
  10. echo
  11. exit
  12. fi
  13. if [ -x "$HIME_BINARY" ]; then
  14. echo
  15. echo "==>$HIME_BINARY:$("$HIME_BINARY" -v 2>&1 | grep version | sed -e 's/$/, linked to/') $(ldd "$HIME_BINARY" | awk '/gtk/{print $3}')"
  16. find /usr/share/doc/ -path "*hime*" -name ChangeLog.Debian.gz \
  17. -exec echo -n "==>{}: " \; -exec zcat {} \; -exec head -n 1 \;
  18. find /usr/share/doc/ -path "*hime*" -name ChangeLog \
  19. -exec echo -n "==>{}: " \; -exec head -n 1 {} \;
  20. fi
  21. echo
  22. echo
  23. echo "====Detecting OS/Distribution===="
  24. # OS / distribution
  25. uname -a | sed -e "s/$(hostname)//" -e "s/$USER//" | tr -s ' ' ' '
  26. echo
  27. lsb_release -a 2>/dev/null | grep -v "LSB Version"
  28. find /etc -name "*version" \
  29. -exec echo "{}:" \; -exec cat {} \; 2>/dev/null
  30. find /etc -name "*release" \
  31. -exec echo "{}:" \; -exec cat {} \; 2>/dev/null
  32. echo
  33. echo "/etc/issue: $(head -n 1 /etc/issue | sed 's/$/\\/' | cut -d "\\" -f 1)"
  34. echo
  35. echo
  36. echo "====Detecting Environment Variables===="
  37. if [ -n "$XMODIFIERS" ] || [ -n "$LC_ALL" ] || [ -n "$LC_CTYPE" ] ||
  38. [ -n "$LANG" ] || [ -n "$LANGUAGE" ] || [ -n "$GTK_IM_MODULE" ] ||
  39. [ -n "$QT_IM_MODULE" ] ; then
  40. echo
  41. [ -n "$XMODIFIERS" ] && echo "XMODIFIERS : XMODIFIERS=$XMODIFIERS"
  42. [ -n "$LANG" ] && echo "LANG : LANG=$LANG"
  43. [ -n "$LANGUAGE" ] && echo "LANGUAGE : LANGUAGE=$LANGUAGE"
  44. [ -n "$LC_CTYPE" ] && echo "LC_CTYPE : LC_CTYPE=$LC_CTYPE"
  45. [ -n "$LC_ALL" ] && echo "LC_ALL : LC_ALL=$LC_ALL"
  46. locale 2>/dev/null | grep -v '"' | sed 's/=/\t : /' | grep -v ': $'
  47. [ -n "$GTK_IM_MODULE" ] && echo "GTK_IM_MODULE: GTK_IM_MODULE=$GTK_IM_MODULE"
  48. [ -n "$QT_IM_MODULE" ] && echo "QT_IM_MODULE : QT_IM_MODULE=$QT_IM_MODULE"
  49. fi
  50. echo
  51. echo
  52. echo "====Detecting hime status===="
  53. echo "==>Running hime number: ""$(pgrep ^hime$ | wc -l)"
  54. echo
  55. # TODO: get tempdir from TMPDIR, TMP, and TEMP
  56. echo "==>hime socket number: $(find "/tmp/.hime-$USER" -name "socket*" | wc -l)"
  57. echo
  58. echo "==>System library path: "
  59. ls -d /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64 2>/dev/null
  60. echo "====Immodule status===="
  61. # TODO: detect more binary name of gtk-query-immodules-2.0
  62. GTK_QUERY_2=$(whereis gtk-query-immodules-2.0 | cut -d ' ' -f 2)
  63. if [ ! -x "$GTK_QUERY_IMMODULES_2" ]; then
  64. GTK_QUERY_IMMODULES_2="$(find /usr/lib -path "*libgtk2.0-0*" -name gtk-query-immodules-2.0)"
  65. fi
  66. if [ -x "$GTK_QUERY_2" ]; then
  67. echo
  68. echo "==>gtk-query-immodules-2.0:"
  69. ls -d "$("$GTK_QUERY_2" | grep hime | cut -d '"' -f 2 | grep '/')"
  70. fi
  71. echo
  72. echo "==>gtk-2.0 immodule cache"
  73. find /etc /usr/lib64 /usr/lib /usr/local/etc \
  74. -path "*gtk-2.0*" -name "*immodules*" \
  75. -exec grep hime '{}' \; 2>/dev/null |
  76. cut -d '"' -f 2 | grep so
  77. # TODO: detect more binary name of gtk-query-immodules-3.0
  78. GTK_QUERY_3=$(whereis gtk-query-immodules-3.0 | cut -d ' ' -f 2)
  79. if [ ! -x "$GTK_QUERY_IMMODULES_3" ]; then
  80. GTK_QUERY_IMMODULES_3="$(find /usr/lib -path "*libgtk-3.0*" -name gtk-query-immodules-3.0)"
  81. fi
  82. if [ -x "$GTK_QUERY_3" ]; then
  83. echo
  84. echo "==>gtk-query-immodules-3.0:"
  85. ls -d "$("$GTK_QUERY_3" | grep hime | cut -d '"' -f 2 | grep '/')"
  86. fi
  87. echo
  88. echo "==>gtk-3.0 immodule cache"
  89. find /usr/lib64 /usr/lib /usr/local/lib \
  90. -path "*gtk-3.0*" -name "immodules.cache*" \
  91. -exec grep hime '{}' \; 2>/dev/null |
  92. cut -d '"' -f 2 | grep so
  93. # Copyright (C) 2012 Wen-Yen Chuang <caleb AT calno DOT com>
  94. #
  95. # This library is free software; you can redistribute it and/or
  96. # modify it under the terms of the GNU Lesser General Public
  97. # License as published by the Free Software Foundation; either
  98. # version 2.1 of the License, or (at your option) any later version.
  99. #
  100. # This library is distributed in the hope that it will be useful,
  101. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  102. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  103. # Lesser General Public License for more details.
  104. #
  105. # You should have received a copy of the GNU Lesser General Public
  106. # License along with this library; if not, write to the Free Software
  107. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA