Bar Plugin
The BarPlugin adds a configurable bar at the top of a screen.
Configuration
The BarConfig takes in three lists of BarComponents in its constructor. These correspond to the left, center, and right components on the bar.
The bar can be styled using XAML - see Styling.
Note
The height of the bar can be configured the XAML styling. However, BarConfig.Height takes precedence over the height specified in the XAML.
Available Widgets
When creating a component, use the CreateComponent
method on the widget class. For example:
List<BarComponent> leftComponents = new() { WorkspaceWidget.CreateComponent() };
List<BarComponent> centerComponents = new() { FocusedWindowWidget.CreateComponent() };
List<BarComponent> rightComponents = new()
{
BatteryWidget.CreateComponent(),
ActiveLayoutWidget.CreateComponent(),
DateTimeWidget.CreateComponent(),
};
Example Config
#r "WHIM_PATH\whim.dll"
#r "WHIM_PATH\plugins\Whim.Bar\Whim.Bar.dll"
using Whim;
using Whim.Bar;
void DoConfig(IContext context)
{
// ...
List<BarComponent> leftComponents = new() { WorkspaceWidget.CreateComponent() };
List<BarComponent> centerComponents = new() { FocusedWindowWidget.CreateComponent() };
List<BarComponent> rightComponents = new()
{
BatteryWidget.CreateComponent(),
ActiveLayoutWidget.CreateComponent(),
DateTimeWidget.CreateComponent(),
};
BarConfig barConfig = new(leftComponents, centerComponents, rightComponents);
BarPlugin barPlugin = new(context, barConfig);
context.PluginManager.AddPlugin(barPlugin);
// ...
}
return DoConfig;
Commands
N/A