You are not logged in.

#726 2012-07-12 09:27:04

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

Re: monsterwm! ~ yet another tiny wm

nice shot LemonMan big_smile
tongue The second link should be this

Last edited by c00kiemon5ter (2012-07-12 09:27:56)


.:[ git me! ] :.

Offline

#727 2012-07-12 09:29:41

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

nice shot LemonMan big_smile
tongue The second link should be this

Meh, did I already say that I hate X clipboard ? smile

Offline

#728 2012-07-12 10:16:46

kuraku
Member
From: planet Earth
Registered: 2012-01-03
Posts: 199

Re: monsterwm! ~ yet another tiny wm

TheLemonMan wrote:

Last night i hacked up your wmrun a bit to produce a dwm-ish statusbar (like this) (and ungolfed it a little, now it's easier to modify for the average user that doesn't grasp the boolean logic). Here it is.
Keep up the good work!

Could you, please, share your Xresources colors?

Offline

#729 2012-07-12 10:35:58

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: monsterwm! ~ yet another tiny wm

kuraku wrote:
TheLemonMan wrote:

Last night i hacked up your wmrun a bit to produce a dwm-ish statusbar (like this) (and ungolfed it a little, now it's easier to modify for the average user that doesn't grasp the boolean logic). Here it is.
Keep up the good work!

Could you, please, share your Xresources colors?

Sure, here they are.

Offline

#730 2012-07-13 01:03:13

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

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:
Šaran wrote:

When I click on cancel in geany's 'do you want to save' dialog or try to rename file in spacefm, monster
segfaults

I will look into it asap, thanks for the report wink there's a null dereference somewhere probably

this should be good now.

the focus behavior slightly changed:
if a window is closed the previously focused window is focused.
if that window is closed (there is no previously focused client now), the previous window is focused; whereas the last window used be focused.

-----------------
|      |    2   |
|  1   |--------|
|      |    3   |
|      |--------|
|      |    4   |
-----------------

current is 3, previously focused is 2.
we close 3 and 2 is focused.

-----------------
|      |    2   |
|  1   |--------|
|      |    4   |
-----------------

current is 2, previously focused is none.
we close 2, and 1 is focused.
it used to be that 4 was focused.

(yes, I have a notebook full of such sketches and code snippets)

Last edited by c00kiemon5ter (2012-07-13 01:13:56)


.:[ git me! ] :.

Offline

#731 2012-07-13 10:40:46

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: monsterwm! ~ yet another tiny wm

It works now, thanks.

Offline

#732 2012-07-13 13:10:03

kuraku
Member
From: planet Earth
Registered: 2012-01-03
Posts: 199

Re: monsterwm! ~ yet another tiny wm

@c00kiemon5ter
Yes, the new focus behaviour works good.

@TheLemonMan
Thank you smile

Offline

#733 2012-07-13 17:18:50

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: monsterwm! ~ yet another tiny wm

Patch for proper detection of window name change (this time should be golfed enough) big_smile Now i just need an adjustment to the script above to show the window names too (*wink*, i'm no bash master smile).

Offline

#734 2012-07-13 17:27:29

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

Re: monsterwm! ~ yet another tiny wm

that's what I do on windowtitles branch, but only once when the window is created, having that code on propertynotify would update the title (some apps change it, like terminals and browsers). I'll probably push that too.

I can help you with bash smile just give me a moment


.:[ git me! ] :.

Offline

#735 2012-07-13 17:32:55

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

that's what I do on windowtitles branch, but only once when the window is created, having that code on propertynotify would update the title (some apps change it, like terminals and browsers). I'll probably push that too.

Seeing tons of windows marked 'urxvt' doesn't help much heh.
The sloc can be reduced by creating a separate function that does the dirty job.

c00kiemon5ter wrote:

I can help you with bash smile just give me a moment

Many thanks smile

Offline

#736 2012-07-13 17:47:01

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

Re: monsterwm! ~ yet another tiny wm

dirty one, can be improved, t is the title

while read -t 60 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+ ]]; then
        read -ra desktops <<< "$wmout" && unset r t
        for desktop in "${desktops[@]}"; do
            if [[ $desktop =~ ^([[:digit:]]+:)+[[:digit:]]+ ]]; then
                IFS=':' read -r d w m c u <<< "$desktop"
                ((c)) && fg="&4" i="${ls[$m]}" || fg="&3"
                ((u)) && w+='&5!'
                r+="$fg${ds[$d]} $w &3:: "
            else
                t+="$desktop "
            fi  
        done
        r="${r%::*}"
    fi  
    printf "&L%s &C%s &R%s\n" "$r&5[&3$i&5]" "$t" "$(date +"%F %R")"
done < "$ff" | some_sorta_bar &

this is more efficient, and also using your complete script:

#!/usr/bin/env bash

: "${wm:=/home/giuseppe/Projects/monsterwm/monsterwm}"
: "${ff:="/tmp/$RANDOM.monsterwm.fifo"}"

tags=('1' '2' '3' '4')
#tags=(
    #"^i($HOME/.icons/terminal.xbm)"
    #"^i($HOME/.icons/world.xbm)"
    #"^i($HOME/.icons/balloon.xbm)"
    #"^i($HOME/.icons/mail.xbm)" 
    #)
layouts=('[]=' '[ ]' 'TTT' '[#]') 

conky | dzen2 -h 18 -x 320 -ta r -e -p -fn &

# Check if it's a pipe, otherwise create it
[[ -p $ff ]] || mkfifo -m 600 "$ff"

while read -r; do
    # extract title from read line
    title="$(sed -r 's;(([[:digit:]]:)+[[:digit:]]+ )+(.*);\3;' <<< "$REPLY")"
    REPLY="${REPLY%$title}"

    [[ $REPLY =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]] && read -ra desktops <<< "$REPLY" || continue
    for desktop in "${desktops[@]}"; do
        IFS=':' read -r d w m c u <<< "$desktop"
        
        # Tags labels
        label=${tags[$d]}

        # Current desktop color (yes/no)
        ((c)) && fg="#fefefe" bg="#204a87" && layout=${layouts[$m]} || fg="#b3b3b3" bg=""

        # Has windows ?
        ((w)) && ((! c)) && fg="#fce94f"

        # Urgent windows ?
        ((u)) && fg="#f92671"

        tmp+="^fg($fg)^bg($bg) $label ^bg()^fg()"
    done
    # Merge the clients indications and the tile mode
    printf "%s %s %s\n" "$tmp" "$layout" "$title" && unset tmp
done < "$ff" | dzen2 -w 320 -h 18 -ta l -e -p &

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

added it to the gist

Last edited by c00kiemon5ter (2012-07-13 18:06:53)


.:[ git me! ] :.

Offline

#737 2012-07-13 18:27:22

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

Re: monsterwm! ~ yet another tiny wm

I also updated the windowtitles branch. Seems to be working good.


.:[ git me! ] :.

Offline

#738 2012-07-13 21:08:26

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

Re: monsterwm! ~ yet another tiny wm

mil reported a bug on github.
resizing the master area would not chech for MINWSZ (minimum windows size).
it is fixed now.


.:[ git me! ] :.

Offline

#739 2012-07-14 00:39:32

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: monsterwm! ~ yet another tiny wm

Here's a patch for an output that is easier to parse, and here is my updated script, simpler and hopefully faster smile

Last edited by TheLemonMan (2012-07-14 12:18:18)

Offline

#740 2012-07-14 14:49:22

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

Re: monsterwm! ~ yet another tiny wm

Please excuse me for talking about this issue of mine again, which I raised some months ago, as it's sorta off-topic, but I would just love to get this sorted out..

When using some_sorta_bar with cookie's init-script, and then adding an acpi command to the rightside output, then when e.g. changing desktops, then the leftside-output(with desktop info) is delayed for 2 secs, since the acpi command is very slow. If using e.g. date and whatever else, but just not acpi, then you dont notice it...

I've now found a semi-working solution, by doing this: (Bold parts my additions, sorry for not using codebloks, but I couldn't highlight my changes with that...)

ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"
while true; 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 '[]')" >> "$ff"
sleep 10
done &

# desktop names
ds=("term" "web" "foo" "bar")

# layout names
ms=("T" "M" "B" "G" "F")

while read -t 60 -r wmout || true; do
    [[ $wmout =~ on$ ]] && status=$wmout
    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"
            ((c)) && fg="&4" i="${ms[$m]}" || fg="&3"
            ((u)) && w+='&5!'
            r+="$fg${ds[$d]} ${w/#0/&8-} &3:: "
        done
        r="${r%::*}"
    fi
    printf "&L%s&R%s\n" "$r&5[&3$i&5]" "$status"
done < "$ff" | some_sorta_bar &

# pass output to pipe and print to stdout
monsterwm | tee -a "$ff"

This works almost, and I have no delays, but now whenever I change volume, with keys set in config.h using amixer, then the leftside-status of the bar gets mangled for some reason, and shows some of the rightside-status infront of the leftside-status??? :
tZXFwcw
If anybody could help me out with a better solution to using some_sorta_bar + acpi, with no delays and no mangled left-side output, then I would really appreciate it.

(Yes, I know that I can use 2 dzen instances to fix this, but I much prefer the much lighter some_sorta_bar, instead of dzen, which has become more of a graphical toolkit than just a simple bar...)

Last edited by mhertz (2012-07-14 15:08:24)

Offline

#741 2012-07-14 15:14:55

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

Re: monsterwm! ~ yet another tiny wm

I don't have acpi to test, but this could work for you [plain text]
A file holds the acpi information, and gets updated every 10secs.
When the info on the bar is updated that file is read.

Last edited by c00kiemon5ter (2012-07-14 15:15:25)


.:[ git me! ] :.

Offline

#742 2012-07-14 15:18:48

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

Re: monsterwm! ~ yet another tiny wm

TheLemonMan wrote:

Here's a patch for an output that is easier to parse, and here is my updated script, simpler and hopefully faster smile

yeah, I'll probably use that. easier to distinguish text after a symbol that's not going to appear before the title. thanks wink


.:[ git me! ] :.

Offline

#743 2012-07-14 16:07:42

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

Re: monsterwm! ~ yet another tiny wm

Sorry cookie, I forgot to mention that I wanted to find a solution without using a tmp file, so as to avoid reading/writing to the hdd...

I have previously tried to use a tmpfile for the rightside-part and just cat'ing it back, and it works, but I don't like it.

I then tried to make and use another fifo, instead of the tempfile, but that would make a delay for some reason when cat'ing it back to some_sorta_bar.

I've now tryed your solution with a fifo instead of a tmpfile and reading it back with $(< foo.fifo), instead of using a cat call, but now the leftside output is 10secs delayed...

Thanks for your help anyways, mate!

Offline

#744 2012-07-14 16:12:21

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

Re: monsterwm! ~ yet another tiny wm

what about this: http://sprunge.us/KQid

Last edited by c00kiemon5ter (2012-07-14 16:15:29)


.:[ git me! ] :.

Offline

#745 2012-07-14 16:34:30

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

Re: monsterwm! ~ yet another tiny wm

Thanks again, but still the same...

The only thing i've ever gotten to work was what I posted here: https://bbs.archlinux.org/viewtopic.php … 7#p1129357

But for some reason I get mangled leftside-output when changing volume, like in the screenshot I posted...

Anyway, thanks for your help, but I guess i'm just gonna have to live with it... (and sorry for the off-topic'ness)

Offline

#746 2012-07-15 02:54:37

livinglifeback
Member
Registered: 2009-10-24
Posts: 29

Re: monsterwm! ~ yet another tiny wm

Using the monster2dzen posted on gist. If set to tile mode and there are exactly two windows and you make one of them floating, either with the mouse or the super key dzen2 crashes and X dies.
This is the error:

/home/justin/monster2dzen: line 52: 8880 segmentation fault     monsterwm > "$ff"

This doesn't happen in any other mode or if there are more than two windows in tile mode. Is there a change in monsterwm's output under these circumstances that could cause this?

Offline

#747 2012-07-15 08:05:33

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

Re: monsterwm! ~ yet another tiny wm

@livinglifeback I had forgotten a `&` at the end of the `dzen2` call.
the only thing you need to run the script is to make it executable and add

    exec /path/to/monsterwm2dzen

in your `~/.xinitrc`


.:[ git me! ] :.

Offline

#748 2012-07-15 11:09:28

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

Re: monsterwm! ~ yet another tiny wm

@mhertz try this one tongue

Last edited by c00kiemon5ter (2012-07-15 11:10:34)


.:[ git me! ] :.

Offline

#749 2012-07-15 15:02:42

livinglifeback
Member
Registered: 2009-10-24
Posts: 29

Re: monsterwm! ~ yet another tiny wm

@c00kimon5ter

I saw the comment on git thank you. The bar works now but dies when removing 1 of 2 tiled windows in tile mode. I tested it with the master branch and it doesn't happen, however it does when I merged fib, nmaster, showhide and centerwindow. I'm trying different combinations to see if it's a specific patch but I'm hoping someone here might have a hint on where to look.

Update: I have the same problem without the bar monsterwm is segfaulting with the combination of patches i'm using.

Last edited by livinglifeback (2012-07-15 17:34:06)

Offline

#750 2012-07-15 22:36:50

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

Re: monsterwm! ~ yet another tiny wm

What are you doing and it's segafaulting ?
I've just merged fib, nmaster, showhide and centerwindow and monsterwm loads fine, changing layouts and fib works, centerwindow works, showhide works, nmaster works - quick-tested with a bunch of terminals and opera (the browser).

Last edited by c00kiemon5ter (2012-07-15 22:41:58)


.:[ git me! ] :.

Offline

Board footer

Powered by FluxBB