jzbor / marswm

A modern window manager featuring dynamic tiling (rusty successor to moonwm).
https://jzbor.de/marswm/
MIT License
48 stars 2 forks source link

Initial impressions #1

Closed 0323pin closed 1 year ago

0323pin commented 1 year ago

Hi,

Came across this project while browsing crates.io yesterday. As a LeftWM user for over a year now, I was curious to test this one :)

Side note: I'm a pkgsrc/NetBSD maintainer, so I've made a package for marswm and here it is running on my machine,

2023-03-23-092435_1366x768_scrot

I know you didn't ask for it but, here are my initial thoughts.

Generally, the WM works well. Related to marsbar, I'm missing the documentation for marsbar.yaml which, I would like to configure somewhat. Yes, I can read marswm/marsbar/src/config.rs and work my way through it but, it would be nicer with an example config.

I'm planning to use marswm for a week to test it. Let me know if you would like me to wait with merging the package into our repositories or, if you are fine with me doing that after testing.

Can get back to you if I find any issues.

EDIT: marsbar print-default-config works :)

jzbor commented 1 year ago

Hi, Thanks for the feedback! It is great so see someone actually using it other than myself, so also thanks for sharing the screenshot.

I know that the documentation for marsbar is sadly lacking at the moment. Also (in contrast to marswm I hope) there are still some quite substantial bugs to be fixed. For example the small dark square on the top left corner is actually the status widget that is not quite properly initialized when there is no status. The red square is an empty system tray. I was not aware however of the tearing issue you mentioned initially.

If you are interested in how a status script looks you can read/test/extend mine, which is currently available here. I will improve marsbar documentation with the next bigger release.

Speaking of the next release I plan on improving the argument parsing on all the programs, which might change the commandline interface a little, but the functionality should remain the same. I currently have exams at university, so I will probably have time for working on this in about two weeks.

Thanks again for your feedback - it is much appreciated :)

0323pin commented 1 year ago

@jzbor Thanks for the status script, it will need to be adjusted for NetBSD but, it gives me ideas.

The tearing is simply gone, I've tried restarting the bar over 10 times and I see no tearing anymore, which is good.

I've just pushed the package to our WIP repository, http://mail-index.netbsd.org/pkgsrc-wip-changes/2023/03/23/msg026677.html But, I'll wait for your improvements before merging it into the main branch.

If it's not asking too much, it would be nice if the bar height could be adjusted, I didn't see an option for it and, as you can see from the screenshot in unnecessarily fat :)

As comparison, lemonbar on LeftWM bellow 2023-03-23-131624_1366x768_scrot

Good luck with the exams!

jzbor commented 1 year ago

I've just pushed the package to our WIP repository, http://mail-index.netbsd.org/pkgsrc-wip-changes/2023/03/23/msg026677.html But, I'll wait for your improvements before merging it into the main branch.

Yes I think that makes sense

If it's not asking too much, it would be nice if the bar height could be adjusted, I didn't see an option for it and, as you can see from the screenshot in unnecessarily fat :)

Ouh yeah that it definitely a missing feature, that needs to be implemented.

As comparison, lemonbar on LeftWM bellow

You should be able to use lemonbar with marswm, although I haven't tested it and these bars are always a little tricky.

Good luck with the exams!

Thanks :)

0323pin commented 1 year ago

You should be able to use lemonbar with marswm, although I haven't tested it and these bars are always a little tricky.

Yeah but, I would prefer to use marsbar. lemonbar works ok on LeftWM after some filtering through liquid, in case you'd be interested

jzbor commented 1 year ago

So I have now implemented the new command line interface for marswm, marsbar and also mars-relay. I have also added an option to configure the bar height. It should work fine and you are welcome to try it out. As for a release I am probably going to wait until I have documentation for marsbar ready and some bugs/minor other stuff sorted out...

0323pin commented 1 year ago

Awesome, thanks!

I have also added an option to configure the bar height.

Nice. For now, I'm running without bar.

2023-03-25-081225_1366x768_scrot

The bar height it working but, I think adding the possibility to set the font and font size would make it more attractive.

Nice progress. I'm enjoying this WM.

jzbor commented 1 year ago

The bar height it working but, I think adding the possibility to set the font and font size would make it more attractive.

Yeah I know, I thought of this yesterday. I will definitely add it. Although the way it it is implemented right now (Xft) I found it to be quite picky on the font/size combos it accepts, so that might be an issue even when the config option is already in place.

0323pin commented 1 year ago

Although the way it it is implemented right now (Xft) I found it to be quite picky

Yeah, I know. I'm using lemonbar-xft

0323pin commented 1 year ago

@jzbor Everything seems fine, been using it all day.

jzbor commented 1 year ago

@jzbor Everything seems fine, been using it all day.

Nice, I am glad to hear that.

I have also added a font option for marsbar now, so you are welcome to try it out.

0323pin commented 1 year ago

I have also added a font option for marsbar now, so you are welcome to try it out.

Is it also possible to define the font size?

I've re-built marswm from git-head again but, still need to try marsbar, been playing around with something else :)

Here's marswm as the widow-manager for LXQt, 2023-03-26-104602_1366x768_scrot

jzbor commented 1 year ago

Is it also possible to define the font size?

Yes you can specify it along with the font name (although it sometimes doesn't work - I'll blame it on xft):

  font: FiraCode:size=12           # font of text surfaces (as xft name)

Here's marswm as the widow-manager for LXQt,

Ouh that looks nice - does it integrate well with the rest of LXQt?

0323pin commented 1 year ago

does it integrate well with the rest of LXQt?

Let's say it's usable. Initially, everything seemed to work fine, as long as the lxqt-panel was at the bottom or top of the desktop and lxqt-globalkeys was disabled.

Placing the panel to the left resulted in the whole desktop freezing and not responding to any keybindings.

There are a few glitches here and there, like Mod4+Return doesn't launch a terminal but, it does start a second one if I launch the first one from the menu. But, in general it works.

I always feel like I have a dirty system whenever I'm using a full DE, so I've removed it now. Perhaps, I should try this on Linux on a VM.

0323pin commented 1 year ago

Working just fine :)

2023-03-26-182800_1366x768_scrot

Thanks!

jzbor commented 1 year ago

Placing the panel to the left resulted in the whole desktop freezing and not responding to any keybindings.

Yes marswm only handles bottom or top panels for now...

There are a few glitches here and there, like Mod4+Return doesn't launch a terminal but, it does start a second one if I launch the first one from the menu. But, in general it works.

Hugh thats weird, can think of anything right now that would cause this...

0323pin commented 1 year ago

thats weird, can think of anything right now that would cause this

I would say, this needs to be tested on the full DE, I only built a selected set of components and swapped-out openbox.

If I find the time, I will try this on Linux, there's a old brick in the house that has Void with LXQt but, it hasn't been used in months.

0323pin commented 1 year ago

@jzbor

there's a old brick in the house that has Void with LXQt

So, I couldn't resist and had to take it for a spin :)

2023-03-27-064137_1366x768_scrot

It works pretty well but, the weird thing with the keybindings remains. I did switch off lxqt-globalkeys in order to avoid potential conflicts with already defined keys but, I get the same behavior. Keybindings are only functional on workspaces that already have one client open.

For example, if I launch an application from the menu (anyone would do), then I can use keybindings to open others but, using any keybinding on a workspace without any client does nothing. Actually, if a workspace is empty it's not even possible to switch to another workspace, on the other hand, if there's an open application this works.

I suspect this has to do with desktop handling. It's possible to switch off desktop control in LXQt but, I didn't want to do this.

EDIT: Should add that if one has a mouse centric workflow, this is nothing one would notice in the first place. In general, integration is good. It's possible that defining keybindings through lxqt-globalkeys would work, would need to be tested but, I don't see why it shouldn't work, as desktop control is still in the hands of pcmanfm-qt.

jzbor commented 1 year ago

as desktop control is still in the hands of pcmanfm-qt.

I think you are right and this causes the problem with the hotkeys: pcmanfm sets a desktop window, which marswm simply maps and ignores. But this means that on an empty workspace there is still that pcmanfm window above the root window, blocking the root window from getting key events...

Better handling for unmanaged windows is still an issue in general, another example is windows getting raised above notifications. But it is good to know this...

0323pin commented 1 year ago

All in all, it works rather good with LXQt. One would just need to make sure the keybindings defined in the yaml-file don't conflict with the ones defined by lxqt-globalkeys and use that to define the bindings.

On another topic, I'm experience some weirdness with the bar. Here's my marsbar.yaml:

status_cmd: mars-relay set-status "$(date +'w%W %a %F')"
action_cmd: null
style:
  background: 0x081013
  expand_workspace_widgets: false
  height: 18
  font: FantasqueSansMono Nerd Font:size=9
  workspaces:
    foreground: 0xa6bc99
    inner_background: 0x081013
    outer_background: 0x081013
    padding_horz: 0
    padding_vert: 0
    text_padding_horz: 10
    text_padding_vert: 4
    spacing: 0
  title:
    foreground: 0xc0c5ce
    background: 0x081013
    padding_horz: 5
    padding_vert: 0
  status:
    foreground: 0x081013
    inner_background: 0xfbd382
    outer_background: 0x081013
    padding_horz: 4
    padding_vert: 4
    text_padding_horz: 5
    text_padding_vert: 0
    spacing: 4

The issue is with the status_cmd. If I set status_cmd: mars-relay set-status "$(date +%F)" and load the bar it shows the date. I can then change this to status_cmd: mars-relay set-status "$(date +'w%W %a %F')" and reload and it still works but, if I start with the later option, it displays just an empty square.

jzbor commented 1 year ago

The issue is with the status_cmd. If I set status_cmd: mars-relay set-status "$(date +%F)" and load the bar it shows the date. I can then change this to status_cmd: mars-relay set-status "$(date +'w%W %a %F')" and reload and it still works but, if I start with the later option, it displays just an empty square.

Hm so I think if you get only one square that is probably just the system tray and there is no status found at all. The problem with your command is that it only sets the status once. The status_cmd is only executed once when the bar is launched.

There is a bug in marsbar that I have not been able to pin down yet, where it does not always pick up the status when it is set. That is usually no problem as the next time the script updates the status it picks it up correctly. In your case though, where the status is only set once it somehow misses it and then never gets a notification about that property ever again.

You can check what is set as status by checking the _MARS_STATUS property on the root window.

0323pin commented 1 year ago

Hm so I think if you get only one square that is probably just the system tray

Yes, just one. How is the system tray supposed to work? Or, better, I'll wait for the documentation.

The problem with your command is that it only sets the status once

True but, I thought that would be enough. I have the time on my shell prompt and the date doesn't change so quickly :) I'll look into creating a loop.

jzbor commented 1 year ago

How is the system tray supposed to work?

It should just pick up tray applications you are using, like nm-applet, nextcloud, whatever. If you don't have any there is nothing to show, although I'll admit it would be nice to hide the tray in that case...

True but, I thought that would be enough.

Yeah it should be - it is definitely a bug (I suspect racing conditions).

0323pin commented 1 year ago

It should just pick up tray applications you are using, like nm-applet, nextcloud, whatever. If you don't have any there is nothing to show

Everything is behaving as it should then. I don't use this sort of things :)

0323pin commented 1 year ago

One last thing for now. The following is lemonbar with leftwm

workspaces

The green label on the workspace means it's the currently active one. The yellow label indicates that clients are open on those workspaces. Is this something you have plans to add as a feature?

I think after this, I don't think I'd need any further features :)

jzbor commented 1 year ago

The green label on the workspace means it's the currently active one. The yellow label indicates that clients are open on those workspaces. Is this something you have plans to add as a feature?

Yeah I had something like this with my old dwm setup. I would definitely like to implement it, but it requires tracking the windows from the marsbar, so it is on the backlog for now. I would really like this, so I would probably implement it eventually.

As for some of the other issues: I have fixed the status not getting set the first time, so your date command from above should work now. Also the system tray is hidden, when there are no tray applications.

0323pin commented 1 year ago

I would really like this, so I would probably implement it eventually.

Looking forward to it in the future, now take care of your exams :)

As for some of the other issues: I have fixed ...

Awesome, I'll try to find the time for a rebuild as soon as possible. Thanks, appreciated.

0323pin commented 1 year ago

Been using the latest additions for sometime now. Things are smooth, thanks for the fixes.

0323pin commented 1 year ago

Would you happen to know where and how should I define media keys? On LeftWM, I have the following,

        (command: Execute, value: "mixerctl -w outputs.master-=12", modifier: [], key: "XF86XK_AudioLowerVolume"),
        (command: Execute, value: "mixerctl -w outputs.master+=12", modifier: [], key: "XF86XK_AudioRaiseVolume"),

But, adding something similar to keybindings doesn't work. Should this be added to the buttonbindings instead?

jzbor commented 1 year ago

This is what I am using currently:

# Volume Control
- key: XF86AudioRaiseVolume
  action: !execute pactl set-sink-volume @DEFAULT_SINK@ +5% && canberra-gtk-play -i audio-volume-change
- key: XF86AudioLowerVolume
  action: !execute pactl set-sink-volume @DEFAULT_SINK@ -5% && canberra-gtk-play -i audio-volume-change
- key: XF86AudioMute
  action: !execute pactl set-sink-mute @DEFAULT_SINK@ toggle
- modifiers: [ Mod4 ]
  key: bracketright
  action: !execute pactl set-sink-volume @DEFAULT_SINK@ +5% && canberra-gtk-play -i audio-volume-change
- modifiers: [ Mod4 ]
  key: bracketleft
  action: !execute pactl set-sink-volume @DEFAULT_SINK@ -5% && canberra-gtk-play -i audio-volume-change
- modifiers: [ Mod4 ]
  key: backslash
  action: !execute pactl set-sink-mute @DEFAULT_SINK@ toggle

# Media Control
- key: XF86AudioPlay
  action: !execute playerctl play-pause -p spotify
- key: XF86AudioPause
  action: !execute playerctl play-pause -p spotify
- key: XF86AudioPrev
  action: !execute playerctl previous -p spotify
- key: XF86AudioNext
  action: !execute playerctl next -p spotify
- modifiers: [ Mod4 ]
  key: i
  action: !execute playerctl play-pause -p spotify
- modifiers: [ Mod4 ]
  key: u
  action: !execute playerctl previous -p spotify
- modifiers: [ Mod4 ]
  key: o
  action: !execute playerctl next -p spotify

The key names are as defined by x11 in keysymdef.h. You can find out the name of a specific key with xev.

0323pin commented 1 year ago

Thanks!

You can find out the name of a specific key with xev

Yeah, this I'm aware of but, I was trying:

modifiers: []
- key: XF86AudioRaiseVolume
  action: !execute mixerctl -w outputs.master+=12
jzbor commented 1 year ago

Ah I think I see whats wrong: The modifiers must be part of a specific key binding. So something like this should work:

- key: XF86AudioRaiseVolume
  modifiers: []
  action: !execute mixerctl -w outputs.master+=12

If I am not mistaken removing the modifiers field completely should also work:

- key: XF86AudioRaiseVolume
  action: !execute mixerctl -w outputs.master+=12
0323pin commented 1 year ago

WIP 😄

jzbor commented 1 year ago

Nice to see!

0323pin commented 1 year ago

Got the volume keys working. None of the other options did it.

0323pin commented 1 year ago

@jzbor https://www.reddit.com/r/unixporn/comments/12cikkt/marswm_another_planet/

jzbor commented 1 year ago

Looks great! I didn't even think about a titlebar-ish border on the side. It's nice to see it enable configurations that I didn't even plan for...

0323pin commented 1 year ago

Closing this now. let's open a new issue when needed.

jzbor commented 1 year ago

I have now published a new version as 0.4.0. There are still some issues, but no deal breakers so I think it should be fine for packaging in pkgsrc...

0323pin commented 1 year ago

I have now published a new version as 0.4.0

🎉

There are still some issues, but no deal breakers so I think it should be fine for packaging in pkgsrc

True, I've been using git-HEAD for the past week and it's ready for prime time. I'll move the package to the main branch today. I'll post here when it's done and probably create a PR with install instructions.

0323pin commented 1 year ago

@jzbor Merged now, http://mail-index.netbsd.org/pkgsrc-changes/2023/04/12/msg272363.html