aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/devices.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-14 18:10:13 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-14 18:10:13 +0000
commit6767e5b82dd2f642bb8986f4e57659990bcccc85 (patch)
treecc8352a4aa9f9b93365a5e356de3d7f8f01d891b /hardinfo2/devices.c
parentf654729f552739d2198250358667bc782524a793 (diff)
Add ACPI Thermal Zone and Battery information
Diffstat (limited to 'hardinfo2/devices.c')
-rw-r--r--hardinfo2/devices.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/hardinfo2/devices.c b/hardinfo2/devices.c
index 1180a092..d5a1cefd 100644
--- a/hardinfo2/devices.c
+++ b/hardinfo2/devices.c
@@ -29,6 +29,7 @@ enum {
DEVICES_PCI,
DEVICES_USB,
DEVICES_PRINTERS,
+ DEVICES_BATTERY,
DEVICES_INPUT,
DEVICES_STORAGE,
} Entries;
@@ -38,6 +39,7 @@ static ModuleEntry hi_entries[] = {
{"PCI Devices", "devices.png"},
{"USB Devices", "usb.png"},
{"Printers", "printer.png"},
+ {"Battery", "battery.png"},
{"Input Devices", "keyboard.png"},
{"Storage", "hdd.png"},
};
@@ -48,11 +50,12 @@ static gchar *printer_list = NULL;
static gchar *pci_list = "";
static gchar *input_list = NULL;
static gchar *storage_list = "";
+static gchar *battery_list = NULL;
#define WALK_UNTIL(x) while((*buf != '\0') && (*buf != x)) buf++
#define GET_STR(field_name,ptr) \
- if (strstr(tmp[0], field_name)) { \
+ if (!ptr && strstr(tmp[0], field_name)) { \
ptr = g_markup_escape_text(g_strstrip(tmp[1]), strlen(tmp[1])); \
g_strfreev(tmp); \
continue; \
@@ -66,6 +69,7 @@ static gchar *storage_list = "";
#include <arch/this/inputdevices.h>
#include <arch/this/usb.h>
#include <arch/this/storage.h>
+#include <arch/this/battery.h>
static void
detect_devices(void)
@@ -92,6 +96,9 @@ detect_devices(void)
shell_status_update("Scanning SCSI devices...");
scan_scsi();
+
+ shell_status_update("Scanning batteries...");
+ scan_battery();
}
gchar *
@@ -108,6 +115,9 @@ void
hi_reload(gint entry)
{
switch (entry) {
+ case DEVICES_BATTERY:
+ scan_battery();
+ break;
case DEVICES_INPUT:
scan_inputdevices();
break;
@@ -138,6 +148,10 @@ hi_info(gint entry)
}
switch (entry) {
+ case DEVICES_BATTERY:
+ return g_strdup_printf("%s\n"
+ "[$ShellParam$]\n"
+ "ReloadInterval=4000\n", battery_list);
case DEVICES_KERNEL_MODULES:
return g_strdup_printf("[Loaded Modules]\n"
"%s"