Skip to content

feat: Added new ipc command get wmlayout - #1249

Open
Sora3e8 wants to merge 5 commits into
mangowm:mainfrom
Sora3e8:ipc-get-wmlayout
Open

feat: Added new ipc command get wmlayout#1249
Sora3e8 wants to merge 5 commits into
mangowm:mainfrom
Sora3e8:ipc-get-wmlayout

Conversation

@Sora3e8

@Sora3e8 Sora3e8 commented Aug 6, 2026

Copy link
Copy Markdown

Added a new ipc command get wmlayout, allows to query current layout eg. for waybar status indicator.
Updated the documentation accordingly
Added into manpages

Added a new ipc command get wmlayout, allows to query current layout eg. for waybar status indicator.
Updated documentation accordingly
Added into manpages
@DreamMaoMao

Copy link
Copy Markdown
Collaborator

mmsg get all-monitors

why not use this

image

@Sora3e8

Sora3e8 commented Aug 6, 2026

Copy link
Copy Markdown
Author

@DreamMaoMao
*edit
I misread your reply, I had no idea there was a layout_symbol in the get all-monitors dump as I am not using json that often I had no idea "jq" existed, but even if I knew about the "layout_symbol" attribute I probably would not have known what it is as I did not find any reference in documentation, I know the association is in the code, but I think I did not find it in docs.

Anyway even with that checking the documentation I did not find any function to get current active monitor, while the get all-monitors allows you to find it using active it's non-trivial parsing.
I needed the current wm layout type as an indicator as on cycle there's no other indicator, but window behavior.

Waybar config using the new mmsg call:

"custom/wmlayout": 
    {
      "format": "{icon}",
      "return-type": "json",
      "interval": 0.1,
      "exec": "mmsg get wmlayout|sed 's/wmlayout/alt/g'",
      "format-icons": 
      {
        "tile": "🟦",
        "scroller": "↔️📜",
        "grid": "🪟",
        "monocle": "🧐",
        "deck": "↔️🃏",
        "vertical_deck": "↕️🃏",
        "center_tile":"💠",
        "right_tile": "➡️",
        "vertical_scroller":"↕️📜",
        "vertical_tile":"↕️",
        "vertical_grid":"↕️🪟",
        "dwindle": "🌀",
        "fair": "🗂️",
        "vertical_fair": "↕️🗂️"
      }
    }

Without windows:
no_windows

With windows:
with_windows

Sample return:

╰─λ mmsg get wmlayout                                                                                                                                              127 (0.000s) < 20:18:58
{"wmlayout":"tile"}

@DreamMaoMao
DreamMaoMao force-pushed the main branch 2 times, most recently from 0efe75b to 20ad711 Compare August 10, 2026 05:15
@Senderman

Copy link
Copy Markdown
Contributor

@Sora3e8 there's native support for mango layout in waybar without the need for custom module:

"mango/layout": {
    "format": "{}"
}

https://github.com/Alexays/Waybar/wiki/Module:-Mango#mangolayout

@Sora3e8

Sora3e8 commented Aug 13, 2026

Copy link
Copy Markdown
Author

@Senderman
Well it's been a while - I either did not know it was a thing or I did..., but it does not really seem that this native module allows me to substitute the symbols for the icons as I do in my waybar example, I may be wrong I suck with waybar config as I am not fan of json and manipulation with jsons overall.

@Senderman

Senderman commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@Sora3e8 it actually allows:

"mango/layout": {
    "format": "default icon here",
    "format-S": "↔️📜",
    "format-M": "🧐",
    "format-F": "️🗂️"
}

and so on. Also you can apply css styles based on active layout, just read the documentation on the waybar's wiki page I provided a link to

@Sora3e8

Sora3e8 commented Aug 13, 2026

Copy link
Copy Markdown
Author

@Senderman
Hmm interesting, I was trying exactly this before and it did not work.
Probably a typo...

Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants