From 1ebffbfd91dc22ec592c950f642917061a8a6d70 Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Sat, 20 Jun 2026 00:37:20 +0200 Subject: [PATCH] noctalia: add local wvkbd osk bar plugin + ui tweaks --- home/niri.nix | 7 +-- home/noctalia-plugins/osk/plugin.toml | 70 +++++++++++++++++++++++++++ home/noctalia-plugins/osk/toggle.luau | 38 +++++++++++++++ home/noctalia.nix | 13 ++++- 4 files changed, 121 insertions(+), 7 deletions(-) create mode 100644 home/noctalia-plugins/osk/plugin.toml create mode 100644 home/noctalia-plugins/osk/toggle.luau diff --git a/home/niri.nix b/home/niri.nix index 5685df7..7cce916 100644 --- a/home/niri.nix +++ b/home/niri.nix @@ -331,7 +331,8 @@ in matches = [ { app-id = "dev.noctalia.Noctalia.Settings"; } ]; - opacity = 0.85; + opacity = 0.9; + draw-border-with-background = false; open-floating = true; default-column-width = { proportion = 0.5; @@ -344,10 +345,6 @@ in y = 20; relative-to = "top"; }; - background-effect = { - blur = true; - xray = true; - }; } # Steam notifications diff --git a/home/noctalia-plugins/osk/plugin.toml b/home/noctalia-plugins/osk/plugin.toml new file mode 100644 index 0000000..109d5af --- /dev/null +++ b/home/noctalia-plugins/osk/plugin.toml @@ -0,0 +1,70 @@ +id = "local/osk" +name = "wvkbd Toggle" +version = "0.2.0" +min_noctalia = "5.0.0" +author = "local" +description = "Bar button to toggle the wvkbd on-screen keyboard with style options." +icon = "keyboard" + +[[widget]] +id = "toggle" +entry = "toggle.luau" + + # Geometry & alpha + [[widget.setting]] + key = "height" + type = "int" + label = "Landscape height (px)" + default = 200 + + [[widget.setting]] + key = "rounding" + type = "int" + label = "Corner rounding (px)" + default = 10 + + [[widget.setting]] + key = "alpha" + type = "int" + label = "Alpha (0-255)" + default = 236 + min = 0 + max = 255 + + # Colors — raw wvkbd format: rrggbb or rrggbbaa (no leading #) + [[widget.setting]] + key = "bg" + type = "string" + label = "Background color (rrggbb|aa)" + default = "" + + [[widget.setting]] + key = "fg" + type = "string" + label = "Key color (rrggbb|aa)" + default = "" + + [[widget.setting]] + key = "press" + type = "string" + label = "Pressed key color (rrggbb|aa)" + default = "" + + [[widget.setting]] + key = "text" + type = "string" + label = "Key text color (rrggbb|aa)" + default = "" + + # Layers & behavior + [[widget.setting]] + key = "layers" + type = "string" + label = "Layers (comma-separated, e.g. full,emoji)" + default = "" + + [[widget.setting]] + key = "non_exclusive" + type = "bool" + label = "Non-exclusive (float over windows)" + default = false diff --git a/home/noctalia-plugins/osk/toggle.luau b/home/noctalia-plugins/osk/toggle.luau new file mode 100644 index 0000000..e48e43a --- /dev/null +++ b/home/noctalia-plugins/osk/toggle.luau @@ -0,0 +1,38 @@ +local BIN = "wvkbd-mobintl" + +-- Build the wvkbd flag string from the widget's style settings. +local function buildArgs() + local args = {} + + local function add(value, flag) + if value ~= nil and value ~= "" then + table.insert(args, flag .. " " .. tostring(value)) + end + end + + add(barWidget.getConfig("height"), "-L") + add(barWidget.getConfig("rounding"), "-R") + add(barWidget.getConfig("alpha"), "--alpha") + add(barWidget.getConfig("bg"), "--bg") + add(barWidget.getConfig("fg"), "--fg") + add(barWidget.getConfig("press"), "--press") + add(barWidget.getConfig("text"), "--text") + add(barWidget.getConfig("layers"), "-l") + + if barWidget.getConfig("non_exclusive") == true then + table.insert(args, "--non-exclusive") + end + + return table.concat(args, " ") +end + +function update() + noctalia.setUpdateInterval(60000) + barWidget.setGlyph("keyboard") + barWidget.setTooltip("Toggle wvkbd on-screen keyboard") +end + +function onClick() + local launch = BIN .. " " .. buildArgs() + noctalia.runAsync("pkill -x " .. BIN .. " || setsid " .. launch) +end diff --git a/home/noctalia.nix b/home/noctalia.nix index 8474672..479d754 100644 --- a/home/noctalia.nix +++ b/home/noctalia.nix @@ -202,7 +202,7 @@ in transparency_mode = "glass"; # solid | soft | glass; # open all panels attached to the bar, near the click position - launcher_placement = "floating"; + launcher_placement = "center"; clipboard_placement = "attached"; control_center_placement = "attached"; wallpaper_placement = "attached"; @@ -259,8 +259,8 @@ in capsule_opacity = 1.0; start = [ + "osk" "launcher" - #Todo osd keyboard "spacer" "sysmon" "media" @@ -297,6 +297,13 @@ in title_scroll = "on_hover"; hide_when_no_media = true; }; + osk = { + type = "local/osk:toggle"; + }; + }; + + plugins = { + enabled = [ "local/osk" ]; }; theme = { @@ -337,4 +344,6 @@ in }; }; + + xdg.dataFile."noctalia/plugins/osk".source = ./noctalia-plugins/osk; }