You are not logged in.

#1226 2013-03-12 14:45:26

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

Re: monsterwm! ~ yet another tiny wm

unnamed pipes/fifos are implemented as shared memory buffers.
named pipes, I am not sure.

monsterwm does not use a pipe though, the startup scripts do.
monsterwm just outputs information, which is written on stdout (so nowhere on the disk).
redirecting the output to /dev/null will just stop any output being written anywhere.

or you can just hack the source and change desktopinfo function to something like:

void desktopinfo(void) {
    return;
}

so nothing can be outputted from the source level.
the compiler would also optimize away the calls to desktopinfo();

----

so, if you're worried about writing to disk, monsterwm does not.
if you want to get rid of the output either redirect to /dev/null
or, change the desktopinfo(); function


.:[ git me! ] :.

Offline

#1227 2013-03-12 14:51:04

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

Re: monsterwm! ~ yet another tiny wm

@c00kiemon5ter
I see. Thank you for quick reply.

Offline

#1228 2013-03-17 01:38:00

seishinryohosha
Member
Registered: 2012-06-24
Posts: 19

Re: monsterwm! ~ yet another tiny wm

I really start to like your WM, c00kiemon5ter!

But I have one question/request smile

Trying to bind my laptop-function-keys I found this:

XF86XK_AudioRaiseVolume
XF86XK_AudioLowerVolume

as keys.

To compile them I added:
#include <X11/XF86keysym.h>
to monsterwm.c

As my C-experience is not that great yet, I thought I could bother you for a second wink

Is this correct? Or is there a better solution?

greetings

seishinryohosha

Offline

#1229 2013-03-17 02:27:22

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

Re: monsterwm! ~ yet another tiny wm

that sounds about right, to use the XF86XK_keys you need the X11/XF86keysym.h header wink


.:[ git me! ] :.

Offline

#1230 2013-03-17 07:45:12

andmars
Member
Registered: 2012-03-13
Posts: 362

Re: monsterwm! ~ yet another tiny wm

seishinryohosha wrote:

I really start to like your WM, c00kiemon5ter!

But I have one question/request smile

Trying to bind my laptop-function-keys I found this:

XF86XK_AudioRaiseVolume
XF86XK_AudioLowerVolume

as keys.

To compile them I added:
#include <X11/XF86keysym.h>
to monsterwm.c

As my C-experience is not that great yet, I thought I could bother you for a second wink

Is this correct? Or is there a better solution?

greetings

seishinryohosha

I have those multimedia-keys on my keyboard, too, but I din't need this header file at all. All you need is install xorg-xev, write down the names of the keys and put them in your config.def.h like this;

https://bbs.archlinux.org/viewtopic.php … 7#p1221297

this works totally fine for me.

Offline

#1231 2013-03-17 11:01:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: monsterwm! ~ yet another tiny wm

The header costs nothing as it only holds the constant keycode definitions which get replaced by the preprocessor with the 0x1008ffXX numbers.  So do whichever is more convenient.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#1232 2013-03-17 17:36:13

seishinryohosha
Member
Registered: 2012-06-24
Posts: 19

Re: monsterwm! ~ yet another tiny wm

If thats the case, I will stick to the header.
As it's better to read big_smile

Thank you all for you quick respones!

greetings seishinryohosha

Offline

#1233 2013-03-21 04:43:35

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

Re: monsterwm! ~ yet another tiny wm

Hey, I'm trying to merge xinerama-init (tried other xineramas as well) with windowtitles and/or uselessgaps and I get this kind of error. I believe I'm capable of manually patching monsterwm.c to use uselessgaps.

[ ~/monsterwm]$ git merge -m merge xinerama-init windowtitles
Auto-merging monsterwm.c
CONFLICT (content): Merge conflict in monsterwm.c
Auto-merging config.def.h
CONFLICT (content): Merge conflict in config.def.h
Automatic merge failed; fix conflicts and then commit the result.

Offline

#1234 2013-03-22 15:30:32

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

Re: monsterwm! ~ yet another tiny wm

hey Shinryuu,

here's a patch to merge xinerama-init with windowtitles and uselessgaps

$ cd monsterwm
$ git checkout xinerama-init
$ wget http://sprunge.us/OCLJ -O xinetitles.diff
$ patch -p1 < xinetitles.diff
$ make  # ...

.:[ git me! ] :.

Offline

#1235 2013-03-22 22:16:08

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

Re: monsterwm! ~ yet another tiny wm

Thanks a ton patching went fine smile I was able to manually add uselessgaps branch before but windowtitles was out of my realm.

EDIT1. It seems I can't see panel's left content at all which contains desktops etc. I can only see right side of the panel. I wonder if I should add something for the "desktop status" section.

#!/usr/bin/env bash

# desktop status
for desk; do
    m="${desk%%:*}" desk="${desk#*:}" # monitor id 
    [ "$m" -ne 0 ] && continue
    n="${desk%%:*}" desk="${desk#*:}" # is current monitor
    d="${desk%%:*}" desk="${desk#*:}" # desktop id
    w="${desk%%:*}" desk="${desk#*:}" # window count
    l="${desk%%:*}" desk="${desk#*:}" # layout mode
    c="${desk%%:*}" desk="${desk#*:}" # is current desktop
    u="$desk"                         # has urgent hint

    # desktop id
    case "$d" in
        0) d=" term" ;; 1) d=" web" ;;
        2) d=" img" ;;
    esac

    # current desktop
    if [ $c -ne 0 ]
    then bg="\b9" un="\u6" fg="\f1"
        case "$l" in
            0) s="Classic Tiling Mode" ;; 1) s="Monocle Mode" ;; 2) s="Bstack Mode" ;;
            3) s="Grid Mode" ;; 4) s="Bloat Mode" ;;
        esac && s="\b7\u7 $s \br\ur"
    fi

    # has urgent hint or no windows
    [ $u -ne 0 ] && un="\u2"
    [ $w -eq 0 ] && w="-"
    
    in="$in$bg$fg$un $d \f7[$w] \ur\br\fr"
    unset bg fg un
done

# music status
music="$(mpc current -f "%artist% - [%title%|%file%]")"
if [ -z "$music" ]; then music="nothing to see here" mstat=""
else
    mstat="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
    [ "$mstat" == "paused" ] && mstat="" || mstat=""
fi

# volume
oss="$(ossmix vmix0-outvol | awk '{print $10}' | awk -F : '{print $1}')dB" vstat=""

# date and time
date="$(date +"%a %d %b %R")" dstat=""

printf '%s %s %s' "$in" "$s" "\r"
printf ' \\b7\\u6\\f1 %s \\br\\ur\\fr %s' "$mstat" "$music" "$vstat" "$oss" "$dstat" "$date "
printf '\n'

Last edited by Shinryuu (2013-03-22 22:53:04)

Offline

#1236 2013-03-24 12:04:40

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

Re: monsterwm! ~ yet another tiny wm

I'm not sure what you're trying to achieve.
If you're using the windowtitles branch, then the info is appended a '|title' part,
which would cause that last part not to be passed to the statusinfo script, (if
you're using my wmrun.sh script)
Tell me what you want to achieve and we'll set it up smile


.:[ git me! ] :.

Offline

#1237 2013-03-24 13:43:33

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

Re: monsterwm! ~ yet another tiny wm

Oh, it seems I was thinking differently how it might "work" and yeah I'm using your wmrun.sh script to launch statusinfo.sh as well. I made a quick screenshot'n'edit about the panel I'm trying to achieve, click me!

Offline

#1238 2013-03-24 23:48:09

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

Re: monsterwm! ~ yet another tiny wm

hey, sorry for the late reply

here's what you need:
first off I had a bug in the patch tongue

@@ -499,7 +500,7 @@ void desktopinfo(void) {
         for (int cd = 0, w = 0; cd < DESKTOPS; cd++, w = 0, urgent = False) {
             for (m = &monitors[cm], c = m->desktops[cd].head; c; urgent |= c->isurgn, ++w, c = c->next);
             printf("%d:%d:%d:%d:%d:%d:%d%c", cm, cm == currmonidx, cd, w, m->desktops[cd].mode,
-                    cd == m->currdeskidx, urgent, cm < nmonitors - 1 && cd < DESKTOPS - 1 ? ' ':'|');
+                    cd == m->currdeskidx, urgent, cm == nmonitors - 1 && cd == DESKTOPS - 1 ? '|':' ');
         }
     d = &monitors[currmonidx].desktops[monitors[currmonidx].currdeskidx];
     printf("%s\n", d->curr ? d->curr->title : "");

then change wmrun.sh to account for the title,
only the grep expression needs to change to

grep -qEx "(([[:digit:]]+:){4,6}[[:digit:]]+ ?)+[|].*"

(iow, it needs the '|' and w/e follows)

and finally the statusinfo script should store the title

    u="$desk"                         # has urgent hint         <-- from this, to

    u="${desk%%|*}" desk="${desk#*|}" # has urgent hint
    t="${desk}"                       # finally the title

so you now have the title in variable 't' and you need to display it, so near the end

printf '%s %s %s' "$in" "$s" "\r"           # from this, to
printf '%s %s %s %s' "$in" "$s" "$t" "\r"


I think that's all you need to display the current desktop information only,
and the title of the current window, after the mode of the current desktop


.:[ git me! ] :.

Offline

#1239 2013-03-25 09:03:41

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

Re: monsterwm! ~ yet another tiny wm

Fixing done. It somewhat works but there's still something random going on big_smile

If I edit my wmrun.sh from this

# spawn a statusbar
while read -t 60 -r line || true; do
    echo "$line" | grep -qEx "(([[:digit:]]+:){4,6}[[:digit:]]+ ?)+" && prev="$line" || line=
    statusinfo.sh ${line:-$prev}
done < "$ff" | bar &

to this

# spawn a statusbar
while read -t 60 -r line || true; do
    echo "$line" | grep -qEx "(([[:digit:]]+:){4,6}[[:digit:]]+ ?)+[|].*" && prev="$line" || line=
    statusinfo.sh ${line:-$prev}
done < "$ff" | bar &

It still prints the title information even I didn't add these following lines into my statusinfo.sh script which is kind of weird and even I added these lines it didn't have effect.

u="${desk%%|*}" desk="${desk#*|}" # has urgent hint
t="${desk}"                       # finally the title
...
printf '%s %s %s %s' "$in" "$s" "$t" "\r"

And finally here's a pic how it looks, click me!

Offline

#1240 2013-03-26 11:23:24

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

Re: monsterwm! ~ yet another tiny wm

hm, it prints '.. Tittle [title] Layout Title' ?
that is weird, I set it up here, and it works fine.
I'll push in my scripts repo in a bit.

If at the end of the wmrun.sh script you change
'$wm > $ff' to '$wm | tee -a "$ff'
you can see what mosterwm returns when you hover around windows;
those liness should look like: 'x:x:x:x:x:x:x x:x:x:x:x:x:x x:x:x:x:x:x:x|title' (where 'x' is a number.)

try with a common statusinfo script, ie w/o blocking one screen's info
so that we can figure out if it's coming from there (most probably).


.:[ git me! ] :.

Offline

#1241 2013-03-26 11:53:42

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

Re: monsterwm! ~ yet another tiny wm

Something is wrong with focusing again. I changed monitor and all of the sudden i can't use focus without alt+tab (i use that shortcut for focus eg next_win in config.h).

How to produce it:
- I start firefox and firefox is the only client on the workspace so it is the focused one;
- I start downloading anything with firefox. When i start downloading anything with firefox, focus should change to download popup (eg "Do you want to save this file?") but that is not the case here. I Have to use alt+tab to remove focus from download popup and then give it back.

I know that download popup is focused because i have disctinct border colors for active clients. Focus with mouse click is not working (i disabled it anyway) so only alt+tab is doing it's job. Also, this happens in pcmanfm in some cases but i forgot how to produce it.

Last edited by kuraku (2013-03-26 11:55:13)

Offline

#1242 2013-03-26 13:07:14

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

Re: monsterwm! ~ yet another tiny wm

hmmm, I cant seem to able to reproduce that.

what I did:
- start monsterwm
- start firefox
- google for test.pdf
- right click on a couple of links and select 'save link as..'
- popup comes up focused as it should
- -
- right click on page 'save page'
- popup comes up focused as it should
- -
- goto filehippo.com
- pick a random app
- click download
- wait a bit
- popup comes up and focused as it should

tried with xinerama-init and monocleborders branches


.:[ git me! ] :.

Offline

#1243 2013-03-26 16:13:32

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

Re: monsterwm! ~ yet another tiny wm

It seems I found the culprit it was this line. Also if I enabled this line it sometimes skipped terminal title but it doesn't matter anymore.

m="${desk%%:*}" desk="${desk#*:}" # monitor id 
    [ "$m" -ne 0 ] && continue

With your scripts everything works just fine and I modified your script not to show other desktop info at all so the final result is what I was looking for so no need to fiddle with this case anymore, thanks smile

I changed

- printf '%s %s %s %s' "$mr$ml" "$s" "$t" "\r"
+ printf '%s %s %s %s' "$mr" "$s" "$t" "\r"

...and I can just add $ml back if I want to see two desktop infos at the same time in one panel.

Last edited by Shinryuu (2013-03-26 16:51:29)

Offline

#1244 2013-03-26 16:50:41

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

Re: monsterwm! ~ yet another tiny wm

@cookie
This could be firefox bug. I will try to reproduce focus issue in pcmanfm. Maybe i missed something.

Offline

#1245 2013-03-28 04:41:12

kanazky
Member
From: Vancouver, Canada
Registered: 2011-11-02
Posts: 70

Re: monsterwm! ~ yet another tiny wm

Hey guys!!

I am very excited to get started using MonsterWM!

I tried, DWM, i3, Xmonad, awesomeWM but haven't found that 1 I really really like!

Anyway:

I need some help, it sounds silly but i've never had to use git before.

git clone : monsterwm (done)

how do I merge in uslessgaps from here? And does anyone have a basic lemonbar config I could call from xinitrc and ill customize it from there. Id like to pipe conky and a tray in it as well.

Any guides or tutorials anyone could link me to, or just some help would be perf!


Archlinx + DWM big_smile I love Wingo-WM Bring it back!!

Offline

#1246 2013-03-28 07:02:00

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

Re: monsterwm! ~ yet another tiny wm

Hey! Wiki entry for Monsterwm is pretty nice and it explains how to merge patches as well, https://wiki.archlinux.org/index.php/Monsterwm#Patches

This is one of the ways to spawn both bar and panel. Just save it somewhere into your $PATH etc. and edit your .xinitrc exec line to point to that script

exec monsterwm <-- replace tihs
exec wmrun.sh <-- with this
#!/usr/bin/env sh

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

trap 'rm -f "$ff"' TERM INT EXIT
[ -p "$ff" ] || { rm -f "$ff"; mkfifo -m 600 "$ff"; }

# spawn a statusbar
while read -t 60 -r line || true; do
    echo "$line" | grep -qEx "(([[:digit:]]+:){4,6}[[:digit:]]+ ?)+[|]?.*" && prev="$line" || line=
    statusinfo.sh ${line:-$prev}
done < "$ff" | bar &

"$wm" > "$ff"

Here's the single monitor statusinfo.sh which is called by wmrun.sh

#!/usr/bin/env sh

# expects a line from monsterwm's output as argument ("$1")
# prints formatted output to be used as input for bar
# reference: bar by LemonBoy -- https://github.com/LemonBoy/bar

# desktop status
for desk; do
    d="${desk%%:*}" desk="${desk#*:}" # desktop id
    w="${desk%%:*}" desk="${desk#*:}" # window count
    l="${desk%%:*}" desk="${desk#*:}" # layout mode
    c="${desk%%:*}" desk="${desk#*:}" # is current desktop
    u="$desk"                         # has urgent hint

    # desktop id
    case "$d" in
        0) d=" term" ;; 1) d=" web" ;;
        2) d=" img" ;;
    esac

    # current desktop
    if [ $c -ne 0 ]
    then bg="\b7" un="\u6" fg="\f9"
        case "$l" in
            0) s="" ;; 1) s="" ;; 2) s="" ;;
            3) s="" ;; 4) s="" ;;
        esac && s="\b8\u8 $s \br\ur"
    fi

    # has urgent hint or no windows
    [ $u -ne 0 ] && un="\u2"
    [ $w -eq 0 ] && w="-"

    in="$in$bg$fg$un $d \f8[$w] \ur\br\fr"
    unset bg fg un
done


# music status
music="$(mpc current -f "%artist% - [%title%|%file%]")"
if [ -z "$music" ]; then music="nothing to see here" mstat=""
else
    mstat="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
    [ "$mstat" == "paused" ] && mstat="" || mstat=""
fi

# volume status
if [ "$(amixer get Master | sed -nr '$ s:.*\[(.+)]$:\1:p')" == "off" ]
then vol="[m]" vstat=""
else
    vol="$(amixer get PCM | sed -nr '$ s:.*\[(.+%)].*:\1:p')"
    if   [ "${vol%\%}" -le 10 ]; then vstat=""
    elif [ "${vol%\%}" -le 20 ]; then vstat=""; else vstat=""; fi
fi

# date and time
date="$(date +"%R")" dstat=""

# symbols
arrow=""

printf '%s %s %s' "$in" "$arrow " "$s" "\r"
printf ' \\b7\\u6\\f1 %s \\br\\ur\\fr %s' "$mstat" "$music" "$vstat" "$vol" "$dstat" "$date "
printf '\n'

If you want to see symbols in that script grab stlarch_font from here

Last edited by Shinryuu (2013-03-28 07:02:50)

Offline

#1247 2013-03-28 12:02:21

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

Re: monsterwm! ~ yet another tiny wm

Mhh I've encountered something random for a few times. Sometimes everything gets stuck but mouse is still working and I can search the web with it. When everything's stuck keybindings etc. won't work but when I wait for a while (around 1 minute) it does all the action I pressed after the freeze. This have happened while using GIMP and dwb. If I recall correctly everything's fine when you disable windowtitles support from statusinfo.sh. I wonder if there's any way to trace this issue smile

EDIT1. Something makes my CPU to run at 100% so I believe that's the issue. I have to trace it.

Last edited by Shinryuu (2013-03-28 12:10:24)

Offline

#1248 2013-03-28 20:16:15

kanazky
Member
From: Vancouver, Canada
Registered: 2011-11-02
Posts: 70

Re: monsterwm! ~ yet another tiny wm

K seems like it's mostly done now! Had to do a bunch of fighting with xinitrc about fonts and things.

Now to customize the shiz outta this!

Last edited by kanazky (2013-03-29 01:46:40)


Archlinx + DWM big_smile I love Wingo-WM Bring it back!!

Offline

#1249 2013-04-13 16:55:54

theGunslinger
Member
Registered: 2011-05-20
Posts: 300

Re: monsterwm! ~ yet another tiny wm

How would one go about getting window titles piped to the bar?

Offline

#1250 2013-04-13 17:14:24

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

about xcb:
I started looking into xcb around the time that bspwm was announced, and I got
sidetracked creating a new wm tongue I will hopefully find some time to get xcb into
monsterwm (and finish the new wm) around mid Feb I suppose.

Hello, c00kiemon5ter

Are there any updates regarding either of the above two items?  Sorry if I've missed them elsewhere in the thread.


oz

Offline

Board footer

Powered by FluxBB