UtkarshVerma / dwmblocks-async

An efficient, lean, and asynchronous status feed generator for dwm.
GNU General Public License v2.0
232 stars 87 forks source link

dwmblocks does not start in Ubuntu 23.10 #56

Closed IamGianluca closed 9 months ago

IamGianluca commented 9 months ago

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:

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?

IamGianluca commented 9 months ago

I've tried to use a different command (date) instead of the user-defined one I created. After doing that, dwmblocks autostart properly. I guess the issue is with adding the directory where those binary executables are located to the PATH before dwmblocks & is called. I was doing that by running export PATH=$PATH:~/.local/bin/statusbar in my .zshrc and even in autostart.sh, but that does not seem to work.

IamGianluca commented 9 months ago

I resolved the issue by moving the custom executable binaries from ~/.local/bin/statusbar/ to /usr/local/bin/.

UtkarshVerma commented 9 months ago

You're setting the PATH incorrectly. Use $HOME instead of tilde. Also, step one of debugging such issues is logging stderr to a file in your erroneous script.

dwmblocks 2>/tmp/dwmblocks.log &
IamGianluca commented 9 months ago

Thank you for the reply @UtkarshVerma ― that was super helpful in speeding up the debugging!

I've improved my solution by using the following command in autostart.sh:

export PATH=$PATH:$HOME/.local/bin/statusbar/ && dwmblocks &