jaelpark / chamferwm

A tiling X11 window manager with Vulkan compositor.
https://jaelpark.github.io/chamferwm-docs/
BSD 3-Clause "New" or "Revised" License
249 stars 11 forks source link

wbar dock has border #2

Closed juanitotc closed 5 years ago

juanitotc commented 5 years ago

I've just built chamferfm and have it working - couple of questions:

config.py mentions "Panels, docks etc. should be rendered with no decorations.", but a wbar dock I'm using has a 5mm thick black/yellow border all the way around it - should this happen? Is there a way to stop it?

I see that config.py look for psutil and pulsectl and that there is some code about battery percentage, etc, but nothing is displayed?

Is there a man page/wiki somewhere that explains the keybindings (how to launch apps, quit chamferfm, etc)?

jaelpark commented 5 years ago

I think the comment about borders on panels etc. in the configuration is a TODO, which apparently hasn't been labeled as one for some reason. The idea is that OnSetupClient would be supplied with some attribute parameters that can be used to decide when to for example use shaders with borders and when not to. I guess I should finally implement this now that you asked. As a workaround, if you can identify the window class name for wbar, you can assign the borderless shaders based on that condition.

Callback to OnTimer() which in the example was programmed to show battery level warnings, is not merged yet. There was some stuttering problem related to that a while back which I haven't taken time to solve yet.

I'm in the process of writing a documentation now that the configuration API is hopefully getting more stable. It's not hosted anywhere yet as it is highly WIP, but it does contain already the basic keybinding and configuration information. I could probably host the draft somewhere today or tomorrow when I have time. For now, the only reference for the keybindings is to look at the default config, specifically what's under OnSetupKeys().

juanitotc commented 5 years ago

Thanks for the reply.

As far as I can tell, the window class name for wbar is "Bar", but substituting "Bar" for "Conky" has no effect.

juanitotc commented 5 years ago

screenshot_0611144504 Example screenshot

jaelpark commented 5 years ago

Can you paste the output from xprop here? If the name is matched, then there should be no problem🤔.

juanitotc commented 5 years ago

Ah - I was mistaken - it is "wbar" and not "Bar", but substituting "wbar" for "Conky" still doesn't remove the border around the wbar dock.

$ xprop WM_NAME(STRING) = "wbar" WM_CLASS(STRING) = "wbar", "wbar" WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW

jaelpark commented 5 years ago

l can't seem to reproduce this. I built wbar and put if self.wm_class == "wbar":. As a result I have it correctly rendered borderless. Note that edits to the config at the moment require a restart of chamferwm, did you try that after editing?

juanitotc commented 5 years ago

I'm restarting chamferwm each time I edit config.py - I have this:

    if self.wm_class == "wbar":
        self.vertexShader = "default_vertex.spv";
        self.geometryShader = "default_geometry.spv";
        self.fragmentShader = "default_fragment.spv";
    else:
        self.vertexShader = "frame_vertex.spv";
        self.geometryShader = "frame_geometry.spv";
        self.fragmentShader = "frame_fragment.spv";

..but wbar still has a border. I also note that none of the bound keystrokes seem to work, although I'm unsure of what keystrokes (alt, ctrl, special) should be used with "q" to quit for example.

When I exit to the console prompt I see chamferwm outputs a lot of details (no errors in the screen I can see) to stdout, is there a way to easily capture this in a log file - I am starting chamferwm with:

exec chamfer --config=/usr/local/share/chamfer/config/config.py --shader-path=/usr/local/share/chamfer/shaders

I suspect I may be missing something in python, but without any errors it's hard to know what.

jaelpark commented 5 years ago

Okay, quite strange then. Can you try print("class:",self.wm_class,".",flush=True) before the condition? Also, put another print statement (also with flush=True) inside the if-branch just to check whether the condition really evaluates true. If it really does, then there's something more problematic going on.

You can log the output with exec stdbuf -oL chamfer --config=/usr/local/share/chamfer/config/config.py --shader-path=/usr/local/share/chamfer/shaders > /tmp/log. Then, while running, it's easy to tail -f /tmp/log for example.

For now the key combination to quit is hardcoded to Alt+Shift+E, although that I can hopefully change soon. The default modifier key for everything else in the config should be Alt.

juanitotc commented 5 years ago

I'm unable to get the "print("class:",self.wm_class,".",flush=True)" to work without an exception being thrown - maybe because python is so finicky about indents? log.tar.gz

However, "alt enter" opens a terminal and "alt shift e" exits the wm, but does not make it back to the console prompt.

I've attached the log generated by starting and exiting chamferwm - I don't see any errors.

jaelpark commented 5 years ago

Do you see the exception? I made pushed some minor logging modifications, if you can pull and check again that'd be nice. Turns out every print needs a flush=True, otherwise it might not get logged at all when using stdbuf.

However, "alt enter" opens a terminal and "alt shift e" exits the wm, but does not make it back to the console prompt.

Do you mean tty? It might be that the runtime behind the compositor gets stuck somewhere during deinitialization. I'm not sure why though.

juanitotc commented 5 years ago

I meant that chamfer stops parsing config.py when it gets to the print statement.

Yes, quit exits chamferwm, but does not make it to tty - I'm obliged to "ctl alt f1" and kill Xorg.

I'm away tomorrow, but will compile the latest git in the near future and try again.

juanitotc commented 5 years ago

I recompiled chamferwm with the latest changes.

The border width is much better now :)

I managed to insert the print statement before the test for wbar, but it is not echoed in the log and the border remains around wbar. My locale is C, does it need to be set to utf8? log.tar.gz

    try:
        print("Setting up \"{}\" ({})".format(self.wm_name,self.wm_class),flush=True);
    except UnicodeDecodeError:
        print("UnicodeDecodeError",flush=True);
    print("class:",self.wm_class,".",flush=True)

    if self.wm_class == "wbar":

What does the print statement need to look like if I add it after the wbar line?

I've also enclosed the log - as before exit does not make it back to the tty.

jaelpark commented 5 years ago

Thanks, the log looks actually fine now. It has all the output from the Python - for every other application you open (except wbar), OnSetupClient() is called and the respective lines are printed. I bet if you replace "wbar" in the shader branch condition with "gedit" for example, gedit will be rendered borderless.

Only that for wbar, OnSetupClient() is not being called at all. I may have identified the reason: in your setup, wbar doesn't make any X map requests, only map notify is given. This can be seen from the log you just provided (lines 34 to 41). At the moment, for technical design reasons OnSetupClient() is called only for clients that do map requests, and for this reason, wbar will always be given the default shaders that are hardcoded to be the decorating shaders.

I will come up with a fix for this first. Then later maybe I need to implement supplying the config with client attributes, so that the shader selection can be done based on those instead of class name.

juanitotc commented 5 years ago

Yes - gedit comes up borderless :)

jaelpark commented 5 years ago

I believe I may have fixed the issue with wbar, if you update and try match the wbar class name again, it should work now.

juanitotc commented 5 years ago

It works now - thanks :)

chamferwm packaged for tinycorelinux (CorePure64).