yabar
yabar copied to clipboard
Workspace Internal Block Feature Enhancement Request
If I am correct the current interal workspaces block only displays the current visible workspace. Is it do-able to add an option to display all existing workspaces as well?
Like in i3? that is exactly what I wanted to do! The problem is all info I can get from EWMH are: the current desktop, the number of desktops and the list of all windows. There is no direct way to know the non-empty desktops/workspaces. I've been thinking (if possible) to track windows after their creation and bind that to the current desktop in order to implement this feature.
TLDR; I am interested in your request but there is no direct way to implement it. But I will try to find a way.
I guess maybe add a string option or boolean (however you want to do it) for different types of WM's. Seems like a lot of work. But maybe support like the top 5. But still there should be a more universal way.
Regards, Dean
Regards, Dean
.: Dean Thomson :. .: CCA Software Support :. .: PH: 03 9894 0055 :. .: MOB: 0414 960 644 :.
On 14/04/16 at 06:01pm, George Badawi wrote:
Like in i3? that is exactly what I wanted to do! The problem is all info I can get from EWMH is the current desktop, the number of desktops and the list of all windows. There is no direct way to know the non-empty desktops/workspaces. I've been thinking (if possible) to track windows after their creation and bind that to the current window in order to implement this feature.
TLDR; I am interested in your request but there is no direct way to implement it. But I will try to find a way.
You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/geommer/yabar/issues/52#issuecomment-210230459
After taking a brief look at xcb_ewmh.h
, it seems like xcb_ewmh_get_desktop_names
could give the names of the desktops.
I haven't tested it out, however.
Guys I am now confused, am I missing something here? I thought @z1lt0id asked for a i3-like workspaces block (i.e. shows only all non-empty workspaces). The name of workspaces is not a problem, the original names can be obtained as @NBonaparte said but internal-option1
skips that and uses its list of names. The real problem, if I understood the initial request correctly, is how to deduce the non-empty workspaces. I don't think EWMH offers a direct solution to that.
Exactly, too makes things a little more annoying bspwm has changed the way it does workspaces :( Shows ID numbers now.
I'm not familiar with i3's code, but it seems like i3 creates desktops only if they are occupied, or if they open on a monitor or when you press a key combination, so wouldn't the ids of the workspaces refer to only the open ones?
Any news about this ?
There hasn't been much work since August, however while @geommer is working on this a simple script using your favourite scripting language could parse output like bspc subscribe
and then use Pango to stylize that output depending on what's selected. :)
I agree that an internal solution using EWMH is better, just proposing a workaround until it's ready.
I've created an experimental module on the dev_workspaces branch (see 6cb6f48), please check if it works for i3 (so far on bspwm it works fine).
Use the option exec: "YABAR_WORKSPACES";
and internal-option1: "e o f u";
where e = empty, o = occupied, f = focused, u = urgent (replace letters with symbols or whatever you want).
@NBonaparte not working for me (bspwm stable, archlinux)
ya_ws: { exec: "YABAR_WORKSPACES"; align: "left"; fixed-size: 80; # variable-size: true; internal-option1: "e o f u"; }
The program segfaults as soon as started
[1] + 16382 segmentation fault (core dumped) yabar
Could you compile with -g
flag, run with gdb and paste the output here?
I am not sure I understood what you mean but I changed the line in Makefile
from $(CC) $(CFLAGS) -c -o $@ $<
to $(CC) $(CFLAGS) -g -o $@ $<
, no additional info, the program just exits with a segfault on the moment I start it
Add -g
to CFLAGS
, compile, then run gdb ./yabar
in the build directory, and in the gdb shell do run
(run -c ...
if you use a different config location). When you run it in gdb and it segfaults it should show line numbers.
yeah, that's what I got in gdb
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff757c6ba in xcb_ewmh_get_atoms_from_reply () from /usr/lib/libxcb-ewmh.so.2
Put the -g
in CFLAGS
instead of where you originally put it.
Same message, I put -g in CFLAGS and restored the -c flag in that line $(CC) $(CFLAGS) -c -o $@ $<
Are you using Archlinux? maybe it has nothing to do with yabar itself, maybe it's in libxcb-ewmh
Yeah, I'm using Arch. Try doing where
and see if the line numbers show there.
`
(gdb) where
#0 0x00007ffff757c6ba in xcb_ewmh_get_atoms_from_reply ()
at /usr/lib/libxcb-ewmh.so.2
#1 0x00007ffff757c712 in xcb_ewmh_get_atoms_reply () at /usr/lib/libxcb-ewmh.so.2
#2 0x0000000000405dc7 in ya_exec_intern_ewmh_blk (blk=0x622f00) at src/ya_exec.c:131
#3 0x0000000000406298 in ya_execute () at src/ya_exec.c:522
#4 0x0000000000404234 in main (argc=
`
I've gotten that once quite a while ago. Not sure if it's me or xcb-ewmh.
If you comment the whole urgent part out does it work? (lines 130-142)
what part? the YABAR_WORKSPACES
in the config file?
Sorry for being unclear. lines 130-142 in ya_exec.c
yeah it works now
I'll try to reimplement the urgency part.
Why not make it to look just like i3bar? only busy desktops are shown and everything else shouldn't be on the bar
i3 functions differently than bspwm; i3 only makes desktops when they are filled or active. I guess I could make an option for that...
You just made the hard part, you can merge that with the internal-options1
from @geommer's work so only the icons corresponding to the busy workspaces are shown instead of this not very helpful string of eooefeooofff
, you can add some other option to highlight the the current workspace.
Have you tried changing the letters in internal-options1
? You can set them to any symbol.
I know I can change them, I just mean that the character should correspond to the workspace icon not the state itself, just like i3 and awesomewm
Just checking (this is very much a wip), does 3dea0c5 work for you? Set internal-option2: "name";
.