config.h
:
/* ... */
static struct arg_t args[] = {
{ function, "format %s", arg, interval, END },
}
functons
list is described under components info
format
will be placed string with component return, so there should be only one %s
arg
to component can by "string"
or NULL
interval
is non-negative integer
END
to update component without waiting interval
just send USR1 signal to thread which you want to update
aslstatus-update
:
#!/bin/sh --
# deps:
# pstree from `psmisc`
# pidof from `procps`
set -ue
alias tree='pstree -tp "$(pidof aslstatus)"'
case "${1:?}" in
-l) tree;;
[0-9]*) kill -USR1 "${1}";;
*) kill -USR1 "$(tree | sed -n "s/.*{${1}}(\([0-9]\+\))/\1/p")"
esac
aslstatus-update -l # list threads
# update component
aslstatus-update datetime # by name
aslstatus-update 1488 # by pid
BAT0
/sys/class/power_supply/${arg}
battery percentage
/sys/class/power_supply/${arg}/capacity
battery charging state
/sys/class/power_supply/${arg}/status
battery remaining HH:MM
backlight display brightness
intel_backlight
/sys/class/backlight/${arg}/{max_,}brightness
bspwm workspaces (for lemonbar?)
NULL
0
bspwm
socketNULL
/proc/stat
(see: man 5 proc
)cpu usage in percent
cpu frequency
date and time
man 3 strftime
)
%F %T
man 8 findmnt
)
/
, /home
, /media
, ...statfs
syscall (see: man 2 statfs
and man 3 statvfs
)free disk space
disk usage in percent
total disk space
used disk space
available entropy
NULL
/proc/sys/kernel/random/entropy_avail
name of current host
NULL
ONCE
uname
syscall (see: man 2 uname
and man 3 gethostname
)eth0
IPv4 address
IPv6 address
operating system release level
NULL
uname -r
uname
syscall (see: man 2 uname
)layout of current keymap
NULL
0
Xorg
X=1
and XKB=1
en
, de
, ru
, ...)EN
, DE
, RU
, ...)load average
NULL
%.2f %.2f %.2f
sysinfo
syscall (see: man 2 sysinfo
and man 3 getloadavg
)interval
wlan0
/sys/class/net/${arg}/statistics/{r,t}x_bytes
receive network speed
transfer network speed
number of files in a directory
/home/user/Mail/Inbox/cur
ram
and swap
NULL
/proc/meminfo
htop
, top
, free
free memory
memory usage in percent
total memory size
sysinfo
syscall (see: man 2 sysinfo
)used memory
free swap
swap usage in percent
total swap size
sysinfo
syscall (see: man 2 sysinfo
)used swap
display output of custom shell command
curl -s -- 'wttr.in/?format=1'
man 3 popen
temperature in degree celsius
NULL
or thermal zone
hwmon0
, hwmon1
, .../sys/class/hwmon/${arg}/temp1_input
NULL
: will automatically find a suitable zonesystem uptime
NULL
clock_gettime
(see: man 2 clock_gettime
)NULL
ONCE
UID of current user
GID of current user
username of current user
volume in percent
AUDIO=ALSA
NULL
(will be used default mixer)AUDIO=PULSE
NULL
(will be used default ?mixer?)/dev/mixer
sys/soundcard.h
wlan0
ioctl
syscall (see: man 2 ioctl
and linux/wireguard.h
)WiFi signal in percent
SIOCGIWSTATS
ioctl
WiFi ESSID
SIOCGIWESSID
ioctl