From b9d337f3c0ca2501744a1bb12b9bd6d3929c692c Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 9 Feb 2025 10:19:46 +0900 Subject: updates --- dwmblocks/Makefile | 41 +++++++++++++++++++++++++++++------------ dwmblocks/config.def.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ dwmblocks/config.h | 49 ------------------------------------------------- dwmblocks/dwmblocks.c | 2 +- 4 files changed, 79 insertions(+), 62 deletions(-) create mode 100644 dwmblocks/config.def.h delete mode 100644 dwmblocks/config.h (limited to 'dwmblocks') diff --git a/dwmblocks/Makefile b/dwmblocks/Makefile index 5cfbb5a..159a71a 100644 --- a/dwmblocks/Makefile +++ b/dwmblocks/Makefile @@ -1,19 +1,36 @@ -.POSIX: +PREFIX := /usr/local +CC := cc +CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os +LDFLAGS := -lX11 -PREFIX = /usr/local -CC = gcc +# FreeBSD (uncomment) +#LDFLAGS += -L/usr/local/lib -I/usr/local/include +# # OpenBSD (uncomment) +#LDFLAGS += -L/usr/X11R6/lib -I/usr/X11R6/include + +all: options dwmblocks + +options: + @echo dwmblocks build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +dwmblocks: dwmblocks.c config.def.h config.h + ${CC} -o dwmblocks dwmblocks.c ${CFLAGS} ${LDFLAGS} + +config.h: + cp config.def.h $@ -dwmblocks: dwmblocks.o - $(CC) dwmblocks.o -lX11 -o dwmblocks -dwmblocks.o: dwmblocks.c config.h - $(CC) -c dwmblocks.c clean: rm -f *.o *.gch dwmblocks + install: dwmblocks - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks + mkdir -p ${DESTDIR}${PREFIX}/bin + cp -f dwmblocks ${DESTDIR}${PREFIX}/bin + chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks + uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks + rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks -.PHONY: clean install uninstall +.PHONY: all options clean install uninstall diff --git a/dwmblocks/config.def.h b/dwmblocks/config.def.h new file mode 100644 index 0000000..6726613 --- /dev/null +++ b/dwmblocks/config.def.h @@ -0,0 +1,49 @@ +// 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 (1-31)*/ + {"", "sb-music", 0, 23}, // Music (far left) + {"", "cat /tmp/recordingicon 2>/dev/null", 0, 24}, // Recording + {"", "sb-torrent", 20, 22}, // Torrent + {"", "sb-queues", 10, 21}, // Queues + {"", "sb-mailbox", 300, 20}, // Mailbox + {"", "sb-news", 0, 19}, // News + {"", "sb-repos", 60, 18}, // Git repositories + {"", "sb-tasks", 60, 17}, // Tasks + {"", "sb-packages", 0, 16}, // Packages + {"", "sb-forecast", 10800, 15}, // Weather + /* {"", "sb-price xmr-btc \"Monero to Bitcoin\" 🔒 30", 9000, 31}, */ + /* {"", "sb-price xmr Monero 🔒 29", 9000, 30}, */ + /* {"", "sb-price bnb Binance 🫧 28", 9000, 29}, */ + /* {"", "sb-price xrp XRP 🪓 27", 9000, 28}, */ + /* {"", "sb-price usdt Tether ⛺ 26", 9000, 27}, */ + /* {"", "sb-price eth Ethereum 🍸 25", 9000, 26}, */ + /* {"", "sb-price btc Bitcoin 💰 24", 9000, 25}, */ + /* {"", "sb-nettraf", 1, 14}, // Network */ + {"", "sb-cpu", 60, 13}, // CPU + {"", "sb-memory", 60, 12}, // Memory + {"", "sb-disk", 10800, 11}, // Disk + {"", "sb-keyboard", 0, 10}, // Inputs + {"", "sb-bghitness", 0, 9}, // Background Lightness + {"", "sb-brightness", 0, 8}, // Brightness + {"", "sb-internet", 5, 7}, // Internet + /* {"", "sb-iplocate", 0, 6}, // ip */ + {"", "sb-volume", 0, 5}, // Volume + {"", "sb-battery", 5, 4}, // Battery + {"", "sb-clock", 60, 3}, // Clock + {"", "sb-ecrypt", 0, 2}, // Ecrypt (rightmost) + {"", "sb-help-icon", 0, 1}, // Help Icon (rightmost) +}; + +// Sets delimiter between status commands. NULL character ('\0') means no delimiter. +static char *delim = " "; + +// Have dwmblocks automatically recompile and run when you edit this file in +// vim with the following line in your vimrc/init.vim: + +// autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks & } + +// Although, pkill is slightly slower than the command kill, which can +// make a big difference if we are making semi-frequent changes in a script. +// To signal with kill, we must send the value plus 34. Just remember 34. +// So, 10 + 34 = 44, so we use this command: kill -44 $(pidof dwmblocks) + diff --git a/dwmblocks/config.h b/dwmblocks/config.h deleted file mode 100644 index 6726613..0000000 --- a/dwmblocks/config.h +++ /dev/null @@ -1,49 +0,0 @@ -// 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 (1-31)*/ - {"", "sb-music", 0, 23}, // Music (far left) - {"", "cat /tmp/recordingicon 2>/dev/null", 0, 24}, // Recording - {"", "sb-torrent", 20, 22}, // Torrent - {"", "sb-queues", 10, 21}, // Queues - {"", "sb-mailbox", 300, 20}, // Mailbox - {"", "sb-news", 0, 19}, // News - {"", "sb-repos", 60, 18}, // Git repositories - {"", "sb-tasks", 60, 17}, // Tasks - {"", "sb-packages", 0, 16}, // Packages - {"", "sb-forecast", 10800, 15}, // Weather - /* {"", "sb-price xmr-btc \"Monero to Bitcoin\" 🔒 30", 9000, 31}, */ - /* {"", "sb-price xmr Monero 🔒 29", 9000, 30}, */ - /* {"", "sb-price bnb Binance 🫧 28", 9000, 29}, */ - /* {"", "sb-price xrp XRP 🪓 27", 9000, 28}, */ - /* {"", "sb-price usdt Tether ⛺ 26", 9000, 27}, */ - /* {"", "sb-price eth Ethereum 🍸 25", 9000, 26}, */ - /* {"", "sb-price btc Bitcoin 💰 24", 9000, 25}, */ - /* {"", "sb-nettraf", 1, 14}, // Network */ - {"", "sb-cpu", 60, 13}, // CPU - {"", "sb-memory", 60, 12}, // Memory - {"", "sb-disk", 10800, 11}, // Disk - {"", "sb-keyboard", 0, 10}, // Inputs - {"", "sb-bghitness", 0, 9}, // Background Lightness - {"", "sb-brightness", 0, 8}, // Brightness - {"", "sb-internet", 5, 7}, // Internet - /* {"", "sb-iplocate", 0, 6}, // ip */ - {"", "sb-volume", 0, 5}, // Volume - {"", "sb-battery", 5, 4}, // Battery - {"", "sb-clock", 60, 3}, // Clock - {"", "sb-ecrypt", 0, 2}, // Ecrypt (rightmost) - {"", "sb-help-icon", 0, 1}, // Help Icon (rightmost) -}; - -// Sets delimiter between status commands. NULL character ('\0') means no delimiter. -static char *delim = " "; - -// Have dwmblocks automatically recompile and run when you edit this file in -// vim with the following line in your vimrc/init.vim: - -// autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks & } - -// Although, pkill is slightly slower than the command kill, which can -// make a big difference if we are making semi-frequent changes in a script. -// To signal with kill, we must send the value plus 34. Just remember 34. -// So, 10 + 34 = 44, so we use this command: kill -44 $(pidof dwmblocks) - diff --git a/dwmblocks/dwmblocks.c b/dwmblocks/dwmblocks.c index 36b6a9a..1bd87f0 100644 --- a/dwmblocks/dwmblocks.c +++ b/dwmblocks/dwmblocks.c @@ -251,7 +251,7 @@ void sighandler() void buttonhandler(int ssi_int) { - char button[2] = {'0' + ssi_int & 0xff, '\0'}; + char button[2] = {('0' + ssi_int) & 0xff, '\0'}; pid_t process_id = getpid(); int sig = ssi_int >> 8; if (fork() == 0) -- cgit v1.2.3