You are not logged in.

#426 2012-03-13 16:22:14

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: monsterwm! ~ yet another tiny wm

Ok, that worked smile I THOught I had gone through that particular iteration yesterday, but I guess not. Well, anyway....using dmplex for this is apparently a bad idea unless I'm missing something. The status info gets combined fine at first (well, formatting is also an issue) but as soon as you start opening windows and switching workspaces, the status bar goes completely fubar (info moves around, prints on top of one another, freezes for short times). I tried using the dzen ^p and ^pa commands to fix the positions, but that didn't seem to work.

No big deal...it just seemed cleaner and more efficient at first than having 2 separate bars! But the 2 bars work great...no issues! I've moved to monsterwm now from dwm and have a totally usable system. Only minor glitches now to figure out.

Thanks for the help!
Scott

Offline

#427 2012-03-13 16:45:10

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

wink
dmplex would be nice if dzen allowed to align text with some special sequence like ^al() , ^ar() for "align right/left", but unfortunatelly that's only possible with a switch (dzen2 -ta [lr]).


.:[ git me! ] :.

Offline

#428 2012-03-13 19:28:00

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: monsterwm! ~ yet another tiny wm

I've added alignment options to some_sorta_bar with monsterwm's type of output in mind.

&L some left text &C some center text &R text on the right

edit:
    I forgot to mention that the numbers for the colours now go from 2 - 9, it was 0 - 7.
Here's a pic:
tY3o3dA

Last edited by moetunes (2012-03-13 20:32:45)


You're just jealous because the voices only talk to me.

Offline

#429 2012-03-13 19:31:34

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

that's great smile I'll try it immediately


.:[ git me! ] :.

Offline

#430 2012-03-13 20:03:04

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Great work moetunes, once again wink


Just pushed a fix that would cause monsterwm to freeze or crash when only one client was present and one tried to go to the previous (non-existing) window.

Also XKeycodeToKeysym is now deprecated, and replaced by XkbKeycodeToKeysym.
Fixed this, so no warnings will be seen when compiling.

Last edited by c00kiemon5ter (2012-03-13 20:03:22)


.:[ git me! ] :.

Offline

#431 2012-03-13 20:36:41

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: monsterwm! ~ yet another tiny wm

What's the impact of that for us mere mortals?

Offline

#432 2012-03-13 21:47:37

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

I've been playing with some_sorta_bar and monsterwm. I got the output to work (I think) but I can't seem to figure out how to run conky through the same bar. Here's my startup script:

#!/bin/bash

: "${wm:=monsterwm}"
: "${ff:="/tmp/${wm}.fifo"}"

some_sorta_bar &

[[ -p $ff ]] || mkfifo -m 600 "$ff"
while read -r; do
    [[ $REPLY =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]] && read -ra desktops <<< "$REPLY" || continue
for desktop in "${desktops[@]}"; do
IFS=':' read -r d w m c u <<< "$desktop"
        case $d in
            0) d="web" s="" ;;
            1) d="term" s=":" ;;
            2) d="foo" s=":" ;;
            3) d="misc" s=":" ;;
        esac
        ((c)) && f="&3" && case $m in
            0) i="[T]" ;;
            1) i="[M]" ;;
            2) i="[b]" ;;
            3) i="[G]" ;;
        esac || f="&2"
        ((u)) && f="&9"
        ((w)) && r+="&2$s $f$d $w " || r+="&2$s $f$d "
    done
printf "&L%s%s\n" "$r" "&2$i" && unset r
done < "$ff" | while read -r; do xsetroot -name "$REPLY"; done &

while :; do "$wm" || break; done | tee -a "$ff"

If you see anything else wrong let me know too, thanks.

Offline

#433 2012-03-13 21:50:55

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Nothing much really. It seems XKeycodeToKeysym had been deprecated long time now, but only as a man page notice, that's why no warnings were triggered. It doesn't work well with newer systems and keyboard layouts.
See related bugs [1] [2]


.:[ git me! ] :.

Offline

#434 2012-03-13 21:51:55

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

stlarch, I'm trying the same thing, setting xsetroot name from two different sources.
It doesn't seem to work, but I may build something around it. .. mm ..


.:[ git me! ] :.

Offline

#435 2012-03-13 23:53:24

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

there goes dzen2 x)

some_sorta_bar &

monsterwm | while read -t 30 -r wmout; do 
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout" && unset r
        ...
    fi
    datetime="$(date +"%D %R")"
    xsetroot -name "&L $r $i $R $datetime"
done

note that the the previous [[ $REPLY =~ ..pattern.. ]] is now a true 'if' statement
also the 'unset r' has been moved, to only unset r, when new data come in.
datetime, can ofcourse be anything you want. It's just an example there, of how to get stuff in the other end too.
You can even have more stuff in the center with &C

Last edited by c00kiemon5ter (2012-03-14 01:55:47)


.:[ git me! ] :.

Offline

#436 2012-03-14 01:48:28

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: monsterwm! ~ yet another tiny wm

@stlarch
    Have monsterwm write to your temp file and use conky's tail function to display it.


You're just jealous because the voices only talk to me.

Offline

#437 2012-03-14 02:02:02

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

@moetunes some_sorta_bar seems great so far smile
the only thing that doesn't seem to work correctly is the font
I have

static const char *fontbarname = "-misc-terminusmod.icons-medium-r-normal--12-120-72-72-c-60-*-*";

I know this is correct, but I've tried with stars(*) in the fields etc, but the font seems to be wrong
actually it seems I'm getting a small electricity socket icon next to the expected icon.

I have no idea what it is :S


.:[ git me! ] :.

Offline

#438 2012-03-14 04:12:22

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: monsterwm! ~ yet another tiny wm

@ c00kiemon5ter
    What it is is the next icon in terminusmod.icons after the expected one showing up. It seems the icons aren't the same width as the rest of the text so anomalies pop up. I spent ages with the icons in my conky trying to get the widths right, I'd adjust it for one scenario and it would be wrong for the next. So I've set it up to be right with standard text and have found that a space at the front of the text will fix it up when the icon widths play up with the spacing. Sound feasible?
I am guessing that you have at least a couple of icons showing before the one that gets the extra, if not it's something new and I'd like to know where it happens in the text and how many icons there are before it so I can check things out.
I've been trying to come up with a way to handle different width fonts but haven't found anything suitable yet.


You're just jealous because the voices only talk to me.

Offline

#439 2012-03-14 12:56:00

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

here's a shot (wtf, weird thumb?!)
tZDFhNA

an idea is to look at dmenu's code, as it does handle different fonts. Maybe that'd help.
I actually, don't really mind, so look into it only when you have time. Don't get into trouble for me.

Another thing I noticed, is that if I hover window above the bar, the contents are erased, like the window is a rubber/erase tool in paint apps tongue If I switch to a tty/console and back then the bar is empty. Ofcourse when xsetroot is called again, the contents come back.

I'll try getting some spaces there wink thanks
I really like that you can arrange text that way,
I had looked to find something like that, but failed.
some_sorta_bar is some sorta bar for sure x)

edit: tried adding space(s) before and after the text, but it doesn't fix it

Last edited by c00kiemon5ter (2012-03-14 13:03:41)


.:[ git me! ] :.

Offline

#440 2012-03-14 13:33:49

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: monsterwm! ~ yet another tiny wm

You have two icons showing everywhere in that shot, that's not good. I get nothing like that so I'm guessing you have a different method for getting the icons into the text. I'm using conky and doing ${execi 1800 printf '\xCE'}, what are you using to have the icons show? printf "%b" ?
I'll have to set up watching for expose events so the text will be drawn when it gets uncovered.

Last edited by moetunes (2012-03-14 13:45:49)


You're just jealous because the voices only talk to me.

Offline

#441 2012-03-14 15:30:21

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

I'll look into it moetunes, once I have more free time.
fyi, I use a bash script that gathers data, and does a printf "%s\n" ..

For the moment I pushed the fix for _NET_ACTIVE_WINDOW so now xdotool and other such tools that use that property to focus/select new windows, should now work correctly wink

I think the next thing I'll push is nmaster tongue but later this week cause I have to make a living x)

Last edited by c00kiemon5ter (2012-03-14 15:31:06)


.:[ git me! ] :.

Offline

#442 2012-03-14 19:31:35

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: monsterwm! ~ yet another tiny wm

I don't know what other people think, but I love the uselessgaps patch. However, when I have 1 window, I prefer to not have the gaps...just the fullscreen window. So I undid the uselessgap changes in the monocle function and it now works the way I prefer. Here's the patch (well, it really just goes back to the way it is in the master branch, so I accomplished nothing dramatic smile ).

Scott

diff --git a/monsterwm.c b/monsterwm.c
index e301d09..1dad295 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -539,8 +539,7 @@ void mousemotion(const Arg *arg) {
 
 /* each window should cover all the available screen space */
 void monocle(int hh, int cy) {
-    for (client *c=head; c; c=c->next) if (!ISFFT(c))
-        XMoveResizeWindow(dis, c->win, USELESSGAP, cy + USELESSGAP, ww - 2*USELESSGAP, hh - 2*USELESSGAP);
+           for (client *c=head; c; c=c->next) if (!ISFFT(c)) XMoveResizeWindow(dis, c->win, 0, cy, ww, hh);
 }
 
 /* move the current client, to current->next

Offline

#443 2012-03-14 21:49:44

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: monsterwm! ~ yet another tiny wm

@c00kiemon5ter
    You have a new line in a one line output? The fonts work fine in some_sorta_bar but I think you have to call them differently then you're used to. Here's an example that has them drawn fine.

starter="exec ck-launch-session dbus-launch --sh-syntax --exit-with-session "

numlockx &
xsetroot -cursor_name left_ptr &
fbsetbg -l &
#turn of the caps lock key !!
xmodmap -e 'keycode 66 ='
#dbus-launch thunar --daemon &

#conky -c ~/build/status_conky | while read -r; do xsetroot -name "$REPLY"; done &
# $starter ~/build/snapwm-0.4.1/snapwm

~/progs/c.files/some_sorta_bar/some_sorta_bar &
# conky -c ~/build/status_conky.ssb | while read -r; do xsetroot -name "$REPLY"; done &

while true; do
   mem=`free -m | grep \+ | awk '{print \$3 }'`
   temp=`/home/pnewm/.bin/sensors_out`
   fuzzytime=`/home/pnewm/progs/c.files/fuzzyctime`
   xsetroot -name "$( printf "&L&4\xCE memory &2$mem mB &C&4\xB1&3temp $temp &R&4\xB9 $fuzzytime \xEA" )"
   sleep 2
done &
 $starter ~/build/dminiwm-0.3.5/src/dminiwm

# $starter startfluxbox

The first icon is drawn in the printf with \xCE , that's all it needs. HTH.


You're just jealous because the voices only talk to me.

Offline

#444 2012-03-15 03:33:14

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

Sorry to disappear. I had a little emergency right after I posted (dog bite to the hand!). Doooh. It hurts like nobody's business. He tried to take it with him. ( He must have thought it was a cookie!) It messed me up pretty bad. I'm starting to come around now. I kinda forgot what I was doing, but I'll give it another try. Thanks for the help guys.

Last edited by stlarch (2012-03-15 16:42:11)

Offline

#445 2012-03-15 14:51:23

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: monsterwm! ~ yet another tiny wm

Thanks alot moetunes for the new direction feature of your bar, much appreciated!

However, I have some problems with it so that I unfortunetly have to stick with dzen2 still...

I've used the example posted by c00kiemon5ter here: https://gist.github.com/1905427#file_st … _sorta_bar, and i've just changed the desktops from 3 to 4 i.e. just added an extra one, and then also added some more bash commands to the $datetime var, i.e. for listing battery and vol and that's it.

Then when starting the wm, I get first the bar shown correctly with the 4 desktops, but then after about 2 secs, I get the same desktops listed again, and the same after 2 secs again?

Also, when I change to other desktops, then it's fine when going  from 1 to 2 and then to 3, but when going to 4, then the bar disappears and never comes back again?

Thanks in advance!

Btw, the $datetime var shows correcty to the right...

Ohh, here's the shot of course:

25iodwz.jpg

Also @c00kiemon5ter: In your gist example, then the $datetime var isn't updated right? I mean it's not a "finished" example, and needs to be changed so as the date and time actually progresses, right? Or is this also only an issue on my end here ?

Thanks in advance!

Last edited by mhertz (2012-03-15 14:55:48)

Offline

#446 2012-03-15 14:56:54

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

mhertz wrote:

when starting the wm, I get first the bar shown correctly with the 4 desktops, but then after about 2 secs, I get the same desktops listed again, and the same after 2 secs again?

Sorry, the multiple output of desktops is my fault
fixed in the gist, check it, I forgot to unset r

read -ra desktops <<< "$wmout" && unset r
mhertz wrote:

Also, when I change to other desktops, then it's fine when going  from 1 to 2 and then to 3, but when going to 4, then the bar disappears and never comes back again?

dont know about that, it could be crashing because of too many copies to display? don't know, check if the fixed gist script fixed that.

mhertz wrote:

Also @c00kiemon5ter: In your gist example, then the $datetime var isn't updated right? I mean it's not a "finished" example, and needs to be changed so as the date and time actually progresses, right? Or is this also only an issue on my end here ?

on the while loop, there is a timeout, -t xxx

monsterwm | while read -t 30 -r wmout; do

set 30 to wheter value of seconds you want, the "datetime" command to update

the script updates either when the timeout is over
or when mosterwm outputs some text

Last edited by c00kiemon5ter (2012-03-15 15:05:21)


.:[ git me! ] :.

Offline

#447 2012-03-15 15:01:44

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

I'm getting some of the same issues described by mhertz. I'm struggling a little here trying to cobble something together. I really need to get with the program and learn some scripting. I've been procrastinating.

Offline

#448 2012-03-15 15:05:51

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

edited the post above, please check that, and tell me wink

edit: oh, also another issue, the while loop should be

monsterwm | while read -t 30 -r wmout || true; do

otherwise it will break when the timeout is over, that could cause the crashing of the bar.

fixed in gist

Last edited by c00kiemon5ter (2012-03-15 15:08:28)


.:[ git me! ] :.

Offline

#449 2012-03-15 16:18:07

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

The new one in gist seems to be working for me now. I think I had part of it right before but I couldn't put it together. I modified it a little. Does it look ok?

#!/bin/bash

: "${wm:=monsterwm}"
: "${ff:="$HOME/tmp/${wm}.fifo"}"

some_sorta_bar &

[[ -p $ff ]] || mkfifo -m 600 "$ff"
while read -t 30 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout" && unset r
        for desktop in "${desktops[@]}"; do
            IFS=':' read -r d w m c u <<< "$desktop"
            case $d in
                0) d="web" s="" ;;
                1) d="term" s=":" ;;
                2) d="foo" s=":" ;;
                3) d="misc" s=":" ;;
            esac
            ((c)) && f="&3" && case $m in
                0) i="T" ;;
                1) i="M" ;;
                2) i="B" ;;
                3) i="G" ;;
            esac || f="&2"
            ((u)) && f="&9"
            ((w)) && r+="&2$s $f$d $w " || r+="&2$s $f$d "
        done
    fi
    datetime="$(date +"%D %R")"
    xsetroot -name "&L$r &2[&3$i&2] &R$datetime"
done < "$ff" &

$wm | tee -a "$ff"

Offline

#450 2012-03-15 16:21:42

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

seems good to me. I think not having the pipe, would get mosterwm hanging on quit.
So I think I'll change it to that, in the gist.

Also I use tee to get the output to stdout on console too.
If you don't want that, then just redirect the output

monsterwm > "$ff"

Last edited by c00kiemon5ter (2012-03-15 16:25:53)


.:[ git me! ] :.

Offline

Board footer

Powered by FluxBB