aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'hardinfo2/arch/linux/common')
-rw-r--r--hardinfo2/arch/linux/common/net.h1
-rw-r--r--hardinfo2/arch/linux/common/os.h31
-rw-r--r--hardinfo2/arch/linux/common/pci.h3
3 files changed, 26 insertions, 9 deletions
diff --git a/hardinfo2/arch/linux/common/net.h b/hardinfo2/arch/linux/common/net.h
index d0738ce5..87e7e59b 100644
--- a/hardinfo2/arch/linux/common/net.h
+++ b/hardinfo2/arch/linux/common/net.h
@@ -42,7 +42,6 @@ void get_net_info(char *if_name, NetInfo *netinfo)
strcpy(ifr.ifr_name, if_name);
strcpy(netinfo->name, if_name);
- strcpy(ifr.ifr_name, if_name);
if (ioctl(fd, SIOCGIFMTU, &ifr) < 0) {
netinfo->mtu = 0;
} else {
diff --git a/hardinfo2/arch/linux/common/os.h b/hardinfo2/arch/linux/common/os.h
index c8204e92..0f7b59e3 100644
--- a/hardinfo2/arch/linux/common/os.h
+++ b/hardinfo2/arch/linux/common/os.h
@@ -58,6 +58,9 @@ get_os_compiled_date(void)
return g_strdup(buf);
}
+
+#include <gdk/gdkx.h>
+
void
detect_desktop_environment(OperatingSystem * os)
{
@@ -66,14 +69,15 @@ detect_desktop_environment(OperatingSystem * os)
int maj, min;
if (tmp) {
- /* FIXME: this might not be true, as the gnome-panel in path may not be the one that's running.
- see where the user's running panel is and run *that* to obtain the version.
-
- the same applies do kcontrol --version. */
+ /* FIXME: this might not be true, as the gnome-panel in path
+ may not be the one that's running.
+ see where the user's running panel is and run *that* to
+ obtain the version. */
version = popen("gnome-panel --version", "r");
if (version) {
fscanf(version, "Gnome gnome-panel %d.%d", &maj, &min);
- if (pclose(version)) goto unknown;
+ if (pclose(version))
+ goto unknown;
} else {
goto unknown;
}
@@ -89,7 +93,8 @@ detect_desktop_environment(OperatingSystem * os)
fgets(buf, 32, version);
fscanf(version, "KDE: %d.%d", &maj, &min);
- if (pclose(version)) goto unknown;
+ if (pclose(version))
+ goto unknown;
} else {
goto unknown;
}
@@ -100,7 +105,19 @@ detect_desktop_environment(OperatingSystem * os)
if (!g_getenv("DISPLAY")) {
os->desktop = g_strdup("Terminal");
} else {
- os->desktop = g_strdup("Unknown");
+ const gchar *windowman;
+ GdkScreen *screen = gdk_screen_get_default();
+
+ windowman = gdk_x11_screen_get_window_manager_name(screen);
+
+ if (g_str_equal(windowman, "Xfwm4")) {
+ /* FIXME: check if xprop -root | grep XFCE_DESKTOP_WINDOW
+ is defined */
+ os->desktop = g_strdup("XFCE 4");
+ } else {
+ os->desktop = g_strdup_printf("Unknown (Window Manager: %s)",
+ windowman);
+ }
}
}
}
diff --git a/hardinfo2/arch/linux/common/pci.h b/hardinfo2/arch/linux/common/pci.h
index 8f3216e2..f8c9d319 100644
--- a/hardinfo2/arch/linux/common/pci.h
+++ b/hardinfo2/arch/linux/common/pci.h
@@ -84,7 +84,8 @@ scan_pci(void)
strdevice =
g_strdup_printf("%sOEM Vendor=%s\n", strdevice, buf);
} else if (!strncmp(buf, "Capabilities", 12)
- && !strstr(buf, "only to root")) {
+ && !strstr(buf, "only to root") &&
+ !strstr(buf, "access denied")) {
WALK_UNTIL(' ');
WALK_UNTIL(']');
buf++;