You are not logged in.
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
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
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
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
Pressing tiling layout combo will tile any floating windows.
Offline
Anyone here that could help me with a little problem
I'm currently running monsterwm with the 'initlayouts' and 'windowtitles' patches
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
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
Sweet!
That did it~ Thanks
Offline
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:
Offline
That sounds really interesting Shian5 I just need to figure out how to use it
Offline
That sounds really interesting Shian5
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
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
Offline
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
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
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
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
Offline
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
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
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
Thank you Shinryuu
In this case I'll simply aviod the grid-Layout and add a Desktop more .
/* No Comment */
Offline
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
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
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
Mhh.. then I'm out of ideas
Offline
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
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
@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