feat: Add mangowm keymode plugin (#14)
* feat(mangowm-keymode): init plugin * docs: update manifest * chore: filename * Update plugin.toml --------- Co-authored-by: Lemmy <studio@quadbyte.net>
This commit is contained in:
co-authored by
Lemmy
parent
dea8de954e
commit
445fe9dcac
@@ -0,0 +1,3 @@
|
|||||||
|
# mangowm-keymode
|
||||||
|

|
||||||
|
**Mangowm Keymode** is a bar widget plugin written for Noctalia (v5) that displays the current keymode from window manager [MANGOWM](https://mangowm.github.io/). It also notifies you when the keymode changes. Notification and bar text are configurable and can be disabled.
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
local showText = barWidget.getConfig("show_text")
|
||||||
|
local notifyChange = barWidget.getConfig("notify_change")
|
||||||
|
|
||||||
|
local currentKeymode = "default"
|
||||||
|
|
||||||
|
noctalia.runStream("mmsg watch keymode", function(line)
|
||||||
|
local data = noctalia.json.decode(line)
|
||||||
|
if data and data.keymode then
|
||||||
|
if currentKeymode ~= data.keymode then
|
||||||
|
currentKeymode = data.keymode
|
||||||
|
if notifyChange then
|
||||||
|
noctalia.notify("Keymode changed", currentKeymode)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
function update()
|
||||||
|
noctalia.setUpdateInterval(1000)
|
||||||
|
barWidget.setGlyph("keyboard")
|
||||||
|
if showText then
|
||||||
|
barWidget.setText(currentKeymode)
|
||||||
|
else
|
||||||
|
barWidget.setText("")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onClick()
|
||||||
|
noctalia.notify("Keymode", currentKeymode)
|
||||||
|
end
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
id = "gambled23/mangowm-keymode"
|
||||||
|
name = "Mangowm Keymode"
|
||||||
|
version = "1.0.0"
|
||||||
|
min_noctalia = "5.0.0"
|
||||||
|
author = "gambled23"
|
||||||
|
license = "MIT"
|
||||||
|
dependencies = ["mmsg"]
|
||||||
|
icon = "keyboard"
|
||||||
|
deprecated = false
|
||||||
|
description = "Mangowm keymode notifier"
|
||||||
|
tags = ["bar", "mangowc"]
|
||||||
|
|
||||||
|
[[widget]]
|
||||||
|
id = "mangowm-keymode"
|
||||||
|
entry = "keymode.luau"
|
||||||
|
|
||||||
|
[[widget.setting]]
|
||||||
|
key = "show_text"
|
||||||
|
type = "bool"
|
||||||
|
label_key = "settings.show_text.label"
|
||||||
|
default = true
|
||||||
|
|
||||||
|
[[widget.setting]]
|
||||||
|
key = "notify_change"
|
||||||
|
type = "bool"
|
||||||
|
label_key = "settings.notify_change.label"
|
||||||
|
default = true
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"settings.show_text.label": "Show text on bar",
|
||||||
|
"settings.notify_change.label": "Notify change"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user