async (multithread) status bar
|
vor 3 Jahren | |
---|---|---|
components | vor 3 Jahren | |
.gitignore | vor 4 Jahren | |
LICENSE | vor 4 Jahren | |
Makefile | vor 3 Jahren | |
README.md | vor 3 Jahren | |
X.h | vor 3 Jahren | |
arg.h | vor 3 Jahren | |
aslstatus.1 | vor 3 Jahren | |
aslstatus.1.md | vor 3 Jahren | |
aslstatus.c | vor 3 Jahren | |
aslstatus.h | vor 3 Jahren | |
components_config.h | vor 3 Jahren | |
config.h | vor 3 Jahren | |
config.mk | vor 3 Jahren | |
os.h | vor 4 Jahren | |
thread_helper.h | vor 3 Jahren | |
util.c | vor 3 Jahren | |
util.h | vor 3 Jahren |
if you found any issues report it here
for all other questions, feel free to ask in matrix #aslstatus:matrix.org
avaliable in my overlay:
eselect repository enable dm9pZCAq
emerge --sync dm9pZCAq
emerge app-admin/aslstatus::dm9pZCAq
if you wanna pack aslstatus
for you distro,
please do so and submit PR to add it here
it is successfully compiling with
clang
tcc
gcc
needs pkg-config
for LDLIBS
you can find out more in config.mk
add support for X
(needed for dwm
WM_NAME
)
you may want to set it to 0
if you use aslstatus in dvtm
1
libxcb-dev
add support for keyboard (needed for keymap
component)
works only if X=1
1
libxcb-xkb-dev
select audio library
ALSA
ALSA
PULSE
''
(empty) to use sys/soundcard.h
or sys/audioio.h
on OpenBSDlibasound-dev
(if AUDIO=ALSA
)libpulse-dev
(if AUDIO=PULSE
)for more info about configs see config.h and components_config.h
also you can change BUFF_SZ
(see util.h)
components were taken from slstatus
and have been modified to work with pthread
,
some have been completely rewritten
all components are tested in Linux
if you are using OpenBSD
or FreeBSD
, please tell me if it works correctly,
or if you have any problems
just send USR1
signal to thread which you want to update
create file with .c
extension in components/
components/simple_module.c
:
#include "../util.h" /* you can find some useful functions in `util.c` */
void
function_name(char *out, const char __unused *arg,
unsigned int __unused interval, void __unused *static_ptr)
{
bprintf(out, "%s", "Hello, World!");
}
arg
, interval
and static_ptr
is optional argument
and if it is unused add __unused
attribute
then put:
void function_name FUNC_ARGS;
#define function_name {function_name, "thread name", 0}
at the end of aslstatus.h
(FUNC_ARGS
is already predefined)
components/my_module.c
:
#include "../util.h"
void
my_module(char *out, const char *arg, unsigned int interval, void *static_ptr)
{
float *static_data = static_ptr;
if (!static_data)
static_data = interval * 20.21;
bprintf(
out,
"'%s' module with '%s' arg and '%u' interval, "
"pointer to static_data is %p with '%f'",
__FUNCTION__, arg, interval, static_ptr, static_data
);
}
aslstatus.h
:
/* ... */
void my_module FUNC_ARGS;
#define my_module {my_module, "My Module", sizeof(float)}
in define
third field is size of static data to which point static_ptr
also in os.h defined 4 variables which can be used to set os specific data sizes in branchless way (see: this lines in aslstatus.h)