Closed ghost closed 2 years ago
It should work now. Also, it would be better if you simply use cat /proc/$PPID/comm
.
Unfortunately that didn't seem to fix it. Adding notify-send "$(cat /proc/$PPID/comm)"
to one of the statusbar modules still returns "sh".
Yeah, I was in a rush so didn't notice. You'll have to check for the parent of parent process, i.e. the grandparent process. This is because dwmblocks-async wraps the block command inside an echo $(cmd)
statement. This wrapping of the command is really important and is discussed in #24 .
To check the grandparent process, you can use this:
ps -p $(ps -o ppid:1= $PPID) -o comm=
Ah ok thanks
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 todwmblocks
and$(ps -p $PPID -o comm=)
is equal tosh
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 withsh
?