First of all very cool window manager thanks for your work @natemaia, i have it working nicely on my devuan beowulf system. Im using tint2 which is really nice as i like tint2 and dwm and the two have never been able to meet until now.
So i got a few questions. Im wanting tint2 to behave like say i3wm statusbar in regards to taskbar, so far all i can think of is to remove the tint2 taskbar and add in executors to show workspaces, what im stumped on is how to show inactive workspaces that are used but hidden, like say im on workspace 1 with st term, and have 2 and 3 open with an editor and web browser. Any ideas on how to show those workspaces as executors or display them in tint2 similar to how i3wm does it?
here is a scrot and im using wmctrl to show current workspace active.
Welcome to the forum and to the yax side lol
I’m no tint2 expert but when I was trying to accomplish the same thing you want, I couldn’t get it to work as expected. Either it hid all the occupied workspaces or it showed them but with all the tasks that were currently on them. And the spacing between them was really annoying, either you set them to be all close together or annoyingly far from each other. Seems like tint2 is not the best option for tiling window managers, although it works. Nate could give a better opinion regarding tint2.
But have you tried polybar and lemonbar? Those two work perfectly with yax.
yeah the taskbar is just not suited to tilers like dwm and yax it seems, but the rest of tint2 is so usable. I just deleted the taskbar and trying to hack together some sort of display through the executors.
Ive tried lemonbar and polybar on dwm, if all else fails ill resort to polybar.
Polybar doesn’t really work that well on dwm by default, actually no bar does apart from the default one. Some tweaking is needed to get them to behave properly in dwm. Maybe your experience with it wasn’t so good because you tried it on dwm.
Anyway, I hope you get tint2 working the way you want. If not, give polybar or lemonbar another shot.
Yeah come to think of it i think i was using bspwm with polybar not dwm, but lemonbar works well i know this, just not as many features as polybar or tint2
Next you don’t need external programs like wmctrl to get info from yax, do
# print active workspace name, can also be num or both with just print ws
yaxwm -c print ws name
There’s a print command for just about everything, my documentation of them is just lacking.
Here’s what I made the other day for lemonbar (should work for any bar that can print text though)
ws()
{
bg="#111111" fg="#666666" hi="#6699ee"
a="$(yaxwm -c print all win |
awk 'BEGIN{s=""} /[0-9]/ {sub(/:[0-9]*/, ""); if (s !~ $2) s = s $2} END{print s}')"
yaxwm -c print all ws |
awk -v i="$(yaxwm -c print ws num)" -v fg="$fg" -v hi="$hi" -v a="$a" -F: '{
if ($1 == i && a ~ $1) {
printf " %%{+u}%%{F" hi "}" $1 "%%{F" fg "}%%{-u} "
} else if ($1 == i) {
printf " %%{F" hi "}" $1 "%%{F" fg "} "
} else if (a ~ $1) {
printf " %%{+u}" $1 "%%{-u} "
} else {
printf " " $1 " "
}
}'
}
It’s using lemonbar formatting to get some extra info on the cheap, workspaces with windows on them get an underline, active workspace gets a (hi)light colour.
Example output with ws 2 active and both ws 1/2 with windows on them
The only thing I haven’t bothered with is the click actions, I’m sure it can be done though.
Since I went off on a bit of a tangent, to answer your tint2 question. yax doesn’t do workspaces like i3, we don’t destroy inactive workspaces or ever free them, only add more. There will always be a set amount of workspaces that can be accessed from any monitor.
Try this tint2conf (specifically the task sections)*
I will give lemonbar a try, im not sure how to input that script into tint2, would need some modification i guess.
That tint2 config works good but similar to what i was using, with that added benefit of getting rid of wmctrl and using yaxwm directly so that is cool, thanks.
I know you said not to worry about wmctrl but something interesting that could be worked a bit better in a script is below piped commands.
this just gives an indication of all workspaces with a asterisk beside what desktop is being used. Still to figure out how to show used but hidden workspace but that might come from a yaxwm command somehow.
that’s the same thing your wmctrl command does. The " %%{+u}" and “%%{-u} " put an underline below occupied workspaces as you can see in the picture of his bar. If you want a * instead you just replace the printf " %%{+u}" $1 "%%{-u} " with something like printf " *" $1 and then you will have a * by the occupied workspaces side.
The printf " %%{+u}” basically means print whatever comes next with an underline indicator and the other "%%{-u} " says stop it here. In between them there is only the ws name. So it’s the same thing that the wmctrl command is doing
Here’s what I whipped up for tint2, first a workspace script kinda like the one in my previous post but using pango markup instead.
#!/bin/bash
cmd="$1"
ws="${2:-$cmd}"
if [[ -z $ws ]]; then
echo "usage: $0 [view, send, follow] <num>"
exit 2
fi
if [[ $ws == "$cmd" ]]; then
a="$(yaxwm -c print all win |
awk 'BEGIN{s=""} /[0-9]/ {sub(/:[0-9]*/, ""); if (s !~ $2) s = s $2} END{print s}')"
if [[ $(yaxwm -c print ws num) == "$ws" ]]; then
if [[ $a =~ $ws ]]; then
echo " <span font_desc='Sans 14' foreground='#6699ee' underline='double'>$ws</span> "
else
echo " <span font_desc='Sans 14' foreground='#6699ee'>$ws</span> "
fi
elif [[ $a =~ $ws ]]; then
echo -e " <span font_desc='Sans 14' underline='double'>$ws</span> "
else
echo " <span font_desc='Sans 14'>$ws</span> "
fi
else
yaxwm -c ws "$cmd" "$ws"
fi
if you just pass it an index it will print it back with formatting tint2ws 1
pass in a command as well and it will run that tint2ws view 1
Then I made an executor for each workspace and added them to the panel, it’s amazingly inefficient but does the job XD. Something like your pipeline works much better but gives no clickable actions, kinda catch 22.