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

Added secret "Beam To tile" API #237

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

NewMountain
Copy link

Hi @domferr 👋 I'm the person who filed #236

I figured rather than just add a request for something I wanted that maybe you didn't, I'd at least put up a working implementation. I am using this right now and this combined with your excellent work is perfection!

If you find anything in here useful, please use it. If you see value in this and want me to push it further, or in a different direction, let me know.

If you think this is an abomination, I will close this and apologize 😉

BTW. To show you my exact use case (give it a try).

My layout.json

[
    {
        "id": "thirdLeft",
        "tiles": [
            {
                "x": 0,
                "y": 0,
                "width": 0.30895601483836777,
                "height": 1,
                "groups": [
                    1
                ]
            },
            {
                "x": 0.30895601483836777,
                "y": 0,
                "width": 0.6910439851616308,
                "height": 1,
                "groups": [
                    1
                ]
            }
        ]
    },
    {
        "id": "thirdRight",
        "tiles": [
            {
                "x": 0,
                "y": 0,
                "width": 0.6910439851616322,
                "height": 1,
                "groups": [
                    1
                ]
            },
            {
                "x": 0.6910439851616322,
                "y": 0,
                "width": 0.30895601483836777,
                "height": 1,
                "groups": [
                    1
                ]
            }
        ]
    },
    {
        "id": "evenThirds",
        "tiles": [
            {
                "x": 0,
                "y": 0,
                "width": 0.30895601483836777,
                "height": 0.5,
                "groups": [
                    1,
                    4
                ]
            },
            {
                "x": 0,
                "y": 0.5,
                "width": 0.30895601483836777,
                "height": 0.4999999999999994,
                "groups": [
                    4,
                    1
                ]
            },
            {
                "x": 0.30895601483836777,
                "y": 0,
                "width": 0.38208797032326447,
                "height": 1,
                "groups": [
                    2,
                    1
                ]
            },
            {
                "x": 0.6910439851616322,
                "y": 0,
                "width": 0.30895601483836904,
                "height": 0.5,
                "groups": [
                    3,
                    2
                ]
            },
            {
                "x": 0.6910439851616322,
                "y": 0.5,
                "width": 0.30895601483836904,
                "height": 0.5,
                "groups": [
                    3,
                    2
                ]
            }
        ]
    },
    {
        "id": "mainScreen",
        "tiles": [
            {
                "x": 0,
                "y": 0,
                "width": 0.05511393746687864,
                "height": 1,
                "groups": [
                    1
                ]
            },
            {
                "x": 0.05511393746687864,
                "y": 0,
                "width": 0.9030206677265501,
                "height": 0.08834586466165413,
                "groups": [
                    2,
                    3,
                    1
                ]
            },
            {
                "x": 0.05511393746687864,
                "y": 0.08834586466165413,
                "width": 0.9030206677265501,
                "height": 0.8402255639097744,
                "groups": [
                    3,
                    2,
                    4,
                    1
                ]
            },
            {
                "x": 0.05511393746687864,
                "y": 0.9285714285714286,
                "width": 0.9030206677265501,
                "height": 0.0714285714285714,
                "groups": [
                    4,
                    2,
                    1
                ]
            },
            {
                "x": 0.9581346051934287,
                "y": 0,
                "width": 0.041865394806571365,
                "height": 1,
                "groups": [
                    2
                ]
            }
        ]
    }
]

and my hotkeys.json (import under tiling shell cog between layout and keybindings section)

{
    "1": {
        "layoutId": "thirdLeft",
        "tileIndex": 0,
        "binding": "<Control><Shift>1"
    },
    "2": {
        "layoutId": "evenThirds",
        "tileIndex": 0,
        "binding": "<Control><Shift>2"
    },
    "3": {
        "layoutId": "evenThirds",
        "tileIndex": 1,
        "binding": "<Control><Shift>3"
    },
    "4": {
        "layoutId": "thirdRight",
        "tileIndex": 0,
        "binding": "<Control><Shift>4"
    },
    "5": {
        "layoutId": "evenThirds",
        "tileIndex": 2,
        "binding": "<Control><Shift>5"
    },
    "6": {
        "layoutId": "mainScreen",
        "tileIndex": 2,
        "binding": "<Control><Shift>6"
    },
    "7": {
        "layoutId": "thirdLeft",
        "tileIndex": 1,
        "binding": "<Control><Shift>7"
    },
    "8": {
        "layoutId": "evenThirds",
        "tileIndex": 4,
        "binding": "<Control><Shift>8"
    },
    "9": {
        "layoutId": "evenThirds",
        "tileIndex": 3,
        "binding": "<Control><Shift>9"
    },
    "0": {
        "layoutId": "thirdRight",
        "tileIndex": 1,
        "binding": "<Control><Shift>0"
    }
}

Feel free to adjust the keybindings, but I cycled through ctrl+shift+1..0 and it bounced to all the places I wanted it to go.

@domferr
Copy link
Owner

domferr commented Jan 11, 2025

Hey thank you for all of this! I believe this is a nice solution. As you probably noticed, with Tiling Shell I heavily focus on providing the greatest user experience ever. Having that in mind, I'd like to give you my comments about this. To publish this feature on large scale, delivering it to everybody we should:

  • have a graphical way to set up keybindings. Like other Tiling Shell's features, such way must be easy to be used even by people not proficient to Linux (e.g newcomers and non devs). The configuration json you have made is definitely something good, so the graphical way could just create such configuration behind the scenes.
  • like you did, it is important to associate the keybinding to each layout, then if a layout gets deleted we can update the configuration accordingly
  • I see you had to identify each tile somehow. When a layout is edited, its tiles might change position (e.g you delete a tile). If that happens, the configuration is not valid anymore. I'm not sure about a good solution for this!
  • Let's say the user has set keybindings for each tile of one layout. If you edit a layout and then add a tile, that one will be the only one without a keybinding associated. Meaning that the user must remember to go and associate that keybinding: this is not great

Please take all of that as nitpicks and they don't mean your work is bad. Indeed, you did an amazing job! Unfortunately, for me it is very important that Tiling Shell is stable and robust for every type of users. Because of that, any new feature must handle a lot of complexities.

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