diff options
Diffstat (limited to 'computer.c')
-rw-r--r-- | computer.c | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -41,6 +41,7 @@ enum { COMPUTER_SHARES, COMPUTER_DISPLAY, COMPUTER_NETWORK, + COMPUTER_USERS, } Entries; static ModuleEntry hi_entries[] = { @@ -53,6 +54,7 @@ static ModuleEntry hi_entries[] = { {"Shared Directories", "shares.png"}, {"Display", "monitor.png"}, {"Network Interfaces", "network.png"}, + {"Users", "users.png"}, }; #include "computer.h" @@ -69,8 +71,10 @@ static GHashTable *moreinfo = NULL; #include <arch/this/os.h> #include <arch/this/filesystem.h> #include <arch/this/samba.h> +#include <arch/this/nfs.h> #include <arch/this/sensors.h> #include <arch/this/net.h> +#include <arch/common/users.h> static Computer * computer_get_info(void) @@ -108,7 +112,8 @@ computer_get_info(void) scan_filesystems(); shell_status_update("Getting shared directories..."); - scan_shared_directories(); + scan_samba_shared_directories(); + scan_nfs_shared_directories(); shell_status_update("Reading sensors..."); read_sensors(); @@ -116,6 +121,9 @@ computer_get_info(void) shell_status_update("Obtaining network information..."); scan_net_interfaces(); + shell_status_update("Obtaining users information..."); + scan_users(); + computer->date_time = "..."; return computer; } @@ -133,6 +141,9 @@ hi_reload(gint entry) case COMPUTER_SENSORS: read_sensors(); break; + case COMPUTER_USERS: + scan_users(); + break; } } @@ -159,8 +170,6 @@ hi_get_field(gchar * field) tmp = g_strdup_printf("%dMB (%dMB used)", mi->total, mi->used); g_free(mi); - } else if (!strcmp(field, "Random")) { - return g_strdup_printf("%d", rand() % 200); } else if (!strcmp(field, "Uptime")) { tmp = computer_get_formatted_uptime(); } else if (!strcmp(field, "Date/Time")) { @@ -198,13 +207,23 @@ hi_info(gint entry) "ReloadInterval=3000\n" "ViewType=1\n" "%s", network_interfaces); + case COMPUTER_USERS: + return g_strdup_printf("[$ShellParam$]\n" + "ReloadInterval=10000\n" + "ViewType=1\n" + "[Human Users]\n" + "%s\n" + "[System Users]\n" + "%s\n", human_users, sys_users); case COMPUTER_SENSORS: return g_strdup_printf("[$ShellParam$]\n" "ReloadInterval=3000\n" "%s", sensors); case COMPUTER_SHARES: return g_strdup_printf("[SAMBA]\n" - "%s", shares_list); + "%s\n" + "[NFS]\n" + "%s", smb_shares_list, nfs_shares_list); case COMPUTER_FILESYSTEMS: return g_strdup_printf("[$ShellParam$]\n" "ViewType=1\n" |