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

Improve Compositor.json #23

Open
Sammy99jsp opened this issue Aug 1, 2022 · 6 comments
Open

Improve Compositor.json #23

Sammy99jsp opened this issue Aug 1, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@Sammy99jsp
Copy link
Member

As suggested by @dorakuflu
I'll quote the their example Compositor.json here as it is good idea.

I'll also add a couple more suggestions:

  • Make variables more distinguishable from plaintext by using some sort of syntax (e.g. %mod%, {{mod}}, $mod)
  • Make Compositor.json a .jsonc file to allow comments.
{
	"variables": {
		"mod": "Mod4",
		"term": "avdanterm",
		"browser": "firefox"
	},
	"tiling": {
		"keybinds": {
			"openTerm": "mod+Enter",
			"openBrowser": "mod+b",
			"closeWindow": "mod+q",
			"reloadConfig": "mod+Shift+c",
			"shutdownPanel": "mod+Shift+s",
			"moveFocusLeft": "mod+Left",
			"moveFocusRight": "mod+Right",
			"moveFocusUp": "mod+Up",
			"moveFocusDown": "mod+Down",
			"moveWindowLeft": "mod+Shift+Left",
			"moveWindowRight": "mod+Shift+Right",
			"moveWindowUp": "mod+Shift+Up",
			"moveWindowDown": "mod+Shift+Down",
			"workspace1": "mod+1",
			"workspace2": "mod+2",
			"workspace3": "mod+3",
			"workspace4": "mod+4",
			"moveWindowWorkspace1": "mod+Shift+1",
			"moveWindowWorkspace2": "mod+Shift+2",
			"moveWindowWorkspace3": "mod+Shift+3",
			"moveWindowWorkspace4": "mod+Shift+4",
			"splitVertically": "mod+v",
			"splitHorizontally": "mod+h",
			"fullscreen": "mod+f",
			"switchModes": "mod+Shift+Space",
			"resizeLeft": "mod+r+Left",
			"resizeRight": "mod+r+Right",
			"resizeUp": "mod+r+Up",
			"resizeDown": "mod+r+Down"
		}
	}
}
@Sammy99jsp Sammy99jsp self-assigned this Aug 1, 2022
@Sammy99jsp
Copy link
Member Author

Sammy99jsp commented Aug 1, 2022

For example, for the workspace keybinds, we could do something like:

{
    /* ... */
    "workspace(n)": "{mod}+{n}",
    "moveWindowWorkspace(n)": "{mod}+{n}",
    /* ... */
}

@ghost ghost closed this as completed Aug 2, 2022
@dorakuflu
Copy link
Contributor

For example, for the workspace keybinds, we could do something like:

{
    /* ... */
    "workspace(n)": "{mod}+{n}",
    "moveWindowWorkspace(n)": "{mod}+{n}",
    /* ... */
}

Just took a look at your pr, very nice work on the compositor! I'm just curious how we could define the {n} variable here (since it can have more than one value at a time). Also, did you use brackets to specifiy that the value inside is a variable, or did you use them to to specify that the variable inside can have multiple values (like n can be 1,2,3...).

@Sammy99jsp
Copy link
Member Author

Sammy99jsp commented Aug 4, 2022

Hey, sorry I didn't see this!

Just took a look at your pr, very nice work on the compositor!

First of all, thanks!
I'll probably be spending most of the next couple days on getting the functionalities me and you have suggested working.

I'm just curious how we could define the {n} variable here (since it can have more than one value at a time). Also, did you use brackets to specify that the value inside is a variable, or did you use them to to specify that the variable inside can have multiple values (like n can be 1,2,3...).

I was thinking something similar to macros, so I guess, kind of both options.
The brackets are there to show that any variables belong to the macro itself (and in this case, means that the value of n does change). In the event that there was a global variable called n, I would imagine that its value would be overridden.

@Sammy99jsp Sammy99jsp reopened this Aug 4, 2022
@Sammy99jsp
Copy link
Member Author

I'll actually re-open this issue since there's a few other things around the configuration that can still be up for discussion (and so I can get Discord notifications, lol).

@Sammy99jsp Sammy99jsp added the enhancement New feature or request label Aug 4, 2022
@Sammy99jsp Sammy99jsp moved this to In Progress in Compositor Aug 4, 2022
@Sammy99jsp
Copy link
Member Author

What would be cool to see are error (or warning messages) with line and column numbers.
Although with serde, this can prove quite... difficult to say the least.

@Kibalchish47
Copy link
Contributor

So speaking of the MoveWindowLeft and the other MoveWindow ones, we can make a standard chunk, say 50 pixels, and using the keyboard shortcut the window will get smaller and smaller by this definite amount (here it's 50 px). Thus, it can be changed in the config file

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
Status: In Progress
Development

No branches or pull requests

3 participants