My slstatus configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

78 lines
4.3 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. /* interval between updates (in ms) */
  3. const unsigned int interval = 300;
  4. /* text to show if no value can be retrieved */
  5. static const char unknown_str[] = "n/a";
  6. /* maximum output string length */
  7. #define MAXLEN 2048
  8. /*
  9. * function description argument (example)
  10. *
  11. * battery_perc battery percentage battery name (BAT0)
  12. * NULL on OpenBSD/FreeBSD
  13. * battery_state battery charging state battery name (BAT0)
  14. * NULL on OpenBSD/FreeBSD
  15. * battery_remaining battery remaining HH:MM battery name (BAT0)
  16. * NULL on OpenBSD/FreeBSD
  17. * cpu_perc cpu usage in percent NULL
  18. * cpu_freq cpu frequency in MHz NULL
  19. * datetime date and time format string (%F %T)
  20. * disk_free free disk space in GB mountpoint path (/)
  21. * disk_perc disk usage in percent mountpoint path (/)
  22. * disk_total total disk space in GB mountpoint path (/")
  23. * disk_used used disk space in GB mountpoint path (/)
  24. * entropy available entropy NULL
  25. * gid GID of current user NULL
  26. * hostname hostname NULL
  27. * ipv4 IPv4 address interface name (eth0)
  28. * ipv6 IPv6 address interface name (eth0)
  29. * kernel_release `uname -r` NULL
  30. * keyboard_indicators caps/num lock indicators format string (c?n?)
  31. * see keyboard_indicators.c
  32. * keymap layout (variant) of current NULL
  33. * keymap
  34. * load_avg load average NULL
  35. * netspeed_rx receive network speed interface name (wlan0)
  36. * netspeed_tx transfer network speed interface name (wlan0)
  37. * num_files number of files in a directory path
  38. * (/home/foo/Inbox/cur)
  39. * ram_free free memory in GB NULL
  40. * ram_perc memory usage in percent NULL
  41. * ram_total total memory size in GB NULL
  42. * ram_used used memory in GB NULL
  43. * run_command custom shell command command (echo foo)
  44. * swap_free free swap in GB NULL
  45. * swap_perc swap usage in percent NULL
  46. * swap_total total swap size in GB NULL
  47. * swap_used used swap in GB NULL
  48. * temp temperature in degree celsius sensor file
  49. * (/sys/class/thermal/...)
  50. * NULL on OpenBSD
  51. * thermal zone on FreeBSD
  52. * (tz0, tz1, etc.)
  53. * uid UID of current user NULL
  54. * uptime system uptime NULL
  55. * username username of current user NULL
  56. * vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer)
  57. * wifi_perc WiFi signal in percent interface name (wlan0)
  58. * wifi_essid WiFi ESSID interface name (wlan0)
  59. */
  60. static const struct arg args[] = {
  61. /* function format argument */
  62. { username, "^c#fbdf90^^b#1e1e2e^ :%s@", "NULL"},
  63. { hostname, "%s ", "NULL"},
  64. { run_command, "^c#81d4ee^^b#1e1e2e^ %s | ", "~/scripts/mute.sh"},
  65. { run_command, ":%s ", "pactl get-sink-volume @DEFAULT_SINK@ | grep -o \"[0-9]*%\" | head -1" },
  66. { run_command, "%s", "~/scripts/status/battery.sh"},
  67. { battery_perc, ":%s|", "BAT1"},
  68. { battery_state, "%s ^b#1e1e2e^", "BAT1"},
  69. { run_command, "^c#d990cd^ :%s ", "~/scripts/status/brightness.sh"},
  70. { cpu_perc, "^c#fbdf90^ :%s ", "NULL"},
  71. { ram_free, "^c#81d4ee^ :%s ", "NULL"},
  72. { run_command, "%s^d^ ", "~/scripts/status/date.sh"}
  73. };