You are not logged in.
Offline
Šaran wrote:When I click on cancel in geany's 'do you want to save' dialog or try to rename file in spacefm, monster
segfaultsI will look into it asap, thanks for the report 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
It works now, thanks.
Offline
@c00kiemon5ter
Yes, the new focus behaviour works good.
@TheLemonMan
Thank you
Offline
Offline
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 just give me a moment
.:[ git me! ] :.
Offline
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.
I can help you with bash just give me a moment
Many thanks
Offline
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
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??? :
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
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
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
what about this: http://sprunge.us/KQid
Last edited by c00kiemon5ter (2012-07-14 16:15:29)
.:[ git me! ] :.
Offline
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
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
@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
@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
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