You are not logged in.

#751 2012-07-16 01:11:16

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

Re: monsterwm! ~ yet another tiny wm

If I am in tiling mode with exactly two windows tiled and then set one to floating either using the mouse or super key it crashes it doesn't happen in any other mode.

Offline

#752 2012-07-16 02:28:35

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

Re: monsterwm! ~ yet another tiny wm

@livinglifeback great, thanks for the report. it was a problem in nmaster patch. it is now fixed.

@TheLemonBoy, I got '|' on windowtitles patch.

on other news I'm going over the multi-montor branch smile will update soon


.:[ git me! ] :.

Offline

#753 2012-07-17 14:25:16

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

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

@mhertz try this one tongue

Ahh, that's great thinking, man smile Thanks alot!

I'm still having some issues, though, which I cannot understand why that's happening... ?

First, I didn't get any acpi output, and the field was just blank where it should have been shown.

Then, I changed:

 if [[ $wmout =~ ^acpi|* ]]; then

To:

 if [[ $wmout =~ ^acpi|.* ]]; then

(I just added a dot...)

Now it does show the acpi info to the right, but now the whole leftside is empty except this '[]' ?

Also, whenever I e.g. change desktops or something, then the acpi info to the right changes into what the wm outputs i.e. all those numbers and colons?

Anyway, you have allready helped me with this way to much, so dont think about it anymore, and again thanks alot for all your help, mate!

@others

If anybody is using some_sorta_bar(or TheLemonMan's bar) to display workspace/window status to the left, and also has conky output to the right, and no delays in the leftside-output, then I would much appreciate if you could kindly pm me with your init-script, thanks. (I'm thinking about if I should replace the acpi, date and amixer commands with just simply conky instead...)

Last edited by mhertz (2012-07-17 15:02:09)

Offline

#754 2012-07-17 18:45:00

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

Re: monsterwm! ~ yet another tiny wm

I've just changed over to TheLemonMan's bar and so I changed cookie's some_sorta_bar initscript to use LemonMan's color and placement-codes... (It took some time experimenting, since some places one backslash where needed, whereas other places, two and also three where needed, depending on where in the script...)

ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"

ds=("web" "dev" "foo" "null")

ms=("T" "M" "B" "G" "F")

while read -t 60 -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"
            ((c)) && fg="\\f4" i="${ms[$m]}" || fg="\\f3"
            ((u)) && w+='\f5!'
            r+="$fg${ds[$d]} ${w/#0/\\f8-} \\f3:: "
        done
        r="${r%::*}"
    fi
	printf "\\\l%s\\\r%s\n" "$r\\f5[\\f3$i\\f5]" "$(date +"%F %R")"
done < "$ff" | bar &

monsterwm > "$ff"

Last edited by mhertz (2012-07-21 18:47:37)

Offline

#755 2012-07-18 17:30:01

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: monsterwm! ~ yet another tiny wm

Hey, I just noticed I've never been able to use "mouse buttons" to spawn commands, I wonder if I'm doing something wrong.. I see no errors around which makes this case really interesting.

Here's the part from config.def.h

static Button buttons[] = {
    {  MOD1,    Button1,     mousemotion,   {.i = MOVE}},
    {  MOD1,    Button3,     mousemotion,   {.i = RESIZE}},
    {  MOD1,    Button2,     spawn,         {.com = menucmd}},
};

Last edited by Shinryuu (2012-07-18 19:28:42)

Offline

#756 2012-07-18 17:48:34

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

Re: monsterwm! ~ yet another tiny wm

I started playing with monster again. I'm using the startup script from mhertz and lemonboy's bar. How would I launch conky in that script? Thanks

Offline

#757 2012-07-18 20:00:49

kalle97
Member
Registered: 2012-07-18
Posts: 80

Re: monsterwm! ~ yet another tiny wm

Thanks c00kiema5ter for this little tiling wm! It's truly amazing how much it can do with so few lines of code. Using it full time. smile

Offline

#758 2012-07-18 20:51:05

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

Re: monsterwm! ~ yet another tiny wm

stlarch wrote:

[...] I'm using the startup script from mhertz and lemonboy's bar. How would I launch conky in that script? Thanks

I've modified the script to use conky:

ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"

ff2="/tmp/monsterwm2.fifo"
[[ -p $ff2 ]] || mkfifo -m 600 "$ff2"

conky | while read -r; do echo "$REPLY" > "$ff2"; done &

ds=("web" "dev" "foo" "null")

ms=("T" "M" "B" "G" "F")

while read -t 60 -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"
            ((c)) && fg="\\f4" i="${ms[$m]}" || fg="\\f3"
            ((u)) && w+='\f5!'
            r+="$fg${ds[$d]} ${w/#0/\\f8-} \\f3:: "
        done
        r="${r%::*}"
    fi
	printf "\\\l%s\\\r%s\n" "$r\\f5[\\f3$i\\f5]" "$(< "$ff2")"
done < "$ff" | bar &

monsterwm > "$ff"

For some reason it needed the while-loop, as just using: 'conky > "$ff2" &', or 'conky | tee -a "$ff2" &', didn't work, or atleast it didn't output anything when using '$(< "$ff2")'...

Note, of course you need to set conky to output to console and not to X, and you will have a delay of the left-side output according to whatever you have set 'update_interval' in .conkyrc to...

I don't use conky myself, but i've tested the above to work correctly...

Last edited by mhertz (2012-07-21 18:48:42)

Offline

#759 2012-07-19 05:22:09

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

Re: monsterwm! ~ yet another tiny wm

Thanks mhertz. I'll play around with it some more.

Offline

#760 2012-07-19 18:49:29

kalle97
Member
Registered: 2012-07-18
Posts: 80

Re: monsterwm! ~ yet another tiny wm

Okey, sorry if this is a silly question to you guys, also sorry if it's wrong to post it here.

How do I get a dzen2 conky bar, is there any guide or such? I've tried to find any documentation but couldn't do so.

Offline

#761 2012-07-19 18:54:15

Doomcide
Member
Registered: 2011-08-22
Posts: 221

Re: monsterwm! ~ yet another tiny wm

^create a console-only conky (by adding the options 'out_to_x no' and 'out_to_console yes' to your conkyrc and piping it into dzen like this:

conky | dzen2 &

Offline

#762 2012-07-19 18:56:39

kalle97
Member
Registered: 2012-07-18
Posts: 80

Re: monsterwm! ~ yet another tiny wm

Okey, thanks.

Do I add that "conky | dzen2 &" to my .xinitrc?

Offline

#763 2012-07-19 19:18:55

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: monsterwm! ~ yet another tiny wm

It seems I can spawn a command with mouse if I have an application like urxvt opened and have focus on it. But if I have mouse in the desktop and try to spawn a command with my mouse.. nothing happens. This would be really useful for my laptop because I use mygtkmenu to help my daily porn.

[static Button buttons[] = {
    {  MOD1,    Button1,     mousemotion,   {.i = MOVE}},
    {  MOD1,    Button3,     mousemotion,   {.i = RESIZE}},
    {  CONTROL, Button3,     spawn,         {.com = mymenucmd}},
};

Last edited by Shinryuu (2012-07-19 19:20:30)

Offline

#764 2012-07-19 19:25:39

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

Re: monsterwm! ~ yet another tiny wm

@Shinryuu, sorry i've been busy lately
you're right, it doesnt work, *if where you click has no window* tongue
I noted to fix this, and will do asap, along with a new mutli-monitor branch.

thanks for reporting.


.:[ git me! ] :.

Offline

#765 2012-07-19 19:33:50

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: monsterwm! ~ yet another tiny wm

Aha, neat to see multi-monitor branch from you, as it's (was) quite hard for me to keep up with you smile

Are you thinking of doing the xcb stuff as seperate btw? Think it would make sense to move to it completely if you do it sometime.

Offline

#766 2012-07-20 08:06:27

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

Re: monsterwm! ~ yet another tiny wm

Seems I might have caused more grief than good for some people using some_sorta_bar with monsterwm. I think I have a solution.
Sorry it took so long.


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

Offline

#767 2012-07-20 09:36:35

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

Re: monsterwm! ~ yet another tiny wm

@Cloudef, heh, I understand that smile rebasing makes things harder for people to follow the code.
I would like to do xcb, but for now, time is not enough .. and yeah, I think eventually the xcb version will prevail.

@moetunes, that's nice wink


.:[ git me! ] :.

Offline

#768 2012-07-20 11:05:22

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

Re: monsterwm! ~ yet another tiny wm

@moetunes

You rock, man! Thanks alot! Brilliant idea, and works perfectly! Finally no more delays! Thank you so much again, mate! smile

For others to try it out, then I have changed cookies some_sorta_bar init-script to instead use splitter_bar. I don't use conky and so the script uses date, acpi and amixer to show to the right: 'time | bat. | vol.'.

while :; do 
	xsetroot -name "$(date +%R) | $(acpi | cut -d ' ' -f5 | cut -d ':' -f1-2) | $(amixer get Master | tail -1 | cut -d ' ' -f6,8 | tr -d '[]')"
	sleep 10
done &

ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"

ds=("term" "web" "foo" "bar")

ms=("T" "M" "B" "G" "F")

while read -t 60 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        unset r
        read -ra desktops <<< "$wmout" 
        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%::*}"
        printf "%s\n" "$r&5[&3$i&5]"
    fi
done < "$ff" | splitter_bar &

monsterwm > "$ff"

Last edited by mhertz (2012-07-21 18:40:13)

Offline

#769 2012-07-20 13:15:34

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

Re: monsterwm! ~ yet another tiny wm

Cookie helped me with a fix to his init-script which makes it work better with splitter_bar, and i've also updated the above script to include it, but now I actually see that with this fix added, then it's also possible to add no delays in LemonMan's bar and also some_sorta_bar(without the fix, you get mangled-leftside-output when changing volume with amixer)...

Here's a working no-delay init-script for LemonMan's bar, which you guys can adapt to your own preferences...

ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"

while :; do
echo "$(date +%R) | $(acpi | cut -d ' ' -f5 | cut -d ':' -f1-2) | $(amixer get Master | tail -1 | cut -d ' ' -f6,8 | tr -d '[]')" > "$ff"
sleep 10
done &

ds=("term" "web" "foo" "bar")

ms=("T" "M" "B" "G" "F")

while read -t 60 -r wmout || true; do
	[[ $wmout =~ ^.*\|.*\|.*$ ]] && status=$wmout
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
		unset r
        read -ra desktops <<< "$wmout"
        for desktop in "${desktops[@]}"; do
            IFS=':' read -r d w m c u <<< "$desktop"
            ((c)) && fg="\\f4" i="${ms[$m]}" || fg="\\f3"
            ((u)) && w+='\f5!'
            r+="$fg${ds[$d]} ${w/#0/\\f8-} \\f3:: "
        done
        r="${r%::*}"
    fi
    printf "\\\l%s\\\r%s\n" "$r\\f5[\\f3$i\\f5]" "$status"
done < "$ff" | bar &

monsterwm > "$ff"

Sorry for double-posting...

Last edited by mhertz (2012-07-21 18:52:43)

Offline

#770 2012-07-20 13:21:02

Doomcide
Member
Registered: 2011-08-22
Posts: 221

Re: monsterwm! ~ yet another tiny wm

kalle97 wrote:

Okey, thanks.

Do I add that "conky | dzen2 &" to my .xinitrc?

Well if you want it to start when X starts, then yes. You can also run it in a terminal with different options, to see what it'll look like before adding the line to xinitrc.

Offline

#771 2012-07-21 17:33:54

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

Re: monsterwm! ~ yet another tiny wm

pushed changes. this should fix @Shinryuu report, about commands binded to mouse buttons not running when no windows are present.

I also created a new branch - xinerama-core.
this should be equivalent to core branch functionality but running on multiple monitors.
if you use it, you'll need to update your config.h. the new vars are:

#define FOLLOW_MONITOR  False     /* Follow the window when moved to a different monitor */
#define INFOCUS         "#9c3885" /* focused window border color on unfocused monitor */

also, in the rules array one can now define on which monitor to spawn the specified app
and at last the keybinds for changing monitor focus and moving clients between monitors
at the end of the keys array; by default using WinKey(MOD4) + F{1..n}.

       MONITORCHANGE(    XK_F1,                             0)
       MONITORCHANGE(    XK_F2,                             1)

next will come the mater branch functionality built upon xinerama-core (will be xinerama-master).
I hope I'll get that before leaving for vacations on Tuesday night.

If you have many monitors test it! It should work well hopefully.
Xinerama support cost is 65loc (xinerama-core vs core) and it
might be possible to decrease that.

Last edited by c00kiemon5ter (2012-07-21 17:37:19)


.:[ git me! ] :.

Offline

#772 2012-07-21 19:17:12

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

Re: monsterwm! ~ yet another tiny wm

xinerama-master is up smile

I need to fix some things on mousemotion, will do asap. fixed wink

Last edited by c00kiemon5ter (2012-07-21 20:15:22)


.:[ git me! ] :.

Offline

#773 2012-07-21 19:51:03

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

xinerama-master is up smile

I need to fix some things on mousemotion, will do asap.

ナイス、 will propably move to that when I have time.
Need to port some of my changes from personal branch though.

Offline

#774 2012-07-21 20:31:38

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: monsterwm! ~ yet another tiny wm

Nicely done, boner achieved! smile

Offline

#775 2012-07-22 13:32:33

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

Nice work! smile I played with the xinerama-core branch a bit and noticed two bugs. I have two monitors, right of which is the primary. Whenever I launch a program specified as floating in config.h, it shows up in the left monitor but monsterwm still thinks it's in the right one (as it should be). Also, making a client fullscreen just puts it to the top left corner of the leftmost monitor regardless of the monitor position. These fixes seem to work fine for me:

diff --git a/monsterwm.c b/monsterwm.c
index 2495aeb..426d323 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -778,7 +778,7 @@ void maprequest(XEvent *e) {
     c = addwindow(w, (d = &(m = &monitors[newmon])->desktops[newdsk])); /* from now on, use c->win */
     c->istrans = XGetTransientForHint(dis, c->win, &w);
     if ((c->isfloat = (floating || d->mode == FLOAT)) && !c->istrans)
-        XMoveWindow(dis, c->win, (m->w - wa.width)/2, (m->h - wa.height)/2);
+        XMoveWindow(dis, c->win, m->x + (m->w - wa.width)/2, m->y + (m->h - wa.height)/2);
 
     int i; unsigned long l; unsigned char *state = NULL; Atom a;
     if (XGetWindowProperty(dis, c->win, netatoms[NET_WM_STATE], 0L, sizeof a,
@@ -1054,7 +1054,7 @@ void setfullscreen(Client *c, Desktop *d, Monitor *m, Bool fullscrn) {
     if (fullscrn != c->isfull) XChangeProperty(dis, c->win,
             netatoms[NET_WM_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char*)
             ((c->isfull = fullscrn) ? &netatoms[NET_FULLSCREEN]:0), fullscrn);
-    if (fullscrn) XMoveResizeWindow(dis, c->win, 0, 0, m->w, m->h + PANEL_HEIGHT);
+    if (fullscrn) XMoveResizeWindow(dis, c->win, m->x, m->y, m->w, m->h + PANEL_HEIGHT);
     XSetWindowBorderWidth(dis, c->win, (c->isfull || !d->head->next ? 0:BORDER_WIDTH));
 }

Also, how would I go about having the bar visible only in the default monitor? Oh and I don't think this will work without modifying the tile function. wink

Offline

Board footer

Powered by FluxBB