neuromorph / openbar

A GNOME Shell extension for theming Gnome Top Bar / Top Panel, Menus, Dash/Dock, Gnome Shell and Gtk/Flatpak Apps.
https://extensions.gnome.org/extension/6580/open-bar/
GNU General Public License v3.0
268 stars 4 forks source link

Enable setting of margins separately #31

Closed finnar-bin closed 5 months ago

finnar-bin commented 6 months ago

It would be awesome if we'd be able to set the bar margins separately. I'm currently using forge for the tiling and there's a lot of space in between the bar and the windows since Forge also doesn't allow setting the gaps separately per position.

image

neuromorph commented 6 months ago

I would prefer to keep the margins symmetric, but I will look into it. I am currently overhauling auto-theming along with extending the styles to the shell and fixing bugs/quirks so a lot needs to be streamlined first. You may also want to comment on Forge issue #272 which seems to deal with the same.

Thanks for your suggestion!

finnar-bin commented 6 months ago

Gotcha, yeah it would be awesome to be able to set it separately but I get your point. I'll check out the forge issue as well.

neuromorph commented 6 months ago

In the meanwhile I can guide you if you are willing to make a change in the extension code in your local installation. This should allow to achieve the same without the GUI. You need to go to the extension directory (~/.local/share/gnome-shell/extensions/openbar@neuromorph) and open stylesheets.js. At line num 677, you can find code below (as I see you are using Tri/Islands Bar):

if(bartype == 'Islands' || bartype == 'Trilands') {
        panelStyle += 
        ` margin: ${margin}px ${1.5*margin}px; 

The syntax currently is for symmetric margins, so it goes like: margin: <top/bottom> <left/right>. For separate control, you can change it to: margin: <top> <right> <bottom> <left>. To get the setting param value, we use ${margin}px pixels. You can use hard coded values OR fractions of this param e.g. if you only want to minimize bottom margin to 10%:

margin: ${margin}px ${1.5*margin}px ${0.1*margin}px ${1.5*margin}px;

Note: after any change you make, you will need to reload Gnome (log out/in) to test the changes.

One more thing, if you want to try out Openbar 2.0 with the enhancements I mentioned earlier, you can clone it from openbar2.0 branch. Feedback on it will be appreciated in issue #29 . Thanks.

finnar-bin commented 6 months ago

Just got back from a holiday, yeah sure I'll check it out when I get some downtime at work. Also, thanks for sharing how to manually do it, I'll take a peek at that as well.

neuromorph commented 5 months ago

I will keep it at manual mod for now (described above). Closing this. Hope you like the new version of OpenBar.