You are not logged in.
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.
Last edited by Cloudef (2012-04-08 12:19:32)
Offline
while read -t 30 -r wmout || true; do
30 there is the amount of seconds to wait before updating the bar. change it to 1 and it should be good enough.
the loop runs if there is new data on the pipe or when the timeout expires.
(I don't know what will happen of you give 0 as a timeout )
.:[ git me! ] :.
Offline
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.
Offline
@Cloudef
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
Offline
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
Last edited by el mariachi (2012-04-08 20:20:17)
Offline
.. 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:
while sleep 1; do
echo "$(date +%R) | $(acpi | cut -d ' ' -f5 | cut -d ':' -f1-2) | $(amixer get Master | tail -1 | cut -d ' ' -f6 | tr -d '[]') $(amixer get Master | tail -1 | cut -d ' ' -f8 | tr -d '[]')" > /tmp/statusbar
done &
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: @c00kie
I 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!
Last edited by mhertz (2012-04-08 23:39:00)
Offline
@mhertz
I came up with this which seems to have the desktop changes show snapily and updates the text each second
numlockx &
xsetroot -cursor_name left_ptr &
fbsetbg -l &
#turn of the caps lock key !!
xmodmap -e 'keycode 66 ='
ds=("web" "dev" "foo" "bar")
ms=("T" "M" "B" "G" "F")
PID=""
function writer {
while true; do
xsetroot -name "&L$1 &5[&3$i&5] &R$(date +'%I:%M:%S')"
sleep 1
done
}
~/progs/c.files/some_sorta_bar/some_sorta_bar &
monsterwm | while read -r wmout; do
kill -n 15 $PID 2> /dev/null
if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
#printf "\nWOOT \t $wmout\n"
read -ra desktops <<< "$wmout" && unset r
for desktop in "${desktops[@]}"; do
IFS=':' read -r d w m c u <<< "$desktop"
((c)) && fg="&4" i="${ms[$m]}" || fg="&3"
((u)) && w+='&5!'
if [[ $w > 0 ]]; then
r+="$fg${ds[$d]} ${w/#0/&8¡} "
else
r+="$fg${ds[$d]} "
fi
done
fi
writer "$r" &
PID=$!
done
Last edited by moetunes (2012-04-09 07:25:30)
You're just jealous because the voices only talk to me.
Offline
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.
Offline
alright, pushed, back to using pixel size values. should be equal now
Yes, it is working like a charm now. Thank you.
Offline
@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)
Thank you anyways for the effort!
Last edited by mhertz (2012-04-09 13:16:16)
Offline
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.
.:[ git me! ] :.
Offline
@cloudef: it's working today :s I must've done something wrong. anyway.. thank you
Offline
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...
Last edited by mhertz (2012-04-09 15:55:28)
Offline
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.
...
#define Button6 6
#define Button7 7
#define Button8 8
#define Button9 9
static Button buttons[] = {
{ MOD1, Button1, mousemotion, {.i = MOVE}},
{ MOD1, Button3, mousemotion, {.i = RESIZE}},
{ MOD4, Button6, spawn, {.com = menucmd}},
// etc
};
.:[ git me! ] :.
Offline
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...
I changed it again, to what I use. hope it's not much complicated
.:[ git me! ] :.
Offline
Thanks alot, mate!
Btw, i've tested your mparser, and I get my desktops shown multiple times over and over, and no external commands is seen, probably because it's out of the screen-range or something...
I've just changed my desktop names, and removed the statusbar external command...
.. Just reporting, as I know you said that you won't be working more on this and it's up to our selves...
Btw, in your gist for mparser, then underneath in the comment section where you write how to enable it through .xinitrc, then you've made a typo:
mparser monsterwm.fifo ...
Instead of:
mparser /tmp/monsterwm.fifo
Again, thanks for your help!
Offline
@cookie
The some_sorta_bar bash script on your gist, when I run it unmodified, fails with a syntax error; the last done is unexpected?
Anyway, I don't want to be a pain about this, so i'll just use moetunes script he posted here previously...
Thanks for your help again!
CU, Martin.
Offline
Thanks cookie, now the some_sorta_bar bash script work perfectly with monsterwm! Also, I like the dash for empty desktops and the exclamation point for urgent desks; nice
(Of course there's still the issue of the delay when adding time-consuming commands like acpi, but nonetheless...)
Thanks for your patience and efforts; it's much appreciated!
CU, Martin.
Last edited by mhertz (2012-04-09 20:43:18)
Offline
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.
Thanks, I'll definitely give it a try when there's more time.
Offline
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
Offline
Hi,
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?
Also, I like the centredfloating patch on dwm(centers on the screen the determined floating windows). Could you provide a similar function to monsterwm?
Thanks!
Offline
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
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)
Also, I like the centredfloating patch on dwm(centers on the screen the determined floating windows). Could you provide a similar function to monsterwm?
I can try that when I'll get some free time
.:[ git me! ] :.
Offline
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)...
Last edited by mhertz (2012-04-11 16:57:21)
Offline
Thank you very much c00kie. You're awesome!
Offline