Coder Social home page Coder Social logo

Comments (8)

DusanLesan avatar DusanLesan commented on May 18, 2024 1

Is there a value that doesn't update at all?

Yes, 0 means it is not updated

Well, I didn't think about that. So do I make this smaller? What do you think is the smallest value for the date that is still logical, but updates unnecessarily? Perhaps it is possible to somehow TRAP the change of the date of the machine, and then just run it?

I honestly would not separate date and time if you are keeping them next to each-other. Even with 5 minutes interval, you could have inaccuracy up to 5 minutes (like for clock, if it updates at 55th second, it will not show correct time until next cycle)
Regarding the date detection by OS, I am sure it is possible, but I do not now how apart from crons

from dwmblocks-async.

UtkarshVerma avatar UtkarshVerma commented on May 18, 2024

This is impossible as dwm renders the status as nothing but a single string obtained from the root window's title. To implement this, non-trivial effort would be required to patch dwm.

From this project's side, all it does is form the status string and set it as the root window's title. If you think about it, dwmblocks-async is nothing but a glorified xsetroot which obtains the status string by executing blocks asynchronously.

from dwmblocks-async.

DusanLesan avatar DusanLesan commented on May 18, 2024

Weird idea I have never tried: add a lot of spaces after your date text. Enough so it pushes the date text all the way to the middle (I think you would need to increase MAX_BLOCK_OUTPUT_LENGTH)

from dwmblocks-async.

UtkarshVerma avatar UtkarshVerma commented on May 18, 2024

That would be quite hacky. I guess you could add a few blocks which just output a bunch of whitespace characters.

from dwmblocks-async.

DusanLesan avatar DusanLesan commented on May 18, 2024

It does sound like a hack. The several blocks would not look ok if you use delimiters

from dwmblocks-async.

og900aero avatar og900aero commented on May 18, 2024

Weird idea I have never tried: add a lot of spaces after your date text. Enough so it pushes the date text all the way to the middle (I think you would need to increase MAX_BLOCK_OUTPUT_LENGTH)

I've been using it this way for a while, but the X system crashes from time to time because of the blocks placed on the left edge. This does not happen with the block placed in the middle. I use lot of spaces.
Ugly looks...

#define BLOCKS(X)         \
    X("/home/Data/Linux/Compile/dwmblocks-async/netspeed.sh", 3, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/freemem.sh", 5, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/cpu.sh", 3, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/date.sh", 86400, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/time.sh", 60, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/brightness.sh", 0, 1)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/volume.sh", 0, 10)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/network.sh", 5, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/ip.sh", 5, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/battery.sh", 60, 0)

from dwmblocks-async.

DusanLesan avatar DusanLesan commented on May 18, 2024

Ok, that was just a idea. I have no clue about fixing the crash though

Few questions regarding this

I've been using it this way for a while, but the X system crashes from time to time because of the blocks placed on the left edge. This does not happen with the block placed in the middle. I use lot of spaces. Ugly looks...

    X("/home/Data/Linux/Compile/dwmblocks-async/date.sh", 86400, 0)  \
    X("/home/Data/Linux/Compile/dwmblocks-async/empty.sh", 630, 0)  \

If the block is empty, why do you need interval?

For the date block, does such a huge interval cause the date remaining the same after midnight? I mean if you start you computer at 6PM, and considering the block updates once a day, would it update at midnight?

from dwmblocks-async.

og900aero avatar og900aero commented on May 18, 2024

Ok, that was just a idea. I have no clue about fixing the crash though

Few questions regarding this

If the block is empty, why do you need interval?

Is there a value that doesn't update at all?

For the date block, does such a huge interval cause the date remaining the same after midnight? I mean if you start you computer at 6PM, and considering the block updates once a day, would it update at midnight?

Well, I didn't think about that. So do I make this smaller? What do you think is the smallest value for the date that is still logical, but updates unnecessarily? Perhaps it is possible to somehow TRAP the change of the date of the machine, and then just run it?

from dwmblocks-async.

Related Issues (20)

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.