Re: monsterwm! ~ yet another tiny wm

mhertz wrote:

I couldn't previously understand why the tag/state part of some_sorta_bar wasen't instantaneously updating and had a 2 sec delay, whereas dzen was instantaneously updating, and I had configured some_sorta_bar to update whenever the fifo changed, and not with a reguar timeout...

Now I then found out that it was obviously because that with dzen, I had two dzen instances, one for left and one for right, and in the right statusbar I had e.g. acpi running to display battery state, and which took about 2 secs, but it didn't interfere with the left bar which showed tag/state info, but on my some_sorta_bar setup, I had the acpi part in the main loop(in the $datetime var) which also showed tag/state info...

I just used the example for some_sorta_bar from c00kie's gist-page, and then just added extra commands to the $datetime var, like e.g. the acpi command...

So, I was thinking if someone could kindly help me out about how I could make some_sorta_bar show tag/state info instantaneous, and still having e.g. the acpi command etc. on the right?

Sorry for nobish question in advance, but im not very advanced in scripting, and i've allready tried a lot of ways which didn't work right...

Thanks!

You would need some timeout interrupting code, so block until x seconds timeout or interrupt if fifo has data. You can do this with select and C.But IMO, I would seperate the tag and status bar to two seperate panels, (with dzen for example), makes much simpler code. (Even though I have in my status bar code interrupts for alsa volume changing too so it's instant)

Also, updated -xcb fork, din't had much time to test it. But hopefully everything is okay.

Re: monsterwm! ~ yet another tiny wm

Strange request: Would it be possible to add more mouse buttons? A lot of these niche window managers seem to only support 5 (X header related?) whereas most mice these days seem to cover at least 9 (1, 2, 3, horizontal (2) and vertical (2) scroll and back/forward.

In my case, xev reports up to 17 buttons. I'm not entirely sure how difficult it would be to implement; WMs such as Subtle and Openbox seem to manage this somehow.

Thanks for your time and effort towards this rather nice Window Manager.

Re: monsterwm! ~ yet another tiny wm

Thanks alot for your help! To be honest I don't think I will be able to do that(skillwise), but I will think about a way and if I fail i'll just change to using two dzen bars...

@c00kie

Thank you! Yeah, I understand what you're saying, but my problem isn't related to that and sorry for not being able to describe the issue better!

Monsterwm outputs e.g. tag switching info to the fifo instantaneously and so the timeout isn't actually needed for this scenario, but when then having an acpi command also in that while loop, then there will be a delay because of that...

To describe it better, then if you take the example for some_sorta_bar that you have on your gist-page, then it works perfectly, since the datetime just has a quick date command in it, but if you then e.g. change the date command into an acpi command, then suddently the bar will have a 2 sec waiting period whenever changing tags and such, because acpi is a command that takes more time/processing than the date command and as the datetime var is run through the while loop each time we're changing tags....

Anyway, you don't have to bother with it, and I will try to find a way myself, but I just wanted to explain what I where reffering to

Re: monsterwm! ~ yet another tiny wm

.. Just if anyone else should have the same issue as I described in my previous post, then i've found a solution, but it's not very pretty as it uses a tempfile in /tmp, but atleast it works! Also, if anyone know a better cleaner way then I would much appreciate it...

OK, instead of having all the commands in the $datetime var, then add them in a while loop placed before the main statusbar while-loop, and make it echo the output once every second to /tmp/statusbar:

And then in the xsetroot command, remove the $(datetime) and instead add $(cat /tmp/statusbar), and finally change the timeout in the main statusbar while loop from 30 to 1:

while read -t 1 -r wmout || true; do

.This then means that the long-taking acpi command isn't run anymore upon each tag-change so that it's not delayed anymore, and instead just a quick 'cat /tmp/statusbar' is done, and the actual acpi while loop has been seperated out of the main loop, so that it dosen't delay tag-changing anymore...

Edit: Hmm, the above solution isn't just ugly, but as it needs to write to disc every second(about every 3'rd sec, since acpi takes about 2 secs + 1 secs sleep), then it's not worth it, and i'd rather then use some more mem and use two dzen's...

I've tried different things, but e.g. as a backgrounded while loop makes a new subshell, then I cannot just output to a var, since that var won't be available outside of that subshell and so the main statusbar while loop cannot read it and hence, the lame tmp file idea...

Edit2: Tried to make the above use a fifo, but that just made the delay come back! Hmm, i'm not good enough yet at these sorta things I must confess...

edit3: @c00kieI just now noticed that in your example for some_sorta_bar on gist, then also the "::" signs are highlighted in the choosen color, and when selecting last desktop, then also the tiling-mode symbol is highlighted. I mean that the code takes a little extra to the right, when highlighting choosen desktop...

If you could look into that highlighting when you have the time/motivation, then it would be much appreciated!

Re: monsterwm! ~ yet another tiny wm

el mariachi wrote:

thank you cloudef! everything is perfect!edit: humm if a window gets the urgent hint, the "tag" will be correctly colored to the URGENT color, but after I go to that tag and select the urgent window the color won't change back to DEFAULT

That's weird, it should reset the urgent hint whenever new desktop info comes with the urgent bit as 0.

Re: monsterwm! ~ yet another tiny wm

@moetunes

Thanks alot for your help, mate! Unfortunetly, it still dosen't work right...

With your code, then everything is dandy, but try adding an extra command to xsetroot: $(acpi), and now changing tags isn't instantanieous anymore, since upon each tag change, then 'acpi' is run, which takes ~ 2 secs on my i3-2.4ghz, and hence, tag changing is delayed 2 secs, just like all things i've tried till now, except using a tmp file in /tmp, like in my previous post! (since cat'ing a file through xsetroot is much quicker than running acpi, and the acpi while loop i seperated out from the main while loop)

Re: monsterwm! ~ yet another tiny wm

mhertz, fixed the highlight issue, define the color you want the separator to have where you define the desktops. I used the dzen2 script as a base, but dzen2 has ^fg() which signifies the reset of the foreground color.

I wrote a very simple parser for mosnterwm's output in c here looking at cloudef's source. One can specify commands to run, whose output will be picked up and appended to the formatted output. That output can be given to other things like some_sorta_bar or dzen2 to draw the panel. The way it is, output is supposed to go to some_sorta_bar. Also commands are run only when there is output from monsterwm. So it needs work, but it small and simple. Don't expect much at this point. If anyone wants, grab it and build on it.

Re: monsterwm! ~ yet another tiny wm

Re: monsterwm! ~ yet another tiny wm

Thanks alot c00kie, that's freakin' awesome!

.. Going to play with it now!

Thanks alot again!

Edit:

@c00kie

I've just tried the revised some_sorta_bar script(bash), and you've fixed the issue about the seperators, except for when selecting the last tag, which will make the rest of the statusbar change color also...

Re: monsterwm! ~ yet another tiny wm

Kaustic wrote:

Strange request: Would it be possible to add more mouse buttons? A lot of these niche window managers seem to only support 5 (X header related?) whereas most mice these days seem to cover at least 9 (1, 2, 3, horizontal (2) and vertical (2) scroll and back/forward.

In my case, xev reports up to 17 buttons. I'm not entirely sure how difficult it would be to implement; WMs such as Subtle and Openbox seem to manage this somehow.

Thanks for your time and effort towards this rather nice Window Manager.

hmm, I can't seem to find the header that defines those. Xlib defines up to Button5. You can define more yourself, in config.h, and hope they don't clutter with others.

Re: monsterwm! ~ yet another tiny wm

mhertz wrote:

I've just tried the revised some_sorta_bar script(bash), and you've fixed the issue about the seperators, except for when selecting the last tag, which will make the rest of the statusbar change color also...

Re: monsterwm! ~ yet another tiny wm

le-hrm, im having some issues with ida pro running on wine. Monsterwm segfaults every now and then, i suspect because of the floating dialog windows. I'm ready to help troubleshooting this, you can find me in #archlinux as TheLemonMan so just ping me

Re: monsterwm! ~ yet another tiny wm

TheLemonMan wrote:

le-hrm, im having some issues with ida pro running on wine. Monsterwm segfaults every now and then, i suspect because of the floating dialog windows. I'm ready to help troubleshooting this, you can find me in #archlinux as TheLemonMan so just ping me

I'll look into it, I have an idea where things might be going wrong

whooper wrote:

I'm using your startwm2some_sorta_bar script and I'm wondering if it's possible to display something when there's a window in a desktop instead of the number of windows? Maybe a asterisk?

yep, "$w" is the number of windows so replace that with w/e you want

replace

r+="$fg${ds[$d]} ${w/#0/&8-} &3:: "

with

if ((w)); then w="*"; else w=""; fi
r+="$fg${ds[$d]} $w &3:: "

so you'll get a * when there are windows, or nothing ("") when there is none (w==0)

whooper wrote:

Also, I like the centredfloating patch on dwm(centers on the screen the determined floating windows). Could you provide a similar function to monsterwm?

Re: monsterwm! ~ yet another tiny wm

If not too hard, or if you have time sometime, and of course if you thinks it ok, then how about the ability of moving floating windows around, or resizing them, through the keyboard, like that moveresize patch for dwm, or whatever it was called...

I use floats very rarelly, so not really important to me, but just thinking out loud alittle here about what could make this awesome wm even nicer than it allready is... (not having to use the mouse for _anything_ would be pretty cool imho)...