home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / gnome-power-bugreport.sh < prev    next >
Encoding:
Text File  |  2007-04-13  |  1.6 KB  |  68 lines

  1. # Copyright (C) 2006-2007 Richard Hughes <richard@hughsie.com>
  2. #
  3. # Licensed under the GNU General Public License Version 2
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14.  
  15. #$1 = keyname
  16. print_hal_key ()
  17. {
  18.     udi="/org/freedesktop/Hal/devices/computer"
  19.     ret=`hal-get-property --udi $udi --key $1 2> /dev/null`
  20.     if [ $? -eq 0 ]; then
  21.         echo $ret
  22.     else
  23.         echo "missing"
  24.     fi 
  25. }
  26.  
  27. #$1 = capability
  28. print_hal_capability ()
  29. {
  30.     ret=`hal-find-by-capability --capability $1`
  31.     if [ -n "$ret" ]; then
  32.         echo "yes"
  33.     else
  34.         echo "no"
  35.     fi
  36. }
  37.  
  38. echo -n "Distro version:       "
  39. cat /etc/*-release | uniq
  40.  
  41. echo -n "Kernel version:       "
  42. uname -r
  43.  
  44. echo -n "HAL version:          "
  45. lshal -V | cut -f3 -d" "
  46.  
  47. echo -n "System manufacturer:  "
  48. print_hal_key "smbios.system.manufacturer"
  49. echo -n "System version:       "
  50. print_hal_key "smbios.system.version"
  51. echo -n "System product:       "
  52. print_hal_key "smbios.system.product"
  53.  
  54. echo -n "AC adapter present:   "
  55. print_hal_capability "ac_adapter"
  56.  
  57. echo -n "Battery present:      "
  58. print_hal_capability "battery"
  59.  
  60. echo -n "Laptop panel present: "
  61. print_hal_capability "laptop_panel"
  62.  
  63. echo -n "CPU scaling present:  "
  64. print_hal_capability "cpufreq_control"
  65.  
  66. echo "Battery Information:"
  67. lshal | grep "battery\."
  68.