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

Add option to position widgets #380

Open
deusipse opened this issue Dec 19, 2023 · 5 comments
Open

Add option to position widgets #380

deusipse opened this issue Dec 19, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@deusipse
Copy link

So I've recently acquired a MacBook Pro with a notch, and turns out the bar has no way of knowing that there is a notch there. Here is what it looks like right now:
IMG_0855
I'd say that the best solution in this situation would be to move the Spotify widget to the left, so that it sits next to the process widget. Since this is probably very hard to detect, I'd suggest that there be an option to arrange the widgets manually.

@deusipse deusipse added the enhancement New feature or request label Dec 19, 2023
@Jean-Tinland
Copy link
Owner

Jean-Tinland commented Jan 5, 2024

The data part of simple-bar can be indeed quickly crowded I understand that. I'm not a fan of moving to the left part of the bar the data widgets that don't fit on the right because it could then overlap with the process widget in some case when user has a lot of spaces & processes opened. It would only move the problem elsewhere.

There is simply not enough horizontal real estate on a small screen to display all that data.

That said it is a recurring problem that I'm planning on solving with the addition of the possibility to create additional bars that could be displayed on specific displays and/or position (top or bottom).

Let me know if it would suits you. Otherwise, you can fix that with custom styles (last tab in settings) by adding a margin to the Spotify widget:

.spotify {
  margin-right: 200px; /* adjust this value */
}

Thank you for your suggestion!

Edit: typos

@deusipse
Copy link
Author

deusipse commented Jan 6, 2024

Thanks for your response - I appreciate that this problem would be a hard compromise to solve.

Screenshot 2024-01-06 at 1 54 01 pm I don't think the custom style did anything: see screenshot above. Could it be something to do with the settings I am using? Sorry for my confusion, I'm not familiar with css at all (I use C++/python/latex for my work :) ) Screenshot 2024-01-06 at 1 55 09 pm 1

@deusipse
Copy link
Author

deusipse commented Jan 6, 2024

Hmm I tried modifiying the /lib/styles/components/data/spotify.js file directly:

export const spotifyStyles = /* css */ `
.spotify {
  position: relative;
  margin-right: 240px;
  width:170px;
  background-color: var(--green);
}
.simple-bar--widgets-background-color-as-foreground .spotify {
  color: var(--green);
  background-color: transparent;
}
`;

Produces
Screenshot 2024-01-06 at 2 10 01 pm
From here I have some questions:

  • Can it work in custom styles?
  • Could the background be disabled in between so it keeps looking like a floating bar?
  • Sometimes the process widget would be too long and then it pushes the right side of the bar a bit out of the screen, which is not desirable. I tried doing
.process {
  max-width: 100px;
}

in the custom styles, but that did not work (the process widget still goes too big at times). Could this be some kind of bug with the custom styles?

  • Another option could be to position the spotify widget manually in custom styles or something like that. I don't know if this is actually possible or not. That way it wouldn't be affected by the rest of the widgets changing width. Ugh, the notch is such a pain to deal with...

Thanks!

@deusipse
Copy link
Author

deusipse commented Apr 6, 2024

@Jean-Tinland Any progress/ideas?

@Jean-Tinland
Copy link
Owner

@deusipse sorry I took some time to get back to you!

I'm only working on this project from time to time so I can't tell you when I'll be working on an update on the widget positioning system.

As for your questions:

  1. Yes it should work in the custom styles tab.
  2. No unfortunately you can't remove this background as the style sheet is based on the HTML markup: the Spotify widget is part of the data section of simple-bar which is grouping all data widget at the same level. You could try to move it manually outside in the index.jsx file and update the CSS according to your needs.
  3. You can try to change the "Widget max width" setting in order to limit the process item size. You can also toggle settings relative to the process widget: show only process app name or even only the icon.

Please let me know if this helps you.

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