monsterwm output to dzen2 or some_sorta_bar
ff="/tmp/monsterwm.fifo" | |
[[ -p $ff ]] || mkfifo -m 600 "$ff" | |
# desktop names | |
ds=("web" "dev" "foo" "null") | |
# layout names | |
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 & | |
# pass output to fifo | |
monsterwm > "$ff" |
#!/usr/bin/env bash | |
# create a fifo to send output | |
ff="/tmp/monsterwm.fifo" | |
[[ -p $ff ]] || mkfifo -m 600 "$ff" | |
while read -r; do | |
# filter output to only what we want to match and parse | |
[[ $REPLY =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]] && read -ra desktops <<< "$REPLY" || continue | |
for desktop in "${desktops[@]}"; do | |
# set values for | |
# d - the desktop id | |
# w - number of windows in that desktop | |
# m - tiling layout/mode for that desktop | |
# c - whether that desktop is the current (1) or not (0) | |
# u - whether a window in that desktop has an urgent hint set (1) or not (0) | |
IFS=':' read -r d w m c u <<< "$desktop" | |
# name each desktop | |
case $d in | |
0) d="web" s="" ;; | |
1) d="dev" s="::" ;; | |
2) d="foo" s="::" ;; | |
esac | |
# the current desktop color should be #d11783 | |
# we will also display the current desktop's tiling layout/mode | |
((c)) && f="#d11783" && case $m in | |
# name each layout/mode with a symbol | |
0) i="[T]" ;; | |
1) i="[M]" ;; | |
2) i="[B]" ;; | |
3) i="[G]" ;; | |
esac || f="#5e7175" | |
# if the desktop has an urgent hint its color should be #ff0000 | |
((u)) && f="#ff0000" | |
# if the desktop has windows print that number next to the desktop name | |
# else just print the desktop name | |
((w)) && r+="$s ^fg($f)$d $w^fg() " || r+="$s ^fg($f)$d^fg() " | |
done | |
# read from fifo and output to dzen2 | |
printf "%s%s\n" "$r" "$i" && unset r | |
done < "$ff" | dzen2 -h 18 -w 400 -ta l -e -p -fn "-misc-terminusmod.icons-medium-r-normal--12-120-72-72-c-60-*-*" & | |
# pass output to fifo | |
monsterwm > "$ff" |
#!/usr/bin/env bash | |
: "${wm:=$HOME/Projects/monsterwm/monsterwm}" | |
: "${ff:="/tmp/$RANDOM.monsterwm.fifo"}" | |
tags=('1' '2' '3' '4') | |
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 -t 60 -r wmout || true; do | |
desktops=( $(cut -d"|" -f1 <<< "$wmout") ) | |
title="$(cut -d"|" -f2- <<< "$wmout")" | |
if [[ "${desktops[@]}" =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then | |
unset tmp | |
for desktop in "${desktops[@]}"; do | |
IFS=':' read -r d w m c u <<< "$desktop" | |
# Tags labels | |
label="${tags[$d]}" | |
# Is this the current desktop ? save the layout | |
((c)) && fg="#fefefe" bg="#204a87" && layout="${layouts[$m]}" \ | |
|| fg="#b3b3b3" bg="" | |
# Has windows ? | |
((w)) && fg="#fce94f" | |
# Urgent windows ? | |
((u)) && fg="#ef2929" | |
tmp+="^fg($fg)^bg($bg) $label ^bg()^fg()" | |
done | |
fi | |
# Merge the clients indications, the tile and the info | |
echo "$tmp $layout $title" | |
done < "$ff" | dzen2 -w 320 -h 18 -ta l -e -p & | |
while :; do "$wm" || break; done | tee -a "$ff" | |
#$wm > "$ff" |
#!/usr/bin/env bash | |
# create a fifo to send output | |
ff="/tmp/monsterwm.fifo" | |
[[ -p $ff ]] || mkfifo -m 600 "$ff" | |
# desktop names | |
ds=("web" "dev" "foo" "null") | |
# layout names | |
ls=("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 | |
# set values for | |
# d - the desktop id | |
# w - number of windows in that desktop | |
# m - tiling layout/mode for that desktop | |
# c - whether that desktop is the current (1) or not (0) | |
# u - whether a window in that desktop has an urgent hint set (1) or not (0) | |
IFS=':' read -r d w m c u <<< "$desktop" | |
# if this is the current desktop, color should be '&4' | |
# if this is the current desktop, also set the layout name | |
# else the color should be '&3' | |
((c)) && fg="&4" i="${ls[$m]}" || fg="&3" | |
# if the desktop has an urgent hint, add an | |
# exclamation mark '!' with '&5' color | |
((u)) && w+='&5!' | |
r+="$fg${ds[$d]} $w &3:: " | |
done | |
r="${r%::*}" | |
fi | |
# read from fifo and output to some_sorta_bar | |
printf "&L%s&R%s\n" "$r&5[&3$i&5]" "$(date +"%F %R")" | |
done < "$ff" | some_sorta_bar & | |
# pass output to fifo | |
monsterwm > "$ff" |
This comment has been minimized.
This comment has been minimized.
I use
update: this is now the default. |
This comment has been minimized.
This comment has been minimized.
some_sorta_bar now reads input from |
This comment has been minimized.
This comment has been minimized.
added friendlier script by @LemonBoy, edited to also include the window titles. |
This comment has been minimized.
This comment has been minimized.
@livinglifeback I had forgotten a
in your |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Also check mstatusbar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
monsterwm🌵 is a tiny but monsterous dynamic tiling wm by @c00kiemon5ter written in less than 650lines of C
bar🔥 is a @LemonBoy creation, a simple bar written in C/XCB.
some_sorta_bar⚡ is a @moetunes creation, some sort of a bar, written in C/Xlib.