slstatus

My fork of https://tools.suckless.org/slstatus/
git clone https://git.inz.fi/slstatus
Log | Files | Refs | README | LICENSE

config.h (4696B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* interval between updates (in ms) */
      4 const unsigned int interval = 10000;
      5 
      6 /* maximum output string length */
      7 #define MAXLEN 2048
      8 
      9 /*
     10  * function            description                     argument (example)
     11  *
     12  * battery_perc        battery percentage              battery name (BAT0)
     13  *                                                     NULL on OpenBSD/FreeBSD
     14  * battery_state       battery charging state          battery name (BAT0)
     15  *                                                     NULL on OpenBSD/FreeBSD
     16  * battery_remaining   battery remaining HH:MM         battery name (BAT0)
     17  *                                                     NULL on OpenBSD/FreeBSD
     18  * cpu_perc            cpu usage in percent            NULL
     19  * cpu_freq            cpu frequency in MHz            NULL
     20  * datetime            date and time                   format string (%F %T)
     21  * disk_free           free disk space in GB           mountpoint path (/)
     22  * disk_perc           disk usage in percent           mountpoint path (/)
     23  * disk_total          total disk space in GB          mountpoint path (/")
     24  * disk_used           used disk space in GB           mountpoint path (/)
     25  * entropy             available entropy               NULL
     26  * gid                 GID of current user             NULL
     27  * hostname            hostname                        NULL
     28  * ipv4                IPv4 address                    interface name (eth0)
     29  * ipv6                IPv6 address                    interface name (eth0)
     30  * kernel_release      `uname -r`                      NULL
     31  * keyboard_indicators caps/num lock indicators        format string (c?n?)
     32  *                                                     see keyboard_indicators.c
     33  * keymap              layout (variant) of current     NULL
     34  *                     keymap
     35  * load_avg            load average                    NULL
     36  * netspeed_rx         receive network speed           interface name (wlan0)
     37  * netspeed_tx         transfer network speed          interface name (wlan0)
     38  * num_files           number of files in a directory  path
     39  *                                                     (/home/foo/Inbox/cur)
     40  * ram_free            free memory in GB               NULL
     41  * ram_perc            memory usage in percent         NULL
     42  * ram_total           total memory size in GB         NULL
     43  * ram_used            used memory in GB               NULL
     44  * run_command         custom shell command            command (echo foo)
     45  * separator           string to echo                  NULL
     46  * swap_free           free swap in GB                 NULL
     47  * swap_perc           swap usage in percent           NULL
     48  * swap_total          total swap size in GB           NULL
     49  * swap_used           used swap in GB                 NULL
     50  * temp                temperature in degree celsius   sensor file
     51  *                                                     (/sys/class/thermal/...)
     52  *                                                     NULL on OpenBSD
     53  *                                                     thermal zone on FreeBSD
     54  *                                                     (tz0, tz1, etc.)
     55  * uid                 UID of current user             NULL
     56  * uptime              system uptime                   NULL
     57  * username            username of current user        NULL
     58  * vol_perc            OSS/ALSA volume in percent      mixer file (/dev/mixer)
     59  *                                                     NULL on OpenBSD
     60  * wifi_perc           WiFi signal in percent          interface name (wlan0)
     61  * wifi_essid          WiFi ESSID                      interface name (wlan0)
     62  */
     63 static struct arg args[] = {
     64 	/* function format          argument */
     65 	{ wintitle, "\033[1;34m \033[11m\uf0e5\033[10m %s\033[0m | ", "WeeChat.*Act:\\((.*)\\)" },
     66 	{ wintitle, "\033[1;36m \033[11m\uf0e5\033[10m %s\033[0m | ", "Irssi.*Act:\\((.*)\\)" },
     67 	{ pipe_command, "%s | ", "tmisu -j | jq -r --unbuffered '"
     68 		"map("
     69 			"{"
     70 				"\"email\":\"\\u001b[11m \\uf2b7 \\u001b[10m\","
     71 				"\"Thunderbird\":\"\\u001b[11m \\uf2b7 \\u001b[10m\","
     72 				"\"network\":\"\\u001b[11m \\uf1eb \\u001b[10m\","
     73 				"\"NetworkManager\":\"\\u001b[11m \\uf1eb \\u001b[10m\","
     74 				"\"im\":\"\\u001b[11m \\uf0e5 \\u001b[10m\""
     75 			"}"
     76 		"[((.hints.category // .app_name // \"\")|split(\".\")[0]) // \"\"] + .summary ) | join(\", \")'" },
     77 	{ load_avg, " \033[11m\uf0e4\033[0m %s | ",	    NULL },
     78 	{ battery_icon, " \033[11m%s\033[0m ",  "\uf244\uf243\uf242\uf241\uf240" },
     79 	{ battery_perc, "%s%%",  NULL },
     80 	{ battery_state, "%s | ",  "BAT0" },
     81 	{ datetime, " \033[11m\uf133\033[0m %s ",        "w%V %d.%m. %H:%M" },
     82 };