From 566442a0c023b2f07b9ade411d54870998564641 Mon Sep 17 00:00:00 2001 From: nikolaus Date: Wed, 7 Sep 2022 13:59:22 +0200 Subject: Initial commit and full program. --- LICENSE | 0 Makefile | 4 ++-- README.md | 0 blocks.def.h | 0 blocks.h | 14 ++++++++++++++ dwmblocks | Bin 0 -> 12392 bytes dwmblocks.c | 10 +++++++--- 7 files changed, 23 insertions(+), 5 deletions(-) mode change 100644 => 100755 LICENSE mode change 100644 => 100755 Makefile mode change 100644 => 100755 README.md mode change 100644 => 100755 blocks.def.h create mode 100755 blocks.h create mode 100755 dwmblocks mode change 100644 => 100755 dwmblocks.c diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 75109ac..c440700 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ LDFLAGS := -lX11 # FreeBSD (uncomment) #LDFLAGS += -L/usr/local/lib -I/usr/local/include -# # OpenBSD (uncomment) -#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include + # OpenBSD (uncomment) +LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include all: options dwmblocks diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/blocks.def.h b/blocks.def.h old mode 100644 new mode 100755 diff --git a/blocks.h b/blocks.h new file mode 100755 index 0000000..277e159 --- /dev/null +++ b/blocks.h @@ -0,0 +1,14 @@ +//Modify this file to change what commands output to your statusbar, and recompile using the make command. +static const Block blocks[] = { + /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ + {"", "volume.sh", 0, 1}, + {"📧", "mail.sh", 300, 0}, +/* {"Mem:", "memory.sh", 60, 0},*/ + {"", "cpu_temp.sh", 45, 0}, + {"", "battery.sh", 60, 0}, + {"", "date '+%d %b %I:%M'", 60, 30}, +}; + +//sets delimeter between status commands. NULL character ('\0') means no delimeter. +static char delim[] = " | "; +static unsigned int delimLen = 5; diff --git a/dwmblocks b/dwmblocks new file mode 100755 index 0000000..631bc7a Binary files /dev/null and b/dwmblocks differ diff --git a/dwmblocks.c b/dwmblocks.c old mode 100644 new mode 100755 index befd252..08f0b59 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -8,7 +8,7 @@ #endif #ifdef __OpenBSD__ #define SIGPLUS SIGUSR1+1 -#define SIGMINUS SIGUSR1-1 +#define SIGMINUS SIGINFO #else #define SIGPLUS SIGRTMIN #define SIGMINUS SIGRTMIN @@ -104,8 +104,12 @@ void setupsignals() { #ifndef __OpenBSD__ /* initialize all real time signals with dummy handler */ - for (int i = SIGRTMIN; i <= SIGRTMAX; i++) - signal(i, dummysighandler); +/* for (int i = SIGRTMIN; i <= SIGRTMAX; i++) */ +/* signal(i, dummysighandler); */ + for (unsigned int i = 0; i < LENGTH(blocks); i++) { + if (blocks[i].signal > 0) + signal(SIGRTMIN+blocks[i].signal, sighandler); + } #endif for (unsigned int i = 0; i < LENGTH(blocks); i++) { -- cgit v1.2.1