https://github.com/supchyan/lolibar
statusbar modding tools for windows written in C#
https://github.com/supchyan/lolibar
bottombar statusbar topbar windows wpf wpf-ui
Last synced: 6 months ago
JSON representation
statusbar modding tools for windows written in C#
- Host: GitHub
- URL: https://github.com/supchyan/lolibar
- Owner: supchyan
- License: mit
- Created: 2024-09-13T22:22:03.000Z (about 1 year ago)
- Default Branch: stable
- Last Pushed: 2025-04-11T19:43:28.000Z (6 months ago)
- Last Synced: 2025-04-14T21:13:08.903Z (6 months ago)
- Topics: bottombar, statusbar, topbar, windows, wpf, wpf-ui
- Language: C#
- Homepage:
- Size: 688 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
####
lolibar | statusbar for Windows [ 10, 11 ] | C### 🌸Introduction
This project is the **toolkit** set for modders, which allow to create statusbars for Windows. There is **NO** `ready-to-use` executable on **[Releases](https://github.com/supchyan/lolibar/releases)** page, so if you want to gain one, you can build it using this toolkit's source! Since this is C# Project, there is no complicated stuff in building procedure. Following a guide below will help you to get into it ASAP.## 🌸Similar Projects
- **[yasb](https://github.com/da-rth/yasb) (Cross platform, Python)**
- **[polybar](https://github.com/polybar/polybar) (Linux, C++)**
- **[eww](https://github.com/elkowar/eww) (Linux, Rust)**
- **[ironbar](https://github.com/JakeStanger/ironbar) (Linux, Rust)**## 🌸Average PC Usage
## 🌸Pre-requirements
All modding operations is highly recommended to do in `Visual Studio 2022+`. Moreover, to build this project, you have to install `.NET 8.0 SDK`. Alternatively, you can use other `.NET SDK` versions as well, but `stable` branch targets to `.NET 8.0`, so any issues with different SDK versions you have to solve locally.## 🌸Modding Basics
Have you ever tried to write mods for video games? So, this toolkit provide the same vibe:
```csharp
namespace LolibarApp.Mods;class ExampleEmptyMod : LolibarMod
{
public override void PreInitialize()
{
// Put your Pre-Initialization code here...
}
public override void Initialize()
{
// Put your Initialization code here...
}
public override void Update()
{
// Put your Updatable code here...
}
}
```
As you can see, this code looks familiar with any other mod body. You can handle every single part of Lolibar's libraries here!## 🌸Your First mod
> [!TIP]
> It's highly recommended to store all mods inside **[Mods](https://github.com/supchyan/lolibar/tree/stable/Mods/)** folder.The first step of your modding journey - **create a mod class**. Let me explain basics on pseudo `MyFirstMod.cs` example:
```cs
namespace LolibarApp.Mods;class MyFirstMod : LolibarMod
{
public override void PreInitialize() { }
public override void Initialize() { }
public override void Update() { }
}
```
Code you can see above is **absolute minimum** your mod must contain. Without that, Lolibar won't compile properly. Now, talk about every part in details ↓↓↓```cs
namespace LolibarApp.Mods;
```
`namespace` have to be set as `LolibarApp.Mods` unless you want to prevent your mod from being detected by `ModLoader`.```cs
public override void PreInitialize() { }
```
`PreInitialize()` hook useful to initialize something before `Initialize()` hook invoked, because calls before initialization process started. I recommend you to setup all properties in there. What is `properties`? Let's talk about them, referencing to **[LolibarProperties](https://github.com/supchyan/lolibar/blob/stable/Source/Tools/LolibarProperties.cs)** class:
```cs
// Properties stores values, which uses in Lolibar's resources.
// It can be anything, starting from styles, such as Main Color (BarColor),
// ending by triggers, which simulates or provides something.// Basic example:
public override void PreInitialize()
{
BarUpdateDelay = 250;
BarHeight = 36;
BarColor = LolibarHelper.SetColor("#2a3247");
BarContainersContentColor = LolibarHelper.SetColor("#6f85bd");
}
```
This example overrides `4` different properties, which will be applied to all Lolibar's components including Lolibar itself during initialization process.```cs
public override void Initialize() { }
```
`Initialize()` hook is about to **initialize** something on application's launch. The most common usage is **initialization of the containers**. What is `container`? Let's get into it, referencing to **[LolibarContainer](https://github.com/supchyan/lolibar/blob/stable/Source/Tools/LolibarContainer.cs)** class:
```cs
// All "Buttons" / "Data Fields" inside your statusbar
// have to be generated by LolibarContainer class.
// This class automatically does job of formatting,
// structing and comparing content inside specified components.
// So that component's Frankenstein can be called simply - `Container`.// How to create one, using LolibarContainer class:
public override void Initialize()
{
LolibarContainer HelloContainer = new()
{
Name = "HelloContainer",
Parent = Lolibar.BarCenterContainer,
Text = "Hello!",
HasBackground = true
};
HelloContainer.Create();
}
```*
Result of the initialization process we can observe after Lolibar's launch.*Here we can see a new object instance, that has a couple of local properties inside. Let me explain about those, which certain example has:
* `Name` - Initial container name. Uses for automatic resources initialization;
* `Parent` - Any other container, where **your container** should be placed;
* `Text` - Text content of the container;
* `HasBackground` - Trigger to draw border around the container. It's semi-transparent and fits well with the whole statusbar theme.I used `Lolibar.BarCenterContainer` here, which is tricky part to put `HelloContainer` into the one of default containers. Lolibar has `3` default containers to place custom containers inside:
* `BarLeftContainer` - Most left side of the statusbar;
* `BarRightContainer` - Most right side of the statusbar.
* `BarCenterContainer` - This container is centered relative to `BarLeftContainer` and `BarRightContainer`. This is not a center of the status bar!We've drawn a static container. Now, let's update it's content, using `Update()` hook:
```cs
public override void Update() { }
```
This hook is about to **update** something along statusbar's execution process. `Update()` hook has an **Update Delay** - time span, between loop iterations. Yes, `Update()` is an infinite loop hook, so keep it in mind. The interations delay can be modified by `BarUpdateDelay` property, which can be defined in `PreInitialize()` hook as well. To understand `Update()`'s principles better, check **[Examples](https://github.com/supchyan/lolibar/tree/stable/Mods/Examples)** section. By the way, **[Examples](https://github.com/supchyan/lolibar/tree/stable/Mods/Examples)** section is **great start point** in your modding journey, because it has various examples of how to create one or other thing. Anyway, let's get back to updating info in `HelloContainer`:
```cs
using LolibarApp.Source.Tools;
using LolibarApp.Source;namespace LolibarApp.Mods;
class MyFirstMod : LolibarMod
{
// I made this container as external var to get access to it under different hooks.
LolibarContainer HelloContainer;public override void PreInitialize() { }
public override void Initialize()
{
HelloContainer = new()
{
Name = "HelloContainer",
Parent = Lolibar.BarCenterContainer,
Text = "Hello!",
HasBackground = true
};
HelloContainer.Create();
}
public override void Update()
{
HelloContainer.Text = DateTime.Now.ToString(); // Change instance's text content ...
HelloContainer.Update(); // ... And update it in resources// Now, text inside `HelloContainer` equals current OS time after every `BarUpdateDelay`.
}
}
// Simple enough, isn't it? 🐳
```*
`HelloContainer` shows current time (every 1000ms by default).*To build 'n run `Lolibar` project, you need to select preferred profile at the top of the VS and push any of `▶` `▷` buttons.
## 🌸Next steps
Inspired enough to start modding? Then, get into **[Examples](https://github.com/supchyan/lolibar/tree/master/Mods/Examples)** section to learn more about Lolibar's capabilities. As I mentioned before, **[Examples](https://github.com/supchyan/lolibar/tree/stable/Mods/Examples)** section is **great start point** in your modding journey. Especially **[Basics](https://github.com/supchyan/lolibar/tree/stable/Mods/Examples/Basics)** section. Good luck!## 🌸Special thanks
- **[MouseHook](https://github.com/ikst/Ikst.MouseHook) by @ikst**
- **[VirtualDesktop](https://github.com/MScholtes/VirtualDesktop) by @MScholtes**
- **[WindowsMediaController](https://github.com/DubyaDude/WindowsMediaController) by @DubyaDude**
- **[The best music covers I've ever heard](https://www.youtube.com/@vallyexe) by @vally.exe**## 🌸In the end...
#####
😎My lolibar's mod showcase---
#####☕Have any questions or suggestions? Feel free to contact me on my [Discord](https://discord.gg/dGF8p9UGyM) Server!