You are not logged in.

#1251 2013-04-13 20:35:10

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

Re: monsterwm! ~ yet another tiny wm

theGunslinger wrote:

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

You need the windowtitles branch of monsterwm, and then use the 'monsterwm2dzen_with-titles_dwm-like' script from https://gist.github.com/c00kiemon5ter/1905427, but change dzen2 and it's args to bar, and also change the line that pipes conky's output...

Last edited by mhertz (2013-04-13 20:37:15)

Offline

#1252 2013-04-13 21:03:57

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

Re: monsterwm! ~ yet another tiny wm

mhertz wrote:
theGunslinger wrote:

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

You need the windowtitles branch of monsterwm, and then use the 'monsterwm2dzen_with-titles_dwm-like' script from https://gist.github.com/c00kiemon5ter/1905427, but change dzen2 and it's args to bar, and also change the line that pipes conky's output...

Thanks, I must have missed it...

Offline

#1253 2013-04-14 08:07:55

ky
Member
From: Melbourne
Registered: 2013-04-14
Posts: 8
Website

Re: monsterwm! ~ yet another tiny wm

So i have been playing with Monster and DWM for a little bit and both (as far as i can see) don't seem to be able to re-snap floating windows. To help support what im trying to ask for is, with Awesome WM, when windows are created either Floating or Assigned to Floating via user input you can also re-snap them into tiling again, i find this handy when moving windows from one monitor to another. Its entirely possible that i have missed this type of functionality through lack of trial and error and/or failure to use a certain patch when compiling. So, does MonsterWM support this type of funcationlity/can it be baked into the source via a certain patch, or is this something that isnt do-able just yet with the base or core source code. Thanks!

Offline

#1254 2013-04-14 08:37:40

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: monsterwm! ~ yet another tiny wm

FWIW, DWM has this functionality. Just press middle mouse button on a client.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1255 2013-04-14 09:22:18

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

Re: monsterwm! ~ yet another tiny wm

Pressing tiling layout combo will tile any floating windows.

Offline

#1256 2013-05-05 16:00:44

xTouchMe
Member
Registered: 2013-05-05
Posts: 6

Re: monsterwm! ~ yet another tiny wm

Anyone here that could help me with a little problem
I'm currently running monsterwm with the 'initlayouts' and 'windowtitles' patches

The bar is screwing up for some reason

I've looked around and noticed that the $d and $w gets filled with a substring of the currently selected window title split by spaces and the $t only gets the last 'word' of the substring, where the substring is the window title minus the first word
eg.
Currently selected window title = "foo bar Firefox - Aurora"
the bar would display:
<workspaces/desktop> bar [bar] Firefox [Firefox] [-] Aurora [Aurora]                 Aurora                    <mpd, volume, date, time>

I've managed to 'fix' the one for $d so now it only displays the ones inside the brackets
by adding a 'default case *)' in the 'case/switch' statement

Here's what I have currently for statusinfo.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%%|*}" desk="${desk#*|}" # has urgent hint
    t="${desk#*}"                     # finally the title


    # desktop id
    case "$d" in
        0) d=" main" ;; 1) d=" web" ;;
        2) d=" gaemz" ;; 3) d=" chats" ;;
        *) d=""
    esac

    # current desktop on active monitor
    if [ $c -ne 0 ]
    then bg="\b9" un="\u3"
        case "$l" in
            0) s="Tiling Mode" ;; 1) s="Monocle Mode" ;; 2) s="BStack Mode" ;;
            3) s="Grid Mode"   ;; 4) s="Float Mode"   ;;
        esac && s="\u0\u0 $s \br\ur"
    fi

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

    mr="$mr$bg$fg$un $d \\f5[$w]\ur\br\fr"

    #if [ "$m" -eq 0 ]
    #then mr="$mr$bg$fg$un $d \\f5[$w] \ur\br\fr"
    #fi

    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 +"%a %d %b %R")" dstat=""

printf '%s %s %s %s' "$mr" "$s" "\\b7\\u7\c $t \\br\ur" "\r"
printf ' \\u3\\b9 %s \\br\\ur %s' "$mstat" "$music" "$vstat" "$vol" "$dstat" "$date "
printf '\n'

and monsterwm2bar

#!/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"

I feel like i'm missing something here

Offline

#1257 2013-05-05 17:54:58

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

Re: monsterwm! ~ yet another tiny wm

hur hur, spaces

try this:

#!/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

line="$@"
t="${line#*|}"
set -- ${line%%|*}

# 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

...

Last edited by c00kiemon5ter (2013-05-05 17:56:13)


.:[ git me! ] :.

Offline

#1258 2013-05-06 00:43:48

xTouchMe
Member
Registered: 2013-05-05
Posts: 6

Re: monsterwm! ~ yet another tiny wm

Sweet!
That did it~ Thanks smile

Offline

#1259 2013-05-11 17:33:14

shian5
Member
Registered: 2013-05-11
Posts: 2

Re: monsterwm! ~ yet another tiny wm

I haven't found a bar that supports Pango, so I've made one myself for using with monsterwm. It's still a little buggy, but here you go:

https://github.com/shian5/cpbar

Offline

#1260 2013-05-17 21:24:23

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

Re: monsterwm! ~ yet another tiny wm

That sounds really interesting Shian5 cool I just need to figure out how to use it

Offline

#1261 2013-05-17 22:52:43

shian5
Member
Registered: 2013-05-11
Posts: 2

Re: monsterwm! ~ yet another tiny wm

Shinryuu wrote:

That sounds really interesting Shian5 cool I just need to figure out how to use it

Thanks, I've uploaded a couple example scripts here if it helps. https://gist.github.com/shian5/5602383

Offline

#1262 2013-05-27 13:06:53

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 245

Re: monsterwm! ~ yet another tiny wm

Hi

I use Shinryuu method , how to inegrate some information in bar ? Also replaced mpd with cmus, btw i don't know how to replace in statusbar.

statusinfo.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'

I want cpu and memory usage & cmus notification smile

Offline

#1263 2013-05-27 13:17:42

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

Re: monsterwm! ~ yet another tiny wm

F34R wrote:

Hi

I use Shinryuu method , how to inegrate some information in bar ? Also replaced mpd with cmus, btw i don't know how to replace in statusbar.

statusinfo.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'

I want cpu and memory usage & cmus notification smile

Here's what I use for cmus artist - song info

#!/bin/bash

if [ ! -x /usr/bin/cmus-remote ];
then
    echo "cmus is not installed."
    exit
fi

ARTIST=$( cmus-remote -Q 2>/dev/null | grep "tag artist" | grep -v "sort" |sed 's/tag.*artist//g'  )
TITLE=$( cmus-remote -Q 2>/dev/null | grep "tag title" | grep -v "sort" | sed 's/tag.*title//g'  )

if [ -z "$ARTIST" ];
then
    echo "Not Playing"
else
    echo "$ARTIST - $TITLE"
fi

Last edited by theGunslinger (2013-05-27 13:18:42)

Offline

#1264 2013-05-27 14:07:12

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

Re: monsterwm! ~ yet another tiny wm

you want to replace the '# music status' block

you can try:

music=$(cmus-remote -Q | awk '$2 == "artist"{a=substr($0,12)} $2 == "title"{t=substr($0,11); exit} END{printf("%s - %s\n",a,t); exit(!t)}')
[  $? -ne 0 ] && mstat="" music="Not playing" || mstat=""

Last edited by c00kiemon5ter (2013-05-27 14:08:08)


.:[ git me! ] :.

Offline

#1265 2013-05-27 15:12:25

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

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

you want to replace the '# music status' block

you can try:

music=$(cmus-remote -Q | awk '$2 == "artist"{a=substr($0,12)} $2 == "title"{t=substr($0,11); exit} END{printf("%s - %s\n",a,t); exit(!t)}')
[  $? -ne 0 ] && mstat="" music="Not playing" || mstat=""

Well one more script goes to the bin, thanks smile

Offline

#1266 2013-05-27 17:15:31

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 245

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

you want to replace the '# music status' block

you can try:

music=$(cmus-remote -Q | awk '$2 == "artist"{a=substr($0,12)} $2 == "title"{t=substr($0,11); exit} END{printf("%s - %s\n",a,t); exit(!t)}')
[  $? -ne 0 ] && mstat="" music="Not playing" || mstat=""

thanks that working , any idea for cpu or ram usage showing ?

Offline

#1267 2013-06-06 19:15:24

Neuromatic
Member
From: Germany
Registered: 2013-05-31
Posts: 65

Re: monsterwm! ~ yet another tiny wm

Hey guys,

when I use the 'grid'-Layout, appears a little (ca. 2px) gap on the right side of the screen. Is there any way how I can fix it?


/* No Comment */

Offline

#1268 2013-06-06 19:57:12

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

Re: monsterwm! ~ yet another tiny wm

Neuromatic wrote:

Hey guys,

when I use the 'grid'-Layout, appears a little (ca. 2px) gap on the right side of the screen. Is there any way how I can fix it?

Ah that one. I don't really have a problem with that with my resolution until I spawn a lot of terminals around. I've asked the same thing in the past from cookieboy and here's the answer from him, https://bbs.archlinux.org/viewtopic.php … 0#p1063710

Offline

#1269 2013-06-07 11:43:01

Neuromatic
Member
From: Germany
Registered: 2013-05-31
Posts: 65

Re: monsterwm! ~ yet another tiny wm

Thank you Shinryuu smile

In this case I'll simply aviod the grid-Layout and add a Desktop more big_smile.


/* No Comment */

Offline

#1270 2013-06-13 13:05:05

Neuromatic
Member
From: Germany
Registered: 2013-05-31
Posts: 65

Re: monsterwm! ~ yet another tiny wm

Another little thing.

I've tryed to change the font in bar from ohnsap to terminus. But always when I want to start it, bar says:

Could not load font -*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1

/* No Comment */

Offline

#1271 2013-06-13 16:48:56

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

Re: monsterwm! ~ yet another tiny wm

That line works just fine and I see no problems/error messages floating around. Did you specify your FontPaths correctly in some of xorg's configurations files? (/etc/X11/xorg.conf.d/*.conf or /etc/X11/xorg.conf)

Here's an example

Section "Files"
    FontPath     "/usr/share/fonts/TTF/"
    FontPath     "/usr/share/fonts/local/"
    FontPath     "/usr/share/fonts/envypn/"
    FontPath     "/usr/share/fonts/misc/"
    FontPath     "/usr/share/fonts/artwiz-fonts/"
    FontPath     "/home/shn/.fonts/"
EndSection

This is my font line in bar's config.def.h file

#define BAR_FONT	"-*-stlarch-medium-r-normal-*-10-*-*-*-*-*-*-*","-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1"

Offline

#1272 2013-06-13 17:28:25

Neuromatic
Member
From: Germany
Registered: 2013-05-31
Posts: 65

Re: monsterwm! ~ yet another tiny wm

Shinryuu wrote:

Did you specify your FontPaths correctly in some of xorg's configurations files?

Yes, FontPaths are in /etc/X11/xorg.conf. And there is no other Error messages. But still

Could not load font -*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1

/* No Comment */

Offline

#1273 2013-06-13 20:40:33

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

Re: monsterwm! ~ yet another tiny wm

Mhh.. then I'm out of ideas

Offline

#1274 2013-06-13 20:53:38

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

Re: monsterwm! ~ yet another tiny wm

If it cannot find the font file then it either cannot see it (not in the FontPath) or it is actually not there.
try:

$ fc-cache -frv

and if it does not work again, try to restart X - this will surely pick up the font files
if they are there and on FontPath; I've had fc-cache fail to load existing font files more than once hmm

If it still doesn't work, post your config.h for bar, just in case there's a typo or something

In any case make sure you have terminus installed, ie

$ fc-list | grep -i terminus

should return results


.:[ git me! ] :.

Offline

#1275 2013-06-14 13:48:16

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

Re: monsterwm! ~ yet another tiny wm

@cookie
How is monsterwm going? Are there any new things to be implemented/fixed or now you focus purely on that new tiling manager that you talked about before?

Offline

Board footer

Powered by FluxBB