UtkarshVerma / dwmblocks-async

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

command not executing properly within set interval #59

Closed yogeshdnumb closed 6 months ago

yogeshdnumb commented 7 months ago

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
UtkarshVerma commented 6 months ago

Might be related to #55 which has been solved. Anyhow, it works as expected for me.

#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 0

// 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("date +%S", 1, 10) \
    X("date +%S", 2, 10) \
    X("date +%S", 5, 10) \
    X("date +%S", 10, 10)

#endif  // CONFIG_H

This outputs the following:

$ ./build/dwmblocks -d
50 
50|50 
50|50|50 
50|50|50|50 
51|50|50|50 
52|50|50|50 
52|52|50|50 
53|52|50|50 
54|54|50|50 
55|54|55|50 
56|54|55|50 
56|56|55|50 
57|56|55|50 
57|58|55|50 
58|58|55|50 
59|58|55|50 
00|58|55|50 
00|58|55|00 
00|00|55|00 
00|00|00|00 

Please feel free to reopen if you still face the issue.