[PR #27] [MERGED] feat: new custom module #8887

Closed
opened 2026-05-23 03:55:02 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/27
Author: @JakeStanger
Created: 10/16/2022
Status: Merged
Merged: 10/23/2022
Merged by: @JakeStanger

Base: masterHead: feat/custom-widget


📝 Commits (2)

  • 3750124 feat: new custom module
  • 2a3fe33 build: remove no longer required patch, reduce build times

📊 Changes

10 files changed (+351 additions, -166 deletions)

View changed files

📝 Cargo.lock (+31 -126)
📝 Cargo.toml (+6 -9)
examples/custom.corn (+25 -0)
📝 src/bar.rs (+4 -0)
📝 src/config.rs (+3 -1)
📝 src/main.rs (+1 -0)
src/modules/custom.rs (+241 -0)
📝 src/modules/mod.rs (+1 -0)
📝 src/modules/script.rs (+4 -30)
src/script.rs (+35 -0)

📄 Description

Allows basic modules to be created from a config object, including popup content.

For example, this config (+ some CSS):

let {
    $power_menu = {
        type = "custom"
        class = "power-menu"

        bar = [ { type = "button" name="power-btn" label = "" exec = "popup:toggle" } ]

        popup = [ {
            type = "box"
            orientation = "vertical"
            widgets = [
                { type = "label" name = "header" label = "Power menu" }
                {
                    type = "box"
                    widgets = [
                        { type = "button" class="power-btn" label = "<span font-size='40pt'></span>" exec = "!shutdown now" }
                        { type = "button" class="power-btn" label = "<span font-size='40pt'></span>" exec = "!reboot" }
                    ]
                }
            ]
        } ]
    }
} in {
    end = [ { type = "clock" } $power_menu ]
}

Produces:

image

I think this is the best way to handle #10.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/27 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 10/16/2022 **Status:** ✅ Merged **Merged:** 10/23/2022 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `feat/custom-widget` --- ### 📝 Commits (2) - [`3750124`](https://github.com/JakeStanger/ironbar/commit/3750124d8cfb4783932a6b3359384f245fcd2394) feat: new custom module - [`2a3fe33`](https://github.com/JakeStanger/ironbar/commit/2a3fe33446a336b4e58490c8c1c52f50bcb16d45) build: remove no longer required patch, reduce build times ### 📊 Changes **10 files changed** (+351 additions, -166 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+31 -126) 📝 `Cargo.toml` (+6 -9) ➕ `examples/custom.corn` (+25 -0) 📝 `src/bar.rs` (+4 -0) 📝 `src/config.rs` (+3 -1) 📝 `src/main.rs` (+1 -0) ➕ `src/modules/custom.rs` (+241 -0) 📝 `src/modules/mod.rs` (+1 -0) 📝 `src/modules/script.rs` (+4 -30) ➕ `src/script.rs` (+35 -0) </details> ### 📄 Description Allows basic modules to be created from a config object, including popup content. For example, this config (+ some CSS): ```corn let { $power_menu = { type = "custom" class = "power-menu" bar = [ { type = "button" name="power-btn" label = "" exec = "popup:toggle" } ] popup = [ { type = "box" orientation = "vertical" widgets = [ { type = "label" name = "header" label = "Power menu" } { type = "box" widgets = [ { type = "button" class="power-btn" label = "<span font-size='40pt'></span>" exec = "!shutdown now" } { type = "button" class="power-btn" label = "<span font-size='40pt'></span>" exec = "!reboot" } ] } ] } ] } } in { end = [ { type = "clock" } $power_menu ] } ``` Produces: ![image](https://user-images.githubusercontent.com/5057870/196058785-042ef171-7e77-4d5c-921a-eca03c6424bd.png) I think this is the best way to handle #10. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 03:55:02 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#8887
No description provided.