You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposal for adding JSON config support to Whim.
The aims for the JSON config would be to:
Increase the approachability of Whim to non-programmers.
Restrict the required amount of knowledge of the internals of Whim - users currently need to be aware of the keybinds, commands, and the store with its transforms and pickers.
Whim will always have the ability to be scripted using C# (.csx).
Example JSON Config
{"workspaces": [{"name": "Browser",// The specific layout engines to use for this workspace."engines": [{"type": "FocusLayoutEngine"}]},{"name": "Chat"},{"name": "Code"},{"name": "Music"}],// The layout engines to use for a workspace if not specified in the workspace config."engines": [{"type": "SliceLayoutEngine","config": {"type": "Column"}},{"type": "SliceLayoutEngine","config": {"type": "PrimaryStack"}},{"type": "TreeLayoutEngine"}],// For each monitor, the sticky workspaces that are available on that monitor."monitors": [{"workspaces": ["Browser","Chat","Music"]},{"workspaces": ["Code"]},{"workspaces": ["*"// All workspaces]}],"keybinds": [{"command": "whim.core.activate_previous_workspace","keybind": "win+ctrl+left"}],"filters": [{"type": "title","value": "whim"}],"routers": [{"type": "fileName","value": "Discord.exe","workspace": "Chat"}],"plugins": [{"name": "GapsPlugin","isEnabled": true,"config": {"gapSize": 10}},{"name": "FocusIndicatorPlugin","isEnabled": true,"config": {"color": "#ff0000","borderSize": 2}},{"name": "BarPlugin","isEnabled": true,"config": {"leftComponents": [{"type": "DateTimeWidget","config": {"format": "HH:mm","interval": 1000}}]}}]}
Issues with the Example JSON Config
Workspace Identification
Identification of workspaces could rely on names. However, workspaces can be renamed and their names may not be unique.
Windows Terminal solves this by having a GUID for each profile. This seems unwieldy for a user to manage.
voidDoConfig(IContextcontext){// First, we load the JSON config.JsonConfigjsonConfig= context.LoadConfig();// Perform a one-off subscription to the JSON config.BarConfigbarConfig= BarConfig.Load(jsonConfig);BarPluginbarPlugin=new BarPlugin(barConfig);
context.PluginManager.AddPlugin(barPlugin);// Perform an ongoing-subscription to the JSON config.GapsConfiggapsConfig= GapsConfig.Subscribe(jsonConfig);GapsPlugingapsPlugin=new GapsPlugin(gapsConfig);
context.PluginManager.AddPlugin(gapsPlugin);}
Issues with the Example C# Config
Adding a new plugin requires changes to the JSON and the C# config.
The isEnabled property is not used in the C# config.
Questions
Should we be able to mix and match JSON and CSX?
If we can, how can we refer to custom layout engines in the JSON?
If we can and there is hot-reloading, how do we handle exceptions in CSX?
Should the Komorebi rules be moved to JSON?
How do we load the JSON config?
Is hot reload desirable? Should the config only be reloaded if the user specifically executed a command to that effect?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a proposal for adding JSON config support to Whim.
The aims for the JSON config would be to:
Whim will always have the ability to be scripted using C# (.csx).
Example JSON Config
Issues with the Example JSON Config
Workspace Identification
Identification of workspaces could rely on names. However, workspaces can be renamed and their names may not be unique.
Windows Terminal solves this by having a GUID for each profile. This seems unwieldy for a user to manage.
Example C# Config
Option 1:
Issues with the Example C# Config
isEnabled
property is not used in the C# config.Questions
Beta Was this translation helpful? Give feedback.
All reactions