Xinqi Bao's Git
1 /* See LICENSE file for copyright and license details. */
3 /* interval between updates (in ms) */
4 static const unsigned int interval
= 1000;
6 /* text to show if no value can be retrieved */
7 static const char unknown_str
[] = "n/a";
9 /* maximum output string length */
13 * function description argument (example)
15 * battery_perc battery percentage battery name (BAT0)
17 * battery_state battery charging state battery name (BAT0)
19 * cpu_perc cpu usage in percent NULL
20 * cpu_freq cpu frequency in MHz NULL
21 * datetime date and time format string (%F %T)
22 * disk_free free disk space in GB mountpoint path (/)
23 * disk_perc disk usage in percent mountpoint path (/)
24 * disk_total total disk space in GB mountpoint path (/")
25 * disk_used used disk space in GB mountpoint path (/)
26 * entropy available entropy NULL
27 * gid GID of current user NULL
28 * hostname hostname NULL
29 * ipv4 IPv4 address interface name (eth0)
30 * ipv6 IPv6 address interface name (eth0)
31 * kernel_release `uname -r` NULL
32 * keyboard_indicators caps/num lock indicators NULL
33 * load_avg load average format string
35 * num_files number of files in a directory path
36 * (/home/foo/Inbox/cur)
37 * ram_free free memory in GB NULL
38 * ram_perc memory usage in percent NULL
39 * ram_total total memory size in GB NULL
40 * ram_used used memory in GB NULL
41 * run_command custom shell command command (echo foo)
42 * swap_free free swap in GB NULL
43 * swap_perc swap usage in percent NULL
44 * swap_total total swap size in GB NULL
45 * swap_used used swap in GB NULL
46 * temp temperature in degree celsius sensor file
47 * (/sys/class/thermal/...)
49 * uid UID of current user NULL
50 * uptime system uptime NULL
51 * username username of current user NULL
52 * vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer)
53 * wifi_perc WiFi signal in percent interface name (wlan0)
54 * wifi_essid WiFi ESSID interface name (wlan0)
56 static const struct arg args
[] = {
57 /* function format argument */
58 { datetime
, "%s", "%F %T" },