Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Multiple widgets in a single window? #87

Closed
Barbaross93 opened this issue Jan 6, 2021 · 6 comments
Closed

[FEATURE] Multiple widgets in a single window? #87

Barbaross93 opened this issue Jan 6, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@Barbaross93
Copy link

Description of the requested feature

I apologize if this has already been discussed, but I can't seem to find anything while scouring the documentation and the github issues/PRs. It would be fantastic to be able to specify multiple widgets within a single window rather than have only one widget per window.

Proposed configuration syntax

I suppose within the <widget> tag, you could specify a list of widgets per location (kind of similar to polybar). To further illustrate:

<windows>
    <window name="main_bottom">
        <geometry x="5%" y="75%" width="90%" height="25%"/>
        <widget>
              <left>
                  <profile/>
                  <player/>
              </left>
              <center>
                  <launch/>
              </center>
              <right>
                  <weather/>
                  <system_info/>
              </right>
          </widget>
      </window>
</windows>

You may even want to create a <widgets> tag for this specific purpose rather than just <widget>

@Barbaross93 Barbaross93 added the enhancement New feature or request label Jan 6, 2021
@elkowar
Copy link
Owner

elkowar commented Jan 6, 2021

You can easily use a <box> to achieve exactly that, no? as in, have 3 boxes that fill out their container with equal width, then have those align their contents left/center/right respectively

@elkowar
Copy link
Owner

elkowar commented Jan 6, 2021

Also note that the <widget> tag allows you to put anything inside, so you can put those boxes directly in the <widget> tag

@elkowar elkowar closed this as completed Jan 6, 2021
@Barbaross93
Copy link
Author

Barbaross93 commented Jan 6, 2021

Oh wow, I didn't realize I could use <box> within the <widget> tag! So to achieve what I'm looking for, I could do something like:

<windows>
    <window name="main_bottom">
        <geometry x="5%" y="75%" width="90%" height="25%"/>
        <widget>
                  <box class="main_bottom" orientation="h"  space-evenly="false">
                      <profile/>
                      <player/>
                      <launch/>
                      <weather/>
                      <system_info/>
                  </box>
          </widget>
      </window>
</windows>

Do I need to add <main_bottom/> after the </box>? Could I also put this <box> into the <def> block, calling it "main" and then place it in the <widget> block?

@elkowar
Copy link
Owner

elkowar commented Jan 6, 2021

Oh wow, I didn't realize I could use <box> within the <widget> tag! So to achieve what I'm looking for, I could do something like:

<windows>
    <window name="main_bottom">
        <geometry x="5%" y="75%" width="90%" height="25%"/>
        <widget>
                  <box class="main_bottom" orientation="h"  space-evenly="false">
                      <profile/>
                      <player/>
                      <launch/>
                      <weather/>
                      <system_info/>
                  </box>
          </widget>
      </window>
</windows>

Do I need to add <main_bottom/> after the </box>? Could I also put this <box> into the <def> block, calling it "main" and then place it in the <widget> block?

Not sure what you mean by the adding </main_bottom> after </box>, but yes, you could definitely also put it into def and use it in the widget block.

@Barbaross93
Copy link
Author

After thinking about it more, I realized that the last <main_box/> is indeed unnecessary. I thought it may be needed to tell the window to open that particular widget. Simply doing eww open main_bottom is sufficient.

As an aside, I just wanted to say thank you so much for creating/sharing this project. You're an absolute visionary for the r/unixporn community!

@elkowar
Copy link
Owner

elkowar commented Jan 6, 2021

Thanks! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants