domferr / tilingshell

Extend Gnome Shell with advanced tiling window management. Supports multiple monitors, Windows 11 Snap Assistant, Fancy Zones, customised tiling layouts and more.
https://extensions.gnome.org/extension/7065/tiling-shell/
GNU General Public License v2.0
691 stars 20 forks source link

[Feature request] Add "default" key support in json #204

Open sebastiaanfranken opened 1 week ago

sebastiaanfranken commented 1 week ago

Describe the feature you'd like A new option in the JSON file to be able to make a custom-defined/coded layout the default one, for example:

[
    {
        "id": "split-half",
        "default": true,
        "tiles": [
            {
                "x": 0,
                "y": 0,
                "width": 0.5,
                "height": 1,
                "groups": [
                    2
                ]
            },
            {
                "x": 0.5,
                "y": 0,
                "width": 0.5,
                "height": 1,
                "groups": [
                    1
                ]
            }
        ]
    }
]

So the split-half becomes the (new) default choice after importing the layouts. I'm not sure how feasible this would be, since with this you add a lot more code complexity and could also create new bugs..

thyttan commented 1 week ago

If you remove all layouts and recreate them starting with the half-split layout - would that work today without changes?

domferr commented 1 week ago

Hey! Thank you for this suggestion. What is the purpose you were thinking about for the default attribute? As of today there isn't any notion of default layout since it is always picked by the user and Tiling Shell focuses on learning and reusing your past choices

sebastiaanfranken commented 1 week ago

I've noticed it always, at least for me, falls back to the 1st layout that's defined and not the one I want to use. I've checked with dconf-editor and that has [['Layout 1'], ['Layout 1']] as it's value for selected-layouts. Maybe what I am experiencing is a bug?

Anyway, my idea behind the default key was to set a (first time) default layout which tilingshell can use as a starting point if the user has no default(s) set. I've looked at some of the TS code and I saw that it gets stored as a gconf/dconf key=>value pair and that it, as you said, uses user input/past actions. So that kind of makes my feature request pointless, I think.

domferr commented 6 days ago

Yeah, when you first install Tiling Shell it does not know anything about your preferred layout and it already comes with some predefined layouts. The first predefined is considered default layout until the user picks its favourite

sebastiaanfranken commented 5 days ago

That's the odd thing here, when I create my own layout(s) and set one as my favourite that gets used on the currently active workspace only. If I switch to another workspace, Tiling Shell rverts to the first one that's predefined. I guess I should file a bug report for this, since this is clearly a bug

domferr commented 5 days ago

Uh I understand what you are experiencing! Yes, workspace support is new and when switching to a new workspace it defaults to the first layout. There were some talks about this here #182 and I'm starting to work on it!