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:
César González Girón
2026-07-14 23:30:08 -04:00
committed by GitHub
co-authored by Lemmy
parent dea8de954e
commit 445fe9dcac
5 changed files with 64 additions and 0 deletions
+30
View File
@@ -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