Coder Social home page Coder Social logo

utkarshverma / dwmblocks-async Goto Github PK

View Code? Open in Web Editor NEW
205.0 205.0 81.0 165 KB

An efficient, lean, and asynchronous status feed generator for dwm.

License: GNU General Public License v2.0

Makefile 4.11% C 95.89%
dwm dwm-status dwm-statusbar suckless

dwmblocks-async's Introduction

dwmblocks-async's People

Contributors

dimaglushkov avatar helionsmoker avatar listeriam avatar ssnailed avatar utkarshverma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dwmblocks-async's Issues

make install problem on Debian 12

I try install with make install, but i get the following output (error)

Package xcb-atom was not found in the pkg-config search path.
Perhaps you should add the directory containing xcb-atom.pc' to the PKG_CONFIG_PATH environment variable Package 'xcb-atom', required by 'virtual:world', not found Package xcb-atom was not found in the pkg-config search path. Perhaps you should add the directory containing xcb-atom.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-atom', required by 'virtual:world', not found
LD build/dwmblocks
/usr/bin/ld: build/x11.o: in function x11_connection_open': x11.c:(.text+0x6): undefined reference to xcb_connect'
/usr/bin/ld: x11.c:(.text+0x11): undefined reference to xcb_connection_has_error' /usr/bin/ld: build/x11.o: in function x11_set_root_name':
x11.c:(.text+0x6b): undefined reference to xcb_get_setup' /usr/bin/ld: x11.c:(.text+0x73): undefined reference to xcb_setup_roots_iterator'
/usr/bin/ld: x11.c:(.text+0x9f): undefined reference to xcb_change_property' /usr/bin/ld: x11.c:(.text+0xa9): undefined reference to xcb_request_check'
/usr/bin/ld: x11.c:(.text+0xe4): undefined reference to xcb_flush' /usr/bin/ld: build/x11.o: in function x11_connection_close':
x11.c:(.text+0x51): undefined reference to `xcb_disconnect'
collect2: error: ld returned 1 exit status
make: *** [Makefile:39: build/dwmblocks] Error 1

Enhancement

Can you make Luke's status bar look like this ?
This build uses the Siji icons which are bitmap fonts.
This bar looks so much better than Luke's.

How to avoid re-runing on click/scroll

I'm not sure if I'm doing this right, but I'd like to use mouse scroll on my volume block. In order to do this, I have to enable scroll buttons in dwm, and by doing it I enable it for ALL the blocks. It works, scrolling triggers my script action but it also reruns calculation too. It's not a problem for the volume block, it is actually desirable, but I have some blocks that take seconds to execute, and scrolling above them makes them execute many times.

  • as far as I know I cannot disable scroll for individual blocks in DWM
  • if I detect mouse scroll in my complex script and exit early, then block is deleted as script output was blank
  • I cannot access old state of the block, a cached version, to return it before early exit

I'm not sure how to do this or is it even possible.

Clickability without statuscmd patch?

Hello there, trying to understand what does that block mean "Earlier, dwmblocks-async used to require a patch to be applied to dwm. However, the code has been redone so there's no need to apply that patch anymore." in clickability section. Is it not nessasery to install statuscmd patch? Mine not working without this patch.

Maximum number of blocks?

Is there a maximum number of displayable blocks?
When I use over 10 blocks, the last ones in the list disappear or visually bug into the middle, but are not clickable.

Feedback needed for new changes in `new-org` branch

I think I have found a fix #24 . It was pretty simple looking back at it. Anyhow, the fix is in the new-org branch. I was playing around with the build system and code organization, so haven't merged it to main yet.

I'm facing the following problem currently, and feedback and help would be highly appreciated:

  • I have to define blocks in blocks.c for the time being, which isn't good because everything should ideally be in config.h.
  • I need to find a way for the compiler to dynamically figure out the number of blocks. Currently N_BLOCKS macro has to be defined manually, which isn't good.

double output in statusbar

Hi sir, do you know why the blocks doubling up? specially the one with icons. it is fixed if i change the volume, this is common when at first boot of pc.
Issue

Cant click blocks

hi, thanks for your work, everythings good but i'm having problem with clicking on the blocks as it does nothing. here is my config:

#define CMDLENGTH 60
#define DELIMITER " | "
#define CLICKABLE_BLOCKS

const Block blocks[] = {
    BLOCK("sb-mail",        180,        17),
    BLOCK("sb-news",        1,          18),
    BLOCK("sb-forecast",    18000,      19),
    BLOCK("sb-memory",      1,          20),
    BLOCK("sb-gpu",         1,          21),
    BLOCK("sb-cpu",         1,          22),
    BLOCK("sb-time",        0,          23),
    BLOCK("sb-date",        1,          24),
    // BLOCK("sb-network", 5,    25),
};

and here is the script for sb-news

#!/bin/sh

case $BLOCK_BUTTON in
    1) setsid "$TERMINAL" -e newsboat ;;
esac

. sb-theme
display "$(cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "NEWS:" $1}')")"

i use this statuscmd-status2d-with-signal

did i do it all correctly?😅 thanks for the help

Edit: distro- Void linux

Parent Process ID is not equal to PID of statusbar

Hello, I've recently started using this for my statusbar. I must say that colours and clickability work perfectly, however I do have a simple issue.

I have all of my statusbar scripts check their $PPID so that colours are only shown when the script is executed by the statusbar. This makes the scripts usable on terminals too.

The problem:
In if [ "$(ps -p $PPID -o comm=)" = "$STATUSBAR" ]; then,

$STATUSBAR is equal to dwmblocks and
$(ps -p $PPID -o comm=) is equal to sh

I've tried to mess around with line 84 in main.c (execBlock()) but I haven't got much experience with C.

Is it possible to make execl("/bin/sh", "sh", "-c", blocks[i].command, (char*)NULL); run the scripts directly rather than with sh?

Autostarting with dwm doesn't work

I have ' dwmblocks & ' in my .xinitrc file and when i startx i can't see the statusbar there is only the basic vanilla dwm thing, but when i open htop i can see that dwmblocks is running. it works only when i run ' dwmblocks ' in a terminal...
(tried using a dwm startup script patch and still no progress)

place blocks impovement

Would it be possible to request an improvement so that you can not only place blocks on the right side of the screen, but also put the selected blocks to the center? For example, as in the case of the polybar, where in the case of the status bar, blocks can be placed to the right, left, and center of the screen.
Personally, I prefer the date and time block in the middle of the display.

doesnt refresh with echo

config:

const Block blocks[] = {
    BLOCK("echo test",        1, 2)
    BLOCK("date '+%H:%M:%S'", 1, 1)
};

expected behavior is date refreshes once a second
what happens is its static and doesn't refresh and doesn't change unless i remove echo test line

`pkill -RTMIN` and `nohup &` don't work correctly

Sorry to bother you again with stupid questions. Below is a clumsy shell script called sb-mpd, written by me to show mpd status:

#!/usr/bin/sh
# show mpd status. WIP

icon=" ------"
color="^c#7c6f64^"
if [ $(pidof mpd) ]; then 
    case $BLOCK_BUTTON in
        1) mpc toggle >/dev/null 2>&1 && pkill -RTMIN+15 dwmblocks;;
        2) notify-send "Current Music" "$(mpc status|head -n1)"
           pkill -RTMIN+15 dwmblocks;; # show current music
        3) nohup setsid -f "$TERMINAL" -e ncmpcpp &;;  # right click, open ncmpcpp
        4) mpc prev >/dev/null 2>&1  ;;  # scroll up, previous
        5) mpc next >/dev/null 2>&1  ;;  # scroll down, next
    esac
    stt=$(mpc status | grep '^\[p'| cut -d " " -f 1)
    case $stt in
        *pause*) icon=" PAUSED";;
        *play*)  icon=" PLYING"; color="^c#427b58^";;
    esac
else 
    case $BLOCK_BUTTON in
        1) mpd && pkill -RTMIN+15 dwmblocks;; # left click to launch mpd
        3) "$TERMINAL" -e "$EDITOR" "$0";; 
    esac
    icon=" NO MPD"
fi

printf "|$color$icon^d^"

There may be some unicode characters display wrongly since I use nerd fonts.

The first problem I had encounter with is in the line 22 mpd && pkill -RTMIN+15 dwmblocks. Ideally when I left click the block, mpd should start then the block should refresh, and it work correctlly when I test the command in my terminal. However, when I try to left click the block, blocks doesn't refresh, still showing "NO MPD" (mpd is actually launched though).

Another problem is about command in the line 11 nohup setsid -f "$TERMINAL" -e ncmpcpp &. In my view, ncmpcpp would be launched independently so that the block can refresh or accept later click event. Well, it doesn't. And htop tree shows that there is a child process echo $(sb-mpd) hanging under dwmblocks.

I would appreciate for your anwser.
P.S.: obviously setsid -f doesn't work either.

No icon support in dwmblocks-async

In Luke's dwmblocks you could set icons however this seems to have been removed entirely in dwmblocks-async.. why?
Do I now need to manually set the icon in the script?

DELIMITER is added at end

image
do not mind the colors, only using delimiter as example
would it be possible to add a check to attempt to remove if there isn't anything after the delimiter? or is this intentional?

Unable to use scroll inputs (button 4/5)

Been having a go again at ricing in a virtual machine and have been making use so far of this async build of dwmblocks. My only issue at the moment is that it seems like blocks won't respond at all to any scroll inputs (mouse buttons 4 and 5).

I've tried to debug this so far by including a notify-send "$BLOCK_BUTTON" line at the start of a block, which indeed throws a notification whenever buttons 1, 2 and 3 are pressed. Otherwise, however, buttons 4 and 5 consistently refuse to throw anything.

Let me know what other info to provide for this issue. I'm also curious as to what input corresponds with button 6, as I have seen this often in different status bar script examples.

issue starting dwmblocks after rewrite

Hi there, after you did the rewrite recently, I am having trouble getting dwmblocks to start the way I would like it to.

I run dwmblocks from within dwm.c using this function:

void
runAutostart(void) {
	system("killall -q dwmblocks; dwmblocks &");
}

This is so that dwmblocks can restart alongside dwm when I kill -HUP dwm.

This all worked fine until the rewrite, now dwmblocks won't start at all this way, instead I just get the default "dwm 6.4" text.

If I run dwmblocks from the command line, it will work fine until I kill -HUP dwm, then it freezes.
If I start dwmblocks in my xprofile or something, it appears but isn't clickable and will freeze when dwm is sent kill -HUP.

Any idea why this might be happening now? Hope you can help!

statusbar is covered by wm_name and has strange square displayed in blocks

1648108915
Above is my statusbar. And as the screenshot can speak itself, the statusbar is wrongly coverd and squares appear in blocks.

For the first problem, I changed #define CMDLENGTH from 60 to 100, and it didn't worked.

For the second problem, I've looked through #13, but unfortunately I don't use bakkeby/dwm-flexipatch, so his solution doesn't work for me (while I've patched statuscmd and corrected getstatusbarpid()).

Here's my config.h for dwmblocks

#define CMDLENGTH 100
#define DELIMITER "|"
#define CLICKABLE_BLOCKS

const Block blocks[] = {
	BLOCK("sb-battery", 60,    0),
	BLOCK("sb-volume",   0,    3),
	BLOCK("sb-light",    0,    2),
	BLOCK("sb-date",    30,    0)
};

And my build of dwm is here.

Problem with commenting lines in config.h

Most likely having to do with the rewrite but I can't figure out a way to comment out lines in the blocks section of the config.h without failing to build:

I used to do commenting like this:

Block blocks[] = {
    {"cat /tmp/recordingicon 2>/dev/null",	0,	1},
    {"sb-music",   18000,    2 },
    {"sb-kbselect",    1800, 3 },
    /*{"sb-disk",    1800, 3 },*/
    /*{"sb-memory",  10,   4 },*/
    {"sb-news", 0,    5 },
    /*{"sb-forecast",     18000,    6 },*/
    /*{"sb-nettraf",  1,    7 },*/
    {"sb-volume",  18000,    8 },
    {"sb-battery", 5,    9 },
    {"sb-clock",    1,    10},
    {"sb-internet",    1,    11},
    /*{"sb-help-icon",    0,    12},*/
};

but now this no longer works:

#define BLOCKS(X)         \
    X("cat /tmp/recordingicon 2>/dev/null", 0, 1) \
    X("sb-music", 18000, 2)                       \
    X("sb-kbselect", 1800, 3)                     \
    /*X("sb-disk",    1800, 3)                    \*/
    /*X("sb-memory",  10,   4)                    \*/
    X("sb-news", 0, 5)                            \
    /*X("sb-forecast", 18000, 6)                  \*/
    /*X("sb-nettraf",  1,    7)                   \*/
    X("sb-volume", 18000, 8)                      \
    X("sb-battery", 5, 9)                         \
    X("sb-clock", 1, 10)                          \
    X("sb-internet", 1, 11)                       \
    /*X("sb-help-icon", 0, 12)                    \*/

neither does this:

#define BLOCKS(X)         \
    X("cat /tmp/recordingicon 2>/dev/null", 0, 1) \
    X("sb-music", 18000, 2)                       \
    X("sb-kbselect", 1800, 3)                     \
    //X("sb-disk",    1800, 3)
    //X("sb-memory",  10,   4)
    X("sb-news", 0, 5)                            \
    //X("sb-forecast", 18000, 6)
    //X("sb-nettraf",  1,    7)
    X("sb-volume", 18000, 8)                      \
    X("sb-battery", 5, 9)                         \
    X("sb-clock", 1, 10)                          \
    X("sb-internet", 1, 11)
    //X("sb-help-icon", 0, 12)

the make install will just error with this:

CLEAN    build
CC       build/block.o
In file included from include/block.h:8,
                 from src/block.c:1:
./config.h:26:7: error: expected declaration specifiers or ‘...’ before string constant
   26 |     X("sb-news", 0, 5)                            \
      |       ^~~~~~~~~
./config.h:26:18: error: expected declaration specifiers or ‘...’ before numeric constant
   26 |     X("sb-news", 0, 5)                            \
      |                  ^
./config.h:26:21: error: expected declaration specifiers or ‘...’ before numeric constant
   26 |     X("sb-news", 0, 5)                            \
      |                     ^
make: *** [Makefile:34: build/block.o] Error 1

Inconsistent logic on time intervals

Hi there, first of all thank you for this incredible tool I really like it.

I use scripts that trigger on events with the kill command and everything updates smoothly. The problem I have is with time intervals. I will take the date as an example, if the time interval is 1 then the date updates every second as it should but when I put 5 in the config.h the time updates every 25 seconds and when I go to 30 or 60 seconds then it never updates.

config.h

#ifndef CONFIG_H
#define CONFIG_H

// String used to delimit block outputs in the status.
#define DELIMITER "  "

// Maximum number of Unicode characters that a block can output.
#define MAX_BLOCK_OUTPUT_LENGTH 45

// Control whether blocks are clickable.
#define CLICKABLE_BLOCKS 1

// Control whether a leading delimiter should be prepended to the status.
#define LEADING_DELIMITER 0

// Control whether a trailing delimiter should be appended to the status.
#define TRAILING_DELIMITER 1

// Define blocks for the status feed as X(cmd, interval, signal).
#define BLOCKS(X)         \
    X("sb-connection", 0, 14)   \
    X("sb-volume", 0, 13)   \
    X("sb-battery", 0, 12) \
    X("sb-date", 5, 11)   \

#endif  // CONFIG_H

sb-date

#!/bin/sh
echo " $(date '+%I:%M:%S %p')"

Thanks for the help!

High dwm CPU usage with clickable blocks

Hi,

If I enable CLICKABLE_BLOCKS in config.h dwm consumes a large amount of CPU power.

I am using dwm-6.3 with statuscmd patch applied and made the modifications as well on getstatusbarpid(). Wit the same patches applied, but disabling CLICKABLE_BLOCKS`, dwm behaves normally.

Let me know if you need any other details

Thanks

Does not display when being run using the autostart script patch

I really want to use this on my system because of its efficiency, but the only time I can get it to run is when I manually run it in a terminal. I have tried it in both the autostart.sh and autostart_blocking.sh, but both don't work. No errors are thrown, the process is still running when I run pidof dwmblocks, but just nothing shows up in the status bar. I've tried other forms of dwmblocks like this one and this one which work fine on my system using the autostart script. This could be caused by the fact that I'm using OpenRC as my init system, but I'm honestly not sure.

Status bar not showing up

  • I have added dwmblocks & to my .xinitrc
  • I have installed statuscmd patch to dwm
  • dwmblocks has a pid and is running
  • ~/.local/bin/ scripts are ran

yet when it's ran, all I have is a single square in place where it should be on the rightmost side of the status bar, like this

image

Any idea what could be the issue?

Operating System: Void Linux
Kernel: 6.0.9_1
dwm-6.4
zsh 5.9

unknown signal dwmblocks

to replicate:
make dwm from source, patch statuscmd, launch dwmblocks-async, click, get hit with unknown signal. it doesn't even have to run a script! it can just be "echo hello" and it just died!

now i'm not sure if this can be replicated because this might be something wrong with my system. when using torrinfail/dwmblocks with the statuscmd patch in the README.md it won't work. using statuscmd patch from suckless.org works?

Limit clickability to blocks

Hello, I've notice when you make a block 'A' clickable the following blocks will trigger the functions of block 'A', unless they have their own functions.
Well I would like those following blocks not to trigger functions of block 'A', only trigger them if I click on block 'A'.

I'm using vanilla dwm 6.3 with statuscmd and I've test with the following:
config.h

#define CMDLENGTH 45
#define DELIMITER " | "
#define CLICKABLE_BLOCKS

const Block blocks[] = {
	BLOCK( "echo foobar",              0,    0 ),

	BLOCK( "$HOME/foo.sh",             0,    1 ),
	BLOCK( "echo foobar",              0,    0 ),

	BLOCK( "$HOME/bar.sh",             0,    2 ),
	BLOCK( "echo foobar",              0,    0 ),

	BLOCK( "date '+%H:%M'",            60,   0 )
};

foo.sh

#!/bin/sh

case $BLOCK_BUTTON in
	1) notify-send foo ;;
esac

echo foo

bar.sh

#!/bin/sh

case $BLOCK_BUTTON in
	1) notify-send bar ;;
esac

echo bar

I don't want the date or 'foobar' to trigger anything if I click them, Could you help me, please?

can't use BLOCK_BUTTON up to 10

Hi, I'm not sure if this dwmblocks or statuscmd patch problem. but i can't use BLOCK_BUTTON 10. I used dwmblocks-flexipatch although i tried also this on vanilla dwm but still didn't work either. is there any limit to BLOCK_BUTTON ?

[dmm] config.h

	{ ClkStatusText,        0,                   Button1,        sigstatusbar,   {.i = 1 } },
	{ ClkStatusText,        0,                   Button2,        sigstatusbar,   {.i = 2 } },
	{ ClkStatusText,        0,                   Button3,        sigstatusbar,   {.i = 3 } },
	{ ClkStatusText,        0,                   Button4,        sigstatusbar,   {.i = 4 } },
	{ ClkStatusText,        0,                   Button5,        sigstatusbar,   {.i = 5 } },
	{ ClkStatusText,        ShiftMask,           Button1,        sigstatusbar,   {.i = 6 } }, // Shift + Left
	{ ClkStatusText,        ShiftMask,           Button2,        sigstatusbar,   {.i = 7 } }, // Shift + Middle
	{ ClkStatusText,        ShiftMask,           Button3,        sigstatusbar,   {.i = 8 } }, // Shift + Right
        { ClkStatusText,        ShiftMask,           Button4,        sigstatusbar,   {.i = 9 } }, // Shift + Scrollup
	{ ClkStatusText,        ShiftMask,           Button5,        sigstatusbar,   {.i = 10 } }, // Shift + Scrolldown

blocktest.sh

case $BLOCK_BUTTON in
	1) notify-send "$BLOCK_BUTTON" ;;
	2) notify-send "$BLOCK_BUTTON" ;;
	3) notify-send "$BLOCK_BUTTON" ;;
	4) notify-send "$BLOCK_BUTTON" ;;
	5) notify-send "$BLOCK_BUTTON" ;;
	6) notify-send "$BLOCK_BUTTON" ;;
	7) notify-send "$BLOCK_BUTTON" ;;
	8) notify-send "$BLOCK_BUTTON" ;;
	9) notify-send "$BLOCK_BUTTON" ;; 
	10) notify-send "$BLOCK_BUTTON" ;;
esac

echo "Click me"

Set leading delimiter

I like using pipes between my blocks. I also dislike having leading pipe or window title color touching my first block.
I want to have padding before the blocks. I think nice way to do it would be to specify desired padding like:

#define LEADING_DELIMITER " "

user-defined signal 1

clicking on statusbar/module makes dwmblocks-async crash with code 138 output:
user-defined signal 1 dwmblocks

this happens when used with my modified dwm build + default dwm only patched with dwm-statuscmd-status

Rectangular symbol between first two blocks

Hi,

I have a strange rectangular symbol between the first two blocks. The symbol is not part of the output generated by the scripts that are run to populate the blocks.

It is always between the first two blocks, irrespectively from the script used to populate them.

image

#ifndef CONFIG_H
#define CONFIG_H

// String used to delimit block outputs in the status.
#define DELIMITER "  "

// Maximum number of Unicode characters that a block can output.
#define MAX_BLOCK_OUTPUT_LENGTH 45

// Control whether blocks are clickable.
#define CLICKABLE_BLOCKS 1

// Control whether a leading delimiter should be prepended to the status.
#define LEADING_DELIMITER 0

// Control whether a trailing delimiter should be appended to the status.
#define TRAILING_DELIMITER 0

// Define blocks for the status feed as X(cmd, interval, signal).
#define BLOCKS(X)          \
    X("dwm_kernel", 0, 0)  \
    X("dwm_volume", 0, 10) \
    X("dwm_battery", 3, 0) \
    X("dwm_date", 3, 0)    \
    X("dwm_clock", 3, 0)
#endif  // CONFIG_H
#!/bin/bash

icon=""
kernel_version="$(uname -r)"
kernel_cleaned="${kernel_version%-*}"

printf "$icon $kernel_cleaned"
#!/bin/bash

vol=$(pactl list sinks | perl -000ne 'if(/#1/){/(Volume:.*)/; print "$1\n"}' | tr ' ' '\n' | grep -m1 '%' | tr -d '%')
if [ -z "$vol" ]; then
	vol=$(pactl list sinks | tr ' ' '\n' | grep -m1 '%' | tr -d '%')
fi

vol_status=$(pactl list sinks | grep 'Mute: yes')

if [ -n "$vol_status" ]
then
        vol_icon=""
elif [ ${vol} -eq 0 ]
then
        vol_icon=""
elif [ ${vol} -lt 50 ]
then
	vol_icon=""
        # vol_icon=" "
else
        vol_icon=""
        # vol_icon=" "
fi

printf "$vol_icon $vol"

What could we causing it?

Weird status output

When I run the status the text isn't displayed correctly. I've made some tests.
For example, when I edit config.h to show battery level and Master volume (with underscore as a separator) this should be showed:
89%92%
This is instead displayed:
89 92%
I've tried displaying three blocks containing the output of the date command:
This time the output doesn't miss any characters, but some have been added... A ( has been added before every block, like so:
(Thu Jul 21 08:52:15 PM CEST 2022
(Thu Jul 21 08:52:15 PM CEST 2022_(Thu Jul 21 08:52:15 PM CEST 2022
As before the underscore characters are the separators.

Checking with the command xprop -root the name of the root window, which is the variable used to store the status text, these paranthesis are indeed present. This means that it's not a problem with dwm displaying it incorrectly.
The same goes for the first example I made (the one with battery and volume percentages): using xprop, it appeared that that some escape sequences had been added. Output of xprop -root for the first example:
\03089%_\03292%

dwmblocks not working as expected

I'm still kinda new to the linux scene.

Installed dwmblocks today added dwmblocks & to my .xinintrc and when i rebooted it's not working.

I got this

What am i doing wrong?

What are the programs or scripts that start with sb-

I just installed arch 2 days ago, coming from gentroo

Thanks

~ Joe B

command not found

Hello,

I installed the blocks but I think I miss something, if I run the command for a test in the terminal I get this.

Operating System: Arch Linux
Kernel: Linux 6.0.2-arch1-1
dwm 6.4
zsh shell

dwmblocks                                                                                                                                                                                                                                                                                                                           0
sh: line 1: sb-disk: command not found
sh: line 1: sb-music: command not found
sh: line 1: sb-record: command not found
sh: line 1: sb-loadavg: command not found
sh: line 1: sb-date: command not found

Modules are not clickable

Trying to switch to lukes build of dwmblocks to this but it seems to be impossible..
Can't click any modules and I have made the changes to the statuscmd patch (I think I did I did it right, the exact line to change wasn't there but something similar was) so clicking does nothing. I also can't get icons to work unless I change all my scripts to use echo and then echo the icon #20
FYI I'm using my own build that's based off of Lukes.

dwmblocks does not start in Ubuntu 23.10

Hi,

My OS is Ubuntu 23.10. I've installed dwm-6.4 and been trying to autostart dwmblocks when logging in. Specifically, I've tried:

  • Start dwmblocks from inside ~/.dwm/autostart.sh
  • Start dwmblocks from ~/.xinitrc
  • Start dwmblocks from ~/.xsession
  • Start dwmblocks from an executable script, called by ~/.xinitrc

This is an example of how I tried to start dwmblocks from a script...

#!/bin/sh
# Start dwmblocks
dwmblocks &
# Start dwm
exec dwm

... and here from autostart.sh (I'm using the autostart patch).

feh --bg-scale ~/Dropbox/ubuntu-mantic-wallpaper.png &
dropbox start &
dwmblocks &
redshift -l 41:-74 -t 5700:3600 -g 0.8 -m randr -v &

The funny thing is that every other tool I'm calling in the autostart.sh script actually starts, aside from dwmblocks.

I have a few binary executable to generate the values needed for the different blocks, but all of them are in the PATH, and can be executed.

Another interesting thing is that, after logging into the dwm session, I can manually start dwmblocks from my terminal.

Here is a trimmed down example of my config.h for reproducibility.

#ifndef CONFIG_H
#define CONFIG_H

// String used to delimit block outputs in the status.
#define DELIMITER "  "

// Maximum number of Unicode characters that a block can output.
#define MAX_BLOCK_OUTPUT_LENGTH 45

// Control whether blocks are clickable.
#define CLICKABLE_BLOCKS 1

// Control whether a leading delimiter should be prepended to the status.
#define LEADING_DELIMITER 0

// Control whether a trailing delimiter should be appended to the status.
#define TRAILING_DELIMITER 0

// Define blocks for the status feed as X(cmd, interval, signal).
#define BLOCKS(X)          \
    X("dwm_kernel", 0, 0) 
#endif  // CONFIG_H

And here is the binary executable ~/.local/bin/statusbar/dwm_kernel.

#!/bin/sh

kernel_v="$(uname -r)"
kernel_v="${kernel_v%-*}"

printf "$kernel_v"

I can run sudo make install successfully.

Do you have any suggestions on how I can debug the issue?

dwmblocks status2d background

hi sir, it's been 2months since i use your dwmblocks-async and it's doing great. im also using your script that sets foreground color with status2d. im planning to also set a background for module just use your sb-theme script. how to extend your script to also set a background color inside your script sb-theme to have something like echo $args "^c$color^$1^b$color^" thank you sir.

#!/bin/sh

# Gruvbox colorscheme
color0="#5d6061"    # gray
color1="#32302f"    # black
color2="#ea6962"    # red
color3="#a9b665"    # green
color4="#e78a4e"    # yellow
color5="#7daea3"    # blue
color6="#d3869b"    # magenta
color7="#89b482"    # cyan
color8="#d4be98"    # white

display() {
    args=""
    case $1 in
        -n) args="-n"; shift ;;
    esac

    if [ -n "${2+x}" ]; then
        color=$2
	else
		case "$(basename $0)" in
            sb-torrent) color="$color8" ;;
            sb-net) color="$color6" ;;
            sb-xbps) color="$color5" ;;
            sb-audio) color="$color4" ;;
            sb-mail) color="$color3" ;;
            sb-news) color="$color2" ;;
            sb-forecast) color="$color7" ;;
            sb-mem) color="$color3" ;;
            sb-gpu) color="$color4" ;;
            sb-cpu) color="$color3" ;;
            #sb-time) color="$color4" ;;
            sb-date) color="$color2" ;;
            sb-uptime) color="$color0" ;;
            *) color="$color8" ;;
        esac
    fi
    echo $args "^c$color^$1"
}

I Cannot Seem to Set the Update Interval to Less than a Second

I tried to set the update interval to a millisecond:

#define CMDLENGTH 45
#define DELIMITER " "
#define CLICKABLE_BLOCKS

const Block blocks[] = {
	BLOCK("sb-volume_input",    0.001, 17),
	BLOCK("sb-volume_output",    0.001, 18),
};

But it caused it to not update at all.

command not executing properly within set interval

In my config.h I have

 #define BLOCKS(X)         \ 
    X("~/.config/dwmblocks/scripts/time", 10, 0)  \  

In my time file I have

notify-send "dwmblocks"

but the script definitely takes more than 10 seconds to update sometimes it takes very long time sometimes suddenly twice .
I don't exactly remember how long I have this problem but it's been more than a month

specs:

 archlinux
  linux 6.7.2

Don't see anything changed

Hello,

I downloaded this from thr repo didn't modify config.h cause the defaults look fine. Did a sudo make install clean. Looked promising. Logged out and back in and dwm status bar is the same. Am I suppose to see something?

I'm new to this so please let me know what I'm doing wrong

Thanks

Joe B

[SUGGESTION] execute commands directly rather than through a shell

We can execute the commands directly rather than through another shell to avoid unnecessary nesting of shells.

By replacing

#define BLOCK(cmd, interval, signal) \
	{ "echo \"$(" cmd ")\"", interval, signal }

with

#define BLOCK(cmd, interval, signal) \
	{ cmd, interval, signal }

and

execl("/bin/sh", "sh", "-c", blocks[i].command, (char*)NULL);

with

execlp(blocks[i].command, (char*)NULL);

we can execute each block without the need of an extra shell.

I apologise for not having sent a PR, I have been having issues with Github recently.

enabling TRAILING_DELIMITER gives error

the only thing i changed in config.h (0 to 1) is
#define TRAILING_DELIMITER 1

it throws this error status.c while using "sudo make clean install"
error/log:
2023-11-17_23-38

btw thankyou for this awesome project

state bar have a small square is displayed

Hello Guys,

Good day to you.

I have a small square is displayed at the front of the time, Anyone knows what is the reason for this issue?

I also have another question.

I saw the NOTE below.

Please note that if you are using dwm-flexipatch, then you only need to enable the statuscmd patch through patches.h. There is no need to edit change the definition of getstatusbarpid() as the changes have already been applied there through dwm-flexipatch#190.

I also using dwm-flexipatch now. May I ask which statuscmd patch are you enabled?
Currently, I am enabled:

#define BAR_DWMBLOCKS_PATCH 1
#define BAR_STATUS2D_PATCH 1

Are there any other patches that need to enable?

Thanks,
Boyang Yan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.