diff --git a/Pictures/Wallpapers/wink.png b/Pictures/Wallpapers/wink.png new file mode 100644 index 0000000..acb7195 Binary files /dev/null and b/Pictures/Wallpapers/wink.png differ diff --git a/dot_config/noctalia/colors.json b/dot_config/noctalia/colors.json new file mode 100644 index 0000000..fb88025 --- /dev/null +++ b/dot_config/noctalia/colors.json @@ -0,0 +1,18 @@ +{ + "mError": "#f38ba8", + "mHover": "#94e2d5", + "mOnError": "#11111b", + "mOnHover": "#11111b", + "mOnPrimary": "#11111b", + "mOnSecondary": "#11111b", + "mOnSurface": "#cdd6f4", + "mOnSurfaceVariant": "#a3b4eb", + "mOnTertiary": "#11111b", + "mOutline": "#4c4f69", + "mPrimary": "#cba6f7", + "mSecondary": "#fab387", + "mShadow": "#11111b", + "mSurface": "#1e1e2e", + "mSurfaceVariant": "#313244", + "mTertiary": "#94e2d5" +} diff --git a/dot_config/noctalia/colorschemes/.keep b/dot_config/noctalia/colorschemes/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/noctalia/notification-rules.json b/dot_config/noctalia/notification-rules.json new file mode 100644 index 0000000..afa7436 --- /dev/null +++ b/dot_config/noctalia/notification-rules.json @@ -0,0 +1,4 @@ +{ + "rules": [ + ] +} diff --git a/dot_config/noctalia/plugins.json b/dot_config/noctalia/plugins.json new file mode 100644 index 0000000..2edf3e8 --- /dev/null +++ b/dot_config/noctalia/plugins.json @@ -0,0 +1,28 @@ +{ + "sources": [ + { + "enabled": true, + "name": "Noctalia Plugins", + "url": "https://github.com/noctalia-dev/noctalia-plugins" + } + ], + "states": { + "catwalk": { + "enabled": true, + "sourceUrl": "https://github.com/noctalia-dev/noctalia-plugins" + }, + "keybind-cheatsheet": { + "enabled": true, + "sourceUrl": "https://github.com/noctalia-dev/noctalia-plugins" + }, + "niri-workspaces": { + "enabled": true, + "sourceUrl": "https://github.com/noctalia-dev/noctalia-plugins" + }, + "noctalia-calculator": { + "enabled": true, + "sourceUrl": "https://github.com/noctalia-dev/noctalia-plugins" + } + }, + "version": 2 +} diff --git a/dot_config/noctalia/plugins/catwalk/BarWidget.qml b/dot_config/noctalia/plugins/catwalk/BarWidget.qml new file mode 100644 index 0000000..ad38e6b --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/BarWidget.qml @@ -0,0 +1,193 @@ +import QtQuick +import QtQuick.Effects +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Modules.Bar.Extras +import qs.Services.UI +import qs.Widgets +import qs.Services.System + +Item { + id: root + + property var pluginApi: null + property ShellScreen screen + property string widgetId: "" + property string section: "" + property int sectionWidgetIndex: -1 + property int sectionWidgetsCount: 0 + + // Per-screen bar properties + readonly property string screenName: screen?.name ?? "" + readonly property string barPosition: Settings.getBarPositionForScreen(screenName) + readonly property bool barIsVertical: barPosition === "left" || barPosition === "right" + readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName) + + property url currentIconSource + + property string tooltipText: { + if (!pluginApi) return ""; + return root.isRunning ? (pluginApi.tr("tooltip.running") || "Running") : (pluginApi.tr("tooltip.sleeping") || "Sleeping"); + } + + property string tooltipDirection: BarService.getTooltipDirection() + property bool enabled: true + property bool allowClickWhenDisabled: false + property bool hovering: false + + property color colorBg: Color.mSurfaceVariant + property color colorFg: Color.mPrimary + property color colorBgHover: Color.mHover + property color colorFgHover: Color.mOnHover + property color colorBorder: Color.mOutline + property color colorBorderHover: Color.mOutline + property real customRadius: Style.radiusL + + signal entered + signal exited + signal clicked + signal rightClicked + signal middleClicked + signal wheel(int angleDelta) + + readonly property real contentWidth: barIsVertical ? capsuleHeight : Math.round(capsuleHeight + Style.marginXS * 2) + readonly property real contentHeight: capsuleHeight + + implicitWidth: contentWidth + implicitHeight: contentHeight + + // --- Catwalk Specific Logic --- + property int frameIndex: 0 + property int idleFrameIndex: 0 + readonly property bool isRunning: root.pluginApi?.mainInstance?.isRunning ?? false + readonly property var icons: root.pluginApi?.mainInstance?.icons || [] + readonly property var idleIcons: root.pluginApi?.mainInstance?.idleIcons || [] + readonly property real cpuUsage: root.pluginApi?.mainInstance?.cpuUsage ?? 0 + + function openPanel() { + if (pluginApi) { + var result = pluginApi.openPanel(root.screen); + Logger.i("Catwalk", "OpenPanel result:", result); + } else { + Logger.e("Catwalk", "PluginAPI is null"); + } + } + + function openExternalMonitor() { + Quickshell.execDetached(["sh", "-c", Settings.data.systemMonitor.externalMonitor]); + } + + Timer { + interval: Math.max(30, 200 - root.cpuUsage * 1.7) + running: root.isRunning + repeat: true + onTriggered: { + root.frameIndex = (root.frameIndex + 1) % root.icons.length + } + } + + Timer { + interval: 400 + running: !root.isRunning + repeat: true + onTriggered: { + root.idleFrameIndex = (root.idleFrameIndex + 1) % root.idleIcons.length + } + } + + currentIconSource: (root.icons && root.icons.length > 0 && root.idleIcons && root.idleIcons.length > 0) + ? (root.isRunning + ? Qt.resolvedUrl(root.icons[root.frameIndex % root.icons.length]) + : Qt.resolvedUrl(root.idleIcons[root.idleFrameIndex % root.idleIcons.length])) + : "" + + Rectangle { + id: visualCapsule + x: Style.pixelAlignCenter(parent.width, width) + y: Style.pixelAlignCenter(parent.height, height) + width: root.contentWidth + height: root.contentHeight + opacity: root.enabled ? Style.opacityFull : Style.opacityMedium + color: mouseArea.containsMouse ? Color.mHover : Style.capsuleColor + radius: Math.min((customRadius >= 0 ? customRadius : Style.iRadiusL), width / 2) + border.color: Style.capsuleBorderColor + border.width: Style.capsuleBorderWidth + + Behavior on color { + ColorAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutQuad + } + } + + Image { + id: iconImage + source: root.currentIconSource + x: Style.pixelAlignCenter(parent.width, width) + y: Style.pixelAlignCenter(parent.height, height) + + width: Style.toOdd(visualCapsule.width - Style.marginXS * 2) + height: width + + // Render SVG at exact target size for crisp output + sourceSize: Qt.size(width, height) + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: false + + // This enables the "mask" behavior to recolor the icon + layer.enabled: true + layer.effect: MultiEffect { + colorization: 1.0 + colorizationColor: Settings.data.colorSchemes.darkMode ? "white" : "black" + } + } + } + + MouseArea { + id: mouseArea + anchors.fill: parent + cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton + hoverEnabled: true + onEntered: { + root.hovering = true; + if (root.tooltipText) { + TooltipService.show(root, root.tooltipText, root.tooltipDirection); + } + root.entered(); + } + onExited: { + root.hovering = false; + if (root.tooltipText) { + TooltipService.hide(); + } + root.exited(); + } + onClicked: function (mouse) { + if (root.tooltipText) { + TooltipService.hide(); + } + + Logger.i("Catwalk", "Clicked! API:", !!pluginApi, "Screen:", root.screen ? root.screen.name : "null"); + + if (!root.enabled && !root.allowClickWhenDisabled) { + return; + } + // Open Panel on left/right click + // Open external monitor on middle click + if (mouse.button === Qt.LeftButton) { + root.openPanel(); + root.clicked(); + } else if (mouse.button === Qt.RightButton) { + root.openPanel(); + root.rightClicked(); + } else if (mouse.button === Qt.MiddleButton) { + root.openExternalMonitor(); + root.middleClicked(); + } + } + onWheel: wheel => root.wheel(wheel.angleDelta.y) + } +} diff --git a/dot_config/noctalia/plugins/catwalk/DesktopWidget.qml b/dot_config/noctalia/plugins/catwalk/DesktopWidget.qml new file mode 100644 index 0000000..931bf33 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/DesktopWidget.qml @@ -0,0 +1,85 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Effects +import Quickshell +import qs.Commons +import qs.Modules.DesktopWidgets +import qs.Widgets +import qs.Services.System + +DraggableDesktopWidget { + id: root + property var pluginApi: null + + implicitWidth: 200 + implicitHeight: 80 + + showBackground: !(root.pluginApi?.mainInstance?.hideBackground ?? false) + + property int frameIndex: 0 + + readonly property var icons: root.pluginApi?.mainInstance?.icons || [] + + property int idleFrameIndex: 0 + readonly property var idleIcons: root.pluginApi?.mainInstance?.idleIcons || [] + + readonly property bool isRunning: root.pluginApi?.mainInstance?.isRunning ?? false + readonly property real cpuUsage: root.pluginApi?.mainInstance?.cpuUsage ?? 0 + + Timer { + interval: Math.max(30, 200 - root.cpuUsage * 1.7) + running: root.isRunning + repeat: true + onTriggered: { + root.frameIndex = (root.frameIndex + 1) % root.icons.length + } + } + + Timer { + interval: 400 + running: !root.isRunning + repeat: true + onTriggered: { + root.idleFrameIndex = (root.idleFrameIndex + 1) % root.idleIcons.length + } + } + + property url currentIconSource: (root.icons && root.icons.length > 0 && root.idleIcons && root.idleIcons.length > 0) + ? (root.isRunning + ? Qt.resolvedUrl(root.icons[root.frameIndex % root.icons.length]) + : Qt.resolvedUrl(root.idleIcons[root.idleFrameIndex % root.idleIcons.length])) + : "" + + RowLayout { + anchors.fill: parent + spacing: 5 + + Image { + id: iconImage + source: root.currentIconSource + Layout.fillHeight: true + Layout.preferredWidth: height + + sourceSize.height: height + sourceSize.width: width + + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: false + + layer.enabled: true + layer.effect: MultiEffect { + colorization: 1.0 + colorizationColor: Settings.data.colorSchemes.darkMode ? "white" : "black" + } + } + + Text { + text: Math.round(root.cpuUsage) + "%" + color: Settings.data.colorSchemes.darkMode ? "white" : "black" + font.bold: true + font.pixelSize: 40 + Layout.alignment: Qt.AlignVCenter + } + } +} diff --git a/dot_config/noctalia/plugins/catwalk/Main.qml b/dot_config/noctalia/plugins/catwalk/Main.qml new file mode 100644 index 0000000..7096062 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/Main.qml @@ -0,0 +1,18 @@ +import QtQuick +import Quickshell +import qs.Services.System + +Item { + id: root + + property var pluginApi: null + + readonly property real minimumThreshold: pluginApi?.pluginSettings?.minimumThreshold || 10 + readonly property bool hideBackground: pluginApi?.pluginSettings?.hideBackground ?? false + + property real cpuUsage: SystemStatService.cpuUsage + readonly property bool isRunning: cpuUsage >= minimumThreshold + + readonly property var icons: ["icons/my-active-0-symbolic.svg", "icons/my-active-1-symbolic.svg", "icons/my-active-2-symbolic.svg", "icons/my-active-3-symbolic.svg", "icons/my-active-4-symbolic.svg"] + readonly property var idleIcons: ["icons/my-idle-0-symbolic.svg", "icons/my-idle-1-symbolic.svg", "icons/my-idle-2-symbolic.svg", "icons/my-idle-3-symbolic.svg"] +} diff --git a/dot_config/noctalia/plugins/catwalk/Panel.qml b/dot_config/noctalia/plugins/catwalk/Panel.qml new file mode 100644 index 0000000..0eeb67c --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/Panel.qml @@ -0,0 +1,102 @@ +import QtQuick +import QtQuick.Effects +import QtQuick.Layouts +import qs.Commons +import qs.Services.System +import qs.Widgets + +Item { + id: root + property var pluginApi: null + + // SmartPanel properties + readonly property var geometryPlaceholder: panelContainer + readonly property bool allowAttach: true + property real contentPreferredWidth: 300 * Style.uiScaleRatio + property real contentPreferredHeight: 300 * Style.uiScaleRatio + + anchors.fill: parent + + Rectangle { + id: panelContainer + anchors.fill: parent + color: "transparent" + + Rectangle { + anchors.fill: parent + anchors.margins: Style.marginL + color: Color.mSurface + radius: Style.radiusL + border.color: Color.mOutline + border.width: Style.borderS + + ColumnLayout { + anchors.centerIn: parent + spacing: Style.marginL + + // Big Cat + Item { + id: bigCatItem + Layout.preferredWidth: 128 * Style.uiScaleRatio + Layout.preferredHeight: 128 * Style.uiScaleRatio + Layout.alignment: Qt.AlignHCenter + + property int frameIndex: 0 + + readonly property bool isRunning: root.pluginApi?.mainInstance?.isRunning ?? false + readonly property var icons: root.pluginApi?.mainInstance?.icons || [] + + property int idleFrameIndex: 0 + readonly property var idleIcons: root.pluginApi?.mainInstance?.idleIcons || [] + + readonly property real cpuUsage: root.pluginApi?.mainInstance?.cpuUsage ?? 0 + + Timer { + interval: Math.max(30, 200 - bigCatItem.cpuUsage * 1.7) + running: bigCatItem.isRunning + repeat: true + onTriggered: bigCatItem.frameIndex = (bigCatItem.frameIndex + 1) % bigCatItem.icons.length + } + + Timer { + interval: 400 + running: !bigCatItem.isRunning + repeat: true + onTriggered: bigCatItem.idleFrameIndex = (bigCatItem.idleFrameIndex + 1) % bigCatItem.idleIcons.length + } + + Image { + id: bigCatImage + anchors.fill: parent + + source: (bigCatItem.icons && bigCatItem.icons.length > 0 && bigCatItem.idleIcons && bigCatItem.idleIcons.length > 0) + ? (bigCatItem.isRunning + ? Qt.resolvedUrl(bigCatItem.icons[bigCatItem.frameIndex % bigCatItem.icons.length]) + : Qt.resolvedUrl(bigCatItem.idleIcons[bigCatItem.idleFrameIndex % bigCatItem.idleIcons.length])) + : "" + + fillMode: Image.PreserveAspectFit + smooth: true + mipmap: true + + // This handles the programmatic coloring + layer.enabled: true + layer.effect: MultiEffect { + colorization: 1.0 + colorizationColor: Settings.data.colorSchemes.darkMode ? "white" : "black" + } + } + } + + // CPU Stats + Text { + Layout.alignment: Qt.AlignHCenter + text: (pluginApi?.tr("panel.cpuLabel") || "CPU: {usage}%").replace("{usage}", Math.round(root.pluginApi?.mainInstance?.cpuUsage ?? 0)) + font.pointSize: Style.fontSizeXL + font.weight: Font.Bold + color: Settings.data.colorSchemes.darkMode ? "white" : "black" + } + } + } + } +} \ No newline at end of file diff --git a/dot_config/noctalia/plugins/catwalk/README.md b/dot_config/noctalia/plugins/catwalk/README.md new file mode 100644 index 0000000..52b094c --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/README.md @@ -0,0 +1,34 @@ +# Catwalk Plugin for Noctalia + +A cute animated cat for your Noctalia bar that reacts to your system's CPU usage. + +## Features + +- **Animated Cat**: The cat walks/runs on your bar based on CPU usage +- **CPU-Based Animation**: + - Below minimum threshold: Shows idle animation with "Zz" bubbles + - Above minimum threshold: Walks faster as CPU usage increases + - Speed scales continuously with CPU load +- **Popup Panel**: Click the cat to open a larger animated version with CPU stats +- **Theme Support**: Automatically switches between light/dark mode icons +- **Configurable Settings**: Adjust the minimum CPU threshold for running animation + +## Installation + +This plugin is part of the `noctalia-plugins` repository. + +## Configuration + +Access the plugin settings in Noctalia to configure: + +- **Minimum CPU Threshold**: Set the CPU usage percentage (5-25%) above which the cat starts running. Below this, it stays idle with "Zz" animation. + +## Usage + +- The cat icon appears on your bar +- It automatically animates based on your CPU usage +- Click to open the CPU stats panel + +## Requirements + +- Noctalia 3.6.0 or later diff --git a/dot_config/noctalia/plugins/catwalk/Settings.qml b/dot_config/noctalia/plugins/catwalk/Settings.qml new file mode 100644 index 0000000..c1721bf --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/Settings.qml @@ -0,0 +1,75 @@ +import QtQuick +import QtQuick.Layouts +import qs.Widgets +import qs.Commons + +ColumnLayout { + id: root + + // Plugin API (injected by the settings dialog system) + property var pluginApi: null + + // Local state - track changes before saving + property real valueMinimumThreshold: pluginApi?.mainInstance?.minimumThreshold ?? (pluginApi?.pluginSettings?.minimumThreshold || 10) + property bool valueHideBackground: pluginApi?.mainInstance?.hideBackground ?? (pluginApi?.pluginSettings?.hideBackground ?? false) + + spacing: Style.marginM + + Component.onCompleted: { + Logger.i("Catwalk", "Settings UI loaded"); + } + + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginS + + NLabel { + label: pluginApi?.tr("settings.minimumThreshold.label") || "Minimum CPU Threshold" + description: pluginApi?.tr("settings.minimumThreshold.description") || "CPU usage must be above this percentage for the cat to start running" + } + + NSlider { + id: thresholdSlider + from: 5 + to: 25 + value: root.valueMinimumThreshold + stepSize: 1 + onValueChanged: { + root.valueMinimumThreshold = value + } + } + + Text { + text: (pluginApi?.tr("settings.currentThreshold") || "Current threshold: {value}%").replace("{value}", thresholdSlider.value) + color: Color.mOnSurfaceVariant + font.pointSize: Style.fontSizeS + } + } + + NToggle { + label: pluginApi?.tr("settings.hideBackground.label") || "Hide Background" + description: pluginApi?.tr("settings.hideBackground.description") || "Hide the background of the desktop widget" + + checked: root.valueHideBackground + onToggled: function(checked) { + root.valueHideBackground = checked + } + } + + // This function is called by the dialog to save settings + function saveSettings() { + if (!pluginApi) { + Logger.e("Catwalk", "Cannot save settings: pluginApi is null"); + return; + } + + // Update the plugin settings object + pluginApi.pluginSettings.minimumThreshold = root.valueMinimumThreshold; + pluginApi.pluginSettings.hideBackground = root.valueHideBackground; + + // Save to disk + pluginApi.saveSettings(); + + Logger.i("Catwalk", "Settings saved successfully"); + } +} \ No newline at end of file diff --git a/dot_config/noctalia/plugins/catwalk/i18n/de.json b/dot_config/noctalia/plugins/catwalk/i18n/de.json new file mode 100644 index 0000000..4424d88 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/de.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Aktuelle Schwelle: {value}%", + "hideBackground": { + "description": "Verstecke den Hintergrund des Desktop-Widgets", + "label": "Hintergrund ausblenden" + }, + "minimumThreshold": { + "description": "Die CPU-Auslastung muss über diesem Prozentsatz liegen, damit die Katze zu laufen beginnt", + "label": "Minimale CPU-Schwelle" + }, + "title": "Catwalk-Einstellungen" + }, + "tooltip": { + "running": "Katze läuft", + "sleeping": "Katze schläft" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/en.json b/dot_config/noctalia/plugins/catwalk/i18n/en.json new file mode 100644 index 0000000..93248a1 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/en.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Current threshold: {value}%", + "hideBackground": { + "description": "Hide the background of the desktop widget", + "label": "Hide Background" + }, + "minimumThreshold": { + "description": "CPU usage must be above this percentage for the cat to start running", + "label": "Minimum CPU Threshold" + }, + "title": "Catwalk Settings" + }, + "tooltip": { + "running": "Cat is running", + "sleeping": "Cat is sleeping" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/es.json b/dot_config/noctalia/plugins/catwalk/i18n/es.json new file mode 100644 index 0000000..873824e --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/es.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Umbral actual: {value}%", + "hideBackground": { + "description": "Ocultar el fondo del widget de escritorio", + "label": "Ocultar fondo" + }, + "minimumThreshold": { + "description": "El uso de CPU debe estar por encima de este porcentaje para que el gato empiece a correr", + "label": "Umbral mínimo de CPU" + }, + "title": "Configuración de Catwalk" + }, + "tooltip": { + "running": "El gato está corriendo", + "sleeping": "El gato está durmiendo" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/fr.json b/dot_config/noctalia/plugins/catwalk/i18n/fr.json new file mode 100644 index 0000000..1b5be2f --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/fr.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU : {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Seuil actuel : {value}%", + "hideBackground": { + "description": "Masquer l'arrière-plan du widget de bureau", + "label": "Masquer l'arrière-plan" + }, + "minimumThreshold": { + "description": "L'utilisation du CPU doit être supérieure à ce pourcentage pour que le chat commence à courir", + "label": "Seuil minimum CPU" + }, + "title": "Paramètres Catwalk" + }, + "tooltip": { + "running": "Le chat court", + "sleeping": "Le chat dort" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/hu.json b/dot_config/noctalia/plugins/catwalk/i18n/hu.json new file mode 100644 index 0000000..6de0c91 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/hu.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Sétasáv" + }, + "settings": { + "currentThreshold": "Aktuális küszöbérték: {value}%", + "hideBackground": { + "description": "Asztali widget hátterének elrejtése", + "label": "Háttér elrejtése" + }, + "minimumThreshold": { + "description": "A processzorhasználatnak e fölött a százalék felett kell lennie, hogy a macska futni kezdjen", + "label": "Minimum CPU Küszöbérték" + }, + "title": "Catwalk beállítások" + }, + "tooltip": { + "running": "A Noctalia fut.", + "sleeping": "A macska alszik" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/it.json b/dot_config/noctalia/plugins/catwalk/i18n/it.json new file mode 100644 index 0000000..46d374e --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/it.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Soglia attuale: {value}%", + "hideBackground": { + "description": "Nascondi lo sfondo del widget desktop", + "label": "Nascondi sfondo" + }, + "minimumThreshold": { + "description": "L'utilizzo della CPU deve essere superiore a questa percentuale affinché il gatto inizi a correre", + "label": "Soglia minima CPU" + }, + "title": "Impostazioni Catwalk" + }, + "tooltip": { + "running": "Il gatto sta correndo", + "sleeping": "Il gatto sta dormendo" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/ja.json b/dot_config/noctalia/plugins/catwalk/i18n/ja.json new file mode 100644 index 0000000..93dbf46 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/ja.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "現在のしきい値: {value}%", + "hideBackground": { + "description": "デスクトップウィジェットの背景を隠す", + "label": "背景を隠す" + }, + "minimumThreshold": { + "description": "猫が走り始めるにはCPU使用率がこの割合を超えている必要があります", + "label": "最小CPUしきい値" + }, + "title": "Catwalk設定" + }, + "tooltip": { + "running": "猫が走っています", + "sleeping": "猫が寝ています" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/ku.json b/dot_config/noctalia/plugins/catwalk/i18n/ku.json new file mode 100644 index 0000000..e5bc9d5 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/ku.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Rêwînga pisîkan" + }, + "settings": { + "currentThreshold": "Astana niha: {value}%", + "hideBackground": { + "description": "Paşxana wîceta sermaseyê veşêre", + "label": "Veşartina Paşxanê" + }, + "minimumThreshold": { + "description": "Divê bikaranîna CPU ji vê rêjeyê bilindtir be da ku pisîk dest bi bezê bike", + "label": "Sînorê herî kêm ê CPU" + }, + "title": "Mîhenên Catwalkê" + }, + "tooltip": { + "running": "Pisîk direve", + "sleeping": "Pisîk radizê." + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/nl.json b/dot_config/noctalia/plugins/catwalk/i18n/nl.json new file mode 100644 index 0000000..efb83a6 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/nl.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Huidige drempelwaarde: {value}%", + "hideBackground": { + "description": "Verberg de achtergrond van de bureaubladwidget", + "label": "Achtergrond verbergen" + }, + "minimumThreshold": { + "description": "CPU-gebruik moet boven dit percentage liggen voordat de kat begint te rennen.", + "label": "Minimale CPU-drempel" + }, + "title": "Catwalk Instellingen" + }, + "tooltip": { + "running": "Kat rent", + "sleeping": "Kat slaapt" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/pl.json b/dot_config/noctalia/plugins/catwalk/i18n/pl.json new file mode 100644 index 0000000..558416a --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/pl.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Wybieg" + }, + "settings": { + "currentThreshold": "Aktualny próg: {value}%", + "hideBackground": { + "description": "Ukryj tło widżetu pulpitu", + "label": "Ukryj tło" + }, + "minimumThreshold": { + "description": "Użycie CPU musi przekraczać ten procent, aby kot zaczął biegać", + "label": "Minimalny próg użycia CPU" + }, + "title": "Ustawienia Catwalk" + }, + "tooltip": { + "running": "Kot jest uruchomiony", + "sleeping": "Kot śpi" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/pt.json b/dot_config/noctalia/plugins/catwalk/i18n/pt.json new file mode 100644 index 0000000..0efb112 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/pt.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Limite atual: {value}%", + "hideBackground": { + "description": "Ocultar o fundo do widget da área de trabalho", + "label": "Ocultar fundo" + }, + "minimumThreshold": { + "description": "O uso da CPU deve estar acima desta porcentagem para o gato começar a correr", + "label": "Limite mínimo de CPU" + }, + "title": "Configurações do Catwalk" + }, + "tooltip": { + "running": "O gato está correndo", + "sleeping": "O gato está dormindo" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/ru.json b/dot_config/noctalia/plugins/catwalk/i18n/ru.json new file mode 100644 index 0000000..53ef758 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/ru.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Catwalk" + }, + "settings": { + "currentThreshold": "Текущий порог: {value}%", + "hideBackground": { + "description": "Скрыть фон виджета рабочего стола", + "label": "Скрыть фон" + }, + "minimumThreshold": { + "description": "Использование CPU должно быть выше этого процента, чтобы кот начал бежать", + "label": "Минимальный порог CPU" + }, + "title": "Настройки Catwalk" + }, + "tooltip": { + "running": "Кот бежит", + "sleeping": "Кот спит" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/tr.json b/dot_config/noctalia/plugins/catwalk/i18n/tr.json new file mode 100644 index 0000000..95bee2e --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/tr.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU: {usage}%", + "title": "Podyum" + }, + "settings": { + "currentThreshold": "Mevcut eşik: {value}%", + "hideBackground": { + "description": "Masaüstü bileşeninin arka planını gizle", + "label": "Arka planı gizle" + }, + "minimumThreshold": { + "description": "CPU kullanımı, kedinin koşmaya başlaması için bu yüzdeden yüksek olmalıdır.", + "label": "Minimum CPU Eşiği" + }, + "title": "Podyum Ayarları" + }, + "tooltip": { + "running": "Kedi koşuyor.", + "sleeping": "Kedi uyuyor." + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/uk-UA.json b/dot_config/noctalia/plugins/catwalk/i18n/uk-UA.json new file mode 100644 index 0000000..e109beb --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/uk-UA.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "ЦП: {usage}%", + "title": "Подіум" + }, + "settings": { + "currentThreshold": "Поточний поріг: {value}%", + "hideBackground": { + "description": "Приховати фон віджета робочого столу", + "label": "Приховати фон" + }, + "minimumThreshold": { + "description": "Використання ЦП має бути вище цього відсотка, щоб кіт почав бігати.", + "label": "Мінімальний поріг ЦП" + }, + "title": "Налаштування подіуму" + }, + "tooltip": { + "running": "Кіт біжить", + "sleeping": "Кіт спить" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/i18n/zh-CN.json b/dot_config/noctalia/plugins/catwalk/i18n/zh-CN.json new file mode 100644 index 0000000..37a9709 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/i18n/zh-CN.json @@ -0,0 +1,22 @@ +{ + "panel": { + "cpuLabel": "CPU:{usage}%", + "title": "猫步" + }, + "settings": { + "currentThreshold": "当前阈值:{value}%", + "hideBackground": { + "description": "隐藏桌面小部件的背景", + "label": "隐藏背景" + }, + "minimumThreshold": { + "description": "CPU 使用率必须高于此百分比,猫才能开始跑动。", + "label": "最低CPU阈值" + }, + "title": "时装秀场布置" + }, + "tooltip": { + "running": "猫在跑", + "sleeping": "猫在睡觉" + } +} diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-active-0-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-active-0-symbolic.svg new file mode 100644 index 0000000..7abf1a0 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-active-0-symbolic.svg @@ -0,0 +1,32 @@ + + + + + + + + + image/svg+xml + + RunCat: Frame 0 + + + + RunCat: Frame 0 + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-active-1-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-active-1-symbolic.svg new file mode 100644 index 0000000..3a06046 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-active-1-symbolic.svg @@ -0,0 +1,32 @@ + + + + + + + + + image/svg+xml + + RunCat: Frame 1 + + + + RunCat: Frame 1 + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-active-2-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-active-2-symbolic.svg new file mode 100644 index 0000000..769737c --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-active-2-symbolic.svg @@ -0,0 +1,32 @@ + + + + + + + + + image/svg+xml + + RunCat: Frame 2 + + + + RunCat: Frame 2 + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-active-3-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-active-3-symbolic.svg new file mode 100644 index 0000000..79ec50c --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-active-3-symbolic.svg @@ -0,0 +1,32 @@ + + + + + + + + + image/svg+xml + + RunCat: Frame 3 + + + + RunCat: Frame 3 + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-active-4-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-active-4-symbolic.svg new file mode 100644 index 0000000..a3a2623 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-active-4-symbolic.svg @@ -0,0 +1,32 @@ + + + + + + + + + image/svg+xml + + RunCat: Frame 4 + + + + RunCat: Frame 4 + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-idle-0-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-idle-0-symbolic.svg new file mode 100644 index 0000000..e6e5028 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-idle-0-symbolic.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-idle-1-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-idle-1-symbolic.svg new file mode 100644 index 0000000..ef0831c --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-idle-1-symbolic.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-idle-2-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-idle-2-symbolic.svg new file mode 100644 index 0000000..b0b3e2a --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-idle-2-symbolic.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dot_config/noctalia/plugins/catwalk/icons/my-idle-3-symbolic.svg b/dot_config/noctalia/plugins/catwalk/icons/my-idle-3-symbolic.svg new file mode 100644 index 0000000..af78795 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/icons/my-idle-3-symbolic.svg @@ -0,0 +1,21 @@ + + + + + + + diff --git a/dot_config/noctalia/plugins/catwalk/manifest.json b/dot_config/noctalia/plugins/catwalk/manifest.json new file mode 100644 index 0000000..74e5518 --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/manifest.json @@ -0,0 +1,32 @@ +{ + "id": "catwalk", + "name": "Catwalk", + "version": "1.1.7", + "minNoctaliaVersion": "3.6.0", + "author": "MannuVilasara", + "license": "MIT", + "repository": "https://github.com/noctalia-dev/noctalia-plugins", + "description": "A cute animated cat for your bar.", + "tags": [ + "Bar", + "Desktop", + "Panel", + "Fun" + ], + "entryPoints": { + "main": "Main.qml", + "barWidget": "BarWidget.qml", + "desktopWidget": "DesktopWidget.qml", + "panel": "Panel.qml", + "settings": "Settings.qml" + }, + "dependencies": { + "plugins": [] + }, + "metadata": { + "defaultSettings": { + "minimumThreshold": 10, + "hideBackground": false + } + } +} diff --git a/dot_config/noctalia/plugins/catwalk/preview.png b/dot_config/noctalia/plugins/catwalk/preview.png new file mode 100644 index 0000000..5e73151 Binary files /dev/null and b/dot_config/noctalia/plugins/catwalk/preview.png differ diff --git a/dot_config/noctalia/plugins/catwalk/settings.json b/dot_config/noctalia/plugins/catwalk/settings.json new file mode 100644 index 0000000..181fb4d --- /dev/null +++ b/dot_config/noctalia/plugins/catwalk/settings.json @@ -0,0 +1,4 @@ +{ + "minimumThreshold": 10, + "hideBackground": false +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/BarWidget.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/BarWidget.qml new file mode 100644 index 0000000..349d9cc --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/BarWidget.qml @@ -0,0 +1,75 @@ +import QtQuick +import Quickshell +import qs.Commons +import qs.Services.UI +import qs.Widgets + +NIconButton { + id: root + + property var pluginApi: null + property ShellScreen screen + property string widgetId: "" + property string section: "" + property int sectionWidgetIndex: -1 + property int sectionWidgetsCount: 0 + + baseSize: Style.getCapsuleHeightForScreen(screen?.name) + applyUiScale: false + icon: "keyboard" + tooltipText: pluginApi?.tr("barwidget.tooltip") + tooltipDirection: BarService.getTooltipDirection(screen?.name) + customRadius: Style.radiusL + + colorBg: Style.capsuleColor + colorFg: Color.mOnSurface + colorBgHover: Color.mHover + colorFgHover: Color.mOnHover + colorBorder: "transparent" + colorBorderHover: "transparent" + + border.color: Style.capsuleBorderColor + border.width: Style.capsuleBorderWidth + + NPopupContextMenu { + id: contextMenu + + model: [ + { + "label": pluginApi?.tr("barwidget.open"), + "action": "open-panel", + "icon": "keyboard" + }, + { + "label": pluginApi?.tr("barwidget.settings"), + "action": "plugin-settings", + "icon": "settings" + }, + ] + + onTriggered: action => { + contextMenu.close(); + PanelService.closeContextMenu(screen); + + if (action === "open-panel") { + if (pluginApi) { + pluginApi.openPanel(screen); + } + } else if (action === "plugin-settings") { + if (pluginApi) { + BarService.openPluginSettings(screen, pluginApi.manifest); + } + } + } + } + + onClicked: { + if (pluginApi) { + pluginApi.openPanel(screen); + } + } + + onRightClicked: { + PanelService.showContextMenu(contextMenu, root, screen); + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/CHANGELOG.md b/dot_config/noctalia/plugins/keybind-cheatsheet/CHANGELOG.md new file mode 100644 index 0000000..1d25f80 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/CHANGELOG.md @@ -0,0 +1,284 @@ +# Changelog + +## [3.7.3] - 2026-05-25 + +### Fixes + +- **Niri: descriptions invisible on light/transparent backgrounds.** Since v3.5.0 the description text color defaulted to a hardcoded `#E0E0E0` (light gray), which is unreadable on light wallpapers shining through a transparent panel. Default is now empty → falls back to `Color.mOnSurface` (theme-aware, always readable). Existing users with a baked-in `#E0E0E0` in their `settings.json` should hit **Reset** on the Description color in Settings → Appearance to pick up the theme-aware default. Reported by @porcaror (#884) +- **MangoWC: `binds=` / `axisbinds=` / `mousebinds=` (plural) directives now parsed.** MangoWC has two directive families: singular (keycode, QWERTY-mapped) and plural (keysym, layout-aware — used by AZERTY and other non-QWERTY layouts). The parser previously only matched the singular form, so AZERTY configs showed no binds. Both forms are now recognised. Reported by @Pintjebier (#881) + +## [3.7.2] - 2026-05-21 + +### Fixes + +- **Settings panel was rendering empty**: `Settings.qml` and `ColorPairRow.qml` reference sibling files (`ColorPairRow`, `ColorPill`) but Quickshell's `NPluginSettingsPopup` loads Settings via `Loader.setSource(file://...)` without adding the plugin directory to the implicit import list. The QML engine threw `ColorPairRow is not a type`, aborting the load. Added `import "."` to both files so the sibling components resolve. Reported by @ajgringo619 (#862) +- **Hyprland Lua: split configs lost their category headers** (`require("modules.keybinds")` resolved as `modules.keybinds.lua` instead of `modules/keybinds.lua`). Lua's `require` treats dots as path separators; the parser now converts them before resolving, so configs that split binds into submodules — e.g. `hyprland.lua` -> `require("modules.keybinds")` -> `modules/keybinds.lua` — pick up their `-- N. CATEGORY` headers and binds land in the correct categories instead of all falling into "Other". Reported by @ajgringo619 (#862) + +## [3.7.1] - 2026-05-20 + +### Fixes + +- Settings: fix `ReferenceError: rootItem is not defined` in the bind-override management section — the override counter, **Restore hidden**, and **Clear all overrides** buttons were broken because of stale `rootItem` references after the `id` rename +- Settings: use the native `tr(key, interpolations)` API for the overrides summary line instead of chained `.replace()` calls (review feedback from @spiros132) + +## [3.7.0] - 2026-05-17 + +### Features + +**Hyprland Lua config support (`hyprland.lua`)** +- Hyprland 0.55+ replaces hyprlang `.conf` with a Lua config. Added a second Hyprland parsing tor that queries `hyprctl binds -j` for the authoritative, already-evaluated bind list — correctly handling `require()`, `for` loops, and multi-key chords that cannot be recovered by static text parsing +- Categories are recovered by lightly scanning `hyprland.lua` (and its `require()` modules) for `-- N. NAME` headers and `description = "..."` literals, with a prefix heuristic for loop-generated binds (e.g. `"Workspace " .. i`) +- Parser mode setting `auto` / `lua` / `conf`: `auto` uses the Lua tor when `hyprland.lua` exists, otherwise the existing `.conf` parser +- The legacy hyprlang `.conf` parser is **kept unchanged as a fallback** for users still on hyprlang configs + +**Add description / hide binds without a description** +- Binds with no description are surfaced in a dedicated "Without Description" section instead of being dropped +- Each undescribed bind can be given a custom description inline, or hidden, directly from the panel +- Overrides are keyed by a stable bind identity (`submap|modmask|key|flags|dispatcher`) that excludes the unstable `__lua` registry ref, so they survive Hyprland restarts +- New settings: `showUndescribedBinds`, an override summary, "Restore hidden" and "Clear all overrides" actions + +**`refresh` IPC** +- Added `refresh` to the plugin IPC handler so the cheatsheet can be re-parsed from a keybind, e.g. `qs ipc call plugin:keybind-cheatsheet refresh` + +### Bug Fixes + +- Fixed a `text` binding loop on the window-height settings input (now seeded once via `Component.onCompleted`) +- Replaced hardcoded `font.pointSize` in bind rows with `Style.fontSizeXS` + +### Notes + +- This release bundles the color-customization, MangoWC-support and Niri parser work previously tracked separately (see the 3.5.0–3.6.2 entries below) together with the Hyprland Lua support, shipped as a single 3.7.0 release. + +--- + +## [3.6.2] - 2026-04-29 + +### i18n + +- Translate "no description" fallback label for undescribed MangoWC binds — was hardcoded `"(no description)"`, now uses `panel.no-description` translation key across all 20 locale files (addresses review feedback from @spiros132 on PR #725). + +--- + +## [3.6.1] - 2026-04-26 + +### MangoWC Parser Regression Fixes + +Addresses review feedback on PR #725 from @countgitmick. + +- **XF86 media keys now formatted:** `formatMangoKeyCombo` calls `formatSpecialKey`, so `XF86AudioRaiseVolume` renders as "Vol Up", `XF86AudioMute` as "Mute", brightness keys as "Bright Up/Down", etc. +- **Stray `#` comments no longer become categories:** `extractMangoCategory` restored filters — length cap of 100 chars, horizontal-rule strip (`────`, `====`, `----`), numbered-list extraction (`1. Foo` → `Foo`), paren/bracket continuation reject, flow-arrow reject (`→`, `->`, `=>`), keyword-prefixed notes reject (TODO/FIXME/NOTE/HACK/XXX/BUG/WIP). +- **Per-bind `#"description"` suffix preserved:** `findMangoUnquotedComment` skips past `#"`, and `parseMangoConfig` extracts the trailing quoted description so `bind=SUPER,T,exec,foo #"Open terminal"` keeps "Open terminal" as the rendered description. +- **Modifier aliases:** `LOGO` (= SUPER) and `MOD1` (= ALT) are now recognized as valid Mango modifier tokens. +- **Default category localized:** the fallback category for `bind=`/`axisbind=`/`mousebind=` lines without a preceding `# Category` now uses `pluginApi.tr("default-category")` instead of hardcoded "General"/"Mouse". +- **Category detection actually runs now:** moved category extraction into the pure-comment branch so `# Title` lines actually update `currentCategory` (previously dead code path). + +--- + +## [3.5.0] - 2026-04-21 + +### New Features + +**Full Per-Category Color Customization** +- Added background and text color pickers for every key category: `Super`, `Ctrl`, `Shift`, `Alt`, `XF86`, `Print`, numeric, mouse, and default letter keys — plus the description text color +- 9 new `keyText*` settings (`keyTextSuper`, `keyTextCtrl`, …) let the label text of every category be themed independently of the background +- `keyColorSuper`, `keyColorCtrl`, `keyColorShift` use an empty-string sentinel to mean "use Material theme accent" (`mPrimary` / `mSecondary` / `mTertiary`), so themed setups remain untouched unless the user deliberately overrides + +**Redesigned Color Picker UI** +- Two-pill layout per category: left pill previews the background, right pill previews the label text on that background +- Single click anywhere on a pill opens `NColorPickerDialog` +- Pencil-icon edit affordance removed — the entire pill is the control +- Per-row reset button clears the override and restores the theme default +- New "Reset all colors" button zeroes out all 20+ color overrides in one action + +**Clipboard Quick-Paste** +- When a valid `#RRGGBB` or `#RRGGBBAA` hex is detected in the clipboard (via `wl-paste`, polled every 1500 ms), a paste icon appears inside each pill +- Clicking the icon applies the clipboard hex to that pill immediately, no picker dialog required +- A new hint row above the color pickers tells the user about this behavior + +**Live Preview + Revert on Cancel** +- Color changes are reflected in the preview row immediately via `_applyPreview(key, value)` instead of only after Save +- A snapshot is taken on `Component.onCompleted`; closing the Settings panel without clicking Save restores the snapshot in `Component.onDestruction`, so cancelled edits are truly reverted + +### Bug Fixes + +**Ctrl / Shift now actually customizable** +- Previously `keyColorCtrl` / `keyColorShift` could not be overridden; the panel always fell back to `Color.mPrimaryContainer` (which does not exist on this shell build). Fixed by consistently honoring the empty-string override sentinel and falling back to `mPrimary` / `mSecondary` / `mTertiary` +- Removed stray references to `Color.mPrimaryContainer` that produced undefined colors at runtime + +**Panel opacity now matches other plugins** +- Switched the Panel from painting its own opaque background to the standard plugin panel-in-panel pattern used by `tailscale` and `hello-world`, so the keybind panel now inherits the user's shell opacity/blur settings correctly + +### Code Quality + +**Component extraction** +- Extracted `ColorPill.qml` (single background/text pill with clipboard paste + picker dialog) and `ColorPairRow.qml` (label + bg pill + text pill + reset) from the Settings surface. Settings.qml is now noticeably smaller and each pill row is a single declarative `ColorPairRow { ... }` + +**Edit-copy discipline + i18n** +- Extended the edit-copy pattern to all 20+ color/text settings — `valueKeyColor*` / `valueKeyText*` properties are the source of truth during edit, `saveSettings()` writes them into `pluginSettings` and calls `pluginApi.saveSettings()` +- The hardcoded `qs … ipc call …` example now lives in `settings.keybind-ipc-command` so it is translation-system-backed like every other string +- Removed the last `|| "auto"` fallback strings in `ColorPairRow.qml`; the translation system handles missing keys +- New i18n keys `panel.search-placeholder`, `settings.color-auto`, `settings.color-paste-hint`, `settings.keybind-ipc-command` localized across all 20 supported languages + +**Cleanup** +- Timer and Process objects (clipboard poll + `wl-paste` Process) are stopped/terminated in `Component.onDestruction` +- Unified empty-string-or-hex property types for overrides (`string` for overrides, `color` for non-optional defaults), preventing QML's implicit `color` coercion from turning `""` into `#000000` + +### Manifest + +- Version bumped to `3.5.0` +- `metadata.defaultSettings` gains 20+ new color defaults covering every per-category override plus `keyLabelColor` and `descriptionTextColor` +- `windowHeight` default corrected from `0` to `850` so the manual-height branch has a sensible initial value +- Tags extended with `Hyprland` and `Niri` for plugin-catalog search filtering + +--- + +## [3.4.0] - 2026-04-07 + +### Bug Fixes + +**Settings unreachable from panel button** +- Fixed critical bug where clicking the settings button (top-right of the keybind panel) blocked all input in the settings window +- The panel now closes before opening settings, preventing the open panel from intercepting mouse events +- Reported by Discord users: editing width/height was impossible when settings were opened this way + +**Settings not saved when opened from panel** +- Fixed settings changes being silently discarded when the settings window was opened via the panel button +- `saveSettings()` was declared on an inner `ColumnLayout` instead of the root `Item`, making it invisible to the Noctalia shell +- With the previous direct-mutation approach this went unnoticed; after switching to the edit-copy pattern saves now work correctly from all entry points + +### Code Quality + +**Settings: edit-copy pattern** +- Replaced direct `pluginSettings` mutation in `onTextChanged` handlers with proper edit-copy properties (`editWindowWidth`, `editWindowHeight`, `editAutoHeight`, `editColumnCount`, `editModKeyVariable`, `editHyprlandConfigPath`, `editNiriConfigPath`) +- Changes are committed to `pluginSettings` only when the user clicks Save, matching Noctalia plugin conventions + +**i18n: corrected structure** +- Removed `"keybind-cheatsheet"` top-level wrapper from all 20 language JSON files +- Removed `"keybind-cheatsheet."` prefix from all 50 `tr()` calls across all QML files +- Structure now matches the Noctalia plugin i18n specification + +**Removed dead code** +- Deleted unused `parseNiriConfig()` function (118 lines) superseded by `parseNiriFileContent()` in v3.1.0 + +**Shell injection hardening** +- Glob expansion in config path resolution now passes user-provided patterns as positional shell arguments (`$1`) instead of string-concatenating them into the shell command, preventing potential injection via crafted config path values + +**resizeTimer: semantic popup detection** +- Replaced fragile `toString()` string matching (`"Popup_QMLTYPE"`, `"NPluginSettingsPopup"`) with a semantic check (`typeof obj.modal === "boolean"`) that works with any QML `Popup` subclass + +**Named key badge colors** +- Extracted hardcoded hex colors in `getKeyColor()` into named `readonly property color` constants (`keyColorAlt`, `keyColorXF86`, `keyColorPrint`, `keyColorNumeric`, `keyColorMouse`) + +### Manifest + +- Added missing `repository` field +- Added tags: `System`, `Indicator` (alongside existing `Bar`, `Panel`) + +--- + +## [3.2.2] - 2026-02-08 + +### Bug Fixes + +**Hyprland Parser - No Category Handling** +- Fixed parser crash when Hyprland config has no category headers (`# 1. Category Name`) +- Parser now creates default "Keybinds" category for configs without categories +- Default category name is fully translatable via i18n system +- Prevents keybind loss for users who don't organize their configs with categories + +### Translations + +**Complete i18n Coverage** +- Added `default-category` translations for all 19 supported languages +- Added missing `error` section translations to all language files (includes German from 3.1.2) +- All language files now have identical structure (61-62 lines each) +- Improved translation consistency across all locales + +**Supported Languages:** +- English (en), Polish (pl), German (de), French (fr), Spanish (es) +- Italian (it), Portuguese (pt), Dutch (nl), Russian (ru), Japanese (ja) +- Chinese Simplified (zh-CN), Chinese Traditional (zh-TW), Korean (ko-KR) +- Turkish (tr), Ukrainian (uk-UA), Swedish (sv), Hungarian (hu) +- Kurdish (ku), Norwegian Nynorsk (nn-NO), Hindi/Nepali (hn) + +### Code Quality + +**Memory Leak Prevention** +- Added recursion limit tracking for parser (`hasCategories` flag) +- Improved parser robustness and error handling +- Better fallback behavior for edge cases + +--- + +## [3.1.2] - 2026-02-08 + +### Translations + +- Added german translations for the `error` keys + +## [3.1.1] - 2026-02-03 + +### Smart Caching + +**Compositor Change Detection** +- Plugin now detects when compositor changes (e.g., switching from Hyprland to Niri) +- Automatically re-parses config only when compositor differs from cached data +- Instant panel opening when using same compositor (uses cache) +- Saves detected compositor in settings for comparison + +### Bug Fixes + +**Improved Niri Parser** +- Fixed multiline bind parsing - handles binds that span multiple lines +- Added `spawn-sh` action support for shell command spawning +- Added `move-column-to-workspace` and `move-window-to-workspace` action categories +- Better handling of complex Niri config structures + +**Better Error Messages** +- User-friendly messages for unsupported compositors (Sway, LabWC, MangoWC) +- Each compositor shows specific explanation why it's not supported +- All error messages are translatable via i18n + +### Documentation + +**README Updates** +- Fixed IPC command syntax in examples +- Updated keybind format examples to use `$mainMod` instead of `$mod` +- Clarified configuration file paths and formats + +--- + +## [3.1.0] - 2026-02-03 + +### New Features + +**Niri Support** +- Full Niri compositor support with KDL config parsing +- Recursive file parsing with `source` directive support +- Automatic action categorization +- Multiline bind support + +**Recursive Config Parsing** +- Both Hyprland and Niri now support recursive file includes +- Memory leak prevention with recursion limits +- Glob pattern support for bulk file imports + +### Improvements + +**Better Error Handling** +- Graceful fallback for unsupported compositors +- User-friendly error messages +- Translation support for all error states + +--- + +## [3.0.0] - 2026-01-30 + +### Initial Release + +**Core Features** +- Hyprland keybind parsing +- Category organization +- Multi-language support +- Bar widget integration +- Settings UI diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPairRow.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPairRow.qml new file mode 100644 index 0000000..73fff65 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPairRow.qml @@ -0,0 +1,77 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import qs.Commons +import qs.Widgets +import "." as Local + +// Label + background pill + text pill + reset. Used by Settings.qml for per-category +// color customization. Empty bgValue/textValue means "use fallback". +RowLayout { + id: row + + property var pluginApi + property var screen + property string labelText: "" + property string bgValue: "" + property string textValue: "" + property color bgFallback: "#888888" + property color textFallback: "#FFFFFF" + property string letter: "A" + property string clipboardHex: "" + property bool showBg: true + property bool showText: true + + signal bgPicked(color value) + signal textPicked(color value) + signal bgPasted(string hex) + signal textPasted(string hex) + signal resetRequested() + + Layout.fillWidth: true + spacing: Style.marginM + + NText { + text: row.labelText + color: Color.mOnSurface + pointSize: Style.fontSizeM + Layout.preferredWidth: 180 * Style.uiScaleRatio + elide: Text.ElideRight + } + + Local.ColorPill { + Layout.preferredWidth: 130 * Style.uiScaleRatio + visible: row.showBg + screen: row.screen + hexValue: row.bgValue + displayColor: row.bgValue.length > 0 ? row.bgValue : row.bgFallback + textMode: false + clipboardHex: row.clipboardHex + placeholderText: row.bgValue.length === 0 ? row.pluginApi?.tr("settings.color-auto") : "" + onColorPicked: c => row.bgPicked(c) + onPasteRequested: hex => row.bgPasted(hex) + } + + Local.ColorPill { + Layout.preferredWidth: 130 * Style.uiScaleRatio + visible: row.showText + screen: row.screen + hexValue: row.textValue + displayColor: row.textValue.length > 0 ? row.textValue : row.textFallback + textMode: true + letter: row.letter + textModeBg: row.bgValue.length > 0 ? row.bgValue : row.bgFallback + clipboardHex: row.clipboardHex + placeholderText: row.textValue.length === 0 ? row.pluginApi?.tr("settings.color-auto") : "" + onColorPicked: c => row.textPicked(c) + onPasteRequested: hex => row.textPasted(hex) + } + + Item { Layout.fillWidth: true } + + NIconButton { + icon: "rotate" + tooltipText: row.pluginApi?.tr("settings.reset-color") + onClicked: row.resetRequested() + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPill.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPill.qml new file mode 100644 index 0000000..98f21fa --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/ColorPill.qml @@ -0,0 +1,124 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import qs.Commons +import qs.Widgets + +// Compact color pill: circle + hex code + optional paste icon. +// Opens NColorPickerDialog on click. Used in pairs (bg + text) per keybind category. +Rectangle { + id: pill + + property var screen + property string hexValue: "" + property color displayColor: "#888888" + property bool textMode: false + property string letter: "A" + property color textModeBg: "#444444" + property string clipboardHex: "" + property string placeholderText: "" + + signal colorPicked(color value) + signal pasteRequested(string hex) + + readonly property bool hasClipboardColor: clipboardHex.length > 0 && + clipboardHex.toLowerCase() !== hexValue.toLowerCase() + + implicitWidth: 150 + implicitHeight: Math.round(Style.baseWidgetSize * 1.1) + + radius: Style.iRadiusM + color: Color.mSurface + border.color: mouseArea.containsMouse ? Color.mPrimary : Color.mOutline + border.width: Style.borderS + + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + var startColor = pill.hexValue.length > 0 ? pill.hexValue : pill.displayColor; + var dialog = dialogFactory.createObject(Overlay.overlay, { + "selectedColor": startColor, + "screen": pill.screen + }); + if (!dialog) return; + dialog.colorSelected.connect(function(c) { + pill.colorPicked(c); + }); + dialog.open(); + } + } + + Component { + id: dialogFactory + NColorPickerDialog {} + } + + RowLayout { + anchors.fill: parent + anchors.leftMargin: Style.marginS + anchors.rightMargin: Style.marginS + spacing: Style.marginS + + Rectangle { + Layout.preferredWidth: pill.height * 0.62 + Layout.preferredHeight: pill.height * 0.62 + radius: width / 2 + color: pill.textMode ? pill.textModeBg : pill.displayColor + border.color: Color.mOutline + border.width: Style.borderS + + NText { + anchors.centerIn: parent + visible: pill.textMode + text: pill.letter + color: pill.displayColor + font.weight: Style.fontWeightBold + pointSize: Style.fontSizeS + } + } + + NText { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + text: pill.hexValue.length > 0 + ? pill.hexValue.toUpperCase() + : (pill.placeholderText.length > 0 ? pill.placeholderText : "auto") + family: Settings.data.ui.fontFixed + color: pill.hexValue.length > 0 ? Color.mOnSurface : Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + elide: Text.ElideRight + } + + Rectangle { + Layout.preferredWidth: pill.height * 0.62 + Layout.preferredHeight: pill.height * 0.62 + visible: pill.hasClipboardColor + radius: width / 2 + color: pasteArea.containsMouse ? Color.mPrimary : Color.mSurfaceVariant + border.color: Color.mOutline + border.width: Style.borderS + + NIcon { + anchors.centerIn: parent + icon: "clipboard" + color: pasteArea.containsMouse ? Color.mOnPrimary : Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + } + + MouseArea { + id: pasteArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: pill.pasteRequested(pill.clipboardHex) + } + + ToolTip.visible: pasteArea.containsMouse && pill.clipboardHex.length > 0 + ToolTip.text: pill.clipboardHex.toUpperCase() + ToolTip.delay: 400 + } + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/Main.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/Main.qml new file mode 100644 index 0000000..e009153 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/Main.qml @@ -0,0 +1,1730 @@ +import QtQuick +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Services.UI +import qs.Services.Compositor + +Item { + id: root + property var pluginApi: null + + + Component.onCompleted: { + if (pluginApi && !parserStarted) { + checkAndParse(); + } + } + + onPluginApiChanged: { + if (pluginApi && !parserStarted) { + checkAndParse(); + } + } + + // Check if compositor changed since last parse, and re-parse if needed + function checkAndParse() { + var currentCompositor = getCurrentCompositor(); + var savedCompositor = pluginApi?.pluginSettings?.detectedCompositor || ""; + var hasData = (pluginApi?.pluginSettings?.cheatsheetData || []).length > 0; + + // Re-parse if: + // 1. No data cached yet, OR + // 2. Compositor changed since last parse + if (!hasData || currentCompositor !== savedCompositor) { + parserStarted = true; + runParser(); + } else { + parserStarted = true; // Mark as done, using cache + } + } + + // Get current compositor name + function getCurrentCompositor() { + if (CompositorService.isHyprland) return "hyprland"; + if (CompositorService.isNiri) return "niri"; + if (CompositorService.isSway) return "sway"; + if (CompositorService.isLabwc) return "labwc"; + if (CompositorService.isMango) return "mango"; + return "unknown"; + } + + // Get user-friendly message for unsupported compositors + function getUnsupportedCompositorMessage(compositor) { + var messages = { + "sway": { + short: pluginApi?.tr("error.sway-not-supported"), + detail: pluginApi?.tr("error.sway-detail") + }, + "labwc": { + short: pluginApi?.tr("error.labwc-not-supported"), + detail: pluginApi?.tr("error.labwc-detail") + }, + "unknown": { + short: pluginApi?.tr("error.unknown-compositor"), + detail: pluginApi?.tr("error.unknown-detail") + } + }; + return messages[compositor] || messages["unknown"]; + } + + property bool parserStarted: false + + // Bug 4 fix: version counter so Panel.qml can react to data updates + property int cheatsheetDataVersion: 0 + + // Memory leak prevention: cleanup on destruction + Component.onDestruction: { + clearParsingData(); + cleanupProcesses(); + } + + function cleanupProcesses() { + if (niriGlobProcess.running) niriGlobProcess.running = false; + if (niriReadProcess.running) niriReadProcess.running = false; + if (hyprGlobProcess.running) hyprGlobProcess.running = false; + if (hyprReadProcess.running) hyprReadProcess.running = false; + if (mangoGlobProcess.running) mangoGlobProcess.running = false; + if (mangoReadProcess.running) mangoReadProcess.running = false; + if (hyprDetectProcess.running) hyprDetectProcess.running = false; + if (hyprLuaReadProcess.running) hyprLuaReadProcess.running = false; + if (hyprctlBindsProcess.running) hyprctlBindsProcess.running = false; + + // Clear process buffers + niriGlobProcess.expandedFiles = []; + hyprGlobProcess.expandedFiles = []; + mangoGlobProcess.expandedFiles = []; + hyprctlChunks = []; + currentLines = []; + } + + function clearParsingData() { + filesToParse = []; + parsedFiles = {}; + accumulatedLines = []; + currentLines = []; + collectedBinds = {}; + parseDepthCounter = 0; + luaCategoryHeaders = []; + descToCategory = ({}); + prefixToCategory = []; + hyprctlChunks = []; + if (mangoGlobProcess.running) mangoGlobProcess.running = false; + if (mangoReadProcess.running) mangoReadProcess.running = false; + mangoGlobProcess.expandedFiles = []; + } + + // Refresh function - accessible from mainInstance + function refresh() { + if (!pluginApi) { + return; + } + + // Reset parserStarted to allow re-parsing + parserStarted = false; + isCurrentlyParsing = false; + + // Now run parser + parserStarted = true; + runParser(); + } + + // Recursive parsing support + property var filesToParse: [] + property var parsedFiles: ({}) + property var accumulatedLines: [] + property var currentLines: [] + property var collectedBinds: ({}) // Collect keybinds from all files + + // Memory leak prevention: recursion limits + property int maxParseDepth: 50 + property int parseDepthCounter: 0 + property bool isCurrentlyParsing: false + + function runParser() { + if (isCurrentlyParsing) { + return; + } + + isCurrentlyParsing = true; + parseDepthCounter = 0; + + // Detect compositor using CompositorService + var compositorName = getCurrentCompositor(); + if (!CompositorService.isHyprland && !CompositorService.isNiri && !CompositorService.isMango) { + isCurrentlyParsing = false; + + Logger.w("KeybindCheatsheet", "Unsupported compositor:", compositorName); + var unsupportedMsg = getUnsupportedCompositorMessage(compositorName); + saveToDb([{ + "title": pluginApi?.tr("error.unsupported-compositor"), + "binds": [ + { "keys": compositorName.toUpperCase(), "desc": unsupportedMsg.short }, + { "keys": "INFO", "desc": unsupportedMsg.detail } + ] + }]); + return; + } + + var homeDir = Quickshell.env("HOME"); + if (!homeDir) { + isCurrentlyParsing = false; + Logger.e("KeybindCheatsheet", "Cannot resolve $HOME environment variable"); + saveToDb([{ + "title": "ERROR", + "binds": [{ "keys": "ERROR", "desc": "Cannot get $HOME" }] + }]); + return; + } + + // Reset recursive state + filesToParse = []; + parsedFiles = {}; + accumulatedLines = []; + collectedBinds = {}; + + var filePath; + if (CompositorService.isHyprland) { + hyprConfPath = (pluginApi?.pluginSettings?.hyprlandConfigPath || (homeDir + "/.config/hypr/hyprland.conf")).replace(/^~/, homeDir); + hyprLuaPath = (pluginApi?.pluginSettings?.hyprlandLuaConfigPath || (homeDir + "/.config/hypr/hyprland.lua")).replace(/^~/, homeDir); + + var mode = pluginApi?.pluginSettings?.hyprlandParserMode || "auto"; + if (mode === "conf") { + startHyprlandConfTor(); + } else if (mode === "lua") { + startHyprlandLuaTor(); + } else { + // auto: prefer lua if hyprland.lua exists, else fall back to .conf + hyprDetectProcess.command = ["sh", "-c", '[ -f "$1" ] && echo lua || echo conf', "sh", hyprLuaPath]; + hyprDetectProcess.running = true; + } + return; + } + + if (CompositorService.isNiri) { + filePath = pluginApi?.pluginSettings?.niriConfigPath || (homeDir + "/.config/niri/config.kdl"); + } else if (CompositorService.isMango) { + filePath = pluginApi?.pluginSettings?.mangoConfigPath || (homeDir + "/.config/mango/config.conf"); + } + + filePath = filePath.replace(/^~/, homeDir); + filesToParse = [filePath]; + + if (CompositorService.isNiri) { + parseNextNiriFile(); + } else if (CompositorService.isMango) { + parseNextMangoFile(); + } + } + + function getDirectoryFromPath(filePath) { + var lastSlash = filePath.lastIndexOf('/'); + return lastSlash >= 0 ? filePath.substring(0, lastSlash) : "."; + } + + function resolveRelativePath(basePath, relativePath) { + var homeDir = Quickshell.env("HOME") || ""; + var resolved = relativePath.replace(/^~/, homeDir); + if (resolved.startsWith('/')) return resolved; + return getDirectoryFromPath(basePath) + "/" + resolved; + } + + function isGlobPattern(path) { + return path.indexOf('*') !== -1 || path.indexOf('?') !== -1; + } + + // ========== NIRI RECURSIVE PARSING ========== + function parseNextNiriFile() { + if (parseDepthCounter >= maxParseDepth) { + Logger.w("KeybindCheatsheet", "Niri parser hit max recursion depth (" + maxParseDepth + "), aborting"); + isCurrentlyParsing = false; + clearParsingData(); + return; + } + parseDepthCounter++; + + if (filesToParse.length === 0) { + finalizeNiriBinds(); + return; + } + + var nextFile = filesToParse.shift(); + + // Handle glob patterns + if (isGlobPattern(nextFile)) { + niriGlobProcess.expandedFiles = []; // Clear previous results + niriGlobProcess.command = ["sh", "-c", 'for f in $1; do [ -f "$f" ] && echo "$f"; done', "sh", nextFile]; + niriGlobProcess.running = true; + return; + } + + if (parsedFiles[nextFile]) { + parseNextNiriFile(); + return; + } + + parsedFiles[nextFile] = true; + currentLines = []; + niriReadProcess.currentFilePath = nextFile; + niriReadProcess.command = ["cat", nextFile]; + niriReadProcess.running = true; + } + + Process { + id: niriGlobProcess + property var expandedFiles: [] + running: false + + stdout: SplitParser { + onRead: data => { + var trimmed = data.trim(); + if (trimmed.length > 0) { + if (niriGlobProcess.expandedFiles.length < 100) { + niriGlobProcess.expandedFiles.push(trimmed); + } + } + } + } + + onExited: { + for (var i = 0; i < expandedFiles.length; i++) { + var path = expandedFiles[i]; + if (!root.parsedFiles[path] && root.filesToParse.indexOf(path) === -1) { + root.filesToParse.push(path); + } + } + expandedFiles = []; + root.parseNextNiriFile(); + } + } + + Process { + id: niriReadProcess + property string currentFilePath: "" + running: false + + stdout: SplitParser { + onRead: data => { + if (root.currentLines.length < 10000) { + root.currentLines.push(data); + } + } + } + + onExited: (exitCode, exitStatus) => { + if (exitCode === 0 && root.currentLines.length > 0) { + // First pass: find includes (Bug 1: skip commented-out lines) + for (var i = 0; i < root.currentLines.length; i++) { + var line = root.currentLines[i]; + // Bug 1 fix: skip lines starting with // (they are comments, not active includes) + if (line.trim().startsWith("//")) continue; + var includeMatch = line.match(/(?:include|source)\s+"([^"]+)"/i); + if (includeMatch) { + var includePath = includeMatch[1]; + var resolvedPath = root.resolveRelativePath(currentFilePath, includePath); + if (!root.parsedFiles[resolvedPath] && root.filesToParse.indexOf(resolvedPath) === -1) { + root.filesToParse.push(resolvedPath); + } + } + } + + // Bug 2 fix: auto-discover standard Noctalia/common keybind files from the config dir + var configDir = root.getDirectoryFromPath(currentFilePath); + var standardFiles = [ + configDir + "/keybindings.common.kdl", + configDir + "/keybindings.noctalia.kdl" + ]; + for (var s = 0; s < standardFiles.length; s++) { + var sf = standardFiles[s]; + if (!root.parsedFiles[sf] && root.filesToParse.indexOf(sf) === -1) { + // We optimistically add them; parseNextNiriFile will skip if the cat fails + root.filesToParse.push(sf); + } + } + + // Second pass: parse keybinds from this file + root.parseNiriFileContent(root.currentLines.join("\n")); + } + root.currentLines = []; + root.parseNextNiriFile(); + } + } + + function parseNiriFileContent(text) { + var lines = text.split('\n'); + var inBindsBlock = false; + var bindsBlockDepth = 0; + var currentCategory = null; + var bindsFoundInFile = 0; + + // State for multiline bind parsing + var currentBindKey = null; + var currentBindAttributes = ""; + var currentBindAction = ""; + var bindBraceDepth = 0; + + var actionCategories = { + "spawn": "Applications", + "spawn-sh": "Applications", + "focus-column": "Column Navigation", + "focus-window": "Window Focus", + "focus-workspace": "Workspace Navigation", + "move-column": "Move Columns", + "move-window": "Move Windows", + "move-column-to-workspace": "Workspace Management", + "move-window-to-workspace": "Workspace Management", + "consume-window": "Window Management", + "expel-window": "Window Management", + "close-window": "Window Management", + "fullscreen-window": "Window Management", + "maximize-column": "Column Management", + "set-column-width": "Column Width", + "switch-preset-column-width": "Column Width", + "reset-window-height": "Window Size", + "screenshot": "Screenshots", + "screenshot-window": "Screenshots", + "screenshot-screen": "Screenshots", + "power-off-monitors": "Power", + "quit": "System", + "toggle-animation": "Animations" + }; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i].trim(); + + // Skip KDL block comments: /- + if (line.startsWith("/-")) continue; + + // Find binds block start + if (!inBindsBlock && line.startsWith("binds") && line.includes("{")) { + inBindsBlock = true; + bindsBlockDepth = 1; + continue; + } + + if (!inBindsBlock) continue; + + // Category markers - support multiple formats: + // //"Category Name" + // // "Category Name" + // // #"Category Name" + // //#"Category Name" + if (line.startsWith("//")) { + var categoryMatch = line.match(/\/\/\s*#?"([^"]+)"/); + if (categoryMatch) { + currentCategory = categoryMatch[1]; + } + continue; + } + + // Skip empty lines + if (line.length === 0) continue; + + // Track braces for binds block boundary + var openBraces = (line.match(/\{/g) || []).length; + var closeBraces = (line.match(/\}/g) || []).length; + + // If we're not currently parsing a multiline bind + if (currentBindKey === null) { + // Try to match a keybind start: Mod+Key or "Mod+Key" attributes { or Mod+Key { action; } + // Bug 3 fix: support optional surrounding quotes on the key combo (e.g. "Mod+Return") + var bindStartMatch = line.match(/^"?([A-Za-z0-9_+]+)"?\s*((?:[a-z\-]+=(?:"[^"]*"|[1-9][0-9]*|true|false)\s*)*)\{(.*)$/); + + if (bindStartMatch) { + currentBindKey = bindStartMatch[1]; + currentBindAttributes = bindStartMatch[2].trim(); + var restOfLine = bindStartMatch[3]; + + // Check if the bind is complete on this line (single-line bind) + if (restOfLine.includes("}")) { + // Single-line bind: Mod+H { focus-column-left; } + currentBindAction = restOfLine.replace(/\}\s*$/, "").trim(); + finalizeBind(); + } else { + // Multiline bind starts here + currentBindAction = restOfLine.trim(); + bindBraceDepth = 1; + } + } else { + // Not a bind start, track braces for binds block + bindsBlockDepth += openBraces - closeBraces; + if (bindsBlockDepth <= 0) { + inBindsBlock = false; + } + } + } else { + // We're in a multiline bind, accumulate action content + bindBraceDepth += openBraces - closeBraces; + + if (bindBraceDepth <= 0) { + // Bind is complete + currentBindAction += " " + line.replace(/\}\s*$/, "").trim(); + finalizeBind(); + } else { + // Still in multiline bind + currentBindAction += " " + line.trim(); + } + } + } + + function finalizeBind() { + if (!currentBindKey) return; + + bindsFoundInFile++; + var action = currentBindAction.trim().replace(/;$/, "").trim(); + + var hotkeyTitle = null; + var titleMatch = currentBindAttributes.match(/hotkey-overlay-title="([^"]+)"/); + if (titleMatch) hotkeyTitle = titleMatch[1]; + + var formattedKeys = formatNiriKeyCombo(currentBindKey); + var category = currentCategory || getNiriCategory(action, actionCategories); + var description = hotkeyTitle || formatNiriAction(action); + + // Extract verb (first whitespace-separated token of action) + var verbMatch = action.match(/^([A-Za-z0-9_\-]+)/); + var verb = verbMatch ? verbMatch[1] : ""; + + // Decompose key combo into modifier set + main key for merge/filter logic + var rawParts = currentBindKey.split("+"); + var mods = []; + var mainKey = ""; + for (var p = 0; p < rawParts.length; p++) { + var rp = rawParts[p].trim(); + if (rp === "Mod" || rp === "Super" || rp === "Win" || + rp === "Ctrl" || rp === "Control" || + rp === "Alt" || rp === "Shift") { + mods.push(rp === "Mod" || rp === "Win" ? "Super" : (rp === "Control" ? "Ctrl" : rp)); + } else if (rp.length > 0) { + mainKey = rp; + } + } + + if (!collectedBinds[category]) { + collectedBinds[category] = []; + } + collectedBinds[category].push({ + "keys": formattedKeys, + "desc": description, + "_verb": verb, + "_mods": mods.join("+"), + "_mainKey": mainKey + }); + + // Reset state + currentBindKey = null; + currentBindAttributes = ""; + currentBindAction = ""; + bindBraceDepth = 0; + } + } + + function finalizeNiriBinds() { + var categoryOrder = [ + "Noctalia", "Applications", "Window Management", "Column Navigation", + "Window Focus", "Workspace Navigation", "Workspace Management", + "Move Columns", "Move Windows", "Column Management", "Column Width", + "Window Size", "Screenshots", "Power", "System", "Animations" + ]; + + var categories = []; + for (var k = 0; k < categoryOrder.length; k++) { + var catName = categoryOrder[k]; + if (collectedBinds[catName] && collectedBinds[catName].length > 0) { + categories.push({ "title": catName, "binds": collectedBinds[catName] }); + } + } + + // Add remaining categories + for (var cat in collectedBinds) { + if (categoryOrder.indexOf(cat) === -1 && collectedBinds[cat].length > 0) { + categories.push({ "title": cat, "binds": collectedBinds[cat] }); + } + } + + if (categories.length === 0) { + Logger.w("KeybindCheatsheet", "Niri parser produced no binds; check config path and binds {} block"); + } + + if (pluginApi?.pluginSettings?.mergeSequentialBinds ?? true) { + categories = mergeSequentialBindsInCategories(categories); + } + + saveToDb(categories); + isCurrentlyParsing = false; + clearParsingData(); + } + + // ========== MERGE SEQUENTIAL KEYBINDS ========== + // Detects runs of consecutive numeric binds with identical modifiers, identical + // verb, and descriptions that differ only by the integer. + // Example: Super+1..5 → "Workspace 1", "Workspace 2", ... → "Workspace 1-5" + function mergeSequentialBindsInCategories(cats) { + if (!cats || cats.length === 0) return cats; + var out = []; + for (var c = 0; c < cats.length; c++) { + var cat = cats[c]; + out.push({ "title": cat.title, "binds": mergeBindsList(cat.binds || []) }); + } + return out; + } + + function mergeBindsList(binds) { + if (!binds || binds.length < 2) return binds; + + // Build a list of merge tokens for each bind: + // token = mods + "|" + verb + "|" + descriptionTemplate + // descriptionTemplate replaces standalone integers with "%N%" + var tokens = []; + var nums = []; + for (var i = 0; i < binds.length; i++) { + var b = binds[i]; + var mainKey = b._mainKey || ""; + var asInt = parseInt(mainKey, 10); + var keyIsInteger = !isNaN(asInt) && /^\d+$/.test(mainKey); + var descTemplate = (b.desc || "").replace(/\b\d+\b/g, "%N%"); + tokens.push({ + mods: b._mods || "", + verb: b._verb || "", + descTemplate: descTemplate, + keyIsInteger: keyIsInteger, + num: keyIsInteger ? asInt : NaN, + bind: b + }); + nums.push(keyIsInteger ? asInt : NaN); + } + + var result = []; + var i = 0; + while (i < tokens.length) { + var startTok = tokens[i]; + if (!startTok.keyIsInteger) { + result.push(startTok.bind); + i++; + continue; + } + + // Try to extend a run as long as next bind has same mods/verb/descTemplate + // and num is exactly previous + 1 + var runEnd = i; + while (runEnd + 1 < tokens.length) { + var nextTok = tokens[runEnd + 1]; + if (!nextTok.keyIsInteger) break; + if (nextTok.mods !== startTok.mods) break; + if (nextTok.verb !== startTok.verb) break; + if (nextTok.descTemplate !== startTok.descTemplate) break; + if (nextTok.num !== tokens[runEnd].num + 1) break; + runEnd++; + } + + var runLen = runEnd - i + 1; + if (runLen >= 3) { + // Collapse the run into a single ranged entry. + var firstBind = startTok.bind; + var lastBind = tokens[runEnd].bind; + var lo = startTok.num; + var hi = tokens[runEnd].num; + var rangeStr = lo + "-" + hi; + + // Reconstruct keys with the range token. Keep the modifier prefix from + // the first bind exactly as displayed (it already contains " + "). + var firstKeys = firstBind.keys || ""; + var lastPlus = firstKeys.lastIndexOf(" + "); + var prefix = lastPlus >= 0 ? firstKeys.substring(0, lastPlus + 3) : ""; + var mergedKeys = prefix + rangeStr; + + // Replace the integer in the description template with the range + var mergedDesc = (firstBind.desc || "").replace(/\b\d+\b/, rangeStr); + + result.push({ + "keys": mergedKeys, + "desc": mergedDesc, + "_verb": firstBind._verb, + "_mods": firstBind._mods, + "_mainKey": rangeStr, + "_merged": true + }); + i = runEnd + 1; + } else { + result.push(startTok.bind); + i++; + } + } + return result; + } + + // ========== HYPRLAND TOR SELECTION ========== + property string hyprConfPath: "" + property string hyprLuaPath: "" + + Process { + id: hyprDetectProcess + running: false + property string result: "" + stdout: SplitParser { + onRead: data => { hyprDetectProcess.result = data.trim(); } + } + onExited: { + if (result === "lua") { + root.startHyprlandLuaTor(); + } else { + root.startHyprlandConfTor(); + } + } + } + + function startHyprlandConfTor() { + filesToParse = [hyprConfPath]; + parseNextHyprlandFile(); + } + + function startHyprlandLuaTor() { + // Read hyprland.lua + required modules to recover category headers, + // then query hyprctl for the authoritative (loop/require-expanded) binds. + luaCategoryHeaders = []; + descToCategory = ({}); + prefixToCategory = []; + filesToParse = [hyprLuaPath]; + parseNextHyprLuaFile(); + } + + // ========== HYPRLAND LUA TOR (hyprctl binds -j) ========== + property var luaCategoryHeaders: [] // ordered category titles from `-- N. NAME` + property var descToCategory: ({}) // exact description -> category + property var prefixToCategory: [] // [{prefix, category}] for loop-built binds + property var hyprctlChunks: [] + + function parseNextHyprLuaFile() { + if (parseDepthCounter >= maxParseDepth) { + runHyprctlBinds(); + return; + } + parseDepthCounter++; + + if (filesToParse.length === 0) { + runHyprctlBinds(); + return; + } + + var nextFile = filesToParse.shift(); + if (parsedFiles[nextFile]) { + parseNextHyprLuaFile(); + return; + } + parsedFiles[nextFile] = true; + currentLines = []; + hyprLuaReadProcess.currentFilePath = nextFile; + hyprLuaReadProcess.command = ["cat", nextFile]; + hyprLuaReadProcess.running = true; + } + + Process { + id: hyprLuaReadProcess + property string currentFilePath: "" + running: false + + stdout: SplitParser { + onRead: data => { + if (root.currentLines.length < 10000) root.currentLines.push(data); + } + } + + onExited: (exitCode, exitStatus) => { + if (exitCode === 0 && root.currentLines.length > 0) { + var currentCategory = null; + for (var i = 0; i < root.currentLines.length; i++) { + var line = root.currentLines[i]; + + // require("a.b.c") / require 'a/b/c' -> a/b/c.lua relative to current file. + // Lua module names use dots as path separators; literal paths (with /) and + // .lua suffixes are passed through unchanged. + var reqMatch = line.match(/require\s*\(?\s*["']([^"']+)["']/); + if (reqMatch) { + var mod = reqMatch[1]; + if (!mod.endsWith(".lua")) { + if (mod.indexOf("/") === -1) mod = mod.replace(/\./g, "/"); + mod = mod + ".lua"; + } + var resolved = root.resolveRelativePath(currentFilePath, mod); + if (!root.parsedFiles[resolved] && root.filesToParse.indexOf(resolved) === -1) { + root.filesToParse.push(resolved); + } + } + + // Category header: -- 1. NAME + var headMatch = line.match(/^\s*--\s*\d+\.\s*(.+?)\s*$/); + if (headMatch) { + currentCategory = headMatch[1].trim(); + if (root.luaCategoryHeaders.indexOf(currentCategory) === -1) { + root.luaCategoryHeaders.push(currentCategory); + } + continue; + } + + // description = "..." / desc = '...' + var dMatch = line.match(/(?:description|desc)\s*=\s*["']([^"']*)["']/); + if (dMatch && currentCategory) { + var lit = dMatch[1]; + if (line.indexOf("..") !== -1) { + // Concatenated/dynamic description (e.g. "Workspace " .. i) + var pfx = lit.trim(); + if (pfx.length > 0) root.prefixToCategory.push({ prefix: pfx, category: currentCategory }); + } else if (lit.length > 0 && root.descToCategory[lit] === undefined) { + root.descToCategory[lit] = currentCategory; + } + } + } + } + root.currentLines = []; + root.parseNextHyprLuaFile(); + } + } + + function runHyprctlBinds() { + hyprctlChunks = []; + hyprctlBindsProcess.command = ["hyprctl", "binds", "-j"]; + hyprctlBindsProcess.running = true; + } + + Process { + id: hyprctlBindsProcess + running: false + + stdout: SplitParser { + onRead: data => { + if (root.hyprctlChunks.length < 20000) root.hyprctlChunks.push(data); + } + } + + onExited: (exitCode, exitStatus) => { + if (exitCode !== 0 || root.hyprctlChunks.length === 0) { + Logger.e("keybind-cheatsheet", "hyprctl binds -j failed (exit " + exitCode + ")"); + root.hyprctlChunks = []; + root.saveToDb([{ + "title": root.pluginApi?.tr("error.unsupported-compositor"), + "binds": [{ "keys": "hyprctl", "desc": root.pluginApi?.tr("error.hyprctl-failed") }] + }]); + root.isCurrentlyParsing = false; + root.clearParsingData(); + return; + } + + var binds = []; + try { + binds = JSON.parse(root.hyprctlChunks.join("\n")); + } catch (e) { + Logger.e("keybind-cheatsheet", "hyprctl JSON parse failed: " + e); + binds = []; + } + root.hyprctlChunks = []; + root.buildCategoriesFromHyprctl(binds); + } + } + + // Hyprland modifier bitmask (see HL_MODIFIER_*) + function decodeModmask(mask) { + var m = []; + if (mask & 64) m.push("Super"); // LOGO / SUPER / META + if (mask & 1) m.push("Shift"); + if (mask & 4) m.push("Ctrl"); + if (mask & 8) m.push("Alt"); + if (mask & 16) m.push("Mod2"); + if (mask & 32) m.push("Mod3"); + if (mask & 128) m.push("Mod5"); + return m; + } + + function computeBindId(b) { + // `arg` is an unstable lua registry ref for __lua binds — exclude it there. + var disp = (b.dispatcher === "__lua") ? "__lua" : (b.dispatcher + ":" + (b.arg || "")); + var flags = (b.release ? 1 : 0) + "" + (b.mouse ? 1 : 0) + (b.longPress ? 1 : 0); + return [b.submap || "", b.modmask, b.key, flags, disp].join("|"); + } + + function categoryForDesc(desc) { + if (descToCategory[desc] !== undefined) return descToCategory[desc]; + for (var i = 0; i < prefixToCategory.length; i++) { + if (desc.indexOf(prefixToCategory[i].prefix) === 0) return prefixToCategory[i].category; + } + return null; + } + + function buildCategoriesFromHyprctl(binds) { + var overrides = pluginApi?.pluginSettings?.bindOverrides || ({}); + var showUndescribed = pluginApi?.pluginSettings?.showUndescribedBinds ?? true; + + var byCat = ({}); + var otherTitle = pluginApi?.tr("panel.other"); + var undescTitle = pluginApi?.tr("panel.undescribed"); + + for (var i = 0; i < binds.length; i++) { + var b = binds[i]; + if (!b || b.key === undefined) continue; + + var bindId = computeBindId(b); + var ov = overrides[bindId]; + if (ov && ov.hidden === true) continue; + + var rawDesc = (b.has_description && b.description) ? b.description : ""; + if (ov && ov.desc) rawDesc = ov.desc; + var undescribed = (rawDesc === ""); + + if (undescribed && !showUndescribed) continue; + + var keyName = formatSpecialKey(b.key); + if (keyName === b.key) keyName = formatSpecialKey(String(b.key).toUpperCase()); + var mods = decodeModmask(b.modmask); + var fullKey = mods.length > 0 ? (mods.join(" + ") + " + " + keyName) : keyName; + + var cat; + if (undescribed) { + cat = undescTitle; + } else { + cat = categoryForDesc(rawDesc) || otherTitle; + } + + if (!byCat[cat]) byCat[cat] = []; + byCat[cat].push({ + "keys": fullKey, + "desc": undescribed ? "" : rawDesc, + "bindId": bindId, + "undescribed": undescribed + }); + } + + // Emit categories in lua header order, then Other, then Undescribed last. + var categories = []; + for (var h = 0; h < luaCategoryHeaders.length; h++) { + var t = luaCategoryHeaders[h]; + if (byCat[t] && byCat[t].length > 0) { + categories.push({ "title": t, "binds": byCat[t] }); + delete byCat[t]; + } + } + if (byCat[otherTitle] && byCat[otherTitle].length > 0) { + categories.push({ "title": otherTitle, "binds": byCat[otherTitle] }); + delete byCat[otherTitle]; + } + var undesc = byCat[undescTitle]; + if (undesc && undesc.length > 0) delete byCat[undescTitle]; + // Any leftover categories (shouldn't normally happen) + for (var k in byCat) { + if (byCat[k] && byCat[k].length > 0) categories.push({ "title": k, "binds": byCat[k] }); + } + if (undesc && undesc.length > 0) { + categories.push({ "title": undescTitle, "binds": undesc }); + } + + saveToDb(categories); + isCurrentlyParsing = false; + clearParsingData(); + } + + // ========== HYPRLAND RECURSIVE PARSING ========== + function parseNextHyprlandFile() { + if (parseDepthCounter >= maxParseDepth) { + Logger.w("KeybindCheatsheet", "Hyprland parser hit max recursion depth (" + maxParseDepth + "), aborting"); + isCurrentlyParsing = false; + clearParsingData(); + return; + } + parseDepthCounter++; + + if (filesToParse.length === 0) { + if (accumulatedLines.length > 0) { + parseHyprlandConfig(accumulatedLines.join("\n")); + } else { + isCurrentlyParsing = false; + } + return; + } + + var nextFile = filesToParse.shift(); + + // Handle glob patterns + if (isGlobPattern(nextFile)) { + hyprGlobProcess.expandedFiles = []; // Clear previous results + hyprGlobProcess.command = ["sh", "-c", 'for f in $1; do [ -f "$f" ] && echo "$f"; done', "sh", nextFile]; + hyprGlobProcess.running = true; + return; + } + + if (parsedFiles[nextFile]) { + parseNextHyprlandFile(); + return; + } + + parsedFiles[nextFile] = true; + currentLines = []; + hyprReadProcess.currentFilePath = nextFile; + hyprReadProcess.command = ["cat", nextFile]; + hyprReadProcess.running = true; + } + + Process { + id: hyprGlobProcess + property var expandedFiles: [] + running: false + + stdout: SplitParser { + onRead: data => { + var trimmed = data.trim(); + if (trimmed.length > 0) { + if (hyprGlobProcess.expandedFiles.length < 100) { + hyprGlobProcess.expandedFiles.push(trimmed); + } + } + } + } + + onExited: { + for (var i = 0; i < expandedFiles.length; i++) { + var path = expandedFiles[i]; + if (!root.parsedFiles[path] && root.filesToParse.indexOf(path) === -1) { + root.filesToParse.push(path); + } + } + expandedFiles = []; + root.parseNextHyprlandFile(); + } + } + + Process { + id: hyprReadProcess + property string currentFilePath: "" + running: false + + stdout: SplitParser { + onRead: data => { + if (root.currentLines.length < 10000) { + root.currentLines.push(data); + } + } + } + + onExited: (exitCode, exitStatus) => { + if (exitCode === 0 && root.currentLines.length > 0) { + for (var i = 0; i < root.currentLines.length; i++) { + var line = root.currentLines[i]; + root.accumulatedLines.push(line); + + // Check for source directive + var sourceMatch = line.trim().match(/^source\s*=\s*(.+)$/); + if (sourceMatch) { + var sourcePath = sourceMatch[1].trim(); + var commentIdx = sourcePath.indexOf('#'); + if (commentIdx > 0) sourcePath = sourcePath.substring(0, commentIdx).trim(); + var resolvedPath = root.resolveRelativePath(currentFilePath, sourcePath); + if (!root.parsedFiles[resolvedPath] && root.filesToParse.indexOf(resolvedPath) === -1) { + root.filesToParse.push(resolvedPath); + } + } + } + } + root.currentLines = []; + root.parseNextHyprlandFile(); + } + } + + // ========== HYPRLAND PARSER ========== + function parseHyprlandConfig(text) { + var lines = text.split('\n'); + var categories = []; + var currentCategory = null; + var hasCategories = false; // Track if we found any category headers + var skippedNoDesc = 0; + + var modVar = pluginApi?.pluginSettings?.modKeyVariable || "$mod"; + var modVarUpper = modVar.toUpperCase(); + var includeUndescribed = pluginApi?.pluginSettings?.showUndescribedBinds ?? false; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i].trim(); + + // Category header: # 1. Category Name + if (line.startsWith("#") && line.match(/#\s*\d+\./)) { + hasCategories = true; // Found at least one category + if (currentCategory) { + categories.push(currentCategory); + } + var title = line.replace(/#\s*\d+\.\s*/, "").trim(); + currentCategory = { "title": title, "binds": [] }; + } + // Any bind directive (bind, bindm, binde, bindr, bindl, etc.) + else if (/^bind[a-z]*\s*=/.test(line)) { + var hasDesc = line.includes('#"'); + if (!hasDesc && !includeUndescribed) { + skippedNoDesc++; + continue; + } + + // If no categories found yet, create default category + if (!currentCategory && !hasCategories) { + var defaultCategoryName = pluginApi?.tr("default-category"); + currentCategory = { "title": defaultCategoryName, "binds": [] }; + } + + if (currentCategory) { + var description; + if (hasDesc) { + var descMatch = line.match(/#"(.*?)"$/); + description = descMatch ? descMatch[1] : "No description"; + } else { + description = ""; + } + + // Strip the trailing #"..." comment so it doesn't pollute parts splitting + var bindLine = hasDesc ? line.replace(/\s*#".*?"\s*$/, "") : line; + + var eqIdx = bindLine.indexOf("="); + if (eqIdx < 0) continue; + var rhs = bindLine.substring(eqIdx + 1); + var parts = rhs.split(','); + if (parts.length >= 2) { + var modPart = parts[0].trim().toUpperCase(); + var rawKey = parts[1].trim().toUpperCase(); + var key = formatSpecialKey(rawKey); + + var verb = parts.length >= 3 ? parts[2].trim().toLowerCase() : ""; + var param = parts.length >= 4 ? parts.slice(3).join(",").trim() : ""; + + // Build modifiers list properly + var mods = []; + if (modPart.includes(modVarUpper) || modPart.includes("SUPER")) mods.push("Super"); + if (modPart.includes("SHIFT")) mods.push("Shift"); + if (modPart.includes("CTRL") || modPart.includes("CONTROL")) mods.push("Ctrl"); + if (modPart.includes("ALT")) mods.push("Alt"); + + // Build full key string + var fullKey; + if (mods.length > 0) { + fullKey = mods.join(" + ") + " + " + key; + } else { + fullKey = key; + } + + // Auto-generate description for undescribed binds when included + if (!hasDesc && includeUndescribed) { + description = verb ? (verb + (param ? " " + param : "")) : pluginApi?.tr("panel.no-description"); + } + + currentCategory.binds.push({ + "keys": fullKey, + "desc": description, + "_verb": verb, + "_param": param, + "_mods": mods.join("+"), + "_mainKey": rawKey + }); + } + } + } + } + + if (currentCategory) { + categories.push(currentCategory); + } + + if (skippedNoDesc > 0) { + Logger.w("KeybindCheatsheet", "Skipped " + skippedNoDesc + " Hyprland binds without #\"description\" suffix (enable showUndescribedBinds to include)"); + } + + if (categories.length === 0 || categories.every(function(c) { return !c.binds || c.binds.length === 0; })) { + Logger.w("KeybindCheatsheet", "Hyprland parser produced no binds; check config path and #\"description\" annotations"); + } + + if (pluginApi?.pluginSettings?.mergeSequentialBinds ?? true) { + categories = mergeSequentialBindsInCategories(categories); + } + + saveToDb(categories); + isCurrentlyParsing = false; + clearParsingData(); + } + + function formatSpecialKey(key) { + var keyMap = { + // Audio keys (uppercase for Hyprland) + "XF86AUDIORAISEVOLUME": "Vol Up", + "XF86AUDIOLOWERVOLUME": "Vol Down", + "XF86AUDIOMUTE": "Mute", + "XF86AUDIOMICMUTE": "Mic Mute", + "XF86AUDIOPLAY": "Play", + "XF86AUDIOPAUSE": "Pause", + "XF86AUDIONEXT": "Next", + "XF86AUDIOPREV": "Prev", + "XF86AUDIOSTOP": "Stop", + "XF86AUDIOMEDIA": "Media", + // Audio keys (mixed case for Niri) + "XF86AudioRaiseVolume": "Vol Up", + "XF86AudioLowerVolume": "Vol Down", + "XF86AudioMute": "Mute", + "XF86AudioMicMute": "Mic Mute", + "XF86AudioPlay": "Play", + "XF86AudioPause": "Pause", + "XF86AudioNext": "Next", + "XF86AudioPrev": "Prev", + "XF86AudioStop": "Stop", + "XF86AudioMedia": "Media", + // Brightness keys + "XF86MONBRIGHTNESSUP": "Bright Up", + "XF86MONBRIGHTNESSDOWN": "Bright Down", + "XF86MonBrightnessUp": "Bright Up", + "XF86MonBrightnessDown": "Bright Down", + // Other common keys + "XF86CALCULATOR": "Calc", + "XF86MAIL": "Mail", + "XF86SEARCH": "Search", + "XF86EXPLORER": "Files", + "XF86WWW": "Browser", + "XF86HOMEPAGE": "Home", + "XF86FAVORITES": "Favorites", + "XF86POWEROFF": "Power", + "XF86SLEEP": "Sleep", + "XF86EJECT": "Eject", + // Print screen + "PRINT": "PrtSc", + "Print": "PrtSc", + // Navigation + "PRIOR": "PgUp", + "NEXT": "PgDn", + "Prior": "PgUp", + "Next": "PgDn", + // Mouse (for Hyprland) + "MOUSE_DOWN": "Scroll Down", + "MOUSE_UP": "Scroll Up", + "MOUSE:272": "Left Click", + "MOUSE:273": "Right Click", + "MOUSE:274": "Middle Click" + }; + return keyMap[key] || key; + } + + function formatNiriKeyCombo(combo) { + // Split by + and process each part + var parts = combo.split("+"); + var formattedParts = []; + + for (var i = 0; i < parts.length; i++) { + var part = parts[i].trim(); + if (part.length === 0) continue; + + // Map modifier names + if (part === "Mod" || part === "Super" || part === "Win") { + formattedParts.push("Super"); + } else if (part === "Ctrl" || part === "Control") { + formattedParts.push("Ctrl"); + } else if (part === "Alt") { + formattedParts.push("Alt"); + } else if (part === "Shift") { + formattedParts.push("Shift"); + } else { + // It's a key - format special keys + formattedParts.push(formatSpecialKey(part)); + } + } + + return formattedParts.join(" + "); + } + + // Map Noctalia IPC target+function to human-readable descriptions + property var noctaliaIpcLabels: ({ + "launcher toggle": "Launcher", + "launcher clipboard": "Clipboard History", + "launcher command": "Command Palette", + "launcher emoji": "Emoji Picker", + "launcher windows": "Window Switcher", + "launcher settings": "Launcher Settings", + "controlCenter toggle": "Control Center", + "settings toggle": "Settings", + "settings open": "Open Settings", + "sessionMenu toggle": "Session Menu", + "sessionMenu lock": "Lock & Session Menu", + "lockScreen lock": "Lock Screen", + "volume increase": "Volume Up", + "volume decrease": "Volume Down", + "volume muteOutput": "Mute Output", + "volume muteInput": "Mute Input", + "volume increaseInput": "Input Volume Up", + "volume decreaseInput": "Input Volume Down", + "brightness increase": "Brightness Up", + "brightness decrease": "Brightness Down", + "media playPause": "Play / Pause", + "media next": "Next Track", + "media previous": "Previous Track", + "media play": "Play", + "media pause": "Pause", + "media stop": "Stop", + "media toggle": "Media Panel", + "notifications toggleDND": "Do Not Disturb", + "notifications toggleHistory": "Notification History", + "notifications clear": "Clear Notifications", + "notifications dismissAll": "Dismiss All", + "wallpaper refresh": "Refresh Wallpaper", + "wallpaper toggle": "Wallpaper Panel", + "wallpaper toggleAutomation": "Toggle Wallpaper Automation", + "darkMode toggle": "Toggle Dark Mode", + "darkMode setDark": "Dark Mode", + "darkMode setLight": "Light Mode", + "nightLight toggle": "Toggle Night Light", + "dock toggle": "Toggle Dock", + "bar toggle": "Toggle Bar", + "desktopWidgets toggle": "Toggle Desktop Widgets", + "desktopWidgets edit": "Edit Desktop Widgets", + "calendar toggle": "Calendar", + "systemMonitor toggle": "System Monitor", + "idleInhibitor toggle": "Toggle Idle Inhibitor", + "monitors off": "Monitors Off", + "monitors on": "Monitors On", + "wifi toggle": "Toggle WiFi", + "bluetooth toggle": "Toggle Bluetooth", + "airplaneMode toggle": "Toggle Airplane Mode", + "powerProfile cycle": "Cycle Power Profile", + "battery togglePanel": "Battery Panel", + "network togglePanel": "Network Panel" + }) + + function formatNiriAction(action) { + // Detect Noctalia IPC commands in two formats: + // 1. spawn-sh "qs -c noctalia-shell ipc call target function" + // 2. spawn "qs" "-c" "noctalia-shell" "ipc" "call" "target" "function" + if (action.indexOf("noctalia-shell") !== -1 && action.indexOf("ipc") !== -1) { + // Extract target and function from either format: + // spawn-sh: ipc call target function (words separated by spaces) + // spawn multi-arg: "ipc" "call" "target" "function" (words wrapped in quotes) + var ipcMatch = action.match(/ipc\s+call\s+(\w+)\s+(\w+)/) || + action.match(/"ipc"\s+"call"\s+"(\w+)"\s+"(\w+)"/); + if (ipcMatch) { + var ipcKey = ipcMatch[1] + " " + ipcMatch[2]; + if (noctaliaIpcLabels[ipcKey]) { + return noctaliaIpcLabels[ipcKey]; + } + // Fallback: format target + function nicely + return ipcMatch[1].replace(/([A-Z])/g, ' $1').trim() + ": " + + ipcMatch[2].replace(/([A-Z])/g, ' $1').trim(); + } + } + + // Handle spawn and spawn-sh commands + if (action.startsWith("spawn")) { + var spawnMatch = action.match(/spawn(?:-sh)?\s+"([^"]+)"/); + if (spawnMatch) { + return "Run: " + spawnMatch[1]; + } + return action; + } + // Format action name: focus-column-left -> Focus Column Left + return action.replace(/-/g, ' ').replace(/\b\w/g, function(l) { return l.toUpperCase(); }); + } + + function getNiriCategory(action, actionCategories) { + // Noctalia IPC commands get their own category + if (action.indexOf("noctalia-shell") !== -1 && action.indexOf("ipc") !== -1) { + return "Noctalia"; + } + for (var prefix in actionCategories) { + if (action.startsWith(prefix)) { + return actionCategories[prefix]; + } + } + return "Other"; + } + + function saveToDb(data) { + if (pluginApi) { + var compositor = getCurrentCompositor(); + pluginApi.pluginSettings.cheatsheetData = data; + pluginApi.pluginSettings.detectedCompositor = compositor; + pluginApi.saveSettings(); + // Bug 4 fix: bump version counter so Panel.qml re-evaluates its data binding + cheatsheetDataVersion++; + } + } + + // ========== MANGO LOOKUP TABLES ========== + readonly property var mangoKeyNameMap: ({ + "Return": "Enter", "return": "Enter", + "equal": "=", "minus": "-", "plus": "+", + "space": "Space", "comma": ",", "period": ".", + "semicolon": ";", "apostrophe": "'", "grave": "`", + "slash": "/", "backslash": "\\", + "bracketleft": "[", "bracketright": "]", + "Escape": "Esc", "escape": "Esc" + }) + + readonly property var mangoAxisMap: ({ + "UP": "Scroll Up", "DOWN": "Scroll Down", + "LEFT": "Scroll Left", "RIGHT": "Scroll Right" + }) + + readonly property var mangoButtonMap: ({ + "BTN_LEFT": "Left Click", "BTN_RIGHT": "Right Click", + "BTN_MIDDLE": "Middle Click", "BTN_SIDE": "Mouse Side", + "BTN_EXTRA": "Mouse Extra" + }) + + readonly property var mangoNoArgActions: ({ + "killclient": "Close window", + "togglefullscreen": "Toggle fullscreen", + "togglemaximizescreen": "Maximize", + "togglefloating": "Toggle floating", + "reload_config": "Reload config", + "toggleoverview": "Toggle overview", + "quit": "Quit compositor", + "switch_proportion_preset": "Cycle column width", + "switch_keyboard_layout": "Switch keyboard layout", + "zoom": "Zoom", + "restart": "Restart", + "incnmaster": "Increase masters", + "switch_layout": "Switch layout" + }) + + readonly property var mangoDirActions: ({ + "focusdir": "Focus", + "exchange_client": "Swap", + "focusmon": "Focus Monitor", + "tagmon": "Send to Monitor" + }) + + // ========== MANGO RECURSIVE PARSING ========== + function parseNextMangoFile() { + if (parseDepthCounter >= maxParseDepth) { + Logger.w("KeybindCheatsheet", "Mango parser hit max recursion depth (" + maxParseDepth + "), aborting"); + isCurrentlyParsing = false; + clearParsingData(); + return; + } + parseDepthCounter++; + + if (filesToParse.length === 0) { + finalizeMangoBinds(); + return; + } + + var nextFile = filesToParse.shift(); + + // Handle glob patterns + if (isGlobPattern(nextFile)) { + mangoGlobProcess.expandedFiles = []; + mangoGlobProcess.command = ["sh", "-c", 'for f in $1; do [ -f "$f" ] && echo "$f"; done', "sh", nextFile]; + mangoGlobProcess.running = true; + return; + } + + if (parsedFiles[nextFile]) { + parseNextMangoFile(); + return; + } + + parsedFiles[nextFile] = true; + currentLines = []; + mangoReadProcess.currentFilePath = nextFile; + mangoReadProcess.command = ["cat", nextFile]; + mangoReadProcess.running = true; + } + + Process { + id: mangoGlobProcess + property var expandedFiles: [] + running: false + + stdout: SplitParser { + onRead: data => { + var trimmed = data.trim(); + if (trimmed.length > 0) { + if (mangoGlobProcess.expandedFiles.length < 100) { + mangoGlobProcess.expandedFiles.push(trimmed); + } + } + } + } + + onExited: { + for (var i = 0; i < expandedFiles.length; i++) { + var path = expandedFiles[i]; + if (!root.parsedFiles[path] && root.filesToParse.indexOf(path) === -1) { + root.filesToParse.push(path); + } + } + expandedFiles = []; + root.parseNextMangoFile(); + } + } + + Process { + id: mangoReadProcess + property string currentFilePath: "" + running: false + + stdout: SplitParser { + onRead: data => { + if (root.currentLines.length < 10000) { + root.currentLines.push(data); + } + } + } + + onExited: (exitCode, exitStatus) => { + if (exitCode === 0 && root.currentLines.length > 0) { + // First pass: find source/source-optional includes + for (var i = 0; i < root.currentLines.length; i++) { + var line = root.currentLines[i].trim(); + // Skip commented lines + var commentPos = root.findMangoUnquotedComment(line); + var effectiveLine = commentPos >= 0 ? line.substring(0, commentPos).trim() : line; + + var srcMatch = effectiveLine.match(/^source-optional\s*=\s*(.+)$/) || + effectiveLine.match(/^source\s*=\s*(.+)$/); + if (srcMatch) { + var srcPath = srcMatch[1].trim(); + var resolvedSrc = root.resolveRelativePath(currentFilePath, srcPath); + if (isGlobPattern(resolvedSrc)) { + if (root.filesToParse.indexOf(resolvedSrc) === -1) { + root.filesToParse.push(resolvedSrc); + } + } else if (!root.parsedFiles[resolvedSrc] && root.filesToParse.indexOf(resolvedSrc) === -1) { + root.filesToParse.push(resolvedSrc); + } + } + } + // Second pass: parse keybinds from this file + root.parseMangoConfig(root.currentLines.join("\n")); + } + root.currentLines = []; + root.parseNextMangoFile(); + } + } + + function findMangoUnquotedComment(str) { + var inSingle = false; + var inDouble = false; + for (var i = 0; i < str.length; i++) { + var ch = str[i]; + if (ch === "'" && !inDouble) { inSingle = !inSingle; continue; } + if (ch === '"' && !inSingle) { inDouble = !inDouble; continue; } + if (ch === '#' && !inSingle && !inDouble) { + // Per-bind description suffix: #"description" — not a comment + if (str.charAt(i + 1) === '"') continue; + return i; + } + } + return -1; + } + + function parseMangoConfig(text) { + var lines = text.split('\n'); + var currentCategory = null; + var defaultCat = pluginApi?.tr("default-category"); + + for (var i = 0; i < lines.length; i++) { + var rawLine = lines[i]; + var commentPos = findMangoUnquotedComment(rawLine); + var effectiveLine = commentPos >= 0 ? rawLine.substring(0, commentPos).trim() : rawLine.trim(); + + // Pure-comment lines: only candidate for category detection (# Title) + if (effectiveLine.length === 0) { + var categoryCandidate = extractMangoCategory(rawLine); + if (categoryCandidate !== null) { + currentCategory = categoryCandidate; + } + continue; + } + + // Extract optional per-bind description: trailing #"description" + var perBindDesc = null; + var descMatch = effectiveLine.match(/#"([^"]*)"\s*$/); + if (descMatch) { + perBindDesc = descMatch[1]; + effectiveLine = effectiveLine.substring(0, descMatch.index).trim(); + if (effectiveLine.length === 0) continue; + } + + // bind=MODS,KEY,ACTION,ARGS (also `binds=` — keysym-based variant + // used by layout-aware setups like AZERTY) + var bindMatch = effectiveLine.match(/^binds?\s*=\s*(.+)$/); + if (bindMatch) { + var parts = bindMatch[1].split(','); + if (parts.length >= 3) { + var modStr = parts[0].trim(); + var key = parts[1].trim(); + var action = parts[2].trim(); + var args = parts.length >= 4 ? parts.slice(3).join(',').trim() : ""; + var cat = currentCategory || defaultCat; + var formattedKeys = formatMangoKeyCombo(modStr, key, "bind"); + var description = perBindDesc || formatMangoAction(action, args); + + if (!collectedBinds[cat]) collectedBinds[cat] = []; + collectedBinds[cat].push({ "keys": formattedKeys, "desc": description }); + } + continue; + } + + // axisbind=MODS,AXIS,ACTION,ARGS (also `axisbinds=` keysym variant) + var axisMatch = effectiveLine.match(/^axisbinds?\s*=\s*(.+)$/); + if (axisMatch) { + var axisParts = axisMatch[1].split(','); + if (axisParts.length >= 3) { + var aModStr = axisParts[0].trim(); + var axis = axisParts[1].trim().toUpperCase(); + var aAction = axisParts[2].trim(); + var aArgs = axisParts.length >= 4 ? axisParts.slice(3).join(',').trim() : ""; + var aCat = currentCategory || defaultCat; + var aKey = mangoAxisMap[axis] || axis; + var aCombo = formatMangoKeyCombo(aModStr, aKey, "axis"); + var aDesc = perBindDesc || formatMangoAction(aAction, aArgs); + + if (!collectedBinds[aCat]) collectedBinds[aCat] = []; + collectedBinds[aCat].push({ "keys": aCombo, "desc": aDesc }); + } + continue; + } + + // mousebind=MODS,BTN,ACTION,ARGS (also `mousebinds=` keysym variant) + var mouseMatch = effectiveLine.match(/^mousebinds?\s*=\s*(.+)$/); + if (mouseMatch) { + var mouseParts = mouseMatch[1].split(','); + if (mouseParts.length >= 3) { + var mModStr = mouseParts[0].trim(); + var btn = mouseParts[1].trim().toUpperCase(); + var mAction = mouseParts[2].trim(); + var mArgs = mouseParts.length >= 4 ? mouseParts.slice(3).join(',').trim() : ""; + var mCat = currentCategory || defaultCat; + var mKey = mangoButtonMap[btn] || btn; + var mCombo = formatMangoKeyCombo(mModStr, mKey, "mouse"); + var mDesc = perBindDesc || formatMangoAction(mAction, mArgs); + + if (!collectedBinds[mCat]) collectedBinds[mCat] = []; + collectedBinds[mCat].push({ "keys": mCombo, "desc": mDesc }); + } + } + } + } + + function extractMangoCategory(line) { + var trimmed = line.trim(); + // A category line is a standalone comment: # Category Name + if (!trimmed.startsWith('#')) return null; + // Strip leading hashes (#, ##, ###, ...) + var rest = trimmed.replace(/^#+/, '').trim(); + if (rest.length === 0) return null; + + // Length cap — categories shouldn't be paragraphs ("# TODO fix later" etc.) + if (rest.length > 100) return null; + + // Pure horizontal rule (only decorative chars): ────, ====, ----, **** + if (/^[─━═=\-_*#/\\\s]+$/.test(rest)) return null; + + // Reject paren/bracket continuation: "(continued)", "(see above)", "[note]" + if (/^[\(\[]/.test(rest)) return null; + + // Reject flow arrows: "→ next step", "->", "=>" + if (/^[→←↑↓⇒⇐➜➔►▶]/.test(rest)) return null; + if (rest.indexOf('->') === 0 || rest.indexOf('=>') === 0) return null; + + // Reject keyword-prefixed notes: "# TODO ...", "# FIXME ...", "# NOTE ..." + if (/^(TODO|FIXME|NOTE|HACK|XXX|BUG|WIP)\b/i.test(rest)) return null; + + // Strip trailing horizontal-rule decoration: "Category ────" -> "Category" + rest = rest.replace(/[─━═=\-_*]{3,}\s*$/, '').trim(); + if (rest.length === 0) return null; + + // Numbered list extraction: "1. Foo" -> "Foo" + var numbered = rest.match(/^\d+\.\s*(.+)$/); + if (numbered) return numbered[1].trim(); + + return rest; + } + + function formatMangoKeyCombo(modStr, key, kind) { + var mods = []; + var modUpper = modStr.toUpperCase(); + // SUPER aliases: SUPER, LOGO + if (modUpper.indexOf("SUPER") !== -1 || modUpper.indexOf("LOGO") !== -1) mods.push("Super"); + if (modUpper.indexOf("SHIFT") !== -1) mods.push("Shift"); + if (modUpper.indexOf("CTRL") !== -1 || modUpper.indexOf("CONTROL") !== -1) mods.push("Ctrl"); + // ALT aliases: ALT, MOD1 + if (modUpper.indexOf("ALT") !== -1 || modUpper.indexOf("MOD1") !== -1) mods.push("Alt"); + + // Map the key name. For bind keys, prefer XF86 special-key formatting (Vol Up, Mute, ...). + var mappedKey; + if (kind === "bind") { + var specialMapped = formatSpecialKey(key); + mappedKey = (specialMapped !== key) ? specialMapped : (mangoKeyNameMap[key] || key); + } else { + mappedKey = key; + } + + if (mods.length > 0) { + return mods.join(" + ") + " + " + mappedKey; + } + return mappedKey; + } + + function formatMangoAction(action, args) { + // Check Noctalia IPC calls: spawn_shell with qs ipc call ... + if (args.indexOf("noctalia-shell") !== -1 && args.indexOf("ipc") !== -1) { + var ipcMatch = args.match(/ipc\s+call\s+(\w+)\s+(\w+)/); + if (ipcMatch) { + var ipcKey = ipcMatch[1] + " " + ipcMatch[2]; + if (noctaliaIpcLabels[ipcKey]) return noctaliaIpcLabels[ipcKey]; + return ipcMatch[1] + ": " + ipcMatch[2]; + } + } + + // No-arg actions + if (mangoNoArgActions[action]) return mangoNoArgActions[action]; + + // Direction actions + if (mangoDirActions[action]) { + var dir = args ? args.toUpperCase() : ""; + return mangoDirActions[action] + (dir ? " " + dir : ""); + } + + // spawn / spawn_shell + if (action === "spawn" || action === "spawn_shell") { + return args ? "Run: " + args : "Run command"; + } + + // workspace / move to workspace + if (action === "workspace") return args ? "Workspace " + args : "Switch workspace"; + if (action === "movetoworkspace") return args ? "Move to workspace " + args : "Move to workspace"; + if (action === "movetoworkspacesilent") return args ? "Move (silent) to workspace " + args : "Move to workspace"; + + // Generic fallback: convert snake_case / camelCase to readable + return action.replace(/_/g, ' ').replace(/([A-Z])/g, ' $1').trim() + .replace(/\b\w/g, function(l) { return l.toUpperCase(); }); + } + + function finalizeMangoBinds() { + var categories = []; + for (var cat in collectedBinds) { + if (collectedBinds[cat].length > 0) { + categories.push({ "title": cat, "binds": collectedBinds[cat] }); + } + } + + if (categories.length === 0) { + Logger.w("KeybindCheatsheet", "Mango parser produced no binds; check config path and bind= directives"); + } + + saveToDb(categories); + isCurrentlyParsing = false; + clearParsingData(); + } + + IpcHandler { + target: "plugin:keybind-cheatsheet" + + function toggle() { + if (root.pluginApi) { + root.pluginApi.withCurrentScreen(screen => { + root.pluginApi.togglePanel(screen); + }); + } + } + + function refresh() { + root.refresh(); + } + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/Panel.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/Panel.qml new file mode 100644 index 0000000..c59119a --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/Panel.qml @@ -0,0 +1,657 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Services.UI +import qs.Services.Compositor +import qs.Widgets + +Item { + id: root + property var pluginApi: null + + // Settings + property var cfg: pluginApi?.pluginSettings || ({}) + property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({}) + + // Settings values + property int settingsWidth: cfg.windowWidth ?? defaults.windowWidth ?? 1400 + property int settingsHeight: cfg.windowHeight ?? defaults.windowHeight ?? 0 + property bool autoHeight: cfg.autoHeight ?? defaults.autoHeight ?? true + property int columnCount: cfg.columnCount ?? defaults.columnCount ?? 3 + + // Bug 4 fix: re-evaluate rawCategories whenever Main.qml increments cheatsheetDataVersion + property int _dataVersion: pluginApi?.mainInstance?.cheatsheetDataVersion ?? 0 + property var rawCategories: { + var _v = _dataVersion; // force QML dependency on version counter + return pluginApi?.pluginSettings?.cheatsheetData || []; + } + property var categories: [] + + // Bug 5 fix: timeout if parsing never completes + property bool loadingTimedOut: false + + Timer { + id: loadingTimeoutTimer + interval: 4000 + repeat: false + running: false + onTriggered: { + if (root.isLoading) { + root.loadingTimedOut = true; + } + } + } + + Component.onCompleted: { + categories = processCategories(rawCategories); + // Start timeout timer if we have no data yet + if (root.isLoading) { + loadingTimeoutTimer.start(); + } + } + + + // Dynamic column items (up to 4 columns) + property var columnItems: [] + + // Memory leak prevention: debounce column updates + Timer { + id: columnUpdateDebounce + interval: 100 + repeat: false + onTriggered: updateColumnItemsNow() + } + + Component.onDestruction: { + // Stop timer to prevent firing after destruction + columnUpdateDebounce.stop(); + loadingTimeoutTimer.stop(); + + // Clear column items + columnItems = []; + } + + onRawCategoriesChanged: { + categories = processCategories(rawCategories); + updateColumnItems(); + } + + onCategoriesChanged: { + updateColumnItems(); + contentPreferredHeight = calculateDynamicHeight(); + } + + onColumnCountChanged: { + updateColumnItems(); + contentPreferredHeight = calculateDynamicHeight(); + } + + onPanelOpenScreenChanged: { + // Recalculate height when screen becomes available (important for bar widget opening) + contentPreferredHeight = calculateDynamicHeight(); + root.searchText = ""; + if (searchInput) searchInput.inputItem.forceActiveFocus(); + } + + onMaxScreenHeightChanged: { + contentPreferredHeight = calculateDynamicHeight(); + } + + function updateColumnItems() { + columnUpdateDebounce.restart(); + } + + function updateColumnItemsNow() { + columnItems = []; // Clear old items explicitly + var assignments = distributeCategories(); + var items = []; + for (var i = 0; i < columnCount; i++) { + items.push(buildColumnItems(assignments[i] || [])); + } + columnItems = items; + } + + // Screen height limit (90% of screen) + property var panelOpenScreen: pluginApi?.panelOpenScreen + property real maxScreenHeight: panelOpenScreen ? panelOpenScreen.height * 0.9 : 800 + + property string searchText: "" + + property real contentPreferredWidth: settingsWidth + property real contentPreferredHeight: calculateDynamicHeight() + readonly property var geometryPlaceholder: panelContainer + readonly property bool allowAttach: false + readonly property bool panelAnchorHorizontalCenter: true + readonly property bool panelAnchorVerticalCenter: true + anchors.fill: parent + + // Key badge colors — read from settings with manifest defaults as fallback + readonly property color keyColorAlt: cfg.keyColorAlt || defaults.keyColorAlt || "#FF6B6B" + readonly property color keyColorXF86: cfg.keyColorXF86 || defaults.keyColorXF86 || "#4ECDC4" + readonly property color keyColorPrint: cfg.keyColorPrint || defaults.keyColorPrint || "#95E1D3" + readonly property color keyColorNumeric: cfg.keyColorNumeric || defaults.keyColorNumeric || "#A8DADC" + readonly property color keyColorMouse: cfg.keyColorMouse || defaults.keyColorMouse || "#F38181" + // Empty string = use theme color (mPrimary/mSecondary/mTertiary) + readonly property string keyColorSuperOverride: cfg.keyColorSuper ?? defaults.keyColorSuper ?? "" + readonly property string keyColorCtrlOverride: cfg.keyColorCtrl ?? defaults.keyColorCtrl ?? "" + readonly property string keyColorShiftOverride: cfg.keyColorShift ?? defaults.keyColorShift ?? "" + readonly property color keyColorDefault: cfg.keyColorDefault || defaults.keyColorDefault || "#6C757D" + readonly property color keyLabelColor: cfg.keyLabelColor || defaults.keyLabelColor || "#FFFFFF" + // Empty string = theme-aware fallback (Color.mOnSurface). Any non-empty + // value is treated as an explicit user override. + readonly property string descriptionColorOverride: cfg.descriptionTextColor || defaults.descriptionTextColor || "" + readonly property color descriptionTextColor: descriptionColorOverride !== "" ? descriptionColorOverride : Color.mOnSurface + + // Per-category text color overrides (empty = fall back to keyLabelColor) + readonly property string keyTextSuperOverride: cfg.keyTextSuper ?? defaults.keyTextSuper ?? "" + readonly property string keyTextCtrlOverride: cfg.keyTextCtrl ?? defaults.keyTextCtrl ?? "" + readonly property string keyTextShiftOverride: cfg.keyTextShift ?? defaults.keyTextShift ?? "" + readonly property string keyTextAltOverride: cfg.keyTextAlt ?? defaults.keyTextAlt ?? "" + readonly property string keyTextXF86Override: cfg.keyTextXF86 ?? defaults.keyTextXF86 ?? "" + readonly property string keyTextPrintOverride: cfg.keyTextPrint ?? defaults.keyTextPrint ?? "" + readonly property string keyTextNumericOverride: cfg.keyTextNumeric ?? defaults.keyTextNumeric ?? "" + readonly property string keyTextMouseOverride: cfg.keyTextMouse ?? defaults.keyTextMouse ?? "" + readonly property string keyTextDefaultOverride: cfg.keyTextDefault ?? defaults.keyTextDefault ?? "" + + // Workspace category split tuning + readonly property bool splitWorkspaces: cfg.splitLargeWorkspaceCategory ?? defaults.splitLargeWorkspaceCategory ?? true + readonly property int workspaceSplitThreshold: cfg.workspaceSplitThreshold ?? defaults.workspaceSplitThreshold ?? 12 + + // Data is loaded by Main.qml, we just display it + property bool isLoading: rawCategories.length === 0 + + function calculateDynamicHeight() { + // If auto height is disabled, use manual height (but still respect screen limit) + if (!autoHeight && settingsHeight > 0) { + return Math.min(settingsHeight, maxScreenHeight); + } + + if (categories.length === 0) return Math.min(400, maxScreenHeight); + + var assignments = distributeCategories(); + var maxColumnHeight = 0; + + for (var col = 0; col < columnCount; col++) { + var colHeight = 0; + var catIndices = assignments[col] || []; + + for (var i = 0; i < catIndices.length; i++) { + var catIndex = catIndices[i]; + if (catIndex >= categories.length) continue; + + var cat = categories[catIndex]; + colHeight += 26; // Header + colHeight += cat.binds.length * 20; // Binds + if (i < catIndices.length - 1) { + colHeight += 6; // Spacer + } + } + + if (colHeight > maxColumnHeight) { + maxColumnHeight = colHeight; + } + } + + // header (45) + content + margins (16) + var totalHeight = 45 + maxColumnHeight + 16 + 15 + 15; + // Limit to 80% of screen height + return Math.max(300, Math.min(totalHeight, maxScreenHeight)); + } + + // ========== UI ========== + Rectangle { + id: panelContainer + anchors.fill: parent + color: "transparent" + radius: Style.radiusL + clip: true + + Rectangle { + id: header + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: 45 + color: Color.mSurfaceVariant + radius: Style.radiusL + + RowLayout { + anchors.fill: parent + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM + spacing: Style.marginS + + // Title section (centered) + Item { Layout.fillWidth: true } + + NIcon { + icon: "keyboard" + pointSize: Style.fontSizeM + color: Color.mPrimary + } + NText { + text: CompositorService.isHyprland ? pluginApi?.tr("panel.title-hyprland") : + CompositorService.isNiri ? pluginApi?.tr("panel.title-niri") : + CompositorService.isMango ? pluginApi?.tr("panel.title-mango") : + pluginApi?.tr("panel.title") + font.pointSize: Style.fontSizeM + font.weight: Font.Bold + color: Color.mPrimary + } + + NTextInput { + id: searchInput + placeholderText: pluginApi?.tr("panel.search-placeholder") + text: root.searchText + + onTextChanged: { + root.searchText = text; + root.updateColumnItems(); + } + } + + Item { Layout.fillWidth: true } + + // Refresh button + NIconButton { + icon: "refresh" + onClicked: { + pluginApi?.mainInstance?.refresh(); + } + } + + // Settings button + NIconButton { + icon: "settings" + onClicked: { + var screen = pluginApi?.panelOpenScreen; + if (screen && pluginApi?.manifest) { + pluginApi.closePanel(screen); + BarService.openPluginSettings(screen, pluginApi.manifest); + } + } + } + } + } + + NText { + id: loadingText + anchors.centerIn: parent + text: root.loadingTimedOut ? pluginApi?.tr("panel.loading-timeout") : pluginApi?.tr("panel.loading") + visible: root.isLoading + font.pointSize: Style.fontSizeL + color: Color.mOnSurface + } + + NScrollView { + id: scrollView + visible: root.categories.length > 0 && !root.isLoading + anchors.top: header.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + clip: true + leftPadding: 35 + rightPadding: -10 + topPadding: 15 + bottomPadding: 15 + + RowLayout { + id: mainLayout + width: scrollView.availableWidth - Style.marginS + spacing: Style.marginS + + Repeater { + model: root.columnItems.length + + ColumnLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + spacing: 2 + + property var colItems: root.columnItems[index] || [] + + Repeater { + model: colItems + Loader { + Layout.fillWidth: true + sourceComponent: modelData.type === "header" ? headerComponent : + (modelData.type === "spacer" ? spacerComponent : bindComponent) + property var itemData: modelData + + // Memory leak prevention: explicit cleanup + Component.onDestruction: { + active = false; + sourceComponent = undefined; + } + } + } + } + } + } + } + } + + Component { + id: headerComponent + ColumnLayout { + Layout.preferredWidth: 300 + Layout.topMargin: Style.marginM + Layout.bottomMargin: 4 + spacing: 0 + + Item { Layout.fillWidth: true; height: 1 } + + NText { + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + x: parent.width - implicitWidth + text: itemData.title + font.pointSize: Style.fontSizeM + font.weight: Font.Bold + color: Color.mPrimary + } + + Item { Layout.fillWidth: true; height: 1 } + } + } + + + Component { + id: spacerComponent + Item { + height: 10 + Layout.fillWidth: true + } + } + + Component { + id: bindComponent + RowLayout { + id: bindRow + spacing: Style.marginS + height: 22 + Layout.bottomMargin: 1 + + property bool editing: false + + Flow { + Layout.preferredWidth: 220 + Layout.alignment: Qt.AlignVCenter + spacing: 3 + Repeater { + model: itemData.keys.split(" + ") + Rectangle { + width: keyText.implicitWidth + 10 + height: 18 + color: getKeyColor(modelData) + radius: 3 + NText { + id: keyText + anchors.centerIn: parent + text: modelData + font.pointSize: modelData.length > 12 ? 7 : 8 + font.weight: Font.Bold + color: getKeyTextColor(modelData) + } + } + } + } + + // Described bind: plain text (unchanged behaviour) + NText { + visible: !itemData.undescribed + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + text: itemData.desc + font.pointSize: Style.fontSizeXS + color: root.descriptionTextColor + elide: Text.ElideRight + } + + // Undescribed bind: placeholder + add-description / hide actions + NText { + visible: itemData.undescribed && !bindRow.editing + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + text: pluginApi?.tr("panel.no-description") + font.pointSize: Style.fontSizeXS + font.italic: true + color: Color.mOnSurfaceVariant + elide: Text.ElideRight + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { bindRow.editing = true; descInput.text = ""; descInput.inputItem.forceActiveFocus(); } + } + } + + NTextInput { + id: descInput + visible: itemData.undescribed && bindRow.editing + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + placeholderText: pluginApi?.tr("panel.add-description-placeholder") + } + + NIconButton { + visible: itemData.undescribed && bindRow.editing + Layout.preferredHeight: 18 + icon: "check" + tooltipText: pluginApi?.tr("panel.save-description") + onClicked: { + root.saveBindDescription(itemData.bindId, descInput.text); + bindRow.editing = false; + } + } + + NIconButton { + visible: itemData.undescribed && bindRow.editing + Layout.preferredHeight: 18 + icon: "close" + tooltipText: pluginApi?.tr("panel.cancel") + onClicked: { bindRow.editing = false; } + } + + NIconButton { + visible: itemData.undescribed && !bindRow.editing + Layout.preferredHeight: 18 + icon: "edit" + tooltipText: pluginApi?.tr("panel.add-description") + onClicked: { bindRow.editing = true; descInput.text = ""; descInput.inputItem.forceActiveFocus(); } + } + + NIconButton { + visible: itemData.undescribed && !bindRow.editing + Layout.preferredHeight: 18 + icon: "eye-off" + tooltipText: pluginApi?.tr("panel.hide-bind") + onClicked: { root.hideBind(itemData.bindId); } + } + } + } + + function getKeyColor(keyName) { + if (keyName === "Super") return root.keyColorSuperOverride || Color.mPrimary; + if (keyName === "Ctrl") return root.keyColorCtrlOverride || Color.mSecondary; + if (keyName === "Shift") return root.keyColorShiftOverride || Color.mTertiary; + if (keyName === "Alt") return root.keyColorAlt; + if (keyName.startsWith("XF86")) return root.keyColorXF86; + if (keyName === "PRINT" || keyName === "Print") return root.keyColorPrint; + if (keyName.match(/^[0-9]$/)) return root.keyColorNumeric; + if (keyName.includes("MOUSE") || keyName.includes("Wheel")) return root.keyColorMouse; + return root.keyColorDefault; + } + + function getKeyTextColor(keyName) { + if (keyName === "Super") return root.keyTextSuperOverride || root.keyLabelColor; + if (keyName === "Ctrl") return root.keyTextCtrlOverride || root.keyLabelColor; + if (keyName === "Shift") return root.keyTextShiftOverride || root.keyLabelColor; + if (keyName === "Alt") return root.keyTextAltOverride || root.keyLabelColor; + if (keyName.startsWith("XF86")) return root.keyTextXF86Override || root.keyLabelColor; + if (keyName === "PRINT" || keyName === "Print") return root.keyTextPrintOverride || root.keyLabelColor; + if (keyName.match(/^[0-9]$/)) return root.keyTextNumericOverride || root.keyLabelColor; + if (keyName.includes("MOUSE") || keyName.includes("Wheel")) return root.keyTextMouseOverride || root.keyLabelColor; + return root.keyTextDefaultOverride || root.keyLabelColor; + } + + // ===== Bind override helpers (shared keyed map in plugin settings) ===== + function _cloneOverrides() { + if (!pluginApi || !pluginApi.pluginSettings) return ({}); + var src = pluginApi.pluginSettings.bindOverrides || ({}); + try { return JSON.parse(JSON.stringify(src)); } catch (e) { return ({}); } + } + + function saveBindDescription(bindId, desc) { + if (!pluginApi || !bindId) return; + var o = _cloneOverrides(); + if (!o[bindId]) o[bindId] = ({}); + var trimmed = (desc || "").trim(); + if (trimmed.length === 0) { + delete o[bindId].desc; + if (Object.keys(o[bindId]).length === 0) delete o[bindId]; + } else { + o[bindId].desc = trimmed; + } + pluginApi.pluginSettings.bindOverrides = o; + pluginApi.saveSettings(); + pluginApi.mainInstance?.refresh(); + } + + function hideBind(bindId) { + if (!pluginApi || !bindId) return; + var o = _cloneOverrides(); + if (!o[bindId]) o[bindId] = ({}); + o[bindId].hidden = true; + pluginApi.pluginSettings.bindOverrides = o; + pluginApi.saveSettings(); + pluginApi.mainInstance?.refresh(); + } + + function buildColumnItems(categoryIndices) { + var result = []; + if (!categoryIndices) return result; + + for (var i = 0; i < categoryIndices.length; i++) { + var catIndex = categoryIndices[i]; + if (catIndex >= categories.length) continue; + + var cat = categories[catIndex]; + result.push({ type: "header", title: cat.title }); + var term = root.searchText.toLowerCase(); + for (var j = 0; j < cat.binds.length; j++) { + var bnd = cat.binds[j]; + var isUndesc = bnd.undescribed === true; + if (!term || (bnd.desc && bnd.desc.toLowerCase().indexOf(term) !== -1) || (isUndesc && bnd.keys.toLowerCase().indexOf(term) !== -1)) { + result.push({ + type: "bind", + keys: bnd.keys, + desc: bnd.desc, + bindId: bnd.bindId || "", + undescribed: isUndesc + }); + } + } + if (i < categoryIndices.length - 1) { + result.push({ type: "spacer" }); + } + } + return result; + } + + function processCategories(cats) { + if (!cats || cats.length === 0) return []; + if (!root.splitWorkspaces) return cats; + + var result = []; + for (var i = 0; i < cats.length; i++) { + var cat = cats[i]; + if (!cat.binds || cat.binds.length <= root.workspaceSplitThreshold) { + result.push(cat); + continue; + } + + // Detect a category dominated by workspace verbs. + // Hyprland verbs: workspace, movetoworkspace, movetoworkspacesilent, movecurrentworkspacetomonitor + // Niri verbs: focus-workspace, move-window-to-workspace, move-column-to-workspace + var workspaceCount = 0; + for (var k = 0; k < cat.binds.length; k++) { + var v = cat.binds[k]._verb || ""; + if (v.indexOf("workspace") !== -1) workspaceCount++; + } + var workspaceDominated = workspaceCount >= Math.ceil(cat.binds.length * 0.6); + if (!workspaceDominated) { + result.push(cat); + continue; + } + + var switching = [], moving = [], mouse = []; + for (var j = 0; j < cat.binds.length; j++) { + var bind = cat.binds[j]; + var verb = bind._verb || ""; + var isMouse = (bind._mainKey || "").indexOf("MOUSE") !== -1 || + (bind.keys || "").indexOf("MOUSE") !== -1 || + (bind.keys || "").indexOf("Wheel") !== -1; + + if (isMouse) { + mouse.push(bind); + } else if (verb.indexOf("move") !== -1 || verb.indexOf("send") !== -1) { + // Hyprland: movetoworkspace*, Niri: move-window-to-workspace, move-column-to-workspace + moving.push(bind); + } else { + // Hyprland: workspace, Niri: focus-workspace + switching.push(bind); + } + } + + if (switching.length > 0) result.push({ title: pluginApi?.tr("panel.workspace-switching"), binds: switching }); + if (moving.length > 0) result.push({ title: pluginApi?.tr("panel.workspace-moving"), binds: moving }); + if (mouse.length > 0) result.push({ title: pluginApi?.tr("panel.workspace-mouse"), binds: mouse }); + } + return result; + } + + function distributeCategories() { + var numCols = root.columnCount; + + // Calculate weights for each category + var catData = []; + for (var i = 0; i < categories.length; i++) { + var weight = 1 + categories[i].binds.length + 1; // header + binds + spacer + catData.push({ index: i, weight: weight }); + } + + // Sort by weight descending (largest categories first for better distribution) + catData.sort(function(a, b) { return b.weight - a.weight; }); + + var columns = []; + var columnWeights = []; + for (var c = 0; c < numCols; c++) { + columns.push([]); + columnWeights.push(0); + } + + // Assign each category to the column with smallest current weight + for (var i = 0; i < catData.length; i++) { + var minCol = 0; + for (var c = 1; c < numCols; c++) { + if (columnWeights[c] < columnWeights[minCol]) { + minCol = c; + } + } + columns[minCol].push(catData[i].index); + columnWeights[minCol] += catData[i].weight; + } + + // Sort categories within each column by original order for consistent display + for (var c = 0; c < numCols; c++) { + columns[c].sort(function(a, b) { return a - b; }); + } + + return columns; + } + +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/README.md b/dot_config/noctalia/plugins/keybind-cheatsheet/README.md new file mode 100644 index 0000000..5c30b87 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/README.md @@ -0,0 +1,272 @@ +# Keybind Cheatsheet for Noctalia + +Universal keyboard shortcuts cheatsheet plugin for Noctalia that **automatically detects** your compositor (Hyprland, Niri or MangoWC) and displays your keybindings with **recursive config parsing**. Supports the classic Hyprland `.conf` format, the new **Hyprland 0.55+ Lua config**, Niri KDL and MangoWC. + +![Preview](preview.png) + +## Features + +- **Automatic compositor detection** (Hyprland, Niri, MangoWC) +- **Hyprland Lua config support** (Hyprland 0.55+) via `hyprctl binds -j` +- **Recursive config parsing** - follows `source` (Hyprland `.conf`), `require()` (Hyprland Lua) and `include` (Niri) directives +- **Glob pattern support** - parses `~/.config/hypr/*.conf` style includes +- **Without Description section** - binds with no description are surfaced, not dropped; add a custom description or hide them inline +- **Full per-category color customization** - background + text color for every key category, with live preview and clipboard quick-paste +- **Search filter** - type to filter keybindings in the panel +- **Configurable paths & parser mode** - custom config locations and forced Lua/conf parser in settings +- **Smart key formatting** - XF86 keys display as readable names (Vol Up, Bright Down, etc.) +- **Flexible column layout** (1-4 columns) with auto-height +- **IPC support** - `toggle` and `refresh` for global hotkeys + +## Supported Compositors + +| Compositor | Default Config | How it's read | +|------------|----------------|----------------| +| **Hyprland 0.55+** | `~/.config/hypr/hyprland.lua` | `hyprctl binds -j` (live, already-evaluated binds) | +| **Hyprland (classic)** | `~/.config/hypr/hyprland.conf` | hyprlang `.conf` text parser (recursive) | +| **Niri** | `~/.config/niri/config.kdl` | KDL parser (recursive `include`) | +| **MangoWC** | `~/.config/mango/config.conf` | `bind=` / `axisbind=` / `mousebind=` parser | + +## Installation + +```bash +cp -r keybind-cheatsheet ~/.config/noctalia/plugins/ +``` + +## Usage + +### Bar Widget +Add the plugin to your bar configuration in Noctalia settings. Click the keyboard icon to open the cheatsheet. + +### Global Hotkey + +**Hyprland:** +```bash +bind = $mod, F1, exec, qs -c noctalia-shell ipc call plugin:keybind-cheatsheet toggle +``` +You can set your custom Super key variable (e.g. `$mainMod`) in the plugin settings. + +**Niri:** +```kdl +binds { + Mod+F1 { spawn-sh "qs -c noctalia-shell ipc call plugin:keybind-cheatsheet toggle"; } +} +``` + +**MangoWC:** +```bash +bind=SUPER,F1,spawn,qs -c noctalia-shell ipc call plugin:keybind-cheatsheet toggle +``` + +### IPC Commands + +| Command | Effect | +|---------|--------| +| `qs -c noctalia-shell ipc call plugin:keybind-cheatsheet toggle` | Open / close the cheatsheet panel | +| `qs -c noctalia-shell ipc call plugin:keybind-cheatsheet refresh` | Force a re-parse of your keybindings | + +`refresh` is useful after editing your config — bind it to a key to reload without restarting the shell. + +## Hyprland Lua Config (0.55+) + +Hyprland 0.55 replaced the static hyprlang `.conf` with a **Lua config** (`hyprland.lua`). Binds can now be generated with `require()`, `for` loops and runtime logic, so they **cannot be recovered by reading the file as text**. + +### How it works + +Instead of parsing the Lua file, the plugin asks Hyprland directly: + +1. **Authoritative bind list** — runs `hyprctl binds -j` and reads the already-evaluated JSON bind list. This correctly handles `require()` modules, `for` loops and multi-key chords — whatever Hyprland *actually* has bound at runtime. +2. **Category & description recovery** — the plugin then *lightly scans* `hyprland.lua` and every file it pulls in via `require()` to recover human-readable structure: + - **Category headers**: a comment in the form `-- N. NAME` (e.g. `-- 1. Applications`) + - **Static descriptions**: a `description = "..."` (or `desc = '...'`) literal maps that exact description to the current category + - **Loop-generated descriptions**: a concatenated literal such as `description = "Workspace " .. i` is treated as a *prefix* — any bind whose description starts with `Workspace ` is filed under that category +3. Binds whose description can't be matched fall into a generic **Other** category; binds with no description at all go to the **Without Description** section (see below). + +You don't need to change your Lua config — just keep using `-- N. NAME` comment headers and `description = "..."` fields where you want grouping. + +**Example Lua structure the scanner understands:** +```lua +-- 1. Applications +Hyprland.config.bind("$mod, T", function() ... end, { description = "Terminal" }) +Hyprland.config.bind("$mod, B", function() ... end, { description = "Browser" }) + +-- 2. Workspaces +for i = 1, 9 do + Hyprland.config.bind("$mod, " .. i, function() ... end, + { description = "Workspace " .. i }) -- prefix "Workspace " -> category "Workspaces" +end + +require("keybinds") -- followed and scanned recursively +``` + +### Parser mode + +A **Parser Mode** setting controls which Hyprland parser is used: + +| Mode | Behavior | +|------|----------| +| `auto` *(default)* | Use the Lua parser if `hyprland.lua` exists, otherwise fall back to the `.conf` parser | +| `lua` | Always use `hyprctl binds -j` (Lua parser) | +| `conf` | Always use the classic `.conf` text parser | + +The legacy hyprlang `.conf` parser is **kept unchanged** as a fallback for users still on hyprlang configs. + +## Without Description Section + +Binds with no description are no longer silently dropped. They appear in a dedicated **Without Description** section where you can: + +- **Add a custom description** inline — it is remembered and displayed like any other bind +- **Hide** a bind you don't care about + +Overrides are keyed by a **stable bind identity** (`submap | modmask | key | flags | dispatcher`) that deliberately excludes Hyprland's unstable internal Lua registry reference, so your custom descriptions and hidden binds **survive Hyprland restarts**. + +Settings provide a **"Show binds without a description"** toggle, plus **"Restore hidden"** and **"Clear all overrides"** actions. + +## Config Format + +### Hyprland (classic `.conf`) + +Recursively parses your main config and all `source` includes. + +```bash +# 1. APPLICATIONS +bind = $mainMod, T, exec, alacritty #"Terminal" +bind = $mainMod, B, exec, firefox #"Browser" + +# 2. WINDOW MANAGEMENT +bind = $mainMod, Q, killactive, #"Close window" +bind = $mainMod, F, fullscreen, #"Toggle fullscreen" +``` + +- Categories: `# N. CATEGORY NAME` (N is a number) +- Descriptions: `#"description"` at end of the bind line +- `source = ~/.config/hypr/keybinds.conf` and globs like `source = ~/.config/hypr/apps/*.conf` are followed automatically + +### Niri + +Parses the `binds { }` block and follows all `include` directives. + +```kdl +binds { + // #"Applications" + Mod+T hotkey-overlay-title="Terminal" { spawn "alacritty"; } + + // #"Window Management" + Mod+Q hotkey-overlay-title="Close window" { close-window; } + + // #"Workspaces" + Mod+1 { focus-workspace 1; } +} +``` + +- Categories: `// #"Category Name"` (exact format) +- Descriptions: `hotkey-overlay-title="description"` attribute +- Without descriptions, actions are auto-categorized by type (see table below) +- `include "~/.config/niri/binds.kdl"` is followed automatically + +### MangoWC + +Parses `bind=`, `axisbind=` and `mousebind=` directives from `~/.config/mango/config.conf`. + +```bash +# Applications +bind=SUPER,T,spawn,alacritty #"Terminal" +bind=SUPER,B,spawn,firefox #"Browser" + +# Window Management +bind=SUPER,Q,killclient, #"Close window" +``` + +- Categories: standalone `# Category Name` comment lines +- Descriptions: trailing `#"description"` on a bind line +- Modifier aliases recognized: `LOGO` = `SUPER`, `MOD1` = `ALT` +- XF86 media keys are formatted (Vol Up, Mute, Bright Up/Down, …) +- Lines without a preceding `# Category` use the localized default category + +## Auto-Categorization (Niri) + +When no category comment is provided, keybindings are grouped by action: + +| Action prefix | Category | +|---------------|----------| +| `spawn` | Applications | +| `focus-column-*` | Column Navigation | +| `focus-window-*` | Window Focus | +| `focus-workspace-*` | Workspace Navigation | +| `move-column-*` | Move Columns | +| `move-window-*` | Move Windows | +| `close-window`, `fullscreen-window` | Window Management | +| `maximize-column` | Column Management | +| `set-column-width` | Column Width | +| `screenshot*` | Screenshots | +| `power-off-monitors` | Power | +| `quit` | System | + +## Special Key Formatting + +| Raw Key | Display | +|---------|---------| +| `XF86AudioRaiseVolume` | Vol Up | +| `XF86AudioLowerVolume` | Vol Down | +| `XF86AudioMute` | Mute | +| `XF86MonBrightnessUp` | Bright Up | +| `XF86MonBrightnessDown` | Bright Down | +| `Print` | PrtSc | +| `Prior` / `Next` | PgUp / PgDn | + +## Color Customization + +Every key category has independently themeable **background** and **text** colors: +`Super`, `Ctrl`, `Shift`, `Alt`, `XF86`, `Print`, numeric, mouse and default letter keys — plus the description text color. + +- **Two-pill rows** per category: left pill = background, right pill = label text on that background. Click a pill to open the color picker. +- **Theme-aware defaults**: `Super` / `Ctrl` / `Shift` use an empty sentinel meaning "use the Material theme accent" (`mPrimary` / `mSecondary` / `mTertiary`), so themed setups stay untouched unless you deliberately override. +- **Clipboard quick-paste**: copy a `#RRGGBB` / `#RRGGBBAA` hex and a paste icon appears in each pill — one click applies it (clipboard polled via `wl-paste`). +- **Live preview + revert**: changes preview immediately; closing Settings without Save restores the snapshot taken when the panel opened. +- **Per-row reset** and a **"Reset all colors"** action restore theme defaults. + +## Settings + +Access settings via the gear icon in the panel header: + +- **Window width / height** (auto or manual) and **column count** (1-4) +- **Hyprland config path** — classic `.conf` location +- **Hyprland Lua path** — `hyprland.lua` location (0.55+) +- **Parser mode** — `auto` / `lua` / `conf` +- **Niri config path** / **MangoWC config path** +- **Show binds without a description** toggle + **Restore hidden** / **Clear all overrides** +- **Merge sequential binds** and **split large workspace category** (threshold configurable) +- **Per-category colors** — background + text for every category, with clipboard paste and reset +- **Refresh** — force reload keybindings + +## Troubleshooting + +### "Loading..." stays forever +1. Check the compositor is detected: look for logs tagged `[KeybindCheatsheet]` +2. Verify the config file exists at the configured path +3. On Hyprland 0.55+, confirm `hyprctl binds -j` works in your terminal + +### `hyprctl` error shown in the panel +The Lua parser depends on `hyprctl binds -j`. Ensure Hyprland is running and `hyprctl` is on your `PATH`, or force the classic parser by setting **Parser mode** to `conf`. + +### No categories found +- **Hyprland `.conf` / MangoWC:** categories must be `# 1.` / `# Category Name` comment lines +- **Hyprland Lua:** add `-- N. NAME` headers and `description = "..."` fields in `hyprland.lua` (and `require()`d modules) +- **Niri:** use `// #"Category Name"` format + +### Binds missing or under "Without Description" +On Lua configs, descriptions are matched from `description = "..."` literals against the live `hyprctl` binds. Loop-generated binds need a concatenated prefix literal (e.g. `"Workspace " .. i`). Anything unmatched lands in **Without Description**, where you can add a description or hide it. + +### Keybinds from included files not showing +The plugin follows `source` (Hyprland `.conf`), `require()` (Hyprland Lua) and `include` (Niri) directives automatically. Check logs to see which files are parsed. + +## Requirements + +- Noctalia Shell 3.6.0+ +- Hyprland (classic `.conf` or 0.55+ Lua), Niri, or MangoWC +- `hyprctl` on `PATH` for Hyprland Lua configs +- `wl-paste` (wl-clipboard) for the color clipboard quick-paste feature + +## License + +MIT diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/Settings.qml b/dot_config/noctalia/plugins/keybind-cheatsheet/Settings.qml new file mode 100644 index 0000000..47ef87a --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/Settings.qml @@ -0,0 +1,1393 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Widgets +import qs.Services.UI +import "." as Local + +ColumnLayout { + id: root + spacing: 0 + + property var pluginApi: null + property var cfg: pluginApi?.pluginSettings || ({}) + property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({}) + + // Live preview + revert-on-cancel pattern (approved deviation from edit-copy). + // Color settings apply visually in real time via _applyPreview, but the snapshot + // is restored on close if saveSettings() (Apply) was never called. + property var _snapshot: null + property bool _applied: false + + function _applyPreview(key, value) { + if (!pluginApi) return; + var patch = {}; + patch[key] = value; + pluginApi.pluginSettings = Object.assign({}, pluginApi.pluginSettings, patch); + } + + // Edit-copy properties for non-preview settings (window, layout, parsing, paths) + property int editWindowWidth: cfg.windowWidth ?? defaults.windowWidth ?? 1400 + property int editWindowHeight: cfg.windowHeight ?? defaults.windowHeight ?? 850 + property bool editAutoHeight: cfg.autoHeight ?? defaults.autoHeight ?? true + property int editColumnCount: cfg.columnCount ?? defaults.columnCount ?? 3 + property string editModKeyVariable: cfg.modKeyVariable || defaults.modKeyVariable || "$mod" + property string editHyprlandConfigPath: cfg.hyprlandConfigPath || defaults.hyprlandConfigPath || "~/.config/hypr/hyprland.conf" + property string editHyprlandLuaConfigPath: cfg.hyprlandLuaConfigPath || defaults.hyprlandLuaConfigPath || "~/.config/hypr/hyprland.lua" + property string editHyprlandParserMode: cfg.hyprlandParserMode || defaults.hyprlandParserMode || "auto" + property string editNiriConfigPath: cfg.niriConfigPath || defaults.niriConfigPath || "~/.config/niri/config.kdl" + property string editMangoConfigPath: cfg.mangoConfigPath || defaults.mangoConfigPath || "~/.config/mango/config.conf" + property bool editMergeSequentialBinds: cfg.mergeSequentialBinds ?? defaults.mergeSequentialBinds ?? true + property bool editShowUndescribedBinds: cfg.showUndescribedBinds ?? defaults.showUndescribedBinds ?? false + property bool editSplitLargeWorkspaceCategory: cfg.splitLargeWorkspaceCategory ?? defaults.splitLargeWorkspaceCategory ?? true + property int editWorkspaceSplitThreshold: cfg.workspaceSplitThreshold ?? defaults.workspaceSplitThreshold ?? 12 + + // Live-preview properties for colors (mirror current pluginSettings; written via _applyPreview). + // All background color fields are stored as string (hex) for empty-string support. + property string valueKeyColorSuper: cfg.keyColorSuper ?? defaults.keyColorSuper ?? "" + property string valueKeyColorCtrl: cfg.keyColorCtrl ?? defaults.keyColorCtrl ?? "" + property string valueKeyColorShift: cfg.keyColorShift ?? defaults.keyColorShift ?? "" + property string valueKeyColorAlt: cfg.keyColorAlt ?? defaults.keyColorAlt ?? "#FF6B6B" + property string valueKeyColorXF86: cfg.keyColorXF86 ?? defaults.keyColorXF86 ?? "#4ECDC4" + property string valueKeyColorPrint: cfg.keyColorPrint ?? defaults.keyColorPrint ?? "#95E1D3" + property string valueKeyColorNumeric: cfg.keyColorNumeric ?? defaults.keyColorNumeric ?? "#A8DADC" + property string valueKeyColorMouse: cfg.keyColorMouse ?? defaults.keyColorMouse ?? "#F38181" + property string valueKeyColorDefault: cfg.keyColorDefault ?? defaults.keyColorDefault ?? "#6C757D" + // Per-category text color overrides — empty string = fall back to keyLabelColor global + property string valueKeyTextSuper: cfg.keyTextSuper ?? defaults.keyTextSuper ?? "" + property string valueKeyTextCtrl: cfg.keyTextCtrl ?? defaults.keyTextCtrl ?? "" + property string valueKeyTextShift: cfg.keyTextShift ?? defaults.keyTextShift ?? "" + property string valueKeyTextAlt: cfg.keyTextAlt ?? defaults.keyTextAlt ?? "" + property string valueKeyTextXF86: cfg.keyTextXF86 ?? defaults.keyTextXF86 ?? "" + property string valueKeyTextPrint: cfg.keyTextPrint ?? defaults.keyTextPrint ?? "" + property string valueKeyTextNumeric: cfg.keyTextNumeric ?? defaults.keyTextNumeric ?? "" + property string valueKeyTextMouse: cfg.keyTextMouse ?? defaults.keyTextMouse ?? "" + property string valueKeyTextDefault: cfg.keyTextDefault ?? defaults.keyTextDefault ?? "" + property string valueKeyLabelColor: cfg.keyLabelColor ?? defaults.keyLabelColor ?? "#FFFFFF" + property string valueDescriptionTextColor: cfg.descriptionTextColor ?? defaults.descriptionTextColor ?? "" + + // Clipboard polling for quick-paste feature. + // Reads wl-paste periodically while Settings is visible; exposes a validated hex if found. + property string clipboardHex: "" + + Timer { + id: clipboardTimer + interval: 1500 + running: root.visible + repeat: true + triggeredOnStart: true + onTriggered: if (!clipboardProcess.running) clipboardProcess.running = true + } + + Process { + id: clipboardProcess + command: ["wl-paste", "-n"] + stdout: StdioCollector { + onStreamFinished: { + var raw = (text || "").trim(); + // Accept #RRGGBB or #RRGGBBAA (with or without leading #) + var m = raw.match(/^#?([0-9a-fA-F]{6}(?:[0-9a-fA-F]{2})?)$/); + if (m) { + root.clipboardHex = "#" + m[1].toUpperCase(); + } else { + root.clipboardHex = ""; + } + } + } + } + + Component.onCompleted: { + if (pluginApi) { + _snapshot = JSON.parse(JSON.stringify(pluginApi.pluginSettings)); + } + } + + Component.onDestruction: { + clipboardTimer.stop(); + if (clipboardProcess.running) clipboardProcess.running = false; + if (!_applied && pluginApi && _snapshot) { + pluginApi.pluginSettings = Object.assign({}, _snapshot); + } + } + + // ============ TAB BAR ============ + NTabBar { + id: tabBar + Layout.fillWidth: true + Layout.bottomMargin: Style.marginM + distributeEvenly: true + currentIndex: tabView.currentIndex + + NTabButton { + text: pluginApi?.tr("settings.tab-general") + icon: "settings" + tabIndex: 0 + checked: tabBar.currentIndex === 0 + } + NTabButton { + text: pluginApi?.tr("settings.tab-appearance") + icon: "color-picker" + tabIndex: 1 + checked: tabBar.currentIndex === 1 + } + } + + Item { + Layout.fillWidth: true + Layout.preferredHeight: Style.marginS + } + + // ============ TAB VIEW ============ + NTabView { + id: tabView + currentIndex: tabBar.currentIndex + + // ============ TAB 1: GENERAL ============ + ColumnLayout { + id: generalTab + spacing: Style.marginM + + // Header + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.title") + pointSize: Style.fontSizeXXL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.description") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeM + wrapMode: Text.WordWrap + } + + // ===== Window Size ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: sizeContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: sizeContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginS + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.window-size") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + RowLayout { + spacing: Style.marginM + + NText { + text: pluginApi?.tr("settings.width") + color: Color.mOnSurface + pointSize: Style.fontSizeM + Layout.preferredWidth: 120 + } + + NTextInput { + id: widthInput + Layout.preferredWidth: 100 * Style.uiScaleRatio + Layout.preferredHeight: Style.baseWidgetSize + text: root.editWindowWidth.toString() + onTextChanged: { + var val = parseInt(text); + if (!isNaN(val) && val >= 400 && val <= 3000) { + root.editWindowWidth = val; + } + } + } + + NText { + text: pluginApi?.tr("settings.width-range") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + } + } + + RowLayout { + spacing: Style.marginM + + NText { + text: pluginApi?.tr("settings.height") + color: Color.mOnSurface + pointSize: Style.fontSizeM + Layout.preferredWidth: 120 + } + + NToggle { + id: autoHeightToggle + label: pluginApi?.tr("settings.auto-height") + checked: root.editAutoHeight + onToggled: function(checked) { + root.editAutoHeight = checked; + } + } + + NTextInput { + id: heightInput + Layout.preferredWidth: 100 * Style.uiScaleRatio + Layout.preferredHeight: Style.baseWidgetSize + Component.onCompleted: text = root.editWindowHeight > 0 ? root.editWindowHeight.toString() : "850" + enabled: !autoHeightToggle.checked + opacity: enabled ? 1.0 : 0.5 + onTextChanged: { + var val = parseInt(text); + if (!isNaN(val) && val >= 300 && val <= 2000) { + root.editWindowHeight = val; + } + } + } + + NText { + text: pluginApi?.tr("settings.height-range") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + opacity: autoHeightToggle.checked ? 0.5 : 1.0 + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.auto-height-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + } + } + + // ===== Layout (Columns) ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: columnContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: columnContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginS + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.layout") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + RowLayout { + spacing: Style.marginM + + NText { + text: pluginApi?.tr("settings.columns") + color: Color.mOnSurface + pointSize: Style.fontSizeM + } + + NComboBox { + id: columnCombo + Layout.preferredWidth: 150 * Style.uiScaleRatio + Layout.preferredHeight: Style.baseWidgetSize + model: ListModel { + ListElement { name: "1"; key: "1" } + ListElement { name: "2"; key: "2" } + ListElement { name: "3"; key: "3" } + ListElement { name: "4"; key: "4" } + } + currentKey: root.editColumnCount.toString() + onSelected: key => { + root.editColumnCount = parseInt(key); + } + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.columns-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + } + } + + // ===== Parsing Options ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: parsingContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: parsingContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginS + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.parsing-options") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NToggle { + Layout.fillWidth: true + label: pluginApi?.tr("settings.merge-sequential") + description: pluginApi?.tr("settings.merge-sequential-hint") + checked: root.editMergeSequentialBinds + onToggled: function(checked) { + root.editMergeSequentialBinds = checked; + } + } + + NToggle { + Layout.fillWidth: true + label: pluginApi?.tr("settings.show-undescribed") + description: pluginApi?.tr("settings.show-undescribed-hint") + checked: root.editShowUndescribedBinds + onToggled: function(checked) { + root.editShowUndescribedBinds = checked; + } + } + + // Bind override management (custom descriptions / hidden binds) + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginXS + + function overrideCount(kind) { + var o = root.pluginApi?.pluginSettings?.bindOverrides || ({}); + var n = 0; + for (var k in o) { + if (kind === "hidden" && o[k] && o[k].hidden === true) n++; + else if (kind === "desc" && o[k] && o[k].desc) n++; + } + return n; + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.overrides-summary", { + "hidden": parent.overrideCount("hidden"), + "custom": parent.overrideCount("desc") + }) + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + + RowLayout { + spacing: Style.marginM + + NButton { + text: pluginApi?.tr("settings.restore-hidden") + icon: "eye" + onClicked: { + var o = root.pluginApi?.pluginSettings?.bindOverrides || ({}); + var next = ({}); + for (var k in o) { + var e = ({}); + if (o[k] && o[k].desc) e.desc = o[k].desc; + if (Object.keys(e).length > 0) next[k] = e; + } + if (root.pluginApi && root.pluginApi.pluginSettings) { + root.pluginApi.pluginSettings.bindOverrides = next; + root.pluginApi.saveSettings(); + root.pluginApi.mainInstance?.refresh(); + } + ToastService.showNotice(root.pluginApi?.tr("settings.restore-hidden-message")); + } + } + + NButton { + text: pluginApi?.tr("settings.clear-overrides") + icon: "rotate" + onClicked: { + if (root.pluginApi && root.pluginApi.pluginSettings) { + root.pluginApi.pluginSettings.bindOverrides = ({}); + root.pluginApi.saveSettings(); + root.pluginApi.mainInstance?.refresh(); + } + ToastService.showNotice(root.pluginApi?.tr("settings.clear-overrides-message")); + } + } + } + } + + NToggle { + Layout.fillWidth: true + label: pluginApi?.tr("settings.split-workspaces") + description: pluginApi?.tr("settings.split-workspaces-hint") + checked: root.editSplitLargeWorkspaceCategory + onToggled: function(checked) { + root.editSplitLargeWorkspaceCategory = checked; + } + } + + RowLayout { + spacing: Style.marginM + visible: root.editSplitLargeWorkspaceCategory + + NText { + text: pluginApi?.tr("settings.split-threshold") + color: Color.mOnSurface + pointSize: Style.fontSizeM + Layout.fillWidth: true + } + + NSpinBox { + Layout.preferredWidth: 140 * Style.uiScaleRatio + value: root.editWorkspaceSplitThreshold + from: 4 + to: 50 + stepSize: 1 + onValueChanged: { + root.editWorkspaceSplitThreshold = value; + } + } + } + } + } + + // ===== Configuration Files ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: pathsContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: pathsContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.config-paths") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.config-paths-description") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + + ColumnLayout { + spacing: Style.marginXS + + RowLayout { + spacing: Style.marginS + NIcon { + icon: "keyboard" + pointSize: Style.fontSizeM + color: Color.mOnSurface + } + NText { + text: pluginApi?.tr("settings.mod-var") + color: Color.mOnSurface + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + + NTextInput { + id: modVarInput + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + text: root.editModKeyVariable + placeholderText: "$mod" + onTextChanged: { + if (text.length > 0) root.editModKeyVariable = text; + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.mod-var-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Color.mOutline + opacity: 0.3 + } + + ColumnLayout { + spacing: Style.marginXS + + RowLayout { + spacing: Style.marginS + NIcon { + icon: "terminal" + pointSize: Style.fontSizeM + color: Color.mPrimary + } + NText { + text: pluginApi?.tr("settings.hyprland-path") + color: Color.mOnSurface + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + + NTextInput { + id: hyprlandPathInput + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + text: root.editHyprlandConfigPath + placeholderText: "~/.config/hypr/hyprland.conf" + onTextChanged: { + if (text.length > 0) root.editHyprlandConfigPath = text; + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.hyprland-format-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Color.mOutline + opacity: 0.3 + } + + // Hyprland Lua path + parser mode (Hyprland 0.55+) + ColumnLayout { + spacing: Style.marginXS + + RowLayout { + spacing: Style.marginS + NIcon { + icon: "terminal" + pointSize: Style.fontSizeM + color: Color.mPrimary + } + NText { + text: pluginApi?.tr("settings.hyprland-lua-path") + color: Color.mOnSurface + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + + NTextInput { + id: hyprlandLuaPathInput + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + text: root.editHyprlandLuaConfigPath + placeholderText: "~/.config/hypr/hyprland.lua" + onTextChanged: { + if (text.length > 0) root.editHyprlandLuaConfigPath = text; + } + } + + RowLayout { + spacing: Style.marginM + NText { + text: pluginApi?.tr("settings.hyprland-parser-mode") + color: Color.mOnSurface + pointSize: Style.fontSizeM + } + NComboBox { + id: parserModeCombo + Layout.preferredWidth: 180 * Style.uiScaleRatio + Layout.preferredHeight: Style.baseWidgetSize + model: ListModel { + ListElement { name: "Auto"; key: "auto" } + ListElement { name: "Lua (hyprctl)"; key: "lua" } + ListElement { name: "Legacy .conf"; key: "conf" } + } + currentKey: root.editHyprlandParserMode + onSelected: key => { root.editHyprlandParserMode = key; } + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.hyprland-lua-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Color.mOutline + opacity: 0.3 + } + + ColumnLayout { + spacing: Style.marginXS + + RowLayout { + spacing: Style.marginS + NIcon { + icon: "layout" + pointSize: Style.fontSizeM + color: Color.mSecondary + } + NText { + text: pluginApi?.tr("settings.niri-path") + color: Color.mOnSurface + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + + NTextInput { + id: niriPathInput + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + text: root.editNiriConfigPath + placeholderText: "~/.config/niri/config.kdl" + onTextChanged: { + if (text.length > 0) root.editNiriConfigPath = text; + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.niri-format-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Color.mOutline + opacity: 0.3 + } + + ColumnLayout { + spacing: Style.marginXS + + RowLayout { + spacing: Style.marginS + NIcon { + icon: "terminal" + pointSize: Style.fontSizeM + color: Color.mTertiary + } + NText { + text: pluginApi?.tr("settings.mango-path") + color: Color.mOnSurface + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + + NTextInput { + id: mangoPathInput + Layout.fillWidth: true + Layout.preferredHeight: Style.baseWidgetSize + text: root.editMangoConfigPath + placeholderText: "~/.config/mango/config.conf" + onTextChanged: { + if (text.length > 0) root.editMangoConfigPath = text; + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.mango-format-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + } + } + + // ===== Actions ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: actionsContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: actionsContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.actions") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + RowLayout { + spacing: Style.marginM + + NButton { + text: pluginApi?.tr("settings.refresh-keybinds") + icon: "refresh" + onClicked: { + pluginApi?.mainInstance?.refresh(); + ToastService.showNotice(pluginApi?.tr("settings.refresh-message")); + } + } + + NButton { + text: pluginApi?.tr("settings.reset-defaults") + icon: "rotate" + onClicked: { + root.editWindowWidth = defaults.windowWidth || 1400; + root.editWindowHeight = defaults.windowHeight || 850; + root.editAutoHeight = defaults.autoHeight ?? true; + root.editColumnCount = defaults.columnCount || 3; + root.editModKeyVariable = defaults.modKeyVariable || "$mod"; + root.editHyprlandConfigPath = defaults.hyprlandConfigPath || "~/.config/hypr/hyprland.conf"; + root.editHyprlandLuaConfigPath = defaults.hyprlandLuaConfigPath || "~/.config/hypr/hyprland.lua"; + root.editHyprlandParserMode = defaults.hyprlandParserMode || "auto"; + root.editNiriConfigPath = defaults.niriConfigPath || "~/.config/niri/config.kdl"; + root.editMangoConfigPath = defaults.mangoConfigPath || "~/.config/mango/config.conf"; + root.editMergeSequentialBinds = defaults.mergeSequentialBinds ?? true; + root.editShowUndescribedBinds = defaults.showUndescribedBinds ?? false; + root.editSplitLargeWorkspaceCategory = defaults.splitLargeWorkspaceCategory ?? true; + root.editWorkspaceSplitThreshold = defaults.workspaceSplitThreshold ?? 12; + + widthInput.text = root.editWindowWidth.toString(); + heightInput.text = root.editWindowHeight.toString(); + modVarInput.text = root.editModKeyVariable; + hyprlandPathInput.text = root.editHyprlandConfigPath; + hyprlandLuaPathInput.text = root.editHyprlandLuaConfigPath; + niriPathInput.text = root.editNiriConfigPath; + mangoPathInput.text = root.editMangoConfigPath; + + if (pluginApi && pluginApi.pluginSettings) { + pluginApi.pluginSettings.cheatsheetData = []; + pluginApi.saveSettings(); + } + + ToastService.showNotice(pluginApi?.tr("settings.reset-message")); + } + } + } + } + } + + // ===== Keybind Setup ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: keybindContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: keybindContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginS + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.keybind-setup") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.keybind-setup-description") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: commandText.implicitHeight + Style.marginS * 2 + color: Color.mSurface + radius: Style.radiusS + + NText { + id: commandText + anchors.fill: parent + anchors.margins: Style.marginS + text: pluginApi?.tr("settings.keybind-ipc-command") + font.family: "monospace" + pointSize: Style.fontSizeS + color: Color.mPrimary + wrapMode: Text.WrapAnywhere + } + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.keybind-example-hyprland") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.keybind-example-niri") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.keybind-example-mango") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeXS + wrapMode: Text.WordWrap + } + } + } + + Item { + Layout.preferredHeight: Style.marginL + } + } + // ============ END TAB 1 ============ + + // ============ TAB 2: APPEARANCE ============ + ColumnLayout { + id: appearanceTab + spacing: Style.marginM + + // Header + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.appearance-section") + pointSize: Style.fontSizeXXL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.appearance-description") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeM + wrapMode: Text.WordWrap + } + + // ===== Live Preview ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: previewContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: previewContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.preview-section") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + Flow { + Layout.fillWidth: true + spacing: Style.marginS + + Component { + id: previewBadge + Rectangle { + property string label: "" + property color bg: "#888888" + property color fg: "#FFFFFF" + width: badgeText.implicitWidth + Style.marginM * 2 + height: badgeText.implicitHeight + Style.marginS * 2 + radius: Style.radiusS + color: bg + border.color: Qt.darker(bg, 1.4) + border.width: Math.max(1, Style.borderS) + + NText { + id: badgeText + anchors.centerIn: parent + text: parent.label + color: parent.fg + pointSize: Style.fontSizeM + font.weight: Style.fontWeightBold + } + } + } + + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Super"; + item.bg = Qt.binding(function() { return root.valueKeyColorSuper || Color.mPrimary }); + item.fg = Qt.binding(function() { return root.valueKeyTextSuper || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Ctrl"; + item.bg = Qt.binding(function() { return root.valueKeyColorCtrl || Color.mSecondary }); + item.fg = Qt.binding(function() { return root.valueKeyTextCtrl || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Shift"; + item.bg = Qt.binding(function() { return root.valueKeyColorShift || Color.mTertiary }); + item.fg = Qt.binding(function() { return root.valueKeyTextShift || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Alt"; + item.bg = Qt.binding(function() { return root.valueKeyColorAlt }); + item.fg = Qt.binding(function() { return root.valueKeyTextAlt || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "XF86Audio"; + item.bg = Qt.binding(function() { return root.valueKeyColorXF86 }); + item.fg = Qt.binding(function() { return root.valueKeyTextXF86 || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Print"; + item.bg = Qt.binding(function() { return root.valueKeyColorPrint }); + item.fg = Qt.binding(function() { return root.valueKeyTextPrint || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "1-9"; + item.bg = Qt.binding(function() { return root.valueKeyColorNumeric }); + item.fg = Qt.binding(function() { return root.valueKeyTextNumeric || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "mouse:272"; + item.bg = Qt.binding(function() { return root.valueKeyColorMouse }); + item.fg = Qt.binding(function() { return root.valueKeyTextMouse || root.valueKeyLabelColor }); + } } + Loader { sourceComponent: previewBadge; onLoaded: { + item.label = "Q"; + item.bg = Qt.binding(function() { return root.valueKeyColorDefault }); + item.fg = Qt.binding(function() { return root.valueKeyTextDefault || root.valueKeyLabelColor }); + } } + } + + // Description preview sample + NText { + Layout.fillWidth: true + Layout.topMargin: Style.marginS + text: pluginApi?.tr("settings.color-description") + " — sample" + color: root.valueDescriptionTextColor + pointSize: Style.fontSizeM + } + } + } + + // ===== Color Pickers ===== + NBox { + Layout.fillWidth: true + Layout.preferredHeight: colorContent.implicitHeight + Style.marginM * 2 + color: Color.mSurfaceVariant + + ColumnLayout { + id: colorContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.color-pickers") + pointSize: Style.fontSizeL + font.weight: Style.fontWeightBold + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.color-theme-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + + RowLayout { + Layout.fillWidth: true + spacing: Style.marginS + NIcon { + icon: "clipboard" + pointSize: Style.fontSizeM + color: root.clipboardHex.length > 0 ? Color.mPrimary : Color.mOnSurfaceVariant + } + NText { + Layout.fillWidth: true + text: pluginApi?.tr("settings.color-paste-hint") + color: Color.mOnSurfaceVariant + pointSize: Style.fontSizeS + wrapMode: Text.WordWrap + } + } + + // Super (modifier: empty bg = theme accent) + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-super") + letter: "S" + bgValue: root.valueKeyColorSuper + textValue: root.valueKeyTextSuper + bgFallback: Color.mPrimary + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorSuper = c.toString(); root._applyPreview("keyColorSuper", c.toString()); } + onTextPicked: c => { root.valueKeyTextSuper = c.toString(); root._applyPreview("keyTextSuper", c.toString()); } + onBgPasted: hex => { root.valueKeyColorSuper = hex; root._applyPreview("keyColorSuper", hex); } + onTextPasted: hex => { root.valueKeyTextSuper = hex; root._applyPreview("keyTextSuper", hex); } + onResetRequested: { + root.valueKeyColorSuper = ""; root._applyPreview("keyColorSuper", ""); + root.valueKeyTextSuper = ""; root._applyPreview("keyTextSuper", ""); + } + } + + // Ctrl + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-ctrl") + letter: "C" + bgValue: root.valueKeyColorCtrl + textValue: root.valueKeyTextCtrl + bgFallback: Color.mSecondary + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorCtrl = c.toString(); root._applyPreview("keyColorCtrl", c.toString()); } + onTextPicked: c => { root.valueKeyTextCtrl = c.toString(); root._applyPreview("keyTextCtrl", c.toString()); } + onBgPasted: hex => { root.valueKeyColorCtrl = hex; root._applyPreview("keyColorCtrl", hex); } + onTextPasted: hex => { root.valueKeyTextCtrl = hex; root._applyPreview("keyTextCtrl", hex); } + onResetRequested: { + root.valueKeyColorCtrl = ""; root._applyPreview("keyColorCtrl", ""); + root.valueKeyTextCtrl = ""; root._applyPreview("keyTextCtrl", ""); + } + } + + // Shift + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-shift") + letter: "⇧" + bgValue: root.valueKeyColorShift + textValue: root.valueKeyTextShift + bgFallback: Color.mTertiary + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorShift = c.toString(); root._applyPreview("keyColorShift", c.toString()); } + onTextPicked: c => { root.valueKeyTextShift = c.toString(); root._applyPreview("keyTextShift", c.toString()); } + onBgPasted: hex => { root.valueKeyColorShift = hex; root._applyPreview("keyColorShift", hex); } + onTextPasted: hex => { root.valueKeyTextShift = hex; root._applyPreview("keyTextShift", hex); } + onResetRequested: { + root.valueKeyColorShift = ""; root._applyPreview("keyColorShift", ""); + root.valueKeyTextShift = ""; root._applyPreview("keyTextShift", ""); + } + } + + // Alt + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-alt") + letter: "A" + bgValue: root.valueKeyColorAlt + textValue: root.valueKeyTextAlt + bgFallback: defaults.keyColorAlt || "#FF6B6B" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorAlt = c.toString(); root._applyPreview("keyColorAlt", c.toString()); } + onTextPicked: c => { root.valueKeyTextAlt = c.toString(); root._applyPreview("keyTextAlt", c.toString()); } + onBgPasted: hex => { root.valueKeyColorAlt = hex; root._applyPreview("keyColorAlt", hex); } + onTextPasted: hex => { root.valueKeyTextAlt = hex; root._applyPreview("keyTextAlt", hex); } + onResetRequested: { + var d = defaults.keyColorAlt || "#FF6B6B"; + root.valueKeyColorAlt = d; root._applyPreview("keyColorAlt", d); + root.valueKeyTextAlt = ""; root._applyPreview("keyTextAlt", ""); + } + } + + // XF86 + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-xf86") + letter: "♪" + bgValue: root.valueKeyColorXF86 + textValue: root.valueKeyTextXF86 + bgFallback: defaults.keyColorXF86 || "#4ECDC4" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorXF86 = c.toString(); root._applyPreview("keyColorXF86", c.toString()); } + onTextPicked: c => { root.valueKeyTextXF86 = c.toString(); root._applyPreview("keyTextXF86", c.toString()); } + onBgPasted: hex => { root.valueKeyColorXF86 = hex; root._applyPreview("keyColorXF86", hex); } + onTextPasted: hex => { root.valueKeyTextXF86 = hex; root._applyPreview("keyTextXF86", hex); } + onResetRequested: { + var d = defaults.keyColorXF86 || "#4ECDC4"; + root.valueKeyColorXF86 = d; root._applyPreview("keyColorXF86", d); + root.valueKeyTextXF86 = ""; root._applyPreview("keyTextXF86", ""); + } + } + + // Print + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-print") + letter: "P" + bgValue: root.valueKeyColorPrint + textValue: root.valueKeyTextPrint + bgFallback: defaults.keyColorPrint || "#95E1D3" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorPrint = c.toString(); root._applyPreview("keyColorPrint", c.toString()); } + onTextPicked: c => { root.valueKeyTextPrint = c.toString(); root._applyPreview("keyTextPrint", c.toString()); } + onBgPasted: hex => { root.valueKeyColorPrint = hex; root._applyPreview("keyColorPrint", hex); } + onTextPasted: hex => { root.valueKeyTextPrint = hex; root._applyPreview("keyTextPrint", hex); } + onResetRequested: { + var d = defaults.keyColorPrint || "#95E1D3"; + root.valueKeyColorPrint = d; root._applyPreview("keyColorPrint", d); + root.valueKeyTextPrint = ""; root._applyPreview("keyTextPrint", ""); + } + } + + // Numeric + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-numeric") + letter: "1" + bgValue: root.valueKeyColorNumeric + textValue: root.valueKeyTextNumeric + bgFallback: defaults.keyColorNumeric || "#A8DADC" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorNumeric = c.toString(); root._applyPreview("keyColorNumeric", c.toString()); } + onTextPicked: c => { root.valueKeyTextNumeric = c.toString(); root._applyPreview("keyTextNumeric", c.toString()); } + onBgPasted: hex => { root.valueKeyColorNumeric = hex; root._applyPreview("keyColorNumeric", hex); } + onTextPasted: hex => { root.valueKeyTextNumeric = hex; root._applyPreview("keyTextNumeric", hex); } + onResetRequested: { + var d = defaults.keyColorNumeric || "#A8DADC"; + root.valueKeyColorNumeric = d; root._applyPreview("keyColorNumeric", d); + root.valueKeyTextNumeric = ""; root._applyPreview("keyTextNumeric", ""); + } + } + + // Mouse + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-mouse") + letter: "M" + bgValue: root.valueKeyColorMouse + textValue: root.valueKeyTextMouse + bgFallback: defaults.keyColorMouse || "#F38181" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorMouse = c.toString(); root._applyPreview("keyColorMouse", c.toString()); } + onTextPicked: c => { root.valueKeyTextMouse = c.toString(); root._applyPreview("keyTextMouse", c.toString()); } + onBgPasted: hex => { root.valueKeyColorMouse = hex; root._applyPreview("keyColorMouse", hex); } + onTextPasted: hex => { root.valueKeyTextMouse = hex; root._applyPreview("keyTextMouse", hex); } + onResetRequested: { + var d = defaults.keyColorMouse || "#F38181"; + root.valueKeyColorMouse = d; root._applyPreview("keyColorMouse", d); + root.valueKeyTextMouse = ""; root._applyPreview("keyTextMouse", ""); + } + } + + // Default letter keys + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-default") + letter: "Q" + bgValue: root.valueKeyColorDefault + textValue: root.valueKeyTextDefault + bgFallback: defaults.keyColorDefault || "#6C757D" + textFallback: root.valueKeyLabelColor + clipboardHex: root.clipboardHex + onBgPicked: c => { root.valueKeyColorDefault = c.toString(); root._applyPreview("keyColorDefault", c.toString()); } + onTextPicked: c => { root.valueKeyTextDefault = c.toString(); root._applyPreview("keyTextDefault", c.toString()); } + onBgPasted: hex => { root.valueKeyColorDefault = hex; root._applyPreview("keyColorDefault", hex); } + onTextPasted: hex => { root.valueKeyTextDefault = hex; root._applyPreview("keyTextDefault", hex); } + onResetRequested: { + var d = defaults.keyColorDefault || "#6C757D"; + root.valueKeyColorDefault = d; root._applyPreview("keyColorDefault", d); + root.valueKeyTextDefault = ""; root._applyPreview("keyTextDefault", ""); + } + } + + // Description text (text-only row — no background) + // Empty value = theme-aware (Color.mOnSurface) at render time. + Local.ColorPairRow { + pluginApi: root.pluginApi + labelText: pluginApi?.tr("settings.color-description") + letter: "T" + showBg: false + bgValue: "" + textValue: root.valueDescriptionTextColor + textFallback: Color.mOnSurface + clipboardHex: root.clipboardHex + onTextPicked: c => { root.valueDescriptionTextColor = c.toString(); root._applyPreview("descriptionTextColor", c.toString()); } + onTextPasted: hex => { root.valueDescriptionTextColor = hex; root._applyPreview("descriptionTextColor", hex); } + onResetRequested: { + root.valueDescriptionTextColor = ""; root._applyPreview("descriptionTextColor", ""); + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Color.mOutline + opacity: 0.3 + } + + NButton { + Layout.alignment: Qt.AlignRight + text: pluginApi?.tr("settings.reset-all-colors") + icon: "rotate" + onClicked: { + var dAlt = defaults.keyColorAlt || "#FF6B6B"; + var dXF86 = defaults.keyColorXF86 || "#4ECDC4"; + var dPrint = defaults.keyColorPrint || "#95E1D3"; + var dNumeric = defaults.keyColorNumeric || "#A8DADC"; + var dMouse = defaults.keyColorMouse || "#F38181"; + var dDefault = defaults.keyColorDefault || "#6C757D"; + var dLabel = defaults.keyLabelColor || "#FFFFFF"; + var dDesc = defaults.descriptionTextColor ?? ""; + + root.valueKeyColorSuper = ""; + root.valueKeyColorCtrl = ""; + root.valueKeyColorShift = ""; + root.valueKeyColorAlt = dAlt; + root.valueKeyColorXF86 = dXF86; + root.valueKeyColorPrint = dPrint; + root.valueKeyColorNumeric = dNumeric; + root.valueKeyColorMouse = dMouse; + root.valueKeyColorDefault = dDefault; + root.valueKeyLabelColor = dLabel; + root.valueDescriptionTextColor = dDesc; + + root.valueKeyTextSuper = ""; + root.valueKeyTextCtrl = ""; + root.valueKeyTextShift = ""; + root.valueKeyTextAlt = ""; + root.valueKeyTextXF86 = ""; + root.valueKeyTextPrint = ""; + root.valueKeyTextNumeric = ""; + root.valueKeyTextMouse = ""; + root.valueKeyTextDefault = ""; + + if (pluginApi) { + pluginApi.pluginSettings = Object.assign({}, pluginApi.pluginSettings, { + keyColorSuper: "", + keyColorCtrl: "", + keyColorShift: "", + keyColorAlt: dAlt, + keyColorXF86: dXF86, + keyColorPrint: dPrint, + keyColorNumeric: dNumeric, + keyColorMouse: dMouse, + keyColorDefault: dDefault, + keyLabelColor: dLabel, + descriptionTextColor: dDesc, + keyTextSuper: "", + keyTextCtrl: "", + keyTextShift: "", + keyTextAlt: "", + keyTextXF86: "", + keyTextPrint: "", + keyTextNumeric: "", + keyTextMouse: "", + keyTextDefault: "" + }); + } + } + } + } + } + + Item { + Layout.preferredHeight: Style.marginL + } + } + // ============ END TAB 2 ============ + } + // ============ END TAB VIEW ============ + + // Save function called by the shell when user clicks Apply/Save + function saveSettings() { + if (!pluginApi) return; + + pluginApi.pluginSettings.windowWidth = root.editWindowWidth; + pluginApi.pluginSettings.windowHeight = root.editWindowHeight; + pluginApi.pluginSettings.autoHeight = root.editAutoHeight; + pluginApi.pluginSettings.columnCount = root.editColumnCount; + pluginApi.pluginSettings.modKeyVariable = root.editModKeyVariable; + pluginApi.pluginSettings.hyprlandConfigPath = root.editHyprlandConfigPath; + pluginApi.pluginSettings.hyprlandLuaConfigPath = root.editHyprlandLuaConfigPath; + pluginApi.pluginSettings.hyprlandParserMode = root.editHyprlandParserMode; + pluginApi.pluginSettings.niriConfigPath = root.editNiriConfigPath; + pluginApi.pluginSettings.mangoConfigPath = root.editMangoConfigPath; + pluginApi.pluginSettings.mergeSequentialBinds = root.editMergeSequentialBinds; + pluginApi.pluginSettings.showUndescribedBinds = root.editShowUndescribedBinds; + pluginApi.pluginSettings.splitLargeWorkspaceCategory = root.editSplitLargeWorkspaceCategory; + pluginApi.pluginSettings.workspaceSplitThreshold = root.editWorkspaceSplitThreshold; + + pluginApi.pluginSettings.keyColorAlt = root.valueKeyColorAlt.toString(); + pluginApi.pluginSettings.keyColorXF86 = root.valueKeyColorXF86.toString(); + pluginApi.pluginSettings.keyColorPrint = root.valueKeyColorPrint.toString(); + pluginApi.pluginSettings.keyColorNumeric = root.valueKeyColorNumeric.toString(); + pluginApi.pluginSettings.keyColorMouse = root.valueKeyColorMouse.toString(); + pluginApi.pluginSettings.keyColorSuper = root.valueKeyColorSuper; + pluginApi.pluginSettings.keyColorCtrl = root.valueKeyColorCtrl; + pluginApi.pluginSettings.keyColorShift = root.valueKeyColorShift; + pluginApi.pluginSettings.keyColorDefault = root.valueKeyColorDefault.toString(); + pluginApi.pluginSettings.keyLabelColor = root.valueKeyLabelColor.toString(); + pluginApi.pluginSettings.descriptionTextColor = root.valueDescriptionTextColor.toString(); + + pluginApi.pluginSettings.keyTextSuper = root.valueKeyTextSuper; + pluginApi.pluginSettings.keyTextCtrl = root.valueKeyTextCtrl; + pluginApi.pluginSettings.keyTextShift = root.valueKeyTextShift; + pluginApi.pluginSettings.keyTextAlt = root.valueKeyTextAlt; + pluginApi.pluginSettings.keyTextXF86 = root.valueKeyTextXF86; + pluginApi.pluginSettings.keyTextPrint = root.valueKeyTextPrint; + pluginApi.pluginSettings.keyTextNumeric = root.valueKeyTextNumeric; + pluginApi.pluginSettings.keyTextMouse = root.valueKeyTextMouse; + pluginApi.pluginSettings.keyTextDefault = root.valueKeyTextDefault; + + _applied = true; + pluginApi.saveSettings(); + + if (pluginApi.mainInstance) { + pluginApi.mainInstance.refresh(); + } + + ToastService.showNotice(pluginApi?.tr("settings.saved")); + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/de.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/de.json new file mode 100644 index 0000000..357d24c --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/de.json @@ -0,0 +1,113 @@ +{ + "default-category": "Tastenkürzel", + "error": { + "unsupported-compositor": "Nicht unterstützter Compositor", + "sway-not-supported": "Sway wird noch nicht unterstützt", + "sway-detail": "Sway-Unterstützung wird möglicherweise in einem zukünftigen Update hinzugefügt (ähnliches Format wie Hyprland)", + "labwc-not-supported": "LabWC wird nicht unterstützt.", + "labwc-detail": "LabWC verwendet das XML-Konfigurationsformat, das mit diesem Plugin nicht kompatibel ist.", + "unknown-compositor": "Unbekannter Compositor erkannt", + "unknown-detail": "Dieses Plugin unterstützt nur Niri und Hyprland als Compositor", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Laden...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Tastenbelegung", + "title-hyprland": "Hyprland Tastenbelegung", + "title-niri": "Niri Tastenbelegung", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ARBEITSBEREICHE - WECHSELN", + "workspace-moving": "ARBEITSBEREICHE - VERSCHIEBEN", + "workspace-mouse": "ARBEITSBEREICHE - MAUS", + "search-placeholder": "Tastenkombinationen suchen...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Tastenkürzel-Ubersicht Einstellungen", + "description": "Konfigurieren Sie das Aussehen und die Quellen der Tastenkürzel fur das Panel.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Fenstergröße", + "width": "Breite:", + "height": "Höhe:", + "auto-height": "Auto", + "auto-height-hint": "Wenn 'Auto' aktiviert ist, passt sich die Höhe automatisch an den Inhalt an.", + "layout": "Layout", + "columns": "Anzahl der Spalten:", + "columns-hint": "Mehr Spalten funktionieren besser mit breiteren Fenstern.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Konfigurationsdateien", + "config-paths-description": "Geben Sie benutzerdefinierte Pfade zu Ihren Tastenkürzel-Konfigurationsdateien an. Das Plugin folgt automatisch allen include/source Direktiven.", + "hyprland-format-hint": "Erwartetes Format: bind = $mod, KEY, action #\"beschreibung\"\nKategorien: # 1. KATEGORIENAME", + "niri-format-hint": "Kategorien werden erstellt mit: // #\"Kategoriename\"\nBeschreibungen: hotkey-overlay-title=\"beschreibung\"", + "actions": "Aktionen", + "refresh-keybinds": "Tastenkürzel aktualisieren", + "refresh-message": "Tastenkürzel werden beim Öffnen des Panels neu geladen.", + "reset-defaults": "Auf Standard zurücksetzen", + "reset-message": "Einstellungen wurden auf Standard zurückgesetzt.", + "saved": "Einstellungen erfolgreich gespeichert.", + "keybind-setup": "Tastenkürzel-Einrichtung", + "keybind-setup-description": "Um die Übersicht mit einer Tastenkombination zu öffnen, fuge diese Bindung zu deiner Compositor-Konfiguration hinzu:", + "keybind-example-hyprland": "Hyprland Beispiel: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri Beispiel: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod-Tasten-Variable", + "mod-var-hint": "Der Variablenname für Ihre Super-Taste (z.B. $mod oder $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland Pfad", + "niri-path": "Niri Pfad", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Tipp: Kopiere eine Hex-Farbe (z. B. #FF6B6B) in die Zwischenablage – in der Pille erscheint ein Einfügen-Symbol für schnelles Einfügen.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Tastenkürzel-Spickzettel", + "open": "Spickzettel öffnen", + "settings": "Plugin-Einstellungen" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/en.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/en.json new file mode 100644 index 0000000..3bdb3aa --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/en.json @@ -0,0 +1,113 @@ +{ + "default-category": "Keybinds", + "error": { + "unsupported-compositor": "Unsupported Compositor", + "sway-not-supported": "Sway is not yet supported", + "sway-detail": "Sway support may be added in a future update (similar format to Hyprland)", + "labwc-not-supported": "LabWC is not supported", + "labwc-detail": "LabWC uses XML config format which is incompatible with this plugin", + "unknown-compositor": "Unknown compositor detected", + "unknown-detail": "This plugin only supports Hyprland and Niri compositors", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Loading...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Keymap", + "title-hyprland": "Hyprland Keymap", + "title-niri": "Niri Keymap", + "title-mango": "MangoWC Keymap", + "workspace-switching": "WORKSPACES - SWITCHING", + "workspace-moving": "WORKSPACES - MOVING", + "workspace-mouse": "WORKSPACES - MOUSE", + "search-placeholder": "Search keybinds...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Keybind Cheatsheet Settings", + "description": "Configure the appearance and keybind sources for the keybind cheatsheet panel.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Window Size", + "width": "Width:", + "height": "Height:", + "auto-height": "Auto", + "auto-height-hint": "When 'Auto' is enabled, height adjusts automatically based on content.", + "layout": "Layout", + "columns": "Number of columns:", + "columns-hint": "More columns work better with wider windows.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Configuration Files", + "config-paths-description": "Specify custom paths to your keybind configuration files. The plugin will automatically parse the appropriate file based on your compositor and follow all include/source directives.", + "hyprland-format-hint": "Expected format: bind = $mod, KEY, action #\"description\"\nCategories: # 1. CATEGORY NAME", + "niri-format-hint": "Categories are created with: // #\"Category Name\"\nDescriptions: hotkey-overlay-title=\"description\"", + "actions": "Actions", + "refresh-keybinds": "Refresh Keybinds", + "refresh-message": "Keybinds will be reloaded when you open the panel.", + "reset-defaults": "Reset to Defaults", + "reset-message": "Settings have been reset to defaults.", + "saved": "Settings saved successfully.", + "keybind-setup": "Keybind Setup", + "keybind-setup-description": "To open the keybind cheatsheet with a keyboard shortcut, add this bind to your compositor config:", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-hyprland": "Hyprland example: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri example: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod Key Variable", + "mod-var-hint": "The variable name used for your Super key (e.g., $mod or $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland Path", + "niri-path": "Niri Path", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "color-paste-hint": "Tip: copy any hex color (e.g. #FF6B6B) to your clipboard and a paste icon will appear inside the pill for quick paste.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Keybind Cheatsheet", + "open": "Open Cheatsheet", + "settings": "Plugin Settings" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/es.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/es.json new file mode 100644 index 0000000..e95b187 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/es.json @@ -0,0 +1,113 @@ +{ + "default-category": "Atajos de teclado", + "error": { + "unsupported-compositor": "Compositor no compatible", + "sway-not-supported": "Sway aún no es compatible", + "sway-detail": "El soporte de Sway podría agregarse en una actualización futura (formato similar a Hyprland)", + "labwc-not-supported": "LabWC no es compatible", + "labwc-detail": "LabWC usa formato de configuración XML que es incompatible con este plugin", + "unknown-compositor": "Compositor desconocido detectado", + "unknown-detail": "Este plugin solo admite los compositores Hyprland y Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Cargando...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Mapa de teclas", + "title-hyprland": "Mapa de teclas Hyprland", + "title-niri": "Mapa de teclas Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ESPACIOS DE TRABAJO - CAMBIAR", + "workspace-moving": "ESPACIOS DE TRABAJO - MOVER", + "workspace-mouse": "ESPACIOS DE TRABAJO - RATÓN", + "search-placeholder": "Buscar atajos...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Configuracion de Atajos de Teclado", + "description": "Configure la apariencia y las fuentes de atajos de teclado para el panel.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Tamano de Ventana", + "width": "Ancho:", + "height": "Alto:", + "auto-height": "Auto", + "auto-height-hint": "Cuando 'Auto' esta activado, la altura se ajusta automaticamente al contenido.", + "layout": "Diseno", + "columns": "Numero de columnas:", + "columns-hint": "Mas columnas funcionan mejor con ventanas mas anchas.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Archivos de Configuracion", + "config-paths-description": "Especifique rutas personalizadas a sus archivos de configuracion de atajos. El plugin seguira automaticamente todas las directivas include/source.", + "hyprland-format-hint": "Formato esperado: bind = $mod, KEY, action #\"descripcion\"\nCategorias: # 1. NOMBRE DE CATEGORIA", + "niri-format-hint": "Las categorias se crean con: // #\"Nombre de categoria\"\nDescripciones: hotkey-overlay-title=\"descripcion\"", + "actions": "Acciones", + "refresh-keybinds": "Actualizar Atajos", + "refresh-message": "Los atajos se recargaran al abrir el panel.", + "reset-defaults": "Restablecer Predeterminados", + "reset-message": "La configuracion se ha restablecido a los valores predeterminados.", + "saved": "Configuracion guardada correctamente.", + "keybind-setup": "Configuracion de Atajo", + "keybind-setup-description": "Para abrir el cheatsheet con un atajo de teclado, agrega este bind a la configuracion de tu compositor:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Variable de Tecla Mod", + "mod-var-hint": "El nombre de la variable usada para su tecla Super (ej. $mod o $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Ruta Hyprland", + "niri-path": "Ruta Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Consejo: copia un color hex (p. ej. #FF6B6B) al portapapeles y aparecerá un icono de pegar dentro de la pastilla.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Hoja de trucos de atajos", + "open": "Abrir hoja de trucos", + "settings": "Configuración del plugin" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/fr.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/fr.json new file mode 100644 index 0000000..f41a9b6 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/fr.json @@ -0,0 +1,113 @@ +{ + "default-category": "Raccourcis clavier", + "error": { + "unsupported-compositor": "Compositeur non pris en charge", + "sway-not-supported": "Sway n'est pas encore pris en charge", + "sway-detail": "La prise en charge de Sway pourrait être ajoutée dans une future mise à jour (format similaire à Hyprland)", + "labwc-not-supported": "LabWC n'est pas pris en charge", + "labwc-detail": "LabWC utilise un format de configuration XML incompatible avec ce plugin", + "unknown-compositor": "Compositeur inconnu détecté", + "unknown-detail": "Ce plugin ne prend en charge que les compositeurs Hyprland et Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Chargement...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Carte des touches", + "title-hyprland": "Carte des touches Hyprland", + "title-niri": "Carte des touches Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ESPACES DE TRAVAIL - BASCULER", + "workspace-moving": "ESPACES DE TRAVAIL - DÉPLACER", + "workspace-mouse": "ESPACES DE TRAVAIL - SOURIS", + "search-placeholder": "Rechercher des raccourcis...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Parametres des Raccourcis Clavier", + "description": "Configurez l'apparence et les sources des raccourcis clavier pour le panneau.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Taille de la Fenetre", + "width": "Largeur:", + "height": "Hauteur:", + "auto-height": "Auto", + "auto-height-hint": "Lorsque 'Auto' est active, la hauteur s'ajuste automatiquement au contenu.", + "layout": "Disposition", + "columns": "Nombre de colonnes:", + "columns-hint": "Plus de colonnes fonctionnent mieux avec des fenetres plus larges.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Fichiers de Configuration", + "config-paths-description": "Specifiez des chemins personnalises vers vos fichiers de configuration de raccourcis. Le plugin suivra automatiquement toutes les directives include/source.", + "hyprland-format-hint": "Format attendu: bind = $mod, KEY, action #\"description\"\nCategories: # 1. NOM DE CATEGORIE", + "niri-format-hint": "Les categories sont creees avec: // #\"Nom de categorie\"\nDescriptions: hotkey-overlay-title=\"description\"", + "actions": "Actions", + "refresh-keybinds": "Actualiser les Raccourcis", + "refresh-message": "Les raccourcis seront recharges a l'ouverture du panneau.", + "reset-defaults": "Reinitialiser par Defaut", + "reset-message": "Les parametres ont ete reinitialises par defaut.", + "saved": "Parametres enregistres avec succes.", + "keybind-setup": "Configuration du Raccourci", + "keybind-setup-description": "Pour ouvrir le cheatsheet avec un raccourci clavier, ajoutez ce bind a la configuration de votre compositeur:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Variable de Touche Mod", + "mod-var-hint": "Le nom de la variable utilisée pour votre touche Super (ex. $mod ou $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Chemin Hyprland", + "niri-path": "Chemin Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Astuce : copiez une couleur hex (ex. #FF6B6B) dans le presse-papiers et une icône de collage apparaîtra dans la pastille.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Aide-mémoire des raccourcis", + "open": "Ouvrir l'aide-mémoire", + "settings": "Paramètres du plugin" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hn.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hn.json new file mode 100644 index 0000000..b222523 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hn.json @@ -0,0 +1,113 @@ +{ + "default-category": "कुञ्जी बाइन्डहरू", + "error": { + "unsupported-compositor": "असमर्थित कम्पोजिटर", + "sway-not-supported": "Sway अझै समर्थित छैन", + "sway-detail": "Sway समर्थन भविष्यको अपडेटमा थप्न सकिन्छ (Hyprland जस्तै ढाँचा)", + "labwc-not-supported": "LabWC समर्थित छैन", + "labwc-detail": "LabWC ले XML कन्फिगरेसन ढाँचा प्रयोग गर्दछ जुन यो प्लगइनसँग मिल्दैन", + "unknown-compositor": "अज्ञात कम्पोजिटर पत्ता लाग्यो", + "unknown-detail": "यो प्लगइनले Hyprland र Niri कम्पोजिटरहरू मात्र समर्थन गर्दछ", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "लोड हो रहा है...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "कीमैप", + "title-hyprland": "Hyprland कीमैप", + "title-niri": "Niri कीमैप", + "title-mango": "MangoWC Keymap", + "workspace-switching": "कार्यक्षेत्र - स्विच करना", + "workspace-moving": "कार्यक्षेत्र - स्थानांतरण", + "workspace-mouse": "कार्यक्षेत्र - माउस", + "search-placeholder": "कीबाइंड खोजें...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "कीबाइंड चीटशीट सेटिंग्स", + "description": "कीबाइंड चीटशीट पैनल के लिए उपस्थिति और कीबाइंड स्रोतों को कॉन्फ़िगर करें।", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "विंडो आकार", + "width": "चौड़ाई:", + "height": "ऊंचाई:", + "auto-height": "स्वचालित", + "auto-height-hint": "जब 'स्वचालित' सक्षम है, ऊंचाई सामग्री के आधार पर स्वचालित रूप से समायोजित होती है।", + "layout": "लेआउट", + "columns": "कॉलम की संख्या:", + "columns-hint": "अधिक कॉलम चौड़ी विंडो के साथ बेहतर काम करते हैं।", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "कॉन्फ़िगरेशन फ़ाइलें", + "config-paths-description": "अपनी कीबाइंड कॉन्फ़िगरेशन फ़ाइलों के लिए कस्टम पथ निर्दिष्ट करें। प्लगइन स्वचालित रूप से आपके कंपोजिटर के आधार पर उपयुक्त फ़ाइल को पार्स करेगा।", + "hyprland-format-hint": "अपेक्षित प्रारूप: bind = $mod, KEY, action #\"description\"\nश्रेणियाँ: # 1. CATEGORY NAME", + "niri-format-hint": "श्रेणियाँ: // #\"Category Name\"\nविवरण: hotkey-overlay-title=\"description\"", + "actions": "क्रियाएं", + "refresh-keybinds": "कीबाइंड रीफ्रेश करें", + "refresh-message": "जब आप पैनल खोलेंगे तो कीबाइंड पुनः लोड होंगे।", + "reset-defaults": "डिफ़ॉल्ट पर रीसेट करें", + "reset-message": "सेटिंग्स डिफ़ॉल्ट पर रीसेट कर दी गई हैं।", + "saved": "सेटिंग्स सफलतापूर्वक सहेजी गईं।", + "keybind-setup": "कीबाइंड सेटअप", + "keybind-setup-description": "कीबोर्ड शॉर्टकट के साथ कीबाइंड चीटशीट खोलने के लिए, अपने कंपोजिटर कॉन्फ़िग में यह बाइंड जोड़ें:", + "keybind-example-hyprland": "Hyprland उदाहरण: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin togglePanel keybind-cheatsheet", + "keybind-example-niri": "Niri उदाहरण: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "मॉड कुंजी वेरिएबल", + "mod-var-hint": "आपकी Super कुंजी के लिए उपयोग किया जाने वाला वेरिएबल नाम (जैसे, $mod या $mainMod)।", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland पथ", + "niri-path": "Niri पथ", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "सुझाव: क्लिपबोर्ड में कोई हेक्स रंग (जैसे #FF6B6B) कॉपी करें, पिल में पेस्ट आइकन दिखेगा।", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "कीबाइंड चीटशीट", + "open": "चीटशीट खोलें", + "settings": "प्लगइन सेटिंग्स" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hu.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hu.json new file mode 100644 index 0000000..9752e44 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/hu.json @@ -0,0 +1,113 @@ +{ + "default-category": "Billentyűparancsok", + "error": { + "unsupported-compositor": "Nem támogatott kompozitor", + "sway-not-supported": "A Sway még nem támogatott", + "sway-detail": "A Sway támogatás egy jövőbeli frissítésben hozzáadható (hasonló formátum, mint a Hyprland)", + "labwc-not-supported": "A LabWC nem támogatott", + "labwc-detail": "A LabWC XML konfigurációs formátumot használ, amely nem kompatibilis ezzel a bővítménnyel", + "unknown-compositor": "Ismeretlen kompozitor észlelve", + "unknown-detail": "Ez a bővítmény csak a Hyprland és Niri kompozitorokat támogatja", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Betoltes...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Billentyűzetkiosztás", + "title-hyprland": "Hyprland billentyűzetkiosztás", + "title-niri": "Niri billentyűzetkiosztás", + "title-mango": "MangoWC Keymap", + "workspace-switching": "MUNKATERÜLETEK - VÁLTÁS", + "workspace-moving": "MUNKATERÜLETEK - ÁTHELYEZÉS", + "workspace-mouse": "MUNKATERÜLETEK - EGÉR", + "search-placeholder": "Billentyűparancsok keresése...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Billentyuparancsok Beallitasai", + "description": "Allitsa be a billentyuparancsok megjeleniteset es forrасait a panelhez.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Ablak Merete", + "width": "Szelesseg:", + "height": "Magassag:", + "auto-height": "Auto", + "auto-height-hint": "Ha az 'Automatikus' be van kapcsolva, a magassag automatikusan igazodik a tartalomhoz.", + "layout": "Elrendezes", + "columns": "Oszlopok szama:", + "columns-hint": "Tobb oszlop jobban mukodik szelessebb ablakokkal.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Konfiguracios Fajlok", + "config-paths-description": "Adjon meg egyedi utvonalakat a billentyuparancs-konfiguracios fajlokhoz. A beepulo automatikusan koveti az osszes include/source direktívat.", + "hyprland-format-hint": "Elvart formatum: bind = $mod, KEY, action #\"leiras\"\nKategoriak: # 1. KATEGORIA NEV", + "niri-format-hint": "A kategoriakat így hozzuk letre: // #\"Kategoria nev\"\nLeirasok: hotkey-overlay-title=\"leiras\"", + "actions": "Muveletek", + "refresh-keybinds": "Billentyuparancsok Frissitese", + "refresh-message": "A billentyuparancsok ujratoltodnek a panel megnyitasakor.", + "reset-defaults": "Alapertelmezettek Visszaallitasa", + "reset-message": "A beallitasok visszaallitva az alapertelmezettre.", + "saved": "Beallitasok sikeresen mentve.", + "keybind-setup": "Billentyuparancs Beallitasa", + "keybind-setup-description": "A cheatsheet billentyuparancsal valo megnyitasahoz adja hozzá ezt a bind-ot a kompozitor konfiguraciojához:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod Billentyuvaltozo", + "mod-var-hint": "A Super billentyuhoz hasznalt valtozó neve (pl. $mod vagy $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland útvonal", + "niri-path": "Niri útvonal", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Tipp: másolj egy hex színt (pl. #FF6B6B) a vágólapra, és a pirulában megjelenik egy beillesztés ikon.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Billentyűparancs súgó", + "open": "Súgó megnyitása", + "settings": "Plugin beállítások" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/it.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/it.json new file mode 100644 index 0000000..6a12ef4 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/it.json @@ -0,0 +1,113 @@ +{ + "default-category": "Scorciatoie da tastiera", + "error": { + "unsupported-compositor": "Compositor non supportato", + "sway-not-supported": "Sway non è ancora supportato", + "sway-detail": "Il supporto per Sway potrebbe essere aggiunto in un aggiornamento futuro (formato simile a Hyprland)", + "labwc-not-supported": "LabWC non è supportato", + "labwc-detail": "LabWC utilizza un formato di configurazione XML incompatibile con questo plugin", + "unknown-compositor": "Rilevato compositor sconosciuto", + "unknown-detail": "Questo plugin supporta solo i compositor Hyprland e Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Caricamento...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Mappa tasti", + "title-hyprland": "Mappa tasti Hyprland", + "title-niri": "Mappa tasti Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "SPAZI DI LAVORO - CAMBIO", + "workspace-moving": "SPAZI DI LAVORO - SPOSTAMENTO", + "workspace-mouse": "SPAZI DI LAVORO - MOUSE", + "search-placeholder": "Cerca scorciatoie...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Impostazioni Scorciatoie da Tastiera", + "description": "Configura l'aspetto e le fonti delle scorciatoie per il pannello.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Dimensione Finestra", + "width": "Larghezza:", + "height": "Altezza:", + "auto-height": "Auto", + "auto-height-hint": "Quando 'Auto' e attivo, l'altezza si adatta automaticamente al contenuto.", + "layout": "Layout", + "columns": "Numero di colonne:", + "columns-hint": "Piu colonne funzionano meglio con finestre piu larghe.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "File di Configurazione", + "config-paths-description": "Specifica percorsi personalizzati per i file di configurazione delle scorciatoie. Il plugin seguira automaticamente tutte le direttive include/source.", + "hyprland-format-hint": "Formato previsto: bind = $mod, KEY, action #\"descrizione\"\nCategorie: # 1. NOME CATEGORIA", + "niri-format-hint": "Le categorie vengono create con: // #\"Nome categoria\"\nDescrizioni: hotkey-overlay-title=\"descrizione\"", + "actions": "Azioni", + "refresh-keybinds": "Aggiorna Scorciatoie", + "refresh-message": "Le scorciatoie verranno ricaricate all'apertura del pannello.", + "reset-defaults": "Ripristina Predefiniti", + "reset-message": "Le impostazioni sono state ripristinate ai valori predefiniti.", + "saved": "Impostazioni salvate con successo.", + "keybind-setup": "Configurazione Scorciatoia", + "keybind-setup-description": "Per aprire il cheatsheet con una scorciatoia, aggiungi questo bind alla configurazione del tuo compositor:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Variabile Tasto Mod", + "mod-var-hint": "Il nome della variabile usata per il tasto Super (es. $mod o $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Percorso Hyprland", + "niri-path": "Percorso Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Suggerimento: copia un colore hex (es. #FF6B6B) negli appunti e apparirà un'icona di incolla dentro la pillola.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Scheda scorciatoie", + "open": "Apri scheda", + "settings": "Impostazioni plugin" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ja.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ja.json new file mode 100644 index 0000000..56f24d6 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ja.json @@ -0,0 +1,113 @@ +{ + "default-category": "キーバインド", + "error": { + "unsupported-compositor": "サポートされていないコンポジター", + "sway-not-supported": "Swayはまだサポートされていません", + "sway-detail": "Swayのサポートは将来のアップデートで追加される可能性があります(Hyprlandと同様の形式)", + "labwc-not-supported": "LabWCはサポートされていません", + "labwc-detail": "LabWCはこのプラグインと互換性のないXML設定形式を使用しています", + "unknown-compositor": "不明なコンポジターが検出されました", + "unknown-detail": "このプラグインはHyprlandとNiriコンポジターのみをサポートしています", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "読み込み中...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "キーマップ", + "title-hyprland": "Hyprland キーマップ", + "title-niri": "Niri キーマップ", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ワークスペース - 切り替え", + "workspace-moving": "ワークスペース - 移動", + "workspace-mouse": "ワークスペース - マウス", + "search-placeholder": "キーバインドを検索...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "キーバインド一覧の設定", + "description": "パネルの外観とキーバインドソースを設定します。", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "ウィンドウサイズ", + "width": "幅:", + "height": "高さ:", + "auto-height": "自動", + "auto-height-hint": "「自動」が有効な場合、高さはコンテンツに合わせて自動調整されます。", + "layout": "レイアウト", + "columns": "列数:", + "columns-hint": "列が多いほど、幅の広いウィンドウで効果的です。", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "設定ファイル", + "config-paths-description": "キーバインド設定ファイルへのカスタムパスを指定します。プラグインは自動的にすべてのinclude/sourceディレクティブに従います。", + "hyprland-format-hint": "期待される形式: bind = $mod, KEY, action #\"説明\"\nカテゴリ: # 1. カテゴリ名", + "niri-format-hint": "カテゴリは次の形式で作成: // #\"カテゴリ名\"\n説明: hotkey-overlay-title=\"説明\"", + "actions": "アクション", + "refresh-keybinds": "キーバインドを更新", + "refresh-message": "パネルを開くとキーバインドが再読み込みされます。", + "reset-defaults": "デフォルトにリセット", + "reset-message": "設定がデフォルトにリセットされました。", + "saved": "設定が正常に保存されました。", + "keybind-setup": "キーバインド設定", + "keybind-setup-description": "キーボードショートカットでチートシートを開くには、このバインドをコンポジター設定に追加してください:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Modキー変数", + "mod-var-hint": "Superキーに使用される変数名(例: $mod または $mainMod)。", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland パス", + "niri-path": "Niri パス", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "自動", + "color-paste-hint": "ヒント: 16 進カラー (例: #FF6B6B) をクリップボードにコピーすると、ピル内に貼り付けアイコンが表示されます。", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "キーバインドチートシート", + "open": "チートシートを開く", + "settings": "プラグイン設定" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ko-KR.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ko-KR.json new file mode 100644 index 0000000..3a4e091 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ko-KR.json @@ -0,0 +1,113 @@ +{ + "default-category": "키바인드", + "error": { + "unsupported-compositor": "지원되지 않는 컴포지터", + "sway-not-supported": "Sway는 아직 지원되지 않습니다", + "sway-detail": "Sway 지원은 향후 업데이트에서 추가될 수 있습니다 (Hyprland와 유사한 형식)", + "labwc-not-supported": "LabWC는 지원되지 않습니다", + "labwc-detail": "LabWC는 이 플러그인과 호환되지 않는 XML 구성 형식을 사용합니다", + "unknown-compositor": "알 수 없는 컴포지터가 감지되었습니다", + "unknown-detail": "이 플러그인은 Hyprland 및 Niri 컴포지터만 지원합니다", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "로딩 중...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "키맵", + "title-hyprland": "Hyprland 키맵", + "title-niri": "Niri 키맵", + "title-mango": "MangoWC Keymap", + "workspace-switching": "작업공간 - 전환", + "workspace-moving": "작업공간 - 이동", + "workspace-mouse": "작업공간 - 마우스", + "search-placeholder": "단축키 검색...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "키바인드 치트시트 설정", + "description": "키바인드 치트시트 패널의 모양과 키바인드 소스를 구성합니다.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "창 크기", + "width": "너비:", + "height": "높이:", + "auto-height": "자동", + "auto-height-hint": "'자동'이 활성화되면 높이가 콘텐츠에 따라 자동으로 조정됩니다.", + "layout": "레이아웃", + "columns": "열 수:", + "columns-hint": "더 많은 열은 넓은 창에서 더 잘 작동합니다.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "구성 파일", + "config-paths-description": "키바인드 구성 파일의 사용자 정의 경로를 지정하세요. 플러그인은 컴포지터에 따라 적절한 파일을 자동으로 파싱합니다.", + "hyprland-format-hint": "예상 형식: bind = $mod, KEY, action #\"description\"\n카테고리: # 1. CATEGORY NAME", + "niri-format-hint": "카테고리: // #\"Category Name\"\n설명: hotkey-overlay-title=\"description\"", + "actions": "작업", + "refresh-keybinds": "키바인드 새로고침", + "refresh-message": "패널을 열면 키바인드가 다시 로드됩니다.", + "reset-defaults": "기본값으로 재설정", + "reset-message": "설정이 기본값으로 재설정되었습니다.", + "saved": "설정이 성공적으로 저장되었습니다.", + "keybind-setup": "키바인드 설정", + "keybind-setup-description": "키보드 단축키로 키바인드 치트시트를 열려면 컴포지터 구성에 이 바인드를 추가하세요:", + "keybind-example-hyprland": "Hyprland 예시: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin togglePanel keybind-cheatsheet", + "keybind-example-niri": "Niri 예시: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod 키 변수", + "mod-var-hint": "Super 키에 사용되는 변수 이름 (예: $mod 또는 $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland 경로", + "niri-path": "Niri 경로", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "자동", + "color-paste-hint": "팁: 16진수 색상(예: #FF6B6B)을 클립보드에 복사하면 알약 내부에 붙여넣기 아이콘이 나타납니다.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "키바인드 치트시트", + "open": "치트시트 열기", + "settings": "플러그인 설정" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ku.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ku.json new file mode 100644 index 0000000..b0d6555 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ku.json @@ -0,0 +1,113 @@ +{ + "default-category": "بەستنەوەی کلیلەکان", + "error": { + "unsupported-compositor": "کۆمپۆزیتەرێکی پشتگیری نەکراو", + "sway-not-supported": "Sway هێشتا پشتگیری ناکرێت", + "sway-detail": "پشتگیری Sway دەکرێت لە نوێکردنەوەیەکی داهاتوودا زیاد بکرێت (فۆرماتێکی هاوشێوەی Hyprland)", + "labwc-not-supported": "LabWC پشتگیری ناکرێت", + "labwc-detail": "LabWC فۆرماتی ڕێکخستنی XML بەکاردەهێنێت کە لەگەڵ ئەم پێوەکراوەدا گونجاو نییە", + "unknown-compositor": "کۆمپۆزیتەرێکی نەناسراو دۆزرایەوە", + "unknown-detail": "ئەم پێوەکراوە تەنها کۆمپۆزیتەرەکانی Hyprland و Niri پشتگیری دەکات", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Barkirin...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Nexşeya Bişkokan", + "title-hyprland": "Nexşeya Bişkokan a Hyprland", + "title-niri": "Nexşeya Bişkokan a Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "QADÊN XEBATÊ - GUHEZTIN", + "workspace-moving": "QADÊN XEBATÊ - VEGUHESTIN", + "workspace-mouse": "QADÊN XEBATÊ - MIŞK", + "search-placeholder": "Lêgerîna kurteyan...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Mîhengên Kurterêyên Klavyeyê", + "description": "Xuyanî û çavkaniyên kurterêyên klavyeyê ji bo panelê veavakin.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Mezinahiya Paceyê", + "width": "Firehî:", + "height": "Bilindî:", + "auto-height": "Xweber", + "auto-height-hint": "Dema 'Xweber' çalak be, bilindî li gorî naverokê xweber tê guhartin.", + "layout": "Rêzkirin", + "columns": "Hejmara stûnan:", + "columns-hint": "Stûnên zêdetir bi paceyên berfirehtir baştir dixebitin.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Pelên Veavakirinê", + "config-paths-description": "Rêyên taybet bo pelên veavakirina kurterêyên klavyeyê diyar bikin. Pêvek bi xweber hemû rêbernameyên include/source dişopîne.", + "hyprland-format-hint": "Formata hêvîdar: bind = $mod, KEY, action #\"rave\"\nBeşan: # 1. NAVÊ BEŞÊ", + "niri-format-hint": "Beş bi vî awayî têne afirandin: // #\"Navê beşê\"\nRave: hotkey-overlay-title=\"rave\"", + "actions": "Çalakî", + "refresh-keybinds": "Kurterêyan Nûve Bike", + "refresh-message": "Kurterêyên klavyeyê dema panelê vebûyî nû dibin.", + "reset-defaults": "Vegerîne Bingehîn", + "reset-message": "Mîhengan vegeriyan nirxên bingehîn.", + "saved": "Mîhengan bi serfirazî hate tomarkirin.", + "keybind-setup": "Mîhengkirina Kurterêyê", + "keybind-setup-description": "Ji bo vekirana cheatsheet bi kurterêyek, ev bind li veavakirina compositor xwe zêde bikin:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Guhêrbarê Bişkoja Mod", + "mod-var-hint": "Navê guhêrbarê ku ji bo bişkoja Super tê bikaranîn (mînak $mod an $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Rêça Hyprland", + "niri-path": "Rêça Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Şîret: rengekî hex (mînak #FF6B6B) kopî bike li clipboard, îkona paste di pill de xuya dibe.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Çavkaniya Kurterêyan", + "open": "Çavkaniyê veke", + "settings": "Mîhengên Pêvek" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nl.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nl.json new file mode 100644 index 0000000..c72f6a5 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nl.json @@ -0,0 +1,113 @@ +{ + "default-category": "Sneltoetsen", + "error": { + "unsupported-compositor": "Niet-ondersteunde compositor", + "sway-not-supported": "Sway wordt nog niet ondersteund", + "sway-detail": "Sway-ondersteuning kan worden toegevoegd in een toekomstige update (vergelijkbaar formaat met Hyprland)", + "labwc-not-supported": "LabWC wordt niet ondersteund", + "labwc-detail": "LabWC gebruikt XML-configuratieformaat dat incompatibel is met deze plugin", + "unknown-compositor": "Onbekende compositor gedetecteerd", + "unknown-detail": "Deze plugin ondersteunt alleen Hyprland- en Niri-compositors", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Laden...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Toetsenbordindeling", + "title-hyprland": "Hyprland toetsenbordindeling", + "title-niri": "Niri toetsenbordindeling", + "title-mango": "MangoWC Keymap", + "workspace-switching": "WERKRUIMTEN - WISSELEN", + "workspace-moving": "WERKRUIMTEN - VERPLAATSEN", + "workspace-mouse": "WERKRUIMTEN - MUIS", + "search-placeholder": "Zoek sneltoetsen...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Sneltoetsen Overzicht Instellingen", + "description": "Configureer het uiterlijk en de bronnen van sneltoetsen voor het paneel.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Venstergrootte", + "width": "Breedte:", + "height": "Hoogte:", + "auto-height": "Auto", + "auto-height-hint": "Wanneer 'Auto' is ingeschakeld, past de hoogte zich automatisch aan de inhoud aan.", + "layout": "Indeling", + "columns": "Aantal kolommen:", + "columns-hint": "Meer kolommen werken beter met bredere vensters.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Configuratiebestanden", + "config-paths-description": "Geef aangepaste paden op naar uw sneltoetsen configuratiebestanden. De plugin volgt automatisch alle include/source richtlijnen.", + "hyprland-format-hint": "Verwacht formaat: bind = $mod, KEY, action #\"beschrijving\"\nCategorieen: # 1. CATEGORIENAAM", + "niri-format-hint": "Categorieen worden aangemaakt met: // #\"Categorienaam\"\nBeschrijvingen: hotkey-overlay-title=\"beschrijving\"", + "actions": "Acties", + "refresh-keybinds": "Sneltoetsen Vernieuwen", + "refresh-message": "Sneltoetsen worden opnieuw geladen wanneer u het paneel opent.", + "reset-defaults": "Standaardwaarden Herstellen", + "reset-message": "Instellingen zijn teruggezet naar standaardwaarden.", + "saved": "Instellingen succesvol opgeslagen.", + "keybind-setup": "Sneltoets Instelling", + "keybind-setup-description": "Om het cheatsheet met een sneltoets te openen, voeg deze binding toe aan je compositor configuratie:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod-toets Variabele", + "mod-var-hint": "De variabelenaam die wordt gebruikt voor uw Super-toets (bijv. $mod of $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland pad", + "niri-path": "Niri pad", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Tip: kopieer een hex-kleur (bijv. #FF6B6B) naar het klembord en er verschijnt een plak-icoon in de pil.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Sneltoetsen Spiekbriefje", + "open": "Spiekbriefje openen", + "settings": "Plugin instellingen" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nn-NO.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nn-NO.json new file mode 100644 index 0000000..3c8c1b0 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/nn-NO.json @@ -0,0 +1,113 @@ +{ + "default-category": "Tastebindingar", + "error": { + "unsupported-compositor": "Ikkje støtta compositor", + "sway-not-supported": "Sway er ikkje støtta enno", + "sway-detail": "Sway-støtte kan leggast til i ei framtidig oppdatering (liknande format som Hyprland)", + "labwc-not-supported": "LabWC er ikkje støtta", + "labwc-detail": "LabWC brukar XML-konfigurasjonsformat som er inkompatibelt med denne plugin-en", + "unknown-compositor": "Ukjend compositor oppdaga", + "unknown-detail": "Denne plugin-en støttar berre Hyprland- og Niri-compositorar", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Lastar...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Tastatur-kart", + "title-hyprland": "Hyprland tastatur-kart", + "title-niri": "Niri tastatur-kart", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ARBEIDSOMRÅDE - BYTTE", + "workspace-moving": "ARBEIDSOMRÅDE - FLYTTE", + "workspace-mouse": "ARBEIDSOMRÅDE - MUS", + "search-placeholder": "Søk snarvegar...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Tastesnarveg-jukselapp Innstillingar", + "description": "Konfigurer utsjånad og tastesnarveg-kjelder for jukselapp-panelet.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Vindaugsstorleik", + "width": "Breidde:", + "height": "Høgde:", + "auto-height": "Auto", + "auto-height-hint": "Når 'Auto' er aktivert, justerer høgda seg automatisk basert på innhald.", + "layout": "Oppsett", + "columns": "Tal på kolonnar:", + "columns-hint": "Fleire kolonnar fungerer betre med breiare vindauge.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Konfigurasjonsfiler", + "config-paths-description": "Spesifiser eigne stiar til tastesnarveg-konfigurasjonsfilene dine. Programtillegget vil automatisk parse rett fil basert på kompositoren din.", + "hyprland-format-hint": "Forventa format: bind = $mod, KEY, action #\"description\"\nKategoriar: # 1. CATEGORY NAME", + "niri-format-hint": "Kategoriar: // #\"Category Name\"\nSkildringar: hotkey-overlay-title=\"description\"", + "actions": "Handlingar", + "refresh-keybinds": "Oppdater tastesnarvegar", + "refresh-message": "Tastesnarvegar vil bli lasta på nytt når du opnar panelet.", + "reset-defaults": "Tilbakestill til standard", + "reset-message": "Innstillingar er tilbakestilt til standard.", + "saved": "Innstillingar lagra.", + "keybind-setup": "Tastesnarveg-oppsett", + "keybind-setup-description": "For å opne tastesnarveg-jukselappen med ein hurtigtast, legg til denne bindinga i kompositor-konfigurasjonen din:", + "keybind-example-hyprland": "Hyprland eksempel: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin togglePanel keybind-cheatsheet", + "keybind-example-niri": "Niri eksempel: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod-tast variabel", + "mod-var-hint": "Variabelnamnet brukt for Super-tasten din (t.d. $mod eller $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland-sti", + "niri-path": "Niri-sti", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Tips: kopier ein hex-farge (t.d. #FF6B6B) til utklippstavla, så kjem eit lim-inn-ikon i pilla.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Tastesnarveg-jukselapp", + "open": "Opne jukselapp", + "settings": "Programtillegg-innstillingar" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pl.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pl.json new file mode 100644 index 0000000..58dc80b --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pl.json @@ -0,0 +1,113 @@ +{ + "default-category": "Skróty klawiszowe", + "error": { + "unsupported-compositor": "Nieobsługiwany kompozytor", + "sway-not-supported": "Sway nie jest jeszcze obsługiwany", + "sway-detail": "Obsługa Sway może zostać dodana w przyszłej aktualizacji (podobny format do Hyprland)", + "labwc-not-supported": "LabWC nie jest obsługiwany", + "labwc-detail": "LabWC używa formatu konfiguracji XML, który jest niekompatybilny z tą wtyczką", + "unknown-compositor": "Wykryto nieznany kompozytor", + "unknown-detail": "Ta wtyczka obsługuje tylko kompozytory Hyprland i Niri", + "hyprctl-failed": "hyprctl binds nie powiodło się - czy Hyprland działa?" + }, + "panel": { + "loading": "Ladowanie...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Mapa klawiszy", + "title-hyprland": "Mapa klawiszy Hyprland", + "title-niri": "Mapa klawiszy Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "OBSZARY ROBOCZE - PRZEŁĄCZANIE", + "workspace-moving": "OBSZARY ROBOCZE - PRZENOSZENIE", + "workspace-mouse": "OBSZARY ROBOCZE - MYSZ", + "search-placeholder": "Szukaj skrótów...", + "no-description": "(brak opisu)", + "other": "Inne", + "undescribed": "Bez opisu", + "add-description": "Dodaj opis", + "add-description-placeholder": "Opis...", + "save-description": "Zapisz", + "cancel": "Anuluj", + "hide-bind": "Ukryj ten skrót" + }, + "settings": { + "title": "Ustawienia Skrotow Klawiszowych", + "description": "Skonfiguruj wyglad i zrodla skrotow klawiszowych dla panelu.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Rozmiar Okna", + "width": "Szerokosc:", + "height": "Wysokosc:", + "auto-height": "Auto", + "auto-height-hint": "Gdy 'Auto' jest wlaczone, wysokosc dostosowuje sie automatycznie do zawartosci.", + "layout": "Uklad", + "columns": "Liczba kolumn:", + "columns-hint": "Wiecej kolumn dziala lepiej z szerszymi oknami.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Pliki Konfiguracyjne", + "config-paths-description": "Okresl wlasne sciezki do plikow konfiguracyjnych skrotow klawiszowych. Plugin automatycznie przetworzy odpowiedni plik na podstawie Twojego kompozytora i podazy za dyrektywami include/source.", + "hyprland-format-hint": "Oczekiwany format: bind = $mod, KEY, action #\"opis\"\nKategorie: # 1. NAZWA KATEGORII", + "niri-format-hint": "Kategorie tworzy sie przez: // #\"Nazwa kategorii\"\nOpisy: hotkey-overlay-title=\"opis\"", + "actions": "Akcje", + "refresh-keybinds": "Odswiez Skroty", + "refresh-message": "Skroty zostana przeladowane po otwarciu panelu.", + "reset-defaults": "Przywroc Domyslne", + "reset-message": "Ustawienia zostaly przywrocone do domyslnych.", + "saved": "Ustawienia zapisane pomyslnie.", + "keybind-setup": "Konfiguracja Skrotu", + "keybind-setup-description": "Aby otworzyc cheatsheet skrotem klawiszowym, dodaj ten bind do konfiguracji kompozytora:", + "keybind-example-hyprland": "Przyklad Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Przyklad Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Zmienna klawisza Mod", + "mod-var-hint": "Nazwa zmiennej używanej dla klawisza Super (np. $mod lub $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Ścieżka Hyprland", + "niri-path": "Ścieżka Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Wskazówka: skopiuj kod koloru hex (np. #FF6B6B) do schowka, a w pastylce pojawi się ikona wklejania.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Ścieżka Hyprland Lua", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: używa hyprland.lua przez `hyprctl binds` jeśli istnieje, w innym wypadku starego parsera .conf.", + "undescribed-title": "Skróty bez opisu", + "overrides-summary": "Ukryte: {hidden} - Własne opisy: {custom}", + "restore-hidden": "Przywróć ukryte", + "restore-hidden-message": "Ukryte skróty przywrócone.", + "clear-overrides": "Wyczyść wszystkie nadpisania", + "clear-overrides-message": "Wszystkie nadpisania skrótów wyczyszczone." + }, + "barwidget": { + "tooltip": "Ściągawka skrótów klawiszowych", + "open": "Otwórz ściągawkę", + "settings": "Ustawienia wtyczki" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pt.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pt.json new file mode 100644 index 0000000..aefc767 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/pt.json @@ -0,0 +1,113 @@ +{ + "default-category": "Atalhos de teclado", + "error": { + "unsupported-compositor": "Compositor não suportado", + "sway-not-supported": "Sway ainda não é suportado", + "sway-detail": "O suporte ao Sway pode ser adicionado em uma atualização futura (formato semelhante ao Hyprland)", + "labwc-not-supported": "LabWC não é suportado", + "labwc-detail": "LabWC usa formato de configuração XML que é incompatível com este plugin", + "unknown-compositor": "Compositor desconhecido detectado", + "unknown-detail": "Este plugin suporta apenas os compositores Hyprland e Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Carregando...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Mapa de teclas", + "title-hyprland": "Mapa de teclas Hyprland", + "title-niri": "Mapa de teclas Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ESPAÇOS DE TRABALHO - ALTERNAR", + "workspace-moving": "ESPAÇOS DE TRABALHO - MOVER", + "workspace-mouse": "ESPAÇOS DE TRABALHO - MOUSE", + "search-placeholder": "Buscar atalhos...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Configuracoes de Atalhos de Teclado", + "description": "Configure a aparencia e as fontes de atalhos de teclado para o painel.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Tamanho da Janela", + "width": "Largura:", + "height": "Altura:", + "auto-height": "Auto", + "auto-height-hint": "Quando 'Auto' esta ativado, a altura se ajusta automaticamente ao conteudo.", + "layout": "Layout", + "columns": "Numero de colunas:", + "columns-hint": "Mais colunas funcionam melhor com janelas mais largas.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Arquivos de Configuracao", + "config-paths-description": "Especifique caminhos personalizados para seus arquivos de configuracao de atalhos. O plugin seguira automaticamente todas as diretivas include/source.", + "hyprland-format-hint": "Formato esperado: bind = $mod, KEY, action #\"descricao\"\nCategorias: # 1. NOME DA CATEGORIA", + "niri-format-hint": "Categorias sao criadas com: // #\"Nome da categoria\"\nDescricoes: hotkey-overlay-title=\"descricao\"", + "actions": "Acoes", + "refresh-keybinds": "Atualizar Atalhos", + "refresh-message": "Os atalhos serao recarregados ao abrir o painel.", + "reset-defaults": "Restaurar Padroes", + "reset-message": "As configuracoes foram restauradas para os valores padrao.", + "saved": "Configuracoes salvas com sucesso.", + "keybind-setup": "Configuracao de Atalho", + "keybind-setup-description": "Para abrir o cheatsheet com um atalho de teclado, adicione este bind a configuracao do seu compositor:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Variável da Tecla Mod", + "mod-var-hint": "O nome da variável usada para sua tecla Super (ex. $mod ou $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Caminho Hyprland", + "niri-path": "Caminho Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Dica: copie uma cor hex (ex. #FF6B6B) para a área de transferência e um ícone de colar aparecerá dentro da pílula.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Folha de dicas de atalhos", + "open": "Abrir folha de dicas", + "settings": "Configurações do plugin" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ru.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ru.json new file mode 100644 index 0000000..c3d69d5 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/ru.json @@ -0,0 +1,113 @@ +{ + "default-category": "Горячие клавиши", + "error": { + "unsupported-compositor": "Неподдерживаемый композитор", + "sway-not-supported": "Sway пока не поддерживается", + "sway-detail": "Поддержка Sway может быть добавлена в будущем обновлении (формат похож на Hyprland)", + "labwc-not-supported": "LabWC не поддерживается", + "labwc-detail": "LabWC использует формат конфигурации XML, несовместимый с этим плагином", + "unknown-compositor": "Обнаружен неизвестный композитор", + "unknown-detail": "Этот плагин поддерживает только композиторы Hyprland и Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Загрузка...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Раскладка клавиш", + "title-hyprland": "Раскладка клавиш Hyprland", + "title-niri": "Раскладка клавиш Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "РАБОЧИЕ ОБЛАСТИ - ПЕРЕКЛЮЧЕНИЕ", + "workspace-moving": "РАБОЧИЕ ОБЛАСТИ - ПЕРЕМЕЩЕНИЕ", + "workspace-mouse": "РАБОЧИЕ ОБЛАСТИ - МЫШЬ", + "search-placeholder": "Поиск сочетаний...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Настройки горячих клавиш", + "description": "Настройте внешний вид и источники горячих клавиш для панели.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Размер окна", + "width": "Ширина:", + "height": "Высота:", + "auto-height": "Авто", + "auto-height-hint": "Когда включено 'Авто', высота автоматически подстраивается под содержимое.", + "layout": "Макет", + "columns": "Количество колонок:", + "columns-hint": "Больше колонок лучше работает с более широкими окнами.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Файлы конфигурации", + "config-paths-description": "Укажите пользовательские пути к файлам конфигурации горячих клавиш. Плагин автоматически следует всем директивам include/source.", + "hyprland-format-hint": "Ожидаемый формат: bind = $mod, KEY, action #\"описание\"\nКатегории: # 1. НАЗВАНИЕ КАТЕГОРИИ", + "niri-format-hint": "Категории создаются с помощью: // #\"Название категории\"\nОписания: hotkey-overlay-title=\"описание\"", + "actions": "Действия", + "refresh-keybinds": "Обновить клавиши", + "refresh-message": "Горячие клавиши будут перезагружены при открытии панели.", + "reset-defaults": "Сбросить настройки", + "reset-message": "Настройки сброшены до значений по умолчанию.", + "saved": "Настройки успешно сохранены.", + "keybind-setup": "Настройка клавиши", + "keybind-setup-description": "Чтобы открыть шпаргалку с помощью клавиши, добавьте этот bind в конфигурацию композитора:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Переменная клавиши Mod", + "mod-var-hint": "Имя переменной, используемой для клавиши Super (например, $mod или $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Путь Hyprland", + "niri-path": "Путь Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "авто", + "color-paste-hint": "Совет: скопируйте hex-цвет (например #FF6B6B) в буфер обмена — в пилюле появится иконка вставки.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Шпаргалка горячих клавиш", + "open": "Открыть шпаргалку", + "settings": "Настройки плагина" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/sv.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/sv.json new file mode 100644 index 0000000..15c8175 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/sv.json @@ -0,0 +1,113 @@ +{ + "default-category": "Tangentbindningar", + "error": { + "unsupported-compositor": "Compositor stöds inte", + "sway-not-supported": "Sway stöds ännu inte", + "sway-detail": "Sway-stöd kan läggas till i en framtida uppdatering (liknande format som Hyprland)", + "labwc-not-supported": "LabWC stöds inte", + "labwc-detail": "LabWC använder XML-konfigurationsformat som är inkompatibelt med detta plugin", + "unknown-compositor": "Okänd compositor upptäckt", + "unknown-detail": "Detta plugin stöder endast Hyprland- och Niri-compositors", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Laddar...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Tangentkarta", + "title-hyprland": "Hyprland tangentkarta", + "title-niri": "Niri tangentkarta", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ARBETSYTOR - BYTA", + "workspace-moving": "ARBETSYTOR - FLYTTA", + "workspace-mouse": "ARBETSYTOR - MUS", + "search-placeholder": "Sök genvägar...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Tangentbordsgenvägar Inställningar", + "description": "Konfigurera utseende och tangentbordsgenvägskällor för fuskbladspanelen.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Fönsterstorlek", + "width": "Bredd:", + "height": "Höjd:", + "auto-height": "Auto", + "auto-height-hint": "När 'Auto' är aktiverat justeras höjden automatiskt baserat på innehåll.", + "layout": "Layout", + "columns": "Antal kolumner:", + "columns-hint": "Fler kolumner fungerar bättre med bredare fönster.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Konfigurationsfiler", + "config-paths-description": "Ange anpassade sökvägar till dina tangentbordsgenvägskonfigurationsfiler. Tillägget kommer automatiskt att tolka rätt fil baserat på din compositor.", + "hyprland-format-hint": "Förväntat format: bind = $mod, KEY, action #\"description\"\nKategorier: # 1. CATEGORY NAME", + "niri-format-hint": "Kategorier: // #\"Category Name\"\nBeskrivningar: hotkey-overlay-title=\"description\"", + "actions": "Åtgärder", + "refresh-keybinds": "Uppdatera tangentbordsgenvägar", + "refresh-message": "Tangentbordsgenvägar laddas om när du öppnar panelen.", + "reset-defaults": "Återställ till standard", + "reset-message": "Inställningarna har återställts till standard.", + "saved": "Inställningar sparade.", + "keybind-setup": "Tangentbordsgenväg inställning", + "keybind-setup-description": "För att öppna tangentbordsgenvägsfuskbladet med en kortkommando, lägg till denna bindning i din compositor-konfiguration:", + "keybind-example-hyprland": "Hyprland exempel: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin togglePanel keybind-cheatsheet", + "keybind-example-niri": "Niri exempel: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod-tangent variabel", + "mod-var-hint": "Variabelnamnet som används för din Super-tangent (t.ex. $mod eller $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland-sökväg", + "niri-path": "Niri-sökväg", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "Tips: kopiera en hex-färg (t.ex. #FF6B6B) till urklipp och en klistra in-ikon visas i pillret.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Tangentbordsgenvägar", + "open": "Öppna fuskblad", + "settings": "Plugin-inställningar" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/tr.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/tr.json new file mode 100644 index 0000000..19244dd --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/tr.json @@ -0,0 +1,113 @@ +{ + "default-category": "Kısayol tuşları", + "error": { + "unsupported-compositor": "Desteklenmeyen kompozitör", + "sway-not-supported": "Sway henüz desteklenmiyor", + "sway-detail": "Sway desteği gelecekteki bir güncellemede eklenebilir (Hyprland'a benzer format)", + "labwc-not-supported": "LabWC desteklenmiyor", + "labwc-detail": "LabWC bu eklentiyle uyumlu olmayan XML yapılandırma formatı kullanıyor", + "unknown-compositor": "Bilinmeyen kompozitör algılandı", + "unknown-detail": "Bu eklenti yalnızca Hyprland ve Niri kompozitörlerini destekler", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Yukleniyor...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Tuş haritası", + "title-hyprland": "Hyprland tuş haritası", + "title-niri": "Niri tuş haritası", + "title-mango": "MangoWC Keymap", + "workspace-switching": "ÇALIŞMA ALANLARI - GEÇİŞ", + "workspace-moving": "ÇALIŞMA ALANLARI - TAŞIMA", + "workspace-mouse": "ÇALIŞMA ALANLARI - FARE", + "search-placeholder": "Kısayol ara...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Klavye Kisayollari Ayarlari", + "description": "Panel icin klavye kisayollarinin gorunumunu ve kaynaklarini yapilandirin.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Pencere Boyutu", + "width": "Genislik:", + "height": "Yukseklik:", + "auto-height": "Otomatik", + "auto-height-hint": "'Otomatik' etkinlestirildiginde, yukseklik icerge gore otomatik olarak ayarlanir.", + "layout": "Duzen", + "columns": "Sutun sayisi:", + "columns-hint": "Daha fazla sutun daha genis pencerelerle daha iyi calisir.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Yapilandirma Dosyalari", + "config-paths-description": "Klavye kisayolu yapilandirma dosyalariniza ozel yollar belirtin. Eklenti otomatik olarak tum include/source yonergelerini takip eder.", + "hyprland-format-hint": "Beklenen format: bind = $mod, KEY, action #\"aciklama\"\nKategoriler: # 1. KATEGORI ADI", + "niri-format-hint": "Kategoriler su sekilde olusturulur: // #\"Kategori adi\"\nAciklamalar: hotkey-overlay-title=\"aciklama\"", + "actions": "Islemler", + "refresh-keybinds": "Kisayollari Yenile", + "refresh-message": "Paneli actinizda kisayollar yeniden yuklenecektir.", + "reset-defaults": "Varsayilanlara Sifirla", + "reset-message": "Ayarlar varsayilan degerlere sifirlandi.", + "saved": "Ayarlar basariyla kaydedildi.", + "keybind-setup": "Kisayol Ayari", + "keybind-setup-description": "Cheatsheet'i bir klavye kisayoluyla acmak icin, bu bind'i compositor yapilandirmaniza ekleyin:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod Tusu Degiskeni", + "mod-var-hint": "Super tusunuz icin kullanilan degisken adi (orn. $mod veya $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland yolu", + "niri-path": "Niri yolu", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "auto", + "color-paste-hint": "İpucu: bir hex rengi (ör. #FF6B6B) panoya kopyalayın; hapın içinde hızlı yapıştırma simgesi görünecek.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Kısayol Kopya Kağıdı", + "open": "Kopya kağıdını aç", + "settings": "Eklenti ayarları" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/uk-UA.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/uk-UA.json new file mode 100644 index 0000000..45141f6 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/uk-UA.json @@ -0,0 +1,113 @@ +{ + "default-category": "Гарячі клавіші", + "error": { + "unsupported-compositor": "Непідтримуваний композитор", + "sway-not-supported": "Sway поки не підтримується", + "sway-detail": "Підтримку Sway може бути додано в майбутньому оновленні (формат схожий на Hyprland)", + "labwc-not-supported": "LabWC не підтримується", + "labwc-detail": "LabWC використовує формат конфігурації XML, несумісний з цим плагіном", + "unknown-compositor": "Виявлено невідомий композитор", + "unknown-detail": "Цей плагін підтримує лише композитори Hyprland та Niri", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "Завантаження...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "Карта клавіш", + "title-hyprland": "Карта клавіш Hyprland", + "title-niri": "Карта клавіш Niri", + "title-mango": "MangoWC Keymap", + "workspace-switching": "РОБОЧІ ОБЛАСТІ - ПЕРЕМИКАННЯ", + "workspace-moving": "РОБОЧІ ОБЛАСТІ - ПЕРЕМІЩЕННЯ", + "workspace-mouse": "РОБОЧІ ОБЛАСТІ - МИША", + "search-placeholder": "Пошук скорочень...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "Налаштування гарячих клавіш", + "description": "Налаштуйте зовнішній вигляд та джерела гарячих клавіш для панелі.", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "Розмір вікна", + "width": "Ширина:", + "height": "Висота:", + "auto-height": "Авто", + "auto-height-hint": "Коли увімкнено 'Авто', висота автоматично підлаштовується під вміст.", + "layout": "Макет", + "columns": "Кількість колонок:", + "columns-hint": "Більше колонок краще працює з ширшими вікнами.", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "Файли конфігурації", + "config-paths-description": "Вкажіть власні шляхи до файлів конфігурації гарячих клавіш. Плагін автоматично слідує всім директивам include/source.", + "hyprland-format-hint": "Очікуваний формат: bind = $mod, KEY, action #\"опис\"\nКатегорії: # 1. НАЗВА КАТЕГОРІЇ", + "niri-format-hint": "Категорії створюються за допомогою: // #\"Назва категорії\"\nОписи: hotkey-overlay-title=\"опис\"", + "actions": "Дії", + "refresh-keybinds": "Оновити клавіші", + "refresh-message": "Гарячі клавіші будуть перезавантажені при відкритті панелі.", + "reset-defaults": "Скинути налаштування", + "reset-message": "Налаштування скинуто до значень за замовчуванням.", + "saved": "Налаштування успішно збережено.", + "keybind-setup": "Налаштування клавіші", + "keybind-setup-description": "Щоб відкрити шпаргалку за допомогою клавіші, додайте цей bind до конфігурації композитора:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Змінна клавіші Mod", + "mod-var-hint": "Ім'я змінної, що використовується для клавіші Super (наприклад, $mod або $mainMod).", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Шлях Hyprland", + "niri-path": "Шлях Niri", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "авто", + "color-paste-hint": "Порада: скопіюйте hex-колір (напр. #FF6B6B) у буфер обміну — у пілюлі з'явиться іконка вставки.", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "Шпаргалка гарячих клавіш", + "open": "Відкрити шпаргалку", + "settings": "Налаштування плагіна" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-CN.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-CN.json new file mode 100644 index 0000000..595294a --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-CN.json @@ -0,0 +1,113 @@ +{ + "default-category": "快捷键", + "error": { + "unsupported-compositor": "不支持的合成器", + "sway-not-supported": "尚不支持 Sway", + "sway-detail": "Sway 支持可能会在未来更新中添加(与 Hyprland 格式类似)", + "labwc-not-supported": "不支持 LabWC", + "labwc-detail": "LabWC 使用与此插件不兼容的 XML 配置格式", + "unknown-compositor": "检测到未知的合成器", + "unknown-detail": "此插件仅支持 Hyprland 和 Niri 合成器", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "加载中...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "按键映射", + "title-hyprland": "Hyprland 按键映射", + "title-niri": "Niri 按键映射", + "title-mango": "MangoWC Keymap", + "workspace-switching": "工作区 - 切换", + "workspace-moving": "工作区 - 移动", + "workspace-mouse": "工作区 - 鼠标", + "search-placeholder": "搜索快捷键...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "快捷键速查表设置", + "description": "配置面板的外观和快捷键来源。", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "窗口大小", + "width": "宽度:", + "height": "高度:", + "auto-height": "自动", + "auto-height-hint": "启用\"自动\"时,高度会根据内容自动调整。", + "layout": "布局", + "columns": "列数:", + "columns-hint": "更多列在较宽的窗口中效果更好。", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "配置文件", + "config-paths-description": "指定快捷键配置文件的自定义路径。插件会自动跟随所有include/source指令。", + "hyprland-format-hint": "预期格式: bind = $mod, KEY, action #\"描述\"\n类别: # 1. 类别名称", + "niri-format-hint": "类别使用以下格式创建: // #\"类别名称\"\n描述: hotkey-overlay-title=\"描述\"", + "actions": "操作", + "refresh-keybinds": "刷新快捷键", + "refresh-message": "打开面板时将重新加载快捷键。", + "reset-defaults": "恢复默认", + "reset-message": "设置已恢复为默认值。", + "saved": "设置保存成功。", + "keybind-setup": "快捷键设置", + "keybind-setup-description": "要使用键盘快捷键打开速查表,请将此绑定添加到合成器配置中:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod 键变量", + "mod-var-hint": "用于 Super 键的变量名称(例如 $mod 或 $mainMod)。", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland 路径", + "niri-path": "Niri 路径", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "自动", + "color-paste-hint": "提示:将十六进制颜色 (如 #FF6B6B) 复制到剪贴板,胶囊内会出现粘贴图标以便快速粘贴。", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "快捷键速查表", + "open": "打开速查表", + "settings": "插件设置" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-TW.json b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-TW.json new file mode 100644 index 0000000..b77dfbb --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/i18n/zh-TW.json @@ -0,0 +1,113 @@ +{ + "default-category": "快捷鍵", + "error": { + "unsupported-compositor": "不支援的合成器", + "sway-not-supported": "尚未支援 Sway", + "sway-detail": "Sway 支援可能會在未來更新中新增(與 Hyprland 格式類似)", + "labwc-not-supported": "不支援 LabWC", + "labwc-detail": "LabWC 使用與此外掛程式不相容的 XML 設定格式", + "unknown-compositor": "偵測到未知的合成器", + "unknown-detail": "此外掛程式僅支援 Hyprland 和 Niri 合成器", + "hyprctl-failed": "hyprctl binds failed - is Hyprland running?" + }, + "panel": { + "loading": "載入中...", + "loading-timeout": "Loading timed out. Click Refresh to retry.", + "title": "按鍵映射", + "title-hyprland": "Hyprland 按鍵映射", + "title-niri": "Niri 按鍵映射", + "title-mango": "MangoWC Keymap", + "workspace-switching": "工作區 - 切換", + "workspace-moving": "工作區 - 移動", + "workspace-mouse": "工作區 - 滑鼠", + "search-placeholder": "搜尋快捷鍵...", + "no-description": "(no description)", + "other": "Other", + "undescribed": "Without Description", + "add-description": "Add description", + "add-description-placeholder": "Description...", + "save-description": "Save", + "cancel": "Cancel", + "hide-bind": "Hide this bind" + }, + "settings": { + "title": "快捷鍵速查表設定", + "description": "設定面板的外觀和快捷鍵來源。", + "tab-general": "General", + "tab-appearance": "Appearance", + "window-size": "視窗大小", + "width": "寬度:", + "height": "高度:", + "auto-height": "自動", + "auto-height-hint": "啟用「自動」時,高度會根據內容自動調整。", + "layout": "佈局", + "columns": "欄位數:", + "columns-hint": "更多欄位在較寬的視窗中效果更好。", + "parsing-options": "Parsing Options", + "merge-sequential": "Merge sequential keybinds", + "merge-sequential-hint": "Combine consecutive numeric keybinds (e.g. Super+1..5 -> Workspace 1..5) into a single ranged entry.", + "show-undescribed": "Show undescribed binds", + "show-undescribed-hint": "Include keybinds that have no comment description. They will be auto-labeled with the action.", + "split-workspaces": "Split large workspace category", + "split-workspaces-hint": "When a workspace category exceeds the threshold, split it into Switching, Moving, and Mouse subcategories.", + "split-threshold": "Split threshold (binds):", + "config-paths": "設定檔", + "config-paths-description": "指定快捷鍵設定檔的自訂路徑。外掛程式會自動跟隨所有 include/source 指令。", + "hyprland-format-hint": "預期格式: bind = $mod, KEY, action #\"描述\"\n類別: # 1. 類別名稱", + "niri-format-hint": "類別使用以下格式建立: // #\"類別名稱\"\n描述: hotkey-overlay-title=\"描述\"", + "actions": "操作", + "refresh-keybinds": "重新整理快捷鍵", + "refresh-message": "開啟面板時將重新載入快捷鍵。", + "reset-defaults": "恢復預設值", + "reset-message": "設定已恢復為預設值。", + "saved": "設定儲存成功。", + "keybind-setup": "快捷鍵設定", + "keybind-setup-description": "要使用鍵盤快捷鍵開啟速查表,請將此繫結新增至合成器設定中:", + "keybind-example-hyprland": "Hyprland: bind = $mod, F1, exec, qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "keybind-example-niri": "Niri: Super+F1 { spawn \"qs\" \"-c\" \"noctalia-shell\" \"ipc\" \"call\" \"plugin\" \"togglePanel\" \"keybind-cheatsheet\"; }", + "mod-var": "Mod 鍵變數", + "mod-var-hint": "用於 Super 鍵的變數名稱(例如 $mod 或 $mainMod)。", + "width-range": "px (400-3000)", + "height-range": "px (300-2000)", + "hyprland-path": "Hyprland 路徑", + "niri-path": "Niri 路徑", + "mango-path": "Mango Path", + "mango-format-hint": "Expected format: bind=MODS,KEY,ACTION,ARGS\nCategories: # Category Name (horizontal rules stripped)\nOptional per-bind description: trailing #\"description\"", + "keybind-example-mango": "Mango example: bind=SUPER,F1,spawn_shell,noctalia-shell ipc call plugin:keybind-cheatsheet toggle", + "appearance-section": "Appearance", + "appearance-description": "Customize the colors used for special key categories. Changes apply immediately and persist when you click Apply.", + "preview-section": "Live Preview", + "color-pickers": "Key Colors", + "color-super": "Super / Mod key", + "color-ctrl": "Ctrl key", + "color-shift": "Shift key", + "color-alt": "Alt-modifier keys", + "color-xf86": "XF86 multimedia keys", + "color-print": "Print / Screenshot keys", + "color-numeric": "Numeric keys (workspaces)", + "color-mouse": "Mouse buttons", + "color-default": "Default letter keys", + "color-label": "Key label text", + "color-description": "Description text", + "color-theme-hint": "Leave empty to use theme accent color.", + "reset-color": "Reset to default", + "reset-all-colors": "Reset all colors", + "color-auto": "自動", + "color-paste-hint": "提示:將十六進位顏色 (如 #FF6B6B) 複製到剪貼簿,膠囊內會出現貼上圖示以便快速貼上。", + "keybind-ipc-command": "qs -c \"noctalia-shell\" ipc call plugin:keybind-cheatsheet toggle", + "hyprland-lua-path": "Hyprland Lua Path", + "hyprland-parser-mode": "Parser:", + "hyprland-lua-hint": "Auto: uses hyprland.lua via `hyprctl binds` when it exists, otherwise the legacy .conf parser.", + "undescribed-title": "Undescribed Binds", + "overrides-summary": "Hidden: {hidden} - Custom descriptions: {custom}", + "restore-hidden": "Restore hidden", + "restore-hidden-message": "Hidden binds restored.", + "clear-overrides": "Clear all overrides", + "clear-overrides-message": "All bind overrides cleared." + }, + "barwidget": { + "tooltip": "快捷鍵速查表", + "open": "開啟速查表", + "settings": "外掛設定" + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/manifest.json b/dot_config/noctalia/plugins/keybind-cheatsheet/manifest.json new file mode 100644 index 0000000..546ce49 --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/manifest.json @@ -0,0 +1,69 @@ +{ + "id": "keybind-cheatsheet", + "name": "Keybind Cheatsheet", + "version": "3.7.3", + "minNoctaliaVersion": "3.6.0", + "author": "blacku", + "license": "MIT", + "repository": "https://github.com/noctalia-dev/noctalia-plugins", + "description": "Universal keyboard shortcuts keymap that automatically detects and displays keybindings for Hyprland, Niri, or MangoWC compositors.", + "tags": [ + "Bar", + "Panel", + "System", + "Indicator", + "Hyprland", + "Niri", + "MangoWC" + ], + "entryPoints": { + "main": "Main.qml", + "barWidget": "BarWidget.qml", + "panel": "Panel.qml", + "settings": "Settings.qml" + }, + "dependencies": { + "plugins": [] + }, + "metadata": { + "defaultSettings": { + "cheatsheetData": [], + "detectedCompositor": "", + "windowWidth": 1400, + "windowHeight": 850, + "autoHeight": true, + "columnCount": 3, + "modKeyVariable": "$mod", + "hyprlandConfigPath": "~/.config/hypr/hyprland.conf", + "hyprlandLuaConfigPath": "~/.config/hypr/hyprland.lua", + "hyprlandParserMode": "auto", + "niriConfigPath": "~/.config/niri/config.kdl", + "mangoConfigPath": "~/.config/mango/config.conf", + "mergeSequentialBinds": true, + "showUndescribedBinds": true, + "splitLargeWorkspaceCategory": true, + "workspaceSplitThreshold": 12, + "keyColorAlt": "#FF6B6B", + "keyColorXF86": "#4ECDC4", + "keyColorPrint": "#95E1D3", + "keyColorNumeric": "#A8DADC", + "keyColorMouse": "#F38181", + "keyColorSuper": "", + "keyColorCtrl": "", + "keyColorShift": "", + "keyColorDefault": "#6C757D", + "keyLabelColor": "#FFFFFF", + "keyTextSuper": "", + "keyTextCtrl": "", + "keyTextShift": "", + "keyTextAlt": "", + "keyTextXF86": "", + "keyTextPrint": "", + "keyTextNumeric": "", + "keyTextMouse": "", + "keyTextDefault": "", + "descriptionTextColor": "", + "bindOverrides": {} + } + } +} diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/preview.png b/dot_config/noctalia/plugins/keybind-cheatsheet/preview.png new file mode 100644 index 0000000..c315ef6 Binary files /dev/null and b/dot_config/noctalia/plugins/keybind-cheatsheet/preview.png differ diff --git a/dot_config/noctalia/plugins/keybind-cheatsheet/settings.json b/dot_config/noctalia/plugins/keybind-cheatsheet/settings.json new file mode 100644 index 0000000..37eed2e --- /dev/null +++ b/dot_config/noctalia/plugins/keybind-cheatsheet/settings.json @@ -0,0 +1,508 @@ +{ + "cheatsheetData": [ + { + "title": "Noctalia", + "binds": [ + { + "keys": "Super + Comma", + "desc": "Noctalia Settings", + "_verb": "spawn-sh", + "_mods": "Super", + "_mainKey": "Comma" + }, + { + "keys": "Super + Shift + Comma", + "desc": "Noctalia Cheatsheet", + "_verb": "spawn-sh", + "_mods": "Super+Shift", + "_mainKey": "Comma" + }, + { + "keys": "Super + R", + "desc": "Open App Launcher: noctalia launcher", + "_verb": "spawn-sh", + "_mods": "Super", + "_mainKey": "R" + }, + { + "keys": "Super + Shift + E", + "desc": "Session Menu: noctalia sessionMenu", + "_verb": "spawn-sh", + "_mods": "Super+Shift", + "_mainKey": "E" + }, + { + "keys": "Vol Up", + "desc": "Volume Up", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioRaiseVolume" + }, + { + "keys": "Vol Down", + "desc": "Volume Down", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioLowerVolume" + }, + { + "keys": "Mute", + "desc": "Mute Output", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioMute" + }, + { + "keys": "Mic Mute", + "desc": "Mute Input", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioMicMute" + }, + { + "keys": "Next", + "desc": "Next Track", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioNext" + }, + { + "keys": "Prev", + "desc": "Previous Track", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioPrev" + }, + { + "keys": "Play", + "desc": "Play / Pause", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioPlay" + }, + { + "keys": "Pause", + "desc": "Play / Pause", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86AudioPause" + }, + { + "keys": "Bright Up", + "desc": "Brightness Up", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86MonBrightnessUp" + }, + { + "keys": "Bright Down", + "desc": "Brightness Down", + "_verb": "spawn-sh", + "_mods": "", + "_mainKey": "XF86MonBrightnessDown" + } + ] + }, + { + "title": "Applications", + "binds": [ + { + "keys": "Super + Return", + "desc": "Open Terminal: kitty", + "_verb": "spawn", + "_mods": "Super", + "_mainKey": "Return" + }, + { + "keys": "Super + B", + "desc": "Open Browser: Librewolf", + "_verb": "spawn", + "_mods": "Super", + "_mainKey": "B" + }, + { + "keys": "Super + E", + "desc": "File Manager: Dolphin", + "_verb": "spawn", + "_mods": "Super", + "_mainKey": "E" + } + ] + }, + { + "title": "Window Management", + "binds": [ + { + "keys": "Super + Shift + Q", + "desc": "Close Window", + "_verb": "close-window", + "_mods": "Super+Shift", + "_mainKey": "Q" + }, + { + "keys": "Super + F", + "desc": "Fullscreen Window", + "_verb": "fullscreen-window", + "_mods": "Super", + "_mainKey": "F" + } + ] + }, + { + "title": "Column Navigation", + "binds": [ + { + "keys": "Super + Home", + "desc": "Focus Column First", + "_verb": "focus-column-first", + "_mods": "Super", + "_mainKey": "Home" + }, + { + "keys": "Super + End", + "desc": "Focus Column Last", + "_verb": "focus-column-last", + "_mods": "Super", + "_mainKey": "End" + }, + { + "keys": "Super + H", + "desc": "Focus Column Left", + "_verb": "focus-column-left", + "_mods": "Super", + "_mainKey": "H" + }, + { + "keys": "Super + L", + "desc": "Focus Column Right", + "_verb": "focus-column-right", + "_mods": "Super", + "_mainKey": "L" + } + ] + }, + { + "title": "Workspace Navigation", + "binds": [ + { + "keys": "Super + K", + "desc": "Focus Workspace Up", + "_verb": "focus-workspace-up", + "_mods": "Super", + "_mainKey": "K" + }, + { + "keys": "Super + J", + "desc": "Focus Workspace Down", + "_verb": "focus-workspace-down", + "_mods": "Super", + "_mainKey": "J" + }, + { + "keys": "Super + 1-9", + "desc": "Focus Workspace 1-9", + "_verb": "focus-workspace", + "_mods": "Super", + "_mainKey": "1-9", + "_merged": true + }, + { + "keys": "Super + TAB", + "desc": "Focus Workspace Previous", + "_verb": "focus-workspace-previous", + "_mods": "Super", + "_mainKey": "TAB" + } + ] + }, + { + "title": "Move Columns", + "binds": [ + { + "keys": "Super + Shift + H", + "desc": "Move Column Left", + "_verb": "move-column-left", + "_mods": "Super+Shift", + "_mainKey": "H" + }, + { + "keys": "Super + Shift + L", + "desc": "Move Column Right", + "_verb": "move-column-right", + "_mods": "Super+Shift", + "_mainKey": "L" + }, + { + "keys": "Super + CTRL + Home", + "desc": "Move Column To First", + "_verb": "move-column-to-first", + "_mods": "Super", + "_mainKey": "Home" + }, + { + "keys": "Super + CTRL + End", + "desc": "Move Column To Last", + "_verb": "move-column-to-last", + "_mods": "Super", + "_mainKey": "End" + }, + { + "keys": "Super + Shift + CTRL + H", + "desc": "Move Column To Monitor Left", + "_verb": "move-column-to-monitor-left", + "_mods": "Super+Shift", + "_mainKey": "H" + }, + { + "keys": "Super + Shift + CTRL + L", + "desc": "Move Column To Monitor Right", + "_verb": "move-column-to-monitor-right", + "_mods": "Super+Shift", + "_mainKey": "L" + }, + { + "keys": "Super + Shift + CTRL + J", + "desc": "Move Column To Workspace Down", + "_verb": "move-column-to-workspace-down", + "_mods": "Super+Shift", + "_mainKey": "J" + }, + { + "keys": "Super + Shift + CTRL + K", + "desc": "Move Column To Workspace Up", + "_verb": "move-column-to-workspace-up", + "_mods": "Super+Shift", + "_mainKey": "K" + }, + { + "keys": "Super + Shift + 1-9", + "desc": "Move Column To Workspace 1-9", + "_verb": "move-column-to-workspace", + "_mods": "Super+Shift", + "_mainKey": "1-9", + "_merged": true + } + ] + }, + { + "title": "Move Windows", + "binds": [ + { + "keys": "Super + Shift + K", + "desc": "Move Window Up", + "_verb": "move-window-up", + "_mods": "Super+Shift", + "_mainKey": "K" + }, + { + "keys": "Super + Shift + J", + "desc": "Move Window Down", + "_verb": "move-window-down", + "_mods": "Super+Shift", + "_mainKey": "J" + } + ] + }, + { + "title": "Column Width", + "binds": [ + { + "keys": "Super + Minus", + "desc": "Set Column Width \" 10%\"", + "_verb": "set-column-width", + "_mods": "Super", + "_mainKey": "Minus" + }, + { + "keys": "Super + Equal", + "desc": "Set Column Width \"+10%\"", + "_verb": "set-column-width", + "_mods": "Super", + "_mainKey": "Equal" + } + ] + }, + { + "title": "Screenshots", + "binds": [ + { + "keys": "CTRL + Shift + 1", + "desc": "Screenshot", + "_verb": "screenshot", + "_mods": "Shift", + "_mainKey": "1" + }, + { + "keys": "CTRL + Shift + 2", + "desc": "Screenshot Screen", + "_verb": "screenshot-screen", + "_mods": "Shift", + "_mainKey": "2" + }, + { + "keys": "CTRL + Shift + 3", + "desc": "Screenshot Window", + "_verb": "screenshot-window", + "_mods": "Shift", + "_mainKey": "3" + } + ] + }, + { + "title": "Power", + "binds": [ + { + "keys": "Super + Shift + P", + "desc": "Power Off Monitors", + "_verb": "power-off-monitors", + "_mods": "Super+Shift", + "_mainKey": "P" + } + ] + }, + { + "title": "System", + "binds": [ + { + "keys": "CTRL + ALT + Delete", + "desc": "Quit", + "_verb": "quit", + "_mods": "", + "_mainKey": "Delete" + } + ] + }, + { + "title": "Other", + "binds": [ + { + "keys": "Super + CTRL + H", + "desc": "Focus Monitor Left", + "_verb": "focus-monitor-left", + "_mods": "Super", + "_mainKey": "H" + }, + { + "keys": "Super + CTRL + L", + "desc": "Focus Monitor Right", + "_verb": "focus-monitor-right", + "_mods": "Super", + "_mainKey": "L" + }, + { + "keys": "Super + CTRL + K", + "desc": "Focus Monitor Up", + "_verb": "focus-monitor-up", + "_mods": "Super", + "_mainKey": "K" + }, + { + "keys": "Super + CTRL + J", + "desc": "Focus Monitor Down", + "_verb": "focus-monitor-down", + "_mods": "Super", + "_mainKey": "J" + }, + { + "keys": "Super + CTRL + F", + "desc": "Expand Column To Available Width", + "_verb": "expand-column-to-available-width", + "_mods": "Super", + "_mainKey": "F" + }, + { + "keys": "Super + C", + "desc": "Center Column", + "_verb": "center-column", + "_mods": "Super", + "_mainKey": "C" + }, + { + "keys": "Super + CTRL + C", + "desc": "Center Visible Columns", + "_verb": "center-visible-columns", + "_mods": "Super", + "_mainKey": "C" + }, + { + "keys": "Super + Shift + Minus", + "desc": "Set Window Height \" 10%\"", + "_verb": "set-window-height", + "_mods": "Super+Shift", + "_mainKey": "Minus" + }, + { + "keys": "Super + Shift + Equal", + "desc": "Set Window Height \"+10%\"", + "_verb": "set-window-height", + "_mods": "Super+Shift", + "_mainKey": "Equal" + }, + { + "keys": "Super + T", + "desc": "Toggle Window Floating", + "_verb": "toggle-window-floating", + "_mods": "Super", + "_mainKey": "T" + }, + { + "keys": "Super + W", + "desc": "Toggle Column Tabbed Display", + "_verb": "toggle-column-tabbed-display", + "_mods": "Super", + "_mainKey": "W" + }, + { + "keys": "Super + ESCAPE", + "desc": "Toggle Keyboard Shortcuts Inhibit", + "_verb": "toggle-keyboard-shortcuts-inhibit", + "_mods": "Super", + "_mainKey": "ESCAPE" + }, + { + "keys": "Super + O", + "desc": "Toggle Overview", + "_verb": "toggle-overview", + "_mods": "Super", + "_mainKey": "O" + } + ] + } + ], + "detectedCompositor": "niri", + "windowWidth": 1400, + "windowHeight": 850, + "autoHeight": true, + "columnCount": 4, + "modKeyVariable": "$mod", + "hyprlandConfigPath": "~/.config/hypr/hyprland.conf", + "hyprlandLuaConfigPath": "~/.config/hypr/hyprland.lua", + "hyprlandParserMode": "auto", + "niriConfigPath": "~/.config/niri/config.kdl", + "mangoConfigPath": "~/.config/mango/config.conf", + "mergeSequentialBinds": true, + "showUndescribedBinds": true, + "splitLargeWorkspaceCategory": true, + "workspaceSplitThreshold": 12, + "keyColorAlt": "#FF6B6B", + "keyColorXF86": "#4ECDC4", + "keyColorPrint": "#95E1D3", + "keyColorNumeric": "#A8DADC", + "keyColorMouse": "#F38181", + "keyColorSuper": "", + "keyColorCtrl": "", + "keyColorShift": "", + "keyColorDefault": "#6C757D", + "keyLabelColor": "#FFFFFF", + "keyTextSuper": "", + "keyTextCtrl": "", + "keyTextShift": "", + "keyTextAlt": "", + "keyTextXF86": "", + "keyTextPrint": "", + "keyTextNumeric": "", + "keyTextMouse": "", + "keyTextDefault": "", + "descriptionTextColor": "", + "bindOverrides": {} +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/LICENSE b/dot_config/noctalia/plugins/niri-workspaces/LICENSE new file mode 100644 index 0000000..aaa24ff --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Kohányi Róbert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dot_config/noctalia/plugins/niri-workspaces/LauncherProvider.qml b/dot_config/noctalia/plugins/niri-workspaces/LauncherProvider.qml new file mode 100644 index 0000000..c2da455 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/LauncherProvider.qml @@ -0,0 +1,344 @@ +import QtQuick +import Quickshell +import qs.Commons + +Item { + id: root + + property var pluginApi: null + + property string name: "Niri Workspaces" + property var launcher: null + property bool handleSearch: false + property string supportedLayouts: "list" + property bool supportsAutoPaste: false + + readonly property var cfg: pluginApi?.pluginSettings || ({}) + readonly property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({}) + readonly property string prefix: cfg.launcherPrefix ?? defaults.launcherPrefix ?? ">ws" + + // `!` immediately after the prefix enters rename mode. `!!` resets. + readonly property string renameSigil: "!" + + readonly property var mainInstance: pluginApi?.mainInstance + + // Workspace id set by the pencil/eraser buttons. When >= 0, indicates a + // button-initiated edit so onActivate skips the post-apply focus jump. + // The keyboard flow (`>ws !name` / `>ws !!`) leaves this at -1 and targets + // `highlightedWorkspaceId` instead, then focuses the edited workspace. + property int editTargetId: -1 + + // Workspace id the user last highlighted while in filter mode. Captured + // by the selectedIndexChanged handler below and frozen the moment rename + // mode kicks in (since the launcher resets selectedIndex to 0 whenever + // results change). + property int highlightedWorkspaceId: -1 + + // Parallel to the last filter-mode results array: workspace id at each + // row index, or -1 for non-workspace rows (e.g. "no matches"). + property var filterResultWorkspaceIds: [] + + Connections { + target: mainInstance + enabled: mainInstance !== null && launcher !== null + function onWorkspacesChanged() { + if (launcher && launcher.searchText && launcher.searchText.startsWith(prefix)) { + launcher.updateResults(); + } + } + } + + // Track which workspace is highlighted in the list — but only while in + // filter mode. Skip updates in rename mode so the frozen highlight at the + // moment the user typed `!` survives the selectedIndex reset. + Connections { + target: launcher + enabled: launcher !== null + function onSelectedIndexChanged() { + root.captureHighlightFromLauncher(); + } + } + + function captureHighlightFromLauncher() { + if (!launcher) return; + var txt = launcher.searchText || ""; + if (!txt.startsWith(prefix)) return; + var content = txt.slice(prefix.length).replace(/^\s+/, ""); + if (content.startsWith(renameSigil)) return; // freeze during rename mode + var idx = launcher.selectedIndex; + if (idx < 0 || idx >= filterResultWorkspaceIds.length) return; + var wsId = filterResultWorkspaceIds[idx]; + if (wsId !== null && wsId !== undefined && wsId !== -1) { + highlightedWorkspaceId = wsId; + } + } + + function handleCommand(searchText) { + return searchText.startsWith(prefix); + } + + function commands() { + return [{ + "name": prefix, + "description": pluginApi?.tr("launcher.command.description"), + "icon": "layout-grid", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () { + if (launcher) launcher.setSearchText(prefix + " "); + } + }]; + } + + function getResults(searchText) { + if (!searchText.startsWith(prefix)) return []; + + if (!mainInstance || !mainInstance.isNiri) { + filterResultWorkspaceIds = []; + return [{ + "name": pluginApi?.tr("launcher.notNiri.name"), + "description": pluginApi?.tr("launcher.notNiri.description"), + "icon": "alert-circle", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () {} + }]; + } + + var content = searchText.slice(prefix.length).replace(/^\s+/, ""); + + if (content.startsWith(renameSigil)) { + return renameModeResults(content.slice(renameSigil.length).replace(/^\s+/, "")); + } + + // Exiting rename mode — clear any pending pencil/eraser target. + if (editTargetId !== -1) editTargetId = -1; + return filterModeResults(content.trim()); + } + + function filterModeResults(filter) { + var results = []; + var ids = []; + var workspaces = mainInstance.sortedWorkspaces; + var filterLower = filter.toLowerCase(); + + for (var i = 0; i < workspaces.length; i++) { + var ws = workspaces[i]; + if (filter.length === 0 || matchesFilter(ws, filterLower)) { + results.push(buildWorkspaceEntry(ws)); + ids.push(ws.id); + } + } + + if (results.length === 0 && filter.length > 0) { + results.push({ + "name": pluginApi?.tr("launcher.noMatches.name", { "filter": filter }), + "description": pluginApi?.tr("launcher.noMatches.description"), + "icon": "mood-empty", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () {} + }); + ids.push(-1); + } + + filterResultWorkspaceIds = ids; + // Seed the highlight to the first visible workspace so an immediate + // transition to rename mode (before the user arrows) still has a target. + if (ids.length > 0 && ids[0] !== -1) { + highlightedWorkspaceId = ids[0]; + } + + // When no filter is active, auto-highlight the focused workspace instead + // of row 0 — matches "which workspace am I editing/jumping from" better + // than "first row on this output". LauncherCore sets selectedIndex=0 at + // the end of updateResults, so we have to override via callLater. + if (filter.length === 0 && launcher && mainInstance.focusedWorkspace) { + var focusedId = mainInstance.focusedWorkspace.id; + var focusedIdx = ids.indexOf(focusedId); + if (focusedIdx > 0) { + Qt.callLater(function () { + if (launcher) launcher.selectedIndex = focusedIdx; + }); + highlightedWorkspaceId = focusedId; + } + } + return results; + } + + function renameModeResults(newName) { + var target = resolveRenameTarget(); + if (!target) { + return [{ + "name": pluginApi?.tr("launcher.noHighlighted.name"), + "description": pluginApi?.tr("launcher.noHighlighted.description"), + "icon": "alert-circle", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () {} + }]; + } + + var targetId = target.id; + var currentName = (target.name && target.name.length > 0) ? target.name : ""; + var targetLabel = currentName.length > 0 ? "\"" + currentName + "\"" : "Workspace " + target.idx; + + // `!!` — reset target's name. + if (newName.startsWith(renameSigil)) { + return [{ + "name": pluginApi?.tr("launcher.resetPrompt.name", { "target": targetLabel }), + "description": pluginApi?.tr("launcher.resetPrompt.description"), + "icon": "eraser", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () { + applyEdit(targetId, null); + } + }]; + } + + if (newName.length === 0) { + var promptName = currentName.length > 0 + ? pluginApi?.tr("launcher.renamePrompt.nameWithCurrent", { "current": currentName }) + : pluginApi?.tr("launcher.renamePrompt.name", { "idx": target.idx }); + return [{ + "name": promptName, + "description": pluginApi?.tr("launcher.renamePrompt.description", { "sigil": renameSigil }), + "icon": "pencil", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () {} + }]; + } + + // No-op: user pressed Enter without changing the pre-filled name. + if (newName === currentName) { + return [{ + "name": pluginApi?.tr("launcher.applyRename.unchangedName", { "name": newName }), + "description": pluginApi?.tr("launcher.applyRename.unchangedDescription"), + "icon": "pencil", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () { + root.editTargetId = -1; + if (launcher) launcher.setSearchText(prefix + " "); + } + }]; + } + + return [{ + "name": pluginApi?.tr("launcher.applyRename.name", { "name": newName }), + "description": pluginApi?.tr("launcher.applyRename.description", { "target": targetLabel }), + "icon": "pencil", + "isTablerIcon": true, + "isImage": false, + "onActivate": function () { + applyEdit(targetId, newName); + } + }]; + } + + // Apply a rename (newName truthy) or reset (newName === null) and return + // the launcher to the filtered-list view. We never auto-focus the edited + // workspace or close the launcher — the user stays in the list so they + // can keep editing or jump somewhere else on their own terms. + function applyEdit(targetId, newName) { + var ws = mainInstance.findWorkspaceById(targetId) || mainInstance.focusedWorkspace; + if (newName === null) { + mainInstance.unsetWorkspaceName(ws); + } else { + mainInstance.renameWorkspace(ws, newName); + } + root.editTargetId = -1; + if (launcher) launcher.setSearchText(prefix + " "); + } + + function resolveRenameTarget() { + // Pencil/eraser wins — they pinpoint a specific row. + if (editTargetId !== -1) { + var targeted = mainInstance.findWorkspaceById(editTargetId); + if (targeted) return targeted; + } + // Keyboard flow: whichever workspace was highlighted in the list. + if (highlightedWorkspaceId !== -1) { + var highlighted = mainInstance.findWorkspaceById(highlightedWorkspaceId); + if (highlighted) return highlighted; + } + // Last resort when the launcher has no usable highlight. + return mainInstance.focusedWorkspace; + } + + function matchesFilter(ws, filterLower) { + if (String(ws.idx).indexOf(filterLower) !== -1) return true; + if (ws.name && ws.name.toLowerCase().indexOf(filterLower) !== -1) return true; + if (ws.output && ws.output.toLowerCase().indexOf(filterLower) !== -1) return true; + return false; + } + + function workspaceLabel(ws) { + if (ws.name && ws.name.length > 0) return ws.idx + " · " + ws.name; + return pluginApi?.tr("launcher.unnamedLabel", { "idx": ws.idx }); + } + + function buildWorkspaceEntry(ws) { + var label = workspaceLabel(ws); + if (ws.isFocused) label += pluginApi?.tr("launcher.currentSuffix"); + var descKey = ws.isFocused ? "launcher.focus.descriptionCurrent" : "launcher.focus.description"; + var desc = pluginApi?.tr(descKey); + if (ws.output) desc = desc + " — " + ws.output; + var wsId = ws.id; + var hasName = !!(ws.name && ws.name.length > 0); + return { + "name": label, + "description": desc, + "icon": ws.isFocused ? "check" : "chevron-right", + "isTablerIcon": true, + "isImage": false, + "provider": root, + "workspaceId": wsId, + "workspaceHasName": hasName, + "onActivate": function () { + var target = mainInstance.findWorkspaceById(wsId); + if (target) mainInstance.focusWorkspace(target); + if (launcher) launcher.close(); + } + }; + } + + // Per-row action buttons. Button-initiated edits set editTargetId so the + // rename mode resolves this specific row and skips the post-apply focus. + function getItemActions(item) { + if (!item || item.workspaceId === undefined) return []; + + var wsId = item.workspaceId; + var actions = []; + + actions.push({ + "icon": "pencil", + "tooltip": pluginApi?.tr("launcher.actions.rename"), + "action": function () { + root.editTargetId = wsId; + var ws = mainInstance.findWorkspaceById(wsId); + var existing = (ws && ws.name && !ws.name.startsWith(renameSigil)) ? ws.name : ""; + if (launcher) launcher.setSearchText(prefix + " " + renameSigil + existing); + } + }); + + if (item.workspaceHasName) { + actions.push({ + "icon": "eraser", + "tooltip": pluginApi?.tr("launcher.actions.reset"), + "action": function () { + // Mark as button-initiated so any refresh of highlightedWorkspaceId + // doesn't accidentally bring keyboard-flow focus-jump semantics in. + root.editTargetId = wsId; + var ws = mainInstance.findWorkspaceById(wsId); + if (ws) mainInstance.unsetWorkspaceName(ws); + root.editTargetId = -1; + } + }); + } + + return actions; + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/Main.qml b/dot_config/noctalia/plugins/niri-workspaces/Main.qml new file mode 100644 index 0000000..35f72b1 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/Main.qml @@ -0,0 +1,162 @@ +import QtQuick +import Quickshell +import Quickshell.Io +import qs.Commons +import qs.Services.Compositor +import qs.Services.UI + +Item { + id: root + + property var pluginApi: null + + readonly property bool isNiri: CompositorService.isNiri + + readonly property var cfg: pluginApi?.pluginSettings || ({}) + readonly property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({}) + readonly property string launcherPrefix: cfg.launcherPrefix ?? defaults.launcherPrefix ?? ">ws" + + // Snapshot of CompositorService.workspaces as a plain array. Rebuilt on + // workspaceChanged so JS-array consumers (LauncherProvider) get a stable, + // iterable view. The backend ListModel is already sorted by output+idx. + property var sortedWorkspaces: [] + property var focusedWorkspace: null + + signal workspacesChanged + + Connections { + target: CompositorService + function onWorkspaceChanged() { + root.rebuildWorkspaces(); + } + } + + function rebuildWorkspaces() { + var arr = []; + var focused = null; + var model = CompositorService.workspaces; + for (var i = 0; i < model.count; i++) { + var w = model.get(i); + arr.push(w); + if (w.isFocused) focused = w; + } + sortedWorkspaces = arr; + focusedWorkspace = focused; + workspacesChanged(); + } + + // Resolve a workspace into a `--workspace` reference acceptable to the + // niri CLI. The CLI parses numeric refs as *idx* (not id) via + // WorkspaceReferenceArg::Index, so `ws.idx` is the only correct numeric + // reference — `ws.id` would silently target a different workspace. + // Names are unique across niri and preferred when available. + function workspaceRef(ws) { + if (!ws) return null; + if (ws.name && ws.name.length > 0) return ws.name; + return String(ws.idx); + } + + function findWorkspaceById(id) { + for (var i = 0; i < sortedWorkspaces.length; i++) { + if (sortedWorkspaces[i].id === id) return sortedWorkspaces[i]; + } + return null; + } + + function renameWorkspace(ws, newName) { + if (!isNiri || !ws) return; + var trimmed = (newName || "").trim(); + // niri's two subcommands take the target in different forms: + // set-workspace-name [--workspace ] + // unset-workspace-name [] + // Passing --workspace to unset-workspace-name makes niri reject the + // command, so branch here. Omitting the reference entirely makes niri + // target the focused workspace, which is what we want when ws is + // already focused (also avoids our idx ref misfiring for unnamed + // workspaces). + var args = ["niri", "msg", "action"]; + var ref = ws.isFocused ? null : workspaceRef(ws); + + if (trimmed.length === 0) { + args.push("unset-workspace-name"); + if (ref !== null) args.push(ref); + } else { + args.push("set-workspace-name", trimmed); + if (ref !== null) args.push("--workspace", ref); + } + + Logger.i("NiriWorkspaces", "Running:", args.join(" ")); + Quickshell.execDetached(args); + } + + function unsetWorkspaceName(ws) { + renameWorkspace(ws, ""); + } + + function renameCurrent(newName) { + if (!focusedWorkspace) { + Logger.w("NiriWorkspaces", "No focused workspace to rename"); + return; + } + renameWorkspace(focusedWorkspace, newName); + } + + function unsetCurrentName() { + if (!focusedWorkspace) { + Logger.w("NiriWorkspaces", "No focused workspace to unset"); + return; + } + unsetWorkspaceName(focusedWorkspace); + } + + function focusWorkspace(ws) { + if (!isNiri || !ws) return; + // niri's `focus-workspace ` toggles back to the previous workspace + // when the target is already focused. Skip the dispatch so re-selecting + // the current workspace is a no-op. + if (ws.isFocused) return; + var ref = workspaceRef(ws); + if (ref === null) return; + Quickshell.execDetached(["niri", "msg", "action", "focus-workspace", ref]); + } + + IpcHandler { + target: "plugin:niri-workspaces" + + // Mirrors the shell's `launcher emoji` toggle: open the launcher in + // workspace mode, close it if already in that mode, or switch modes if + // it's open on a different prefix. + function toggle() { + if (!pluginApi) return; + pluginApi.withCurrentScreen(screen => { + var prefix = root.launcherPrefix; + var searchText = PanelService.getLauncherSearchText(screen); + var isInWsMode = searchText.startsWith(prefix); + if (!PanelService.isLauncherOpen(screen)) { + PanelService.openLauncherWithSearch(screen, prefix + " "); + } else if (isInWsMode) { + PanelService.closeLauncher(screen); + } else { + PanelService.setLauncherSearchText(screen, prefix + " "); + } + }, Settings.data.appLauncher.overviewLayer); + } + + function renameCurrent(name: string) { + root.renameCurrent(name); + } + + function unsetCurrent() { + root.unsetCurrentName(); + } + } + + Component.onCompleted: { + if (isNiri) { + Logger.i("NiriWorkspaces", "Using CompositorService for workspace state"); + } else { + Logger.w("NiriWorkspaces", "Not running on Niri — plugin inactive"); + } + rebuildWorkspaces(); + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/README.md b/dot_config/noctalia/plugins/niri-workspaces/README.md new file mode 100644 index 0000000..6fd367d --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/README.md @@ -0,0 +1,54 @@ +# Niri Workspaces + +Browse, jump to, rename or reset Niri workspaces from the Noctalia launcher — modelled after the built-in `>win` window switcher. + +## Usage + +Open the launcher and type the `>ws` prefix. + +- `>ws` — lists every workspace (current workspace highlighted). Arrow up/down to pick a row, Enter jumps to it. +- `>ws foo` — filters workspaces whose name, index, or output contains `foo`. + +The focused workspace is highlighted by default when the list opens unfiltered, so keyboard rename/reset shortcuts target it right away without any extra navigation. + +### Keyboard rename / reset + +With `>ws` (unfiltered) open and a workspace highlighted, type: + +- `!new name` → `>ws !new name` — renames the highlighted workspace. +- `!!` → `>ws !!` — clears the highlighted workspace's custom name. + +After applying, the launcher returns to the workspace list so you can keep editing or jump somewhere else on your own — Enter on a row switches to that workspace. + +Entering rename mode with `!` pre-fills the current name (if any), so you can edit it rather than retype. Because rename mode only engages when `!` is the first character after the prefix, clear any filter text before typing `!`. + +### Pencil / eraser buttons + +Each workspace row shows action buttons on the right when selected: + +- **Pencil** — opens rename mode pre-filled with the workspace's current name. Enter applies. +- **Eraser** — clears the name immediately (shown only when the workspace is named). + +## Keyboard shortcuts (without opening the launcher) + +Bind these to Niri keybindings for direct access: + +```sh +# Open/close the launcher in workspace mode (mirrors the shell's `launcher emoji` toggle). +qs ipc call plugin:niri-workspaces toggle + +# Rename / reset the focused workspace without opening the launcher. +qs ipc call plugin:niri-workspaces renameCurrent "my name" +qs ipc call plugin:niri-workspaces unsetCurrent +``` + +`renameCurrent` / `unsetCurrent` always target the focused workspace. `toggle` respects your configured launcher prefix. + +## Requirements + +- [Niri](https://github.com/YaLTeR/niri) with the `niri msg` CLI (event-stream support). +- On other compositors the plugin loads but stays dormant. + +## Why Niri-only? + +Niri has first-class `set-workspace-name` / `unset-workspace-name` actions, and the concept of "reset the name to fall back to the index" maps cleanly to `unset-workspace-name`. Hyprland's `renameworkspace` has different semantics, so a Hyprland variant would need to be a separate plugin. diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/de.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/de.json new file mode 100644 index 0000000..73e8142 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/de.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Niri-Arbeitsflächen filtern, wechseln, umbenennen oder zurücksetzen" + }, + "unnamedLabel": "Arbeitsfläche {idx}", + "currentSuffix": " (aktuell)", + "focus": { + "description": "Zu dieser Arbeitsfläche wechseln", + "descriptionCurrent": "Aktuelle Arbeitsfläche" + }, + "actions": { + "rename": "Umbenennen", + "reset": "Name zurücksetzen (auf Index)" + }, + "renamePrompt": { + "name": "Neuen Namen für Arbeitsfläche {idx} eingeben", + "nameWithCurrent": "Name von „{current}“ bearbeiten", + "description": "Mit Enter übernehmen. {sigil}{sigil} zum Zurücksetzen." + }, + "resetPrompt": { + "name": "Namen von {target} zurücksetzen", + "description": "Entfernt den benutzerdefinierten Namen — Enter übernimmt" + }, + "applyRename": { + "name": "Name setzen: {name}", + "description": "{target} auf diesen Namen umbenennen", + "unchangedName": "Name behalten: {name}", + "unchangedDescription": "Name ist bereits gesetzt — Enter schließt" + }, + "noMatches": { + "name": "Keine Arbeitsflächen passen zu „{filter}“", + "description": "Anderen Filter versuchen oder zurücksetzen" + }, + "noHighlighted": { + "name": "Keine Arbeitsfläche zum Bearbeiten", + "description": "Eine Arbeitsfläche in der Liste markieren oder den Launcher auf Niri öffnen" + }, + "notNiri": { + "name": "Läuft nicht auf Niri", + "description": "Dieses Plugin funktioniert nur auf dem Niri-Compositor" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/en.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/en.json new file mode 100644 index 0000000..738d602 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/en.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filter, jump to, rename or reset Niri workspaces" + }, + "unnamedLabel": "Workspace {idx}", + "currentSuffix": " (current)", + "focus": { + "description": "Switch to this workspace", + "descriptionCurrent": "Current workspace" + }, + "actions": { + "rename": "Rename", + "reset": "Reset name (back to index)" + }, + "renamePrompt": { + "name": "Type a new name for Workspace {idx}", + "nameWithCurrent": "Edit name of \"{current}\"", + "description": "Press Enter to apply. Type {sigil}{sigil} to reset." + }, + "resetPrompt": { + "name": "Reset name of {target}", + "description": "Clears the custom name — press Enter to apply" + }, + "applyRename": { + "name": "Set name: {name}", + "description": "Rename {target} to this", + "unchangedName": "Keep name: {name}", + "unchangedDescription": "Name is already set — press Enter to close" + }, + "noMatches": { + "name": "No workspaces match \"{filter}\"", + "description": "Try a different filter or clear it" + }, + "noHighlighted": { + "name": "No workspace to edit", + "description": "Highlight a workspace in the list, or open the launcher on Niri" + }, + "notNiri": { + "name": "Not running on Niri", + "description": "This plugin only works on the Niri compositor" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/es.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/es.json new file mode 100644 index 0000000..da36f39 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/es.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filtrar, cambiar, renombrar o restablecer espacios de trabajo de Niri" + }, + "unnamedLabel": "Espacio de trabajo {idx}", + "currentSuffix": " (actual)", + "focus": { + "description": "Cambiar a este espacio de trabajo", + "descriptionCurrent": "Espacio de trabajo actual" + }, + "actions": { + "rename": "Renombrar", + "reset": "Restablecer nombre (al índice)" + }, + "renamePrompt": { + "name": "Escribe un nuevo nombre para el espacio de trabajo {idx}", + "nameWithCurrent": "Editar nombre de «{current}»", + "description": "Pulsa Enter para aplicar. Escribe {sigil}{sigil} para restablecer." + }, + "resetPrompt": { + "name": "Restablecer nombre de {target}", + "description": "Borra el nombre personalizado — pulsa Enter para aplicar" + }, + "applyRename": { + "name": "Establecer nombre: {name}", + "description": "Renombrar {target} con este nombre", + "unchangedName": "Mantener nombre: {name}", + "unchangedDescription": "El nombre ya está establecido — pulsa Enter para cerrar" + }, + "noMatches": { + "name": "Ningún espacio de trabajo coincide con «{filter}»", + "description": "Prueba con otro filtro o bórralo" + }, + "noHighlighted": { + "name": "Ningún espacio de trabajo para editar", + "description": "Selecciona un espacio de trabajo en la lista, o abre el lanzador en Niri" + }, + "notNiri": { + "name": "No se está ejecutando en Niri", + "description": "Este plugin solo funciona en el compositor Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/fr.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/fr.json new file mode 100644 index 0000000..d45db7b --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/fr.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filtrer, basculer, renommer ou réinitialiser les espaces de travail Niri" + }, + "unnamedLabel": "Espace de travail {idx}", + "currentSuffix": " (actuel)", + "focus": { + "description": "Basculer vers cet espace de travail", + "descriptionCurrent": "Espace de travail actuel" + }, + "actions": { + "rename": "Renommer", + "reset": "Réinitialiser le nom (selon l'index)" + }, + "renamePrompt": { + "name": "Saisir un nouveau nom pour l'espace de travail {idx}", + "nameWithCurrent": "Modifier le nom de « {current} »", + "description": "Appuyez sur entrée pour appliquer. {sigil}{sigil} pour réinitialiser." + }, + "resetPrompt": { + "name": "Réinitialiser le nom de {target}", + "description": "Supprime le nom personnalisé — appuyez sur entrée pour appliquer" + }, + "applyRename": { + "name": "Définir le nom : {name}", + "description": "Renommer {target} ainsi", + "unchangedName": "Garder le nom : {name}", + "unchangedDescription": "Le nom est déjà défini — appuyez sur entrée pour fermer" + }, + "noMatches": { + "name": "Aucun espace de travail ne correspond à « {filter} »", + "description": "Essayez un autre filtre ou effacez-le" + }, + "noHighlighted": { + "name": "Aucun espace de travail à modifier", + "description": "Sélectionnez un espace de travail dans la liste, ou ouvrez le lanceur sur Niri" + }, + "notNiri": { + "name": "Ne fonctionne pas sous Niri", + "description": "Ce plugin fonctionne uniquement avec le compositeur Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/hu.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/hu.json new file mode 100644 index 0000000..2884193 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/hu.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Niri munkaterületek szűrése, váltás, átnevezés vagy visszaállítás" + }, + "unnamedLabel": "{idx}. munkaterület", + "currentSuffix": " (aktuális)", + "focus": { + "description": "Váltás erre a munkaterületre", + "descriptionCurrent": "Aktuális munkaterület" + }, + "actions": { + "rename": "Átnevezés", + "reset": "Név visszaállítása (indexre)" + }, + "renamePrompt": { + "name": "Adj új nevet a {idx}. munkaterületnek", + "nameWithCurrent": "„{current}” nevének szerkesztése", + "description": "Enter az alkalmazáshoz. {sigil}{sigil} a visszaállításhoz." + }, + "resetPrompt": { + "name": "{target} nevének visszaállítása", + "description": "Törli az egyéni nevet — Enter az alkalmazáshoz" + }, + "applyRename": { + "name": "Név beállítása: {name}", + "description": "{target} átnevezése erre", + "unchangedName": "Név megtartása: {name}", + "unchangedDescription": "A név már be van állítva — Enter a bezáráshoz" + }, + "noMatches": { + "name": "Nincs találat erre: „{filter}”", + "description": "Próbálj másik szűrőt vagy töröld" + }, + "noHighlighted": { + "name": "Nincs szerkeszthető munkaterület", + "description": "Jelölj ki egy munkaterületet a listában, vagy nyisd meg a launchert Niri alatt" + }, + "notNiri": { + "name": "Nem Niri-n fut", + "description": "Ez a plugin csak a Niri kompozitoron működik" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/it.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/it.json new file mode 100644 index 0000000..b441867 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/it.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filtra, cambia, rinomina o reimposta le aree di lavoro Niri" + }, + "unnamedLabel": "Area di lavoro {idx}", + "currentSuffix": " (attuale)", + "focus": { + "description": "Passa a quest'area di lavoro", + "descriptionCurrent": "Area di lavoro attuale" + }, + "actions": { + "rename": "Rinomina", + "reset": "Reimposta nome (all'indice)" + }, + "renamePrompt": { + "name": "Inserisci un nuovo nome per l'area di lavoro {idx}", + "nameWithCurrent": "Modifica il nome di «{current}»", + "description": "Premi Invio per applicare. Digita {sigil}{sigil} per reimpostare." + }, + "resetPrompt": { + "name": "Reimposta il nome di {target}", + "description": "Rimuove il nome personalizzato — premi Invio per applicare" + }, + "applyRename": { + "name": "Imposta nome: {name}", + "description": "Rinomina {target} in questo", + "unchangedName": "Mantieni nome: {name}", + "unchangedDescription": "Il nome è già impostato — premi Invio per chiudere" + }, + "noMatches": { + "name": "Nessuna area di lavoro corrisponde a «{filter}»", + "description": "Prova un altro filtro o cancellalo" + }, + "noHighlighted": { + "name": "Nessuna area di lavoro da modificare", + "description": "Seleziona un'area di lavoro nell'elenco, o apri il launcher su Niri" + }, + "notNiri": { + "name": "Non in esecuzione su Niri", + "description": "Questo plugin funziona solo sul compositor Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/ja.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/ja.json new file mode 100644 index 0000000..d6d1827 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/ja.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Niri ワークスペースの絞り込み・切り替え・名前変更・リセット" + }, + "unnamedLabel": "ワークスペース {idx}", + "currentSuffix": "(現在)", + "focus": { + "description": "このワークスペースに切り替える", + "descriptionCurrent": "現在のワークスペース" + }, + "actions": { + "rename": "名前を変更", + "reset": "名前をリセット(インデックスに戻す)" + }, + "renamePrompt": { + "name": "ワークスペース {idx} の新しい名前を入力", + "nameWithCurrent": "「{current}」の名前を編集", + "description": "Enter で適用。{sigil}{sigil} でリセット。" + }, + "resetPrompt": { + "name": "{target} の名前をリセット", + "description": "カスタム名を削除します — Enter で適用" + }, + "applyRename": { + "name": "名前を設定: {name}", + "description": "{target} をこの名前に変更", + "unchangedName": "名前を維持: {name}", + "unchangedDescription": "名前はすでに設定されています — Enter で閉じる" + }, + "noMatches": { + "name": "「{filter}」に一致するワークスペースがありません", + "description": "別の条件で絞り込むか、クリアしてください" + }, + "noHighlighted": { + "name": "編集対象のワークスペースがありません", + "description": "リストでワークスペースを選択するか、Niri 上でランチャーを開いてください" + }, + "notNiri": { + "name": "Niri 上で動作していません", + "description": "このプラグインは Niri コンポジタでのみ動作します" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/ku.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/ku.json new file mode 100644 index 0000000..a8df6ab --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/ku.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Qadên xebatê yên Niri parzûn bike, biguhere, nav biguhere an jî vegerîne" + }, + "unnamedLabel": "Qada xebatê {idx}", + "currentSuffix": " (niha)", + "focus": { + "description": "Biçe vê qada xebatê", + "descriptionCurrent": "Qada xebatê ya niha" + }, + "actions": { + "rename": "Nav biguhere", + "reset": "Navî vegerîne (bo îndeksê)" + }, + "renamePrompt": { + "name": "Ji bo qada xebatê {idx} navekî nû binivîse", + "nameWithCurrent": "Navê „{current}“ serast bike", + "description": "Enter bike da ku sepandin. {sigil}{sigil} ji bo vegerandinê." + }, + "resetPrompt": { + "name": "Navê {target} vegerîne", + "description": "Navê taybet jê dibe — Enter bike da ku sepandin" + }, + "applyRename": { + "name": "Nav saz bike: {name}", + "description": "{target} bi vê binav bike", + "unchangedName": "Navî biparêze: {name}", + "unchangedDescription": "Nav jixwe hatiye sazkirin — Enter bike da ku bigire" + }, + "noMatches": { + "name": "Tu qada xebatê bi „{filter}“ re li hev nayê", + "description": "Parzûnekî din biceribîne an jî paqij bike" + }, + "noHighlighted": { + "name": "Qada xebatê ji bo sererastkirinê tune", + "description": "Qadekî xebatê di lîsteyê de hilbijêre, an jî destpêkerê li Niri veke" + }, + "notNiri": { + "name": "Li ser Niri naxebite", + "description": "Ev pêvek tenê li ser komposîtorê Niri dixebite" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/nl.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/nl.json new file mode 100644 index 0000000..3a37469 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/nl.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Niri-werkruimtes filteren, wisselen, hernoemen of resetten" + }, + "unnamedLabel": "Werkruimte {idx}", + "currentSuffix": " (huidig)", + "focus": { + "description": "Naar deze werkruimte wisselen", + "descriptionCurrent": "Huidige werkruimte" + }, + "actions": { + "rename": "Hernoemen", + "reset": "Naam resetten (naar index)" + }, + "renamePrompt": { + "name": "Typ een nieuwe naam voor werkruimte {idx}", + "nameWithCurrent": "Naam van „{current}” bewerken", + "description": "Druk op Enter om toe te passen. Typ {sigil}{sigil} om te resetten." + }, + "resetPrompt": { + "name": "Naam van {target} resetten", + "description": "Wist de aangepaste naam — druk op Enter om toe te passen" + }, + "applyRename": { + "name": "Naam instellen: {name}", + "description": "{target} hiernaar hernoemen", + "unchangedName": "Naam behouden: {name}", + "unchangedDescription": "Naam is al ingesteld — druk op Enter om te sluiten" + }, + "noMatches": { + "name": "Geen werkruimtes komen overeen met „{filter}”", + "description": "Probeer een ander filter of wis het" + }, + "noHighlighted": { + "name": "Geen werkruimte om te bewerken", + "description": "Selecteer een werkruimte in de lijst, of open de launcher op Niri" + }, + "notNiri": { + "name": "Draait niet op Niri", + "description": "Deze plugin werkt alleen op de Niri-compositor" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/pl.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/pl.json new file mode 100644 index 0000000..c492d3c --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/pl.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filtruj, przełączaj, zmieniaj nazwy lub resetuj obszary robocze Niri" + }, + "unnamedLabel": "Obszar roboczy {idx}", + "currentSuffix": " (bieżący)", + "focus": { + "description": "Przełącz na ten obszar roboczy", + "descriptionCurrent": "Bieżący obszar roboczy" + }, + "actions": { + "rename": "Zmień nazwę", + "reset": "Zresetuj nazwę (do indeksu)" + }, + "renamePrompt": { + "name": "Wpisz nową nazwę dla obszaru roboczego {idx}", + "nameWithCurrent": "Edytuj nazwę „{current}”", + "description": "Naciśnij Enter, aby zastosować. Wpisz {sigil}{sigil}, aby zresetować." + }, + "resetPrompt": { + "name": "Zresetuj nazwę {target}", + "description": "Usuwa niestandardową nazwę — naciśnij Enter, aby zastosować" + }, + "applyRename": { + "name": "Ustaw nazwę: {name}", + "description": "Zmień nazwę {target} na tę", + "unchangedName": "Zachowaj nazwę: {name}", + "unchangedDescription": "Nazwa jest już ustawiona — naciśnij Enter, aby zamknąć" + }, + "noMatches": { + "name": "Żaden obszar roboczy nie pasuje do „{filter}”", + "description": "Spróbuj innego filtra lub go wyczyść" + }, + "noHighlighted": { + "name": "Brak obszaru roboczego do edycji", + "description": "Zaznacz obszar roboczy na liście lub otwórz launcher w Niri" + }, + "notNiri": { + "name": "Nie działa na Niri", + "description": "Ta wtyczka działa tylko na kompozytorze Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/pt.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/pt.json new file mode 100644 index 0000000..4d7c7a9 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/pt.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Filtrar, alternar, renomear ou redefinir espaços de trabalho do Niri" + }, + "unnamedLabel": "Espaço de trabalho {idx}", + "currentSuffix": " (atual)", + "focus": { + "description": "Alternar para este espaço de trabalho", + "descriptionCurrent": "Espaço de trabalho atual" + }, + "actions": { + "rename": "Renomear", + "reset": "Redefinir nome (para o índice)" + }, + "renamePrompt": { + "name": "Digite um novo nome para o espaço de trabalho {idx}", + "nameWithCurrent": "Editar nome de «{current}»", + "description": "Pressione Enter para aplicar. Digite {sigil}{sigil} para redefinir." + }, + "resetPrompt": { + "name": "Redefinir nome de {target}", + "description": "Remove o nome personalizado — pressione Enter para aplicar" + }, + "applyRename": { + "name": "Definir nome: {name}", + "description": "Renomear {target} para este", + "unchangedName": "Manter nome: {name}", + "unchangedDescription": "O nome já está definido — pressione Enter para fechar" + }, + "noMatches": { + "name": "Nenhum espaço de trabalho corresponde a «{filter}»", + "description": "Tente um filtro diferente ou limpe-o" + }, + "noHighlighted": { + "name": "Nenhum espaço de trabalho para editar", + "description": "Destaque um espaço de trabalho na lista, ou abra o launcher no Niri" + }, + "notNiri": { + "name": "Não está em execução no Niri", + "description": "Este plugin só funciona no compositor Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/ru.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/ru.json new file mode 100644 index 0000000..3248591 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/ru.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Фильтрация, переключение, переименование и сброс рабочих столов Niri" + }, + "unnamedLabel": "Рабочий стол {idx}", + "currentSuffix": " (текущий)", + "focus": { + "description": "Переключиться на этот рабочий стол", + "descriptionCurrent": "Текущий рабочий стол" + }, + "actions": { + "rename": "Переименовать", + "reset": "Сбросить имя (до индекса)" + }, + "renamePrompt": { + "name": "Введите новое имя для рабочего стола {idx}", + "nameWithCurrent": "Изменить имя «{current}»", + "description": "Enter — применить. {sigil}{sigil} — сбросить." + }, + "resetPrompt": { + "name": "Сбросить имя {target}", + "description": "Очищает пользовательское имя — Enter применит" + }, + "applyRename": { + "name": "Задать имя: {name}", + "description": "Переименовать {target} в это", + "unchangedName": "Оставить имя: {name}", + "unchangedDescription": "Имя уже задано — Enter закроет" + }, + "noMatches": { + "name": "Нет рабочих столов по запросу «{filter}»", + "description": "Попробуйте другой фильтр или очистите его" + }, + "noHighlighted": { + "name": "Нет рабочего стола для редактирования", + "description": "Выберите рабочий стол в списке или откройте лаунчер на Niri" + }, + "notNiri": { + "name": "Не запущено на Niri", + "description": "Этот плагин работает только на композиторе Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/tr.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/tr.json new file mode 100644 index 0000000..09b5614 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/tr.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Niri çalışma alanlarını filtreleyin, geçiş yapın, yeniden adlandırın veya sıfırlayın" + }, + "unnamedLabel": "Çalışma Alanı {idx}", + "currentSuffix": " (geçerli)", + "focus": { + "description": "Bu çalışma alanına geç", + "descriptionCurrent": "Geçerli çalışma alanı" + }, + "actions": { + "rename": "Yeniden adlandır", + "reset": "Adı sıfırla (indekse)" + }, + "renamePrompt": { + "name": "Çalışma alanı {idx} için yeni bir ad yazın", + "nameWithCurrent": "„{current}” adını düzenle", + "description": "Uygulamak için Enter. Sıfırlamak için {sigil}{sigil} yazın." + }, + "resetPrompt": { + "name": "{target} adını sıfırla", + "description": "Özel adı temizler — uygulamak için Enter" + }, + "applyRename": { + "name": "Adı belirle: {name}", + "description": "{target} öğesini buna yeniden adlandır", + "unchangedName": "Adı koru: {name}", + "unchangedDescription": "Ad zaten belirlenmiş — kapatmak için Enter" + }, + "noMatches": { + "name": "„{filter}” ile eşleşen çalışma alanı yok", + "description": "Farklı bir filtre deneyin veya temizleyin" + }, + "noHighlighted": { + "name": "Düzenlenecek çalışma alanı yok", + "description": "Listeden bir çalışma alanı seçin veya başlatıcıyı Niri'de açın" + }, + "notNiri": { + "name": "Niri üzerinde çalışmıyor", + "description": "Bu eklenti yalnızca Niri kompozitöründe çalışır" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/uk-UA.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/uk-UA.json new file mode 100644 index 0000000..ffcf665 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/uk-UA.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Фільтрування, перемикання, перейменування та скидання робочих просторів Niri" + }, + "unnamedLabel": "Робочий простір {idx}", + "currentSuffix": " (поточний)", + "focus": { + "description": "Перейти до цього робочого простору", + "descriptionCurrent": "Поточний робочий простір" + }, + "actions": { + "rename": "Перейменувати", + "reset": "Скинути назву (до індексу)" + }, + "renamePrompt": { + "name": "Введіть нову назву для робочого простору {idx}", + "nameWithCurrent": "Редагувати назву «{current}»", + "description": "Enter — застосувати. {sigil}{sigil} — скинути." + }, + "resetPrompt": { + "name": "Скинути назву {target}", + "description": "Очищає користувацьку назву — Enter застосує" + }, + "applyRename": { + "name": "Встановити назву: {name}", + "description": "Перейменувати {target} на цю назву", + "unchangedName": "Залишити назву: {name}", + "unchangedDescription": "Назву вже встановлено — Enter закриє" + }, + "noMatches": { + "name": "Немає робочих просторів за запитом «{filter}»", + "description": "Спробуйте інший фільтр або очистіть його" + }, + "noHighlighted": { + "name": "Немає робочого простору для редагування", + "description": "Виберіть робочий простір у списку або відкрийте лаунчер у Niri" + }, + "notNiri": { + "name": "Не запущено на Niri", + "description": "Цей плагін працює лише на композиторі Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/vi.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/vi.json new file mode 100644 index 0000000..eb52c4a --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/vi.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "Lọc, chuyển, đổi tên hoặc đặt lại không gian làm việc Niri" + }, + "unnamedLabel": "Không gian làm việc {idx}", + "currentSuffix": " (hiện tại)", + "focus": { + "description": "Chuyển sang không gian làm việc này", + "descriptionCurrent": "Không gian làm việc hiện tại" + }, + "actions": { + "rename": "Đổi tên", + "reset": "Đặt lại tên (về chỉ số)" + }, + "renamePrompt": { + "name": "Nhập tên mới cho không gian làm việc {idx}", + "nameWithCurrent": "Chỉnh sửa tên của „{current}”", + "description": "Nhấn Enter để áp dụng. Nhập {sigil}{sigil} để đặt lại." + }, + "resetPrompt": { + "name": "Đặt lại tên của {target}", + "description": "Xóa tên tùy chỉnh — nhấn Enter để áp dụng" + }, + "applyRename": { + "name": "Đặt tên: {name}", + "description": "Đổi tên {target} thành tên này", + "unchangedName": "Giữ tên: {name}", + "unchangedDescription": "Tên đã được đặt — nhấn Enter để đóng" + }, + "noMatches": { + "name": "Không có không gian làm việc nào khớp với „{filter}”", + "description": "Hãy thử bộ lọc khác hoặc xóa nó" + }, + "noHighlighted": { + "name": "Không có không gian làm việc để chỉnh sửa", + "description": "Chọn một không gian làm việc trong danh sách, hoặc mở launcher trên Niri" + }, + "notNiri": { + "name": "Không chạy trên Niri", + "description": "Plugin này chỉ hoạt động trên compositor Niri" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-CN.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-CN.json new file mode 100644 index 0000000..dc00974 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-CN.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "筛选、切换、重命名或重置 Niri 工作区" + }, + "unnamedLabel": "工作区 {idx}", + "currentSuffix": "(当前)", + "focus": { + "description": "切换到该工作区", + "descriptionCurrent": "当前工作区" + }, + "actions": { + "rename": "重命名", + "reset": "重置名称(回到索引)" + }, + "renamePrompt": { + "name": "为工作区 {idx} 输入新名称", + "nameWithCurrent": "编辑「{current}」的名称", + "description": "按 Enter 应用。输入 {sigil}{sigil} 重置。" + }, + "resetPrompt": { + "name": "重置 {target} 的名称", + "description": "清除自定义名称 — 按 Enter 应用" + }, + "applyRename": { + "name": "设置名称:{name}", + "description": "将 {target} 重命名为此", + "unchangedName": "保留名称:{name}", + "unchangedDescription": "名称已设置 — 按 Enter 关闭" + }, + "noMatches": { + "name": "没有工作区与「{filter}」匹配", + "description": "尝试其他筛选条件或清除筛选" + }, + "noHighlighted": { + "name": "没有可编辑的工作区", + "description": "在列表中选择一个工作区,或在 Niri 上打开启动器" + }, + "notNiri": { + "name": "未在 Niri 上运行", + "description": "该插件仅在 Niri 合成器上工作" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-TW.json b/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-TW.json new file mode 100644 index 0000000..066417d --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/i18n/zh-TW.json @@ -0,0 +1,44 @@ +{ + "launcher": { + "command": { + "description": "篩選、切換、重新命名或重設 Niri 工作區" + }, + "unnamedLabel": "工作區 {idx}", + "currentSuffix": "(目前)", + "focus": { + "description": "切換到這個工作區", + "descriptionCurrent": "目前的工作區" + }, + "actions": { + "rename": "重新命名", + "reset": "重設名稱(回到索引)" + }, + "renamePrompt": { + "name": "為工作區 {idx} 輸入新名稱", + "nameWithCurrent": "編輯「{current}」的名稱", + "description": "按 Enter 套用。輸入 {sigil}{sigil} 以重設。" + }, + "resetPrompt": { + "name": "重設 {target} 的名稱", + "description": "清除自訂名稱 — 按 Enter 套用" + }, + "applyRename": { + "name": "設定名稱:{name}", + "description": "將 {target} 重新命名為此", + "unchangedName": "保留名稱:{name}", + "unchangedDescription": "名稱已設定 — 按 Enter 關閉" + }, + "noMatches": { + "name": "沒有工作區符合「{filter}」", + "description": "請嘗試其他篩選條件或清除篩選" + }, + "noHighlighted": { + "name": "沒有可編輯的工作區", + "description": "在清單中選取一個工作區,或在 Niri 上開啟啟動器" + }, + "notNiri": { + "name": "未在 Niri 上執行", + "description": "此外掛僅在 Niri 合成器上運作" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/manifest.json b/dot_config/noctalia/plugins/niri-workspaces/manifest.json new file mode 100644 index 0000000..bf1c792 --- /dev/null +++ b/dot_config/noctalia/plugins/niri-workspaces/manifest.json @@ -0,0 +1,28 @@ +{ + "id": "niri-workspaces", + "name": "Niri Workspaces", + "version": "1.0.0", + "minNoctaliaVersion": "4.4.1", + "author": "Kohányi Róbert", + "license": "MIT", + "repository": "https://github.com/noctalia-dev/noctalia-plugins", + "description": "Filter, jump to, rename or reset Niri workspaces from the launcher.", + "tags": [ + "Launcher", + "Utility", + "Niri" + ], + "entryPoints": { + "main": "Main.qml", + "launcherProvider": "LauncherProvider.qml" + }, + "dependencies": { + "plugins": [] + }, + "metadata": { + "commandPrefix": ">ws", + "defaultSettings": { + "launcherPrefix": ">ws" + } + } +} diff --git a/dot_config/noctalia/plugins/niri-workspaces/preview.png b/dot_config/noctalia/plugins/niri-workspaces/preview.png new file mode 100644 index 0000000..1bf614a Binary files /dev/null and b/dot_config/noctalia/plugins/niri-workspaces/preview.png differ diff --git a/dot_config/noctalia/plugins/noctalia-calculator/AdvancedMath.js b/dot_config/noctalia/plugins/noctalia-calculator/AdvancedMath.js new file mode 100644 index 0000000..d7bc367 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/AdvancedMath.js @@ -0,0 +1,161 @@ +// AdvancedMath.js - Lightweight math library for Noctalia Calculator +// Provides advanced mathematical functions beyond basic arithmetic + +// Helper function to convert degrees to radians +function toRadians(degrees) { + return degrees * (Math.PI / 180); +} + +// Helper function to convert radians to degrees +function toDegrees(radians) { + return radians * (180 / Math.PI); +} + +// Constants +var constants = { + PI: Math.PI, + E: Math.E, + LN2: Math.LN2, + LN10: Math.LN10, + LOG2E: Math.LOG2E, + LOG10E: Math.LOG10E, + SQRT1_2: Math.SQRT1_2, + SQRT2: Math.SQRT2 +}; + +// Safe evaluation function that handles advanced math +function evaluate(expression) { + try { + // Fixes decimal arithmetic + var cleanExpr = expression.replace(/\s+/g, '').toLowerCase(); + + // Allows numbers (including decimals), basic operators, and explicitly permitted math terms only + var safeRegex = /^(\d*\.?\d+|[+\-*/()^%,]|sin|cos|tan|asin|acos|atan|atan2|sinh|cosh|tanh|asinh|acosh|atanh|log|ln|exp|pow|sqrt|cbrt|abs|floor|ceil|round|trunc|min|max|random|pi|e|sind|cosd|tand)+$/; + + if (!safeRegex.test(cleanExpr)) { + throw new Error("Invalid characters or unauthorized functions in expression"); + } + + // Replace mathematical constants (Original Structure) + var processed = cleanExpr + .replace(/\bpi\b/gi, Math.PI) + .replace(/\be\b/gi, Math.E); + + // Replace function calls with Math object equivalents + processed = processed + // Trigonometric functions + .replace(/\bsin\s*\(/g, 'Math.sin(') + .replace(/\bcos\s*\(/g, 'Math.cos(') + .replace(/\btan\s*\(/g, 'Math.tan(') + .replace(/\basin\s*\(/g, 'Math.asin(') + .replace(/\bacos\s*\(/g, 'Math.acos(') + .replace(/\batan\s*\(/g, 'Math.atan(') + .replace(/\batan2\s*\(/g, 'Math.atan2(') + + // Hyperbolic functions + .replace(/\bsinh\s*\(/g, 'Math.sinh(') + .replace(/\bcosh\s*\(/g, 'Math.cosh(') + .replace(/\btanh\s*\(/g, 'Math.tanh(') + .replace(/\basinh\s*\(/g, 'Math.asinh(') + .replace(/\bacosh\s*\(/g, 'Math.acosh(') + .replace(/\batanh\s*\(/g, 'Math.atanh(') + + // Logarithmic and exponential functions + .replace(/\blog\s*\(/g, 'Math.log10(') + .replace(/\bln\s*\(/g, 'Math.log(') + .replace(/\bexp\s*\(/g, 'Math.exp(') + .replace(/\bpow\s*\(/g, 'Math.pow(') + + // Root functions + .replace(/\bsqrt\s*\(/g, 'Math.sqrt(') + .replace(/\bcbrt\s*\(/g, 'Math.cbrt(') + + // Rounding and absolute + .replace(/\babs\s*\(/g, 'Math.abs(') + .replace(/\bfloor\s*\(/g, 'Math.floor(') + .replace(/\bceil\s*\(/g, 'Math.ceil(') + .replace(/\bround\s*\(/g, 'Math.round(') + .replace(/\btrunc\s*\(/g, 'Math.trunc(') + + // Min/Max + .replace(/\bmin\s*\(/g, 'Math.min(') + .replace(/\bmax\s*\(/g, 'Math.max(') + + // Random + .replace(/\brandom\s*\(\s*\)/g, 'Math.random()'); + + // Handle degree versions of trig functions + processed = processed + .replace(/\bsind\s*\(/g, '(function(x) { return Math.sin(' + (Math.PI / 180) + ' * x); })(') + .replace(/\bcosd\s*\(/g, '(function(x) { return Math.cos(' + (Math.PI / 180) + ' * x); })(') + .replace(/\btand\s*\(/g, '(function(x) { return Math.tan(' + (Math.PI / 180) + ' * x); })('); + + // Handle ^ for exponentiation: convert 2^3 to Math.pow(2,3) + processed = processed.replace(/([\d.]+|\))\^([\d.]+|\([^)]*\))/g, 'Math.pow($1,$2)'); + + // Replacing eval() with a scoped function constructor + // This is safe because the strict whitelist guarantees only math reaches this point + var result = new Function('return ' + processed)(); + + if (!isFinite(result) || isNaN(result)) { + throw new Error("Invalid result"); + } + + return result; + } catch (error) { + throw new Error("Evaluation failed: " + error.message); + } +} + +// Format result for display +function formatResult(result) { + if (Number.isInteger(result)) { + return result.toString(); + } + + // Handle very large or very small numbers + if (Math.abs(result) >= 1e15 || (Math.abs(result) < 1e-6 && result !== 0)) { + return result.toExponential(6); + } + + // Normal decimal formatting + return parseFloat(result.toFixed(10)).toString(); +} + +// Get list of available functions for help +function getAvailableFunctions() { + return [ + // Basic arithmetic: +, -, *, /, %, ^, () + + // Trigonometric functions + "sin(x), cos(x), tan(x) - trigonometric functions (radians)", + "sind(x), cosd(x), tand(x) - trigonometric functions (degrees)", + "asin(x), acos(x), atan(x) - inverse trigonometric", + "atan2(y, x) - two-argument arctangent", + + // Hyperbolic functions + "sinh(x), cosh(x), tanh(x) - hyperbolic functions", + "asinh(x), acosh(x), atanh(x) - inverse hyperbolic", + + // Logarithmic and exponential + "log(x) - base 10 logarithm", + "ln(x) - natural logarithm", + "exp(x) - e^x", + "pow(x, y) - x^y", + + // Root functions + "sqrt(x) - square root", + "cbrt(x) - cube root", + + // Rounding and absolute + "abs(x) - absolute value", + "floor(x), ceil(x), round(x), trunc(x)", + + // Min/Max/Random + "min(a, b, ...), max(a, b, ...)", + "random() - random number 0-1", + + // Constants + "pi, e - mathematical constants" + ]; +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/BarWidget.qml b/dot_config/noctalia/plugins/noctalia-calculator/BarWidget.qml new file mode 100644 index 0000000..7c70a57 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/BarWidget.qml @@ -0,0 +1,124 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell +import qs.Commons +import qs.Widgets +import qs.Services.UI + +Item { + id: root + + property var pluginApi: null + property ShellScreen screen + property string widgetId: "" + property string section: "" + property int sectionWidgetIndex: -1 + property int sectionWidgetsCount: 0 + + readonly property var mainInst: pluginApi?.mainInstance ?? null + readonly property bool isPanelOpen: pluginApi?.isPanelOpen ?? false + readonly property bool isSelected: isPanelOpen + + readonly property string screenName: screen ? screen.name : "" + readonly property string barPosition: Settings.getBarPositionForScreen(screenName) + readonly property bool isVertical: barPosition === "left" || barPosition === "right" + readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName) + + readonly property string badge: mainInst?.badgeText ?? "" + readonly property color capsuleBgColor: { + if (isSelected) { + return mouseArea.containsMouse ? Qt.darker(Color.mPrimary, 1.08) : Color.mPrimary; + } + return mouseArea.containsMouse ? Color.mHover : Style.capsuleColor; + } + readonly property color contentColor: isSelected + ? Color.mOnPrimary + : (mouseArea.containsMouse ? Color.mOnHover : Color.mOnSurface) + implicitWidth: visualCapsule.width + implicitHeight: visualCapsule.height + + NPopupContextMenu { + id: contextMenu + + model: [ + { + "label": pluginApi?.tr("bar.clear"), + "action": "clear", + "icon": "trash" + }, + { + "label": pluginApi?.tr("bar.settings"), + "action": "settings", + "icon": "settings" + } + ] + + onTriggered: action => { + contextMenu.close(); + PanelService.closeContextMenu(root.screen); + + if (action === "clear") { + mainInst?.clearAll(); + } else if (action === "settings") { + BarService.openPluginSettings(root.screen, pluginApi.manifest); + } + } + } + + Rectangle { + id: visualCapsule + anchors.centerIn: parent + width: Math.max(root.capsuleHeight, iconRow.implicitWidth + Style.marginM * 2) + height: root.capsuleHeight + radius: Style.radiusL + color: root.capsuleBgColor + border.color: root.isSelected ? Color.mPrimary : Style.capsuleBorderColor + border.width: Style.capsuleBorderWidth + + Row { + id: iconRow + anchors.centerIn: parent + spacing: badge !== "" ? Style.marginS : 0 + + NIcon { + icon: "calculator" + color: root.contentColor + } + + NText { + text: badge + visible: text !== "" + font.bold: true + pointSize: Style.fontSizeS + color: root.contentColor + } + } + } + + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + cursorShape: Qt.PointingHandCursor + + onClicked: mouse => { + TooltipService.hide(); + if (mouse.button === Qt.RightButton) { + PanelService.showContextMenu(contextMenu, root, root.screen); + } else if (pluginApi) { + pluginApi.togglePanel(root.screen, root); + } + } + + onEntered: { + TooltipService.show( + root, + pluginApi?.tr("bar.tooltip-title"), + BarService.getTooltipDirection(root) + ); + } + + onExited: TooltipService.hide() + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/LICENSE b/dot_config/noctalia/plugins/noctalia-calculator/LICENSE new file mode 100644 index 0000000..313b684 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Pir0c0pter0 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dot_config/noctalia/plugins/noctalia-calculator/Main.qml b/dot_config/noctalia/plugins/noctalia-calculator/Main.qml new file mode 100644 index 0000000..118c37b --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/Main.qml @@ -0,0 +1,391 @@ +import QtQuick +import Quickshell +import Quickshell.Io +import "AdvancedMath.js" as AdvancedMath +import qs.Services.UI + +Item { + id: root + + property var pluginApi: null + + readonly property var settings: pluginApi?.pluginSettings ?? ({}) + readonly property var defaults: pluginApi?.manifest?.metadata?.defaultSettings ?? ({}) + + readonly property bool showBarValue: settings.showBarValue ?? defaults.showBarValue ?? true + readonly property int precision: Math.max(0, Math.min(settings.precision ?? defaults.precision ?? 8, 10)) + + // Max digits before JS double precision loses accuracy + readonly property int _maxInputLength: 18 + + property var tokens: [] + property string currentInput: "0" + property bool shouldResetInput: false + property bool justEvaluated: false + property bool errorState: false + property string lastExpression: "" + + readonly property bool hasExpression: tokens.length > 0 || currentInput !== "0" || justEvaluated + readonly property string displayText: errorState ? pluginApi?.tr("state.error") : currentInput + readonly property string expressionText: expressionPreview() + readonly property string badgeText: !showBarValue ? "" : compactDisplay(displayText, 9) + readonly property bool hasCopyableResult: !errorState && displayText !== "" && (justEvaluated || displayText !== "0" || tokens.length > 0) + + function _isOperator(token) { + return token === "+" || token === "-" || token === "*" || token === "/"; + } + + function _normalizeOperator(op) { + if (op === "x" || op === "X") return "*"; + if (_isOperator(op)) return op; + return ""; + } + + function _sanitizeCurrentInput() { + if (currentInput === "" || currentInput === "-") return "0"; + if (currentInput.endsWith(".")) return currentInput + "0"; + return currentInput; + } + + function _numberToString(value) { + if (!Number.isFinite(value)) return null; + + let rounded = value; + if (precision >= 0) { + rounded = Number(value.toFixed(precision)); + } + if (Object.is(rounded, -0)) rounded = 0; + + let text = rounded.toString(); + if (text.indexOf("e") >= 0 || text.indexOf("E") >= 0) { + return text.replace("e+", "e"); + } + + if (text.length > 16 && rounded !== 0) { + text = rounded.toExponential(Math.max(0, Math.min(precision, 6))).replace("e+", "e"); + } + return text; + } + + function compactDisplay(text, maxLength) { + if (!text) return ""; + if (text.length <= maxLength) return text; + const numeric = Number(text); + if (!Number.isNaN(numeric) && Number.isFinite(numeric)) { + const exp = numeric.toExponential(Math.max(0, Math.min(precision, 3))).replace("e+", "e"); + if (exp.length <= maxLength) return exp; + } + return text.slice(0, Math.max(1, maxLength - 1)) + "~"; + } + + function clearAll() { + tokens = []; + currentInput = "0"; + shouldResetInput = false; + justEvaluated = false; + errorState = false; + lastExpression = ""; + } + + function _setError() { + tokens = []; + currentInput = "0"; + shouldResetInput = false; + justEvaluated = false; + errorState = true; + lastExpression = ""; + } + + function appendDigit(digit) { + if (errorState) clearAll(); + + if (justEvaluated && tokens.length === 0 && !shouldResetInput) { + clearAll(); + } + + if (shouldResetInput) { + currentInput = digit; + shouldResetInput = false; + justEvaluated = false; + errorState = false; + return; + } + + if (currentInput === "0") { + currentInput = digit; + } else if (currentInput === "-0") { + currentInput = "-" + digit; + } else if (currentInput.length < _maxInputLength) { + currentInput += digit; + } + + justEvaluated = false; + errorState = false; + } + + function appendDecimal() { + if (errorState) clearAll(); + + if (justEvaluated && tokens.length === 0 && !shouldResetInput) { + clearAll(); + } + + if (shouldResetInput) { + currentInput = "0."; + shouldResetInput = false; + justEvaluated = false; + return; + } + + if (currentInput.indexOf(".") === -1) { + currentInput += "."; + } + justEvaluated = false; + } + + function deleteLastChar() { + if (errorState) { + clearAll(); + return; + } + if (justEvaluated) { + clearAll(); + return; + } + if (shouldResetInput) { + currentInput = "0"; + shouldResetInput = false; + return; + } + + if (currentInput.length <= 1 || (currentInput.length === 2 && currentInput.startsWith("-"))) { + currentInput = "0"; + return; + } + + currentInput = currentInput.slice(0, currentInput.length - 1); + } + + function toggleSign() { + if (errorState) return; + + if (shouldResetInput) { + currentInput = "0"; + shouldResetInput = false; + } + + if (currentInput.startsWith("-")) { + currentInput = currentInput.slice(1); + } else { + currentInput = "-" + currentInput; + } + + if (currentInput === "-0") { + justEvaluated = false; + return; + } + + justEvaluated = false; + } + + function applyPercent() { + if (errorState) return; + + const numeric = Number(_sanitizeCurrentInput()); + if (Number.isNaN(numeric)) { + _setError(); + return; + } + + const formatted = _numberToString(numeric / 100); + if (formatted === null) { + _setError(); + return; + } + + currentInput = formatted; + shouldResetInput = false; + justEvaluated = false; + } + + function applyOperator(op) { + if (errorState) return; + + const operator = _normalizeOperator(op); + if (!operator) return; + + if (justEvaluated && tokens.length === 0) { + tokens = [currentInput, operator]; + shouldResetInput = true; + justEvaluated = false; + lastExpression = ""; + return; + } + + if (shouldResetInput) { + if (tokens.length > 0 && _isOperator(tokens[tokens.length - 1])) { + const updated = tokens.slice(0, tokens.length - 1); + updated.push(operator); + tokens = updated; + } else { + tokens = tokens.concat([operator]); + } + lastExpression = ""; + return; + } + + tokens = tokens.concat([_sanitizeCurrentInput(), operator]); + shouldResetInput = true; + justEvaluated = false; + lastExpression = ""; + } + + function _buildEvaluationTokens() { + const built = Array.from(tokens); + if (!shouldResetInput || built.length === 0 || !_isOperator(built[built.length - 1])) { + built.push(_sanitizeCurrentInput()); + } + while (built.length > 0 && _isOperator(built[built.length - 1])) { + built.pop(); + } + return built; + } + + function _buildDisplayTokens() { + const built = Array.from(tokens); + if (!shouldResetInput || built.length === 0 || !_isOperator(built[built.length - 1])) { + built.push(_sanitizeCurrentInput()); + } + return built; + } + + function _evaluateExpression(expressionStr) { + try { + return AdvancedMath.evaluate(expressionStr); + } catch (e) { + return null; + } + } + + function _formatExpression(tokensToFormat) { + const parts = []; + for (let i = 0; i < tokensToFormat.length; i++) { + const token = tokensToFormat[i]; + if (token === "*") parts.push("x"); + else parts.push(String(token)); + } + return parts.join(" "); + } + + function expressionPreview() { + if (errorState) return lastExpression || ""; + if (justEvaluated && lastExpression) return lastExpression; + + const built = _buildDisplayTokens(); + if (built.length === 0 || (built.length === 1 && built[0] === "0" && !hasExpression)) { + return ""; + } + return _formatExpression(built); + } + + function evaluate() { + if (errorState) return; + + const evaluationTokens = _buildEvaluationTokens(); + if (evaluationTokens.length === 0) return; + + const expression = _formatExpression(evaluationTokens); + const expressionStr = evaluationTokens.join(" "); + const result = _evaluateExpression(expressionStr); + if (result === null) { + _setError(); + return; + } + + const formatted = _numberToString(result); + if (formatted === null) { + _setError(); + return; + } + + currentInput = formatted; + tokens = []; + shouldResetInput = false; + justEvaluated = true; + errorState = false; + lastExpression = expression; + } + + function pressButton(action) { + if (action >= "0" && action <= "9") { + appendDigit(action); + return; + } + + if (action === "decimal") appendDecimal(); + else if (action === "add") applyOperator("+"); + else if (action === "subtract") applyOperator("-"); + else if (action === "multiply") applyOperator("*"); + else if (action === "divide") applyOperator("/"); + else if (action === "equals") evaluate(); + else if (action === "percent") applyPercent(); + else if (action === "sign") toggleSign(); + else if (action === "clear") clearAll(); + else if (action === "delete") deleteLastChar(); + } + + readonly property var _operatorActionMap: ({ + "+": "add", "-": "subtract", "/": "divide", + "*": "multiply", "x": "multiply", "X": "multiply" + }) + + function actionForKeyEvent(event) { + if ((event.modifiers & Qt.ControlModifier) || (event.modifiers & Qt.MetaModifier)) { + return ""; + } + + const text = event.text ?? ""; + if (text >= "0" && text <= "9") return text; + if (text === "." || text === ",") return "decimal"; + if (text in _operatorActionMap) return _operatorActionMap[text]; + if (text === "%") return "percent"; + if (text === "=") return "equals"; + + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) return "equals"; + if (event.key === Qt.Key_Backspace) return "delete"; + if (event.key === Qt.Key_Escape || event.key === Qt.Key_Delete) return "clear"; + if (event.key === Qt.Key_F9) return "sign"; + + return ""; + } + + function handleKeyEvent(event) { + const action = actionForKeyEvent(event); + if (action === "") return false; + + pressButton(action); + return true; + } + + function copyResult() { + if (!hasCopyableResult) return; + const value = displayText; + const escaped = value.replace(/'/g, "'\\''"); + Quickshell.execDetached(["sh", "-c", "printf '%s' '" + escaped + "' | wl-copy"]); + const shown = value.length > 24 ? value.slice(0, 24) + "…" : value; + if (pluginApi) { + ToastService.showNotice(pluginApi.tr("toast.copied", { "value": shown })); + } + } + + IpcHandler { + target: "plugin:noctalia-calculator" + function toggle() { + if (pluginApi) { + pluginApi.withCurrentScreen(screen => { + pluginApi.togglePanel(screen); + }); + } + } + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/Panel.qml b/dot_config/noctalia/plugins/noctalia-calculator/Panel.qml new file mode 100644 index 0000000..1790772 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/Panel.qml @@ -0,0 +1,286 @@ +import QtQuick +import QtQuick.Layouts +import qs.Commons +import qs.Widgets +import qs.Services.UI + +FocusScope { + id: root + + property var pluginApi: null + readonly property var geometryPlaceholder: panelContainer + property real contentPreferredWidth: 360 * Style.uiScaleRatio + property real contentPreferredHeight: Math.ceil(panelCard.implicitHeight + (Style.marginM * 2)) + readonly property bool allowAttach: true + + anchors.fill: parent + focus: visible + + readonly property var mainInst: pluginApi?.mainInstance ?? null + property string flashedAction: "" + + readonly property var buttonModel: [ + { "label": "AC", "action": "clear", "tone": "danger", "span": 1 }, + { "label": "+/-", "action": "sign", "tone": "operator", "span": 1 }, + { "label": "%", "action": "percent", "tone": "operator", "span": 1 }, + { "label": "DEL", "action": "delete", "tone": "operator", "span": 1 }, + { "label": "7", "action": "7", "tone": "number", "span": 1 }, + { "label": "8", "action": "8", "tone": "number", "span": 1 }, + { "label": "9", "action": "9", "tone": "number", "span": 1 }, + { "label": "/", "action": "divide", "tone": "operator", "span": 1 }, + { "label": "4", "action": "4", "tone": "number", "span": 1 }, + { "label": "5", "action": "5", "tone": "number", "span": 1 }, + { "label": "6", "action": "6", "tone": "number", "span": 1 }, + { "label": "x", "action": "multiply", "tone": "operator", "span": 1 }, + { "label": "1", "action": "1", "tone": "number", "span": 1 }, + { "label": "2", "action": "2", "tone": "number", "span": 1 }, + { "label": "3", "action": "3", "tone": "number", "span": 1 }, + { "label": "-", "action": "subtract", "tone": "operator", "span": 1 }, + { "label": "0", "action": "0", "tone": "number", "span": 2 }, + { "label": ".", "action": "decimal", "tone": "number", "span": 1 }, + { "label": "+", "action": "add", "tone": "operator", "span": 1 }, + { "label": "=", "action": "equals", "tone": "accent", "span": 4 } + ] + + Timer { + id: flashTimer + interval: 140 + repeat: false + onTriggered: root.flashedAction = "" + } + + Component.onCompleted: { + if (visible) root.forceActiveFocus(); + } + + onVisibleChanged: { + if (visible) root.forceActiveFocus(); + } + + Keys.onPressed: event => { + const action = mainInst?.actionForKeyEvent(event) ?? ""; + if (action !== "") { + root.flashButton(action); + } + if (mainInst?.handleKeyEvent(event)) { + event.accepted = true; + } + } + + function flashButton(action) { + flashedAction = action; + flashTimer.restart(); + } + + function buttonFill(buttonData, hovered, active) { + if (active) { + if (buttonData.tone === "accent") return Qt.darker(Color.mPrimary, 1.12); + if (buttonData.tone === "danger") return Qt.alpha(Color.mError, 0.22); + if (buttonData.tone === "operator") return Qt.alpha(Color.mPrimary, 0.28); + return Qt.alpha(Color.mOnSurface, 0.16); + } + if (buttonData.tone === "accent") { + return hovered ? Qt.darker(Color.mPrimary, 1.05) : Color.mPrimary; + } + if (buttonData.tone === "danger") { + return hovered ? Qt.alpha(Color.mError, 0.18) : Qt.alpha(Color.mError, 0.12); + } + if (buttonData.tone === "operator") { + return hovered ? Qt.alpha(Color.mPrimary, 0.22) : Qt.alpha(Color.mPrimary, 0.15); + } + return hovered ? Qt.alpha(Color.mOnSurface, 0.10) : Color.mSurfaceVariant; + } + + function buttonBorder(buttonData, hovered, active) { + if (active) { + if (buttonData.tone === "danger") return Qt.alpha(Color.mError, 0.85); + return Color.mPrimary; + } + if (buttonData.tone === "accent") return Color.mPrimary; + if (buttonData.tone === "danger") return Qt.alpha(Color.mError, 0.65); + return hovered ? Color.mPrimary : Qt.alpha(Color.mOutline, 0.7); + } + + function buttonTextColor(buttonData) { + if (buttonData.tone === "accent") return Color.mOnPrimary; + if (buttonData.tone === "danger") return Color.mError; + if (buttonData.tone === "operator") return Color.mPrimary; + return Color.mOnSurface; + } + + Rectangle { + id: panelContainer + anchors.fill: parent + color: "transparent" + + ColumnLayout { + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + NBox { + id: panelCard + Layout.fillWidth: true + implicitHeight: Math.ceil(cardContent.implicitHeight + (Style.marginM * 2)) + + ColumnLayout { + id: cardContent + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginM + + RowLayout { + Layout.fillWidth: true + spacing: Style.marginM + + NIcon { + icon: "calculator" + pointSize: Style.fontSizeL + color: Color.mPrimary + Layout.alignment: Qt.AlignVCenter + } + + ColumnLayout { + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + spacing: Style.marginS + + NText { + text: pluginApi?.tr("panel.title") + pointSize: Style.fontSizeL + font.bold: true + color: Color.mOnSurface + } + + NText { + Layout.fillWidth: true + text: pluginApi?.tr("panel.subtitle") + color: Qt.alpha(Color.mOnSurface, 0.68) + } + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: Math.round((expressionLabel.visible ? 92 : 72) * Style.uiScaleRatio) + Layout.minimumHeight: Layout.preferredHeight + radius: Style.radiusL + color: Qt.alpha(Color.mPrimary, 0.08) + border.color: root.activeFocus ? Qt.alpha(Color.mPrimary, 0.8) : Qt.alpha(Color.mOutline, 0.65) + border.width: Style.borderS + + ColumnLayout { + anchors.fill: parent + anchors.margins: Style.marginM + spacing: Style.marginS + + NText { + id: expressionLabel + Layout.fillWidth: true + text: mainInst?.expressionText ?? "" + visible: text !== "" + pointSize: Style.fontSizeS + color: Qt.alpha(Color.mOnSurface, 0.68) + elide: Text.ElideLeft + horizontalAlignment: Text.AlignRight + } + + RowLayout { + Layout.fillWidth: true + spacing: Style.marginS + + NText { + Layout.fillWidth: true + text: mainInst?.displayText ?? "0" + pointSize: Math.round(Style.fontSizeL * 1.85) + font.bold: true + color: (mainInst?.errorState ?? false) ? Color.mError : Color.mOnSurface + elide: Text.ElideLeft + horizontalAlignment: Text.AlignRight + } + + Item { + Layout.preferredWidth: copyIcon.implicitWidth + Style.marginS + Layout.preferredHeight: copyIcon.implicitHeight + Layout.alignment: Qt.AlignVCenter + visible: mainInst?.hasCopyableResult ?? false + + NIcon { + id: copyIcon + anchors.centerIn: parent + icon: "copy" + pointSize: Style.fontSizeM + color: copyMouse.containsMouse ? Color.mPrimary : Qt.alpha(Color.mOnSurface, 0.55) + + Behavior on color { ColorAnimation { duration: Style.animationFast } } + } + + MouseArea { + id: copyMouse + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: mainInst?.copyResult() + onEntered: TooltipService.show(parent, pluginApi?.tr("panel.copy-result-tooltip")) + onExited: TooltipService.hide() + } + } + } + } + } + + GridLayout { + Layout.fillWidth: true + columns: 4 + rowSpacing: Style.marginS + columnSpacing: Style.marginS + + Repeater { + model: root.buttonModel + + delegate: Rectangle { + required property var modelData + + Layout.fillWidth: true + Layout.columnSpan: modelData.span + Layout.preferredHeight: Math.round((modelData.action === "equals" ? 58 : 52) * Style.uiScaleRatio) + Layout.minimumHeight: Layout.preferredHeight + + readonly property bool isFlashed: root.flashedAction === modelData.action + radius: Style.radiusL + color: root.buttonFill(modelData, buttonMouse.containsMouse, isFlashed) + border.color: root.buttonBorder(modelData, buttonMouse.containsMouse, isFlashed) + border.width: Style.borderS + scale: isFlashed ? 0.96 : 1.0 + + Behavior on color { ColorAnimation { duration: Style.animationFast } } + Behavior on border.color { ColorAnimation { duration: Style.animationFast } } + Behavior on scale { NumberAnimation { duration: 90 } } + + NText { + anchors.centerIn: parent + text: modelData.label + pointSize: modelData.action === "equals" ? Style.fontSizeL : Style.fontSizeM + font.bold: true + color: root.buttonTextColor(modelData) + } + + MouseArea { + id: buttonMouse + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + + onClicked: { + mainInst?.pressButton(modelData.action); + root.forceActiveFocus(); + } + } + } + } + } + } + } + } + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/README.md b/dot_config/noctalia/plugins/noctalia-calculator/README.md new file mode 100644 index 0000000..75d6fe9 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/README.md @@ -0,0 +1,51 @@ +# noctalia-calculator + +A theme-aware calculator plugin for Noctalia on Niri, with a bar widget, floating panel, keyboard support, and a clean UI that follows the active shell colors. + +## Preview + +![Calculator Preview](preview.png) + +## Features + +- Full expression evaluation with operator precedence via bundled `AdvancedMath.js` +- Bar widget with optional live result badge +- Floating panel with 21-button grid +- Mouse and keyboard input +- Theme-aware colors and spacing +- 10-language i18n (en, pt, es, fr, de, it, ru, zh, ja, ko) +- Configurable decimal precision (0-10) + +## Usage + +- Left click the bar widget to open the calculator +- Right click the bar widget for the context menu +- Keyboard: + - `0-9` for digits + - `+ - * /` for operators + - `.` or `,` for decimal input + - `Enter` for equals + - `Backspace` for delete + - `Esc` or `Delete` for clear + - `F9` for sign toggle + - `%` for percent + +## Files + +- `AdvancedMath.js`: math evaluation library (from noctalia-shell Helpers) +- `Main.qml`: calculator logic +- `BarWidget.qml`: bar widget entry point +- `Panel.qml`: floating calculator panel +- `Settings.qml`: plugin settings UI +- `i18n/`: translations (en, pt, es, fr, de, it, ru, zh, ja, ko) + +## Copying the result + +When the panel is open and a value is showing, a small copy icon appears to the right of the result. Click it to copy the value to the system clipboard. A toast confirms the copy. + +Requires `wl-copy` (from `wl-clipboard`) on `PATH`. The icon is hidden in the resting `0` state and while an error is displayed. + +## Author + +Pir0c0pter0 +`pir0c0pter0000@gmail.com` diff --git a/dot_config/noctalia/plugins/noctalia-calculator/Settings.qml b/dot_config/noctalia/plugins/noctalia-calculator/Settings.qml new file mode 100644 index 0000000..562f0a2 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/Settings.qml @@ -0,0 +1,61 @@ +import QtQuick +import QtQuick.Layouts +import qs.Commons +import qs.Widgets + +ColumnLayout { + id: root + + property var pluginApi: null + + property bool valueShowBarValue: pluginApi?.pluginSettings?.showBarValue ?? true + property int valuePrecision: pluginApi?.pluginSettings?.precision ?? 8 + + spacing: Style.marginM + + function saveSettings() { + if (!pluginApi?.pluginSettings) return; + pluginApi.pluginSettings.showBarValue = valueShowBarValue; + pluginApi.pluginSettings.precision = valuePrecision; + pluginApi.saveSettings(); + } + + NToggle { + Layout.fillWidth: true + label: pluginApi?.tr("settings.show-bar") + description: pluginApi?.tr("settings.show-bar-desc") + checked: root.valueShowBarValue + onToggled: checked => { + root.valueShowBarValue = checked; + root.saveSettings(); + } + } + + ColumnLayout { + Layout.fillWidth: true + spacing: Style.marginS + + NLabel { + label: pluginApi?.tr("settings.precision", { "value": root.valuePrecision }) + description: pluginApi?.tr("settings.precision-desc") + } + + NSlider { + Layout.fillWidth: true + from: 0 + to: 10 + stepSize: 1 + value: root.valuePrecision + onMoved: { + root.valuePrecision = Math.round(value); + root.saveSettings(); + } + } + } + + NLabel { + Layout.fillWidth: true + label: pluginApi?.tr("settings.about") + description: pluginApi?.tr("settings.developed-by", { "version": pluginApi?.manifest?.version ?? "1.0.0" }) + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/de.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/de.json new file mode 100644 index 0000000..b247860 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/de.json @@ -0,0 +1,26 @@ +{ + "state": { + "error": "Fehler" + }, + "bar": { + "clear": "Loeschen", + "settings": "Einstellungen", + "tooltip-title": "Rechner" + }, + "panel": { + "title": "Rechner", + "subtitle": "Schnellrechnung in der Leiste", + "copy-result-tooltip": "Ergebnis kopieren" + }, + "toast": { + "copied": "Kopiert: {value}" + }, + "settings": { + "about": "Über", + "show-bar": "Wert in der Leiste anzeigen", + "show-bar-desc": "Zeigt den aktuellen Wert neben dem Rechner-Symbol an", + "precision": "Dezimalgenauigkeit: {value}", + "precision-desc": "Maximale Dezimalstellen bei der Ergebnisformatierung", + "developed-by": "Entwickelt von Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/en.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/en.json new file mode 100644 index 0000000..2e14c7f --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/en.json @@ -0,0 +1,26 @@ +{ + "state": { + "error": "Error" + }, + "bar": { + "clear": "Clear", + "settings": "Settings", + "tooltip-title": "Calculator" + }, + "panel": { + "title": "Calculator", + "subtitle": "Quick math in the bar", + "copy-result-tooltip": "Copy result" + }, + "toast": { + "copied": "Copied: {value}" + }, + "settings": { + "about": "About", + "show-bar": "Show value in bar", + "show-bar-desc": "Display the current value next to the calculator icon", + "precision": "Decimal precision: {value}", + "precision-desc": "Maximum decimals used when formatting results", + "developed-by": "Developed by Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/es.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/es.json new file mode 100644 index 0000000..4a44d1e --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/es.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "Error" + }, + "bar": { + "clear": "Limpiar", + "settings": "Ajustes", + "tooltip-title": "Calculadora" + }, + "panel": { + "title": "Calculadora", + "subtitle": "Calculo rapido en la barra" + }, + "settings": { + "about": "Acerca de", + "show-bar": "Mostrar valor en la barra", + "show-bar-desc": "Muestra el valor actual junto al icono de la calculadora", + "precision": "Precision decimal: {value}", + "precision-desc": "Maximo de decimales al formatear resultados", + "developed-by": "Desarrollado por Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/fr.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/fr.json new file mode 100644 index 0000000..e947356 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/fr.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "Erreur" + }, + "bar": { + "clear": "Effacer", + "settings": "Paramètres", + "tooltip-title": "Calculatrice" + }, + "panel": { + "title": "Calculatrice", + "subtitle": "Calcul rapide dans la barre" + }, + "settings": { + "about": "À propos", + "show-bar": "Afficher la valeur dans la barre", + "show-bar-desc": "Affiche la valeur actuelle à côté de l'icone de la calculatrice", + "precision": "Précision décimale : {value}", + "precision-desc": "Nombre maximal de décimales pour le formatage des résultats", + "developed-by": "Développé par Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/it.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/it.json new file mode 100644 index 0000000..1398dc5 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/it.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "Errore" + }, + "bar": { + "clear": "Cancella", + "settings": "Impostazioni", + "tooltip-title": "Calcolatrice" + }, + "panel": { + "title": "Calcolatrice", + "subtitle": "Calcolo rapido nella barra" + }, + "settings": { + "about": "Informazioni", + "show-bar": "Mostra valore nella barra", + "show-bar-desc": "Visualizza il valore corrente accanto all'icona della calcolatrice", + "precision": "Precisione decimale: {value}", + "precision-desc": "Numero massimo di decimali nella formattazione dei risultati", + "developed-by": "Sviluppato da Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/ja.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ja.json new file mode 100644 index 0000000..86bc023 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ja.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "エラー" + }, + "bar": { + "clear": "クリア", + "settings": "設定", + "tooltip-title": "電卓" + }, + "panel": { + "title": "電卓", + "subtitle": "バーで素早く計算" + }, + "settings": { + "about": "このプラグインについて", + "show-bar": "バーに数値を表示", + "show-bar-desc": "電卓アイコンの横に現在の値を表示します", + "precision": "小数精度: {value}", + "precision-desc": "結果のフォーマット時の最大小数桁数", + "developed-by": "Pir0c0pter0 が開発
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/ko.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ko.json new file mode 100644 index 0000000..9f1b30e --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ko.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "오류" + }, + "bar": { + "clear": "지우기", + "settings": "설정", + "tooltip-title": "계산기" + }, + "panel": { + "title": "계산기", + "subtitle": "바에서 빠른 계산" + }, + "settings": { + "about": "정보", + "show-bar": "바에 값 표시", + "show-bar-desc": "계산기 아이콘 옆에 현재 값을 표시합니다", + "precision": "소수점 정밀도: {value}", + "precision-desc": "결과 포맷 시 최대 소수 자릿수", + "developed-by": "Pir0c0pter0 개발
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/pt.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/pt.json new file mode 100644 index 0000000..7ea7c81 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/pt.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "Erro" + }, + "bar": { + "clear": "Limpar", + "settings": "Configuracoes", + "tooltip-title": "Calculadora" + }, + "panel": { + "title": "Calculadora", + "subtitle": "Conta rapida direto na barra" + }, + "settings": { + "about": "Sobre", + "show-bar": "Mostrar valor na barra", + "show-bar-desc": "Exibe o valor atual ao lado do icone da calculadora", + "precision": "Precisao decimal: {value}", + "precision-desc": "Maximo de casas decimais ao formatar resultados", + "developed-by": "Desenvolvido por Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/ru.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ru.json new file mode 100644 index 0000000..b4beefc --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/ru.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "Ошибка" + }, + "bar": { + "clear": "Очистить", + "settings": "Настройки", + "tooltip-title": "Калькулятор" + }, + "panel": { + "title": "Калькулятор", + "subtitle": "Быстрый расчёт в панели" + }, + "settings": { + "about": "О плагине", + "show-bar": "Показывать значение в панели", + "show-bar-desc": "Отображает текущее значение рядом с иконкой калькулятора", + "precision": "Десятичная точность: {value}", + "precision-desc": "Максимальное количество десятичных знаков при форматировании результатов", + "developed-by": "Разработано Pir0c0pter0
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/i18n/zh.json b/dot_config/noctalia/plugins/noctalia-calculator/i18n/zh.json new file mode 100644 index 0000000..27d09e9 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/i18n/zh.json @@ -0,0 +1,22 @@ +{ + "state": { + "error": "错误" + }, + "bar": { + "clear": "清除", + "settings": "设置", + "tooltip-title": "计算器" + }, + "panel": { + "title": "计算器", + "subtitle": "栏内快速计算" + }, + "settings": { + "about": "关于", + "show-bar": "在栏中显示数值", + "show-bar-desc": "在计算器图标旁显示当前数值", + "precision": "小数精度: {value}", + "precision-desc": "格式化结果时的最大小数位数", + "developed-by": "由 Pir0c0pter0 开发
v{version}" + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/manifest.json b/dot_config/noctalia/plugins/noctalia-calculator/manifest.json new file mode 100644 index 0000000..d17ff09 --- /dev/null +++ b/dot_config/noctalia/plugins/noctalia-calculator/manifest.json @@ -0,0 +1,26 @@ +{ + "id": "noctalia-calculator", + "name": "Calculator", + "version": "1.1.1", + "minNoctaliaVersion": "4.4.0", + "author": "pir0c0pter0", + "license": "MIT", + "repository": "https://github.com/noctalia-dev/noctalia-plugins", + "description": "Theme-aware calculator plugin for Noctalia on Niri with bar widget, floating panel and keyboard support", + "tags": ["Bar", "Panel", "Utility"], + "entryPoints": { + "main": "Main.qml", + "barWidget": "BarWidget.qml", + "panel": "Panel.qml", + "settings": "Settings.qml" + }, + "dependencies": { + "plugins": [] + }, + "metadata": { + "defaultSettings": { + "showBarValue": true, + "precision": 8 + } + } +} diff --git a/dot_config/noctalia/plugins/noctalia-calculator/preview.png b/dot_config/noctalia/plugins/noctalia-calculator/preview.png new file mode 100644 index 0000000..fb1c7b3 Binary files /dev/null and b/dot_config/noctalia/plugins/noctalia-calculator/preview.png differ diff --git a/dot_config/noctalia/settings.json b/dot_config/noctalia/settings.json new file mode 100644 index 0000000..e688ca8 --- /dev/null +++ b/dot_config/noctalia/settings.json @@ -0,0 +1,803 @@ +{ + "appLauncher": { + "autoPasteClipboard": false, + "clipboardWatchImageCommand": "wl-paste --type image --watch cliphist store", + "clipboardWatchTextCommand": "wl-paste --type text --watch cliphist store", + "clipboardWrapText": true, + "customLaunchPrefix": "", + "customLaunchPrefixEnabled": false, + "density": "default", + "enableClipPreview": true, + "enableClipboardChips": true, + "enableClipboardHistory": false, + "enableClipboardSmartIcons": true, + "enableSessionSearch": true, + "enableSettingsSearch": true, + "enableWindowsSearch": true, + "iconMode": "tabler", + "ignoreMouseInput": false, + "overviewLayer": false, + "pinnedApps": [ + ], + "position": "center", + "screenshotAnnotationTool": "", + "showCategories": true, + "showIconBackground": false, + "sortByMostUsed": true, + "terminalCommand": "alacritty -e", + "viewMode": "list" + }, + "audio": { + "mprisBlacklist": [ + ], + "preferredPlayer": "", + "spectrumFrameRate": 30, + "spectrumMirrored": true, + "visualizerType": "linear", + "volumeFeedback": false, + "volumeFeedbackSoundFile": "", + "volumeOverdrive": false, + "volumeStep": 5 + }, + "bar": { + "autoHideDelay": 500, + "autoShowDelay": 150, + "backgroundOpacity": 0, + "barType": "simple", + "capsuleColorKey": "none", + "capsuleOpacity": 1, + "contentPadding": 2, + "density": "comfortable", + "displayMode": "always_visible", + "enableExclusionZoneInset": true, + "fontScale": 1, + "frameRadius": 12, + "frameThickness": 8, + "hideOnOverview": false, + "marginHorizontal": 4, + "marginVertical": 4, + "middleClickAction": "none", + "middleClickCommand": "", + "middleClickFollowMouse": false, + "monitors": [ + ], + "mouseWheelAction": "none", + "mouseWheelWrap": true, + "outerCorners": true, + "position": "top", + "reverseScroll": false, + "rightClickAction": "controlCenter", + "rightClickCommand": "", + "rightClickFollowMouse": true, + "screenOverrides": [ + ], + "showCapsule": true, + "showOnWorkspaceSwitch": true, + "showOutline": true, + "useSeparateOpacity": true, + "widgetSpacing": 6, + "widgets": { + "center": [ + { + "characterCount": 2, + "colorizeIcons": false, + "emptyColor": "secondary", + "enableScrollWheel": true, + "focusedColor": "primary", + "followFocusedScreen": false, + "fontWeight": "bold", + "groupedBorderOpacity": 1, + "hideUnoccupied": false, + "iconScale": 0.8, + "id": "Workspace", + "labelMode": "index", + "occupiedColor": "secondary", + "pillSize": 0.6, + "showApplications": false, + "showApplicationsHover": false, + "showBadge": true, + "showLabelsOnlyWhenOccupied": true, + "unfocusedIconsOpacity": 1 + }, + { + "defaultSettings": { + "hideBackground": false, + "minimumThreshold": 10 + }, + "id": "plugin:catwalk" + } + ], + "left": [ + { + "colorizeSystemIcon": "none", + "colorizeSystemText": "none", + "customIconPath": "", + "enableColorization": false, + "icon": "rocket", + "iconColor": "none", + "id": "Launcher", + "useDistroLogo": false + }, + { + "clockColor": "none", + "customFont": "", + "formatHorizontal": "HH:mm ddd, MMM dd", + "formatVertical": "HH mm - dd MM", + "id": "Clock", + "tooltipFormat": "HH:mm ddd, MMM dd", + "useCustomFont": false + }, + { + "compactMode": false, + "diskPath": "/", + "iconColor": "none", + "id": "SystemMonitor", + "showCpuCores": true, + "showCpuFreq": false, + "showCpuTemp": true, + "showCpuUsage": true, + "showDiskAvailable": false, + "showDiskUsage": true, + "showDiskUsageAsPercent": false, + "showGpuTemp": true, + "showLoadAverage": false, + "showMemoryAsPercent": false, + "showMemoryUsage": true, + "showNetworkStats": true, + "showSwapUsage": false, + "textColor": "none", + "useMonospaceFont": true, + "usePadding": false + }, + { + "compactMode": false, + "hideMode": "hidden", + "hideWhenIdle": false, + "id": "MediaMini", + "maxWidth": 145, + "panelShowAlbumArt": true, + "scrollingMode": "hover", + "showAlbumArt": true, + "showArtistFirst": true, + "showProgressRing": true, + "showVisualizer": false, + "textColor": "none", + "useFixedWidth": false, + "visualizerType": "linear" + } + ], + "right": [ + { + "blacklist": [ + ], + "chevronColor": "none", + "colorizeIcons": false, + "drawerEnabled": true, + "hidePassive": false, + "id": "Tray", + "pinned": [ + "Discord", + "steam", + "Telegram Desktop" + ] + }, + { + "hideWhenZero": false, + "hideWhenZeroUnread": false, + "iconColor": "none", + "id": "NotificationHistory", + "showUnreadBadge": true, + "unreadBadgeColor": "primary" + }, + { + "displayMode": "onhover", + "iconColor": "none", + "id": "Volume", + "middleClickCommand": "pwvucontrol || pavucontrol", + "textColor": "none" + }, + { + "displayMode": "onhover", + "iconColor": "none", + "id": "Microphone", + "middleClickCommand": "pwvucontrol || pavucontrol", + "textColor": "none" + }, + { + "applyToAllMonitors": false, + "displayMode": "onhover", + "iconColor": "none", + "id": "Brightness", + "textColor": "none" + }, + { + "defaultSettings": { + "precision": 8, + "showBarValue": true + }, + "id": "plugin:noctalia-calculator" + }, + { + "colorizeDistroLogo": false, + "colorizeSystemIcon": "none", + "colorizeSystemText": "none", + "customIconPath": "", + "enableColorization": false, + "icon": "noctalia", + "id": "ControlCenter", + "useDistroLogo": false + } + ] + } + }, + "brightness": { + "backlightDeviceMappings": [ + ], + "brightnessStep": 5, + "enableDdcSupport": true, + "enforceMinimum": true + }, + "calendar": { + "cards": [ + { + "enabled": true, + "id": "calendar-header-card" + }, + { + "enabled": true, + "id": "calendar-month-card" + }, + { + "enabled": true, + "id": "weather-card" + } + ] + }, + "colorSchemes": { + "darkMode": true, + "generationMethod": "tonal-spot", + "manualSunrise": "06:30", + "manualSunset": "18:30", + "monitorForColors": "", + "predefinedScheme": "Catppuccin", + "schedulingMode": "off", + "syncGsettings": true, + "useWallpaperColors": false + }, + "controlCenter": { + "cards": [ + { + "enabled": true, + "id": "profile-card" + }, + { + "enabled": true, + "id": "shortcuts-card" + }, + { + "enabled": true, + "id": "audio-card" + }, + { + "enabled": true, + "id": "brightness-card" + }, + { + "enabled": true, + "id": "weather-card" + }, + { + "enabled": true, + "id": "media-sysmon-card" + } + ], + "diskPath": "/", + "position": "top_center", + "shortcuts": { + "left": [ + { + "id": "Network" + }, + { + "id": "Bluetooth" + }, + { + "id": "WallpaperSelector" + }, + { + "id": "NoctaliaPerformance" + } + ], + "right": [ + { + "id": "Notifications" + }, + { + "id": "PowerProfile" + }, + { + "id": "KeepAwake" + }, + { + "id": "NightLight" + } + ] + } + }, + "desktopWidgets": { + "enabled": true, + "gridSnap": true, + "gridSnapScale": true, + "monitorWidgets": [ + { + "name": "DP-3", + "widgets": [ + { + "id": "Weather", + "roundedCorners": true, + "scale": 1.5361548729715255, + "showBackground": true, + "x": 378, + "y": 756 + }, + { + "colorName": "primary", + "height": 72, + "hideWhenIdle": false, + "id": "AudioVisualizer", + "roundedCorners": true, + "scale": 4.978125, + "showBackground": true, + "visualizerType": "linear", + "width": 320, + "x": 378, + "y": 918 + }, + { + "hideMode": "visible", + "id": "MediaPlayer", + "roundedCorners": true, + "scale": 1.551805337914226, + "showAlbumArt": true, + "showBackground": true, + "showButtons": true, + "showVisualizer": false, + "visualizerType": "wave", + "x": 1350, + "y": 756 + }, + { + "clockColor": "none", + "clockStyle": "minimal", + "customFont": "DejaVu Serif", + "format": "HH:mm\\nd MMMM yyyy", + "id": "Clock", + "roundedCorners": true, + "scale": 1.6566451392244383, + "showBackground": true, + "useCustomFont": false, + "x": 1053, + "y": 54 + }, + { + "diskPath": "/", + "id": "SystemStat", + "layout": "side", + "roundedCorners": true, + "scale": 0.9002316672690356, + "showBackground": true, + "statType": "GPU", + "x": 378, + "y": 486 + }, + { + "diskPath": "/", + "id": "SystemStat", + "layout": "bottom", + "roundedCorners": true, + "scale": 0.9000000000000001, + "showBackground": true, + "statType": "CPU", + "x": 378, + "y": 621 + }, + { + "diskPath": "/", + "id": "SystemStat", + "layout": "bottom", + "roundedCorners": true, + "scale": 0.9000000000000001, + "showBackground": true, + "statType": "Disk", + "x": 621, + "y": 486 + }, + { + "diskPath": "/", + "id": "SystemStat", + "layout": "bottom", + "roundedCorners": true, + "scale": 0.8977105562396721, + "showBackground": true, + "statType": "Memory", + "x": 621, + "y": 621 + } + ] + } + ], + "overviewEnabled": true + }, + "dock": { + "animationSpeed": 1, + "backgroundOpacity": 1, + "colorizeIcons": true, + "deadOpacity": 0.6, + "displayMode": "auto_hide", + "dockType": "floating", + "enabled": true, + "floatingRatio": 1, + "groupApps": false, + "groupClickAction": "cycle", + "groupContextMenuMode": "extended", + "groupIndicatorStyle": "dots", + "inactiveIndicators": false, + "indicatorColor": "primary", + "indicatorOpacity": 0.6, + "indicatorThickness": 3, + "launcherIcon": "", + "launcherIconColor": "none", + "launcherPosition": "end", + "launcherUseDistroLogo": false, + "monitors": [ + ], + "onlySameOutput": true, + "pinnedApps": [ + ], + "pinnedStatic": false, + "position": "bottom", + "showDockIndicator": false, + "showLauncherIcon": false, + "sitOnFrame": false, + "size": 1 + }, + "general": { + "allowPanelsOnScreenWithoutBar": true, + "allowPasswordWithFprintd": false, + "animationDisabled": true, + "animationSpeed": 2, + "autoStartAuth": false, + "avatarImage": "/home/benq/.face", + "boxRadiusRatio": 1, + "clockFormat": "hh\\nmm", + "clockStyle": "custom", + "compactLockScreen": false, + "dimmerOpacity": 0.2, + "enableBlurBehind": true, + "enableLockScreenCountdown": true, + "enableLockScreenMediaControls": false, + "enableShadows": true, + "forceBlackScreenCorners": false, + "iRadiusRatio": 1, + "keybinds": { + "keyDown": [ + "Down" + ], + "keyEnter": [ + "Return", + "Enter" + ], + "keyEscape": [ + "Esc" + ], + "keyLeft": [ + "Left" + ], + "keyRemove": [ + "Del" + ], + "keyRight": [ + "Right" + ], + "keyUp": [ + "Up" + ] + }, + "language": "", + "lockOnSuspend": true, + "lockScreenAnimations": false, + "lockScreenBlur": 0, + "lockScreenCountdownDuration": 10000, + "lockScreenMonitors": [ + ], + "lockScreenTint": 0, + "passwordChars": false, + "radiusRatio": 1, + "reverseScroll": false, + "scaleRatio": 1.1, + "screenRadiusRatio": 1, + "shadowDirection": "bottom_right", + "shadowOffsetX": 2, + "shadowOffsetY": 3, + "showChangelogOnStartup": true, + "showHibernateOnLockScreen": false, + "showScreenCorners": false, + "showSessionButtonsOnLockScreen": true, + "smoothScrollEnabled": true, + "telemetryEnabled": false + }, + "hooks": { + "colorGeneration": "", + "darkModeChange": "", + "enabled": false, + "performanceModeDisabled": "", + "performanceModeEnabled": "", + "screenLock": "", + "screenUnlock": "", + "session": "", + "startup": "", + "wallpaperChange": "" + }, + "idle": { + "customCommands": "[]", + "enabled": true, + "fadeDuration": 5, + "lockCommand": "", + "lockTimeout": 660, + "resumeLockCommand": "", + "resumeScreenOffCommand": "", + "resumeSuspendCommand": "", + "screenOffCommand": "", + "screenOffTimeout": 600, + "suspendCommand": "", + "suspendTimeout": 1800 + }, + "location": { + "analogClockInCalendar": false, + "autoLocate": false, + "firstDayOfWeek": 1, + "hideWeatherCityName": false, + "hideWeatherTimezone": false, + "name": "Saint-Petersburg", + "showCalendarEvents": true, + "showCalendarWeather": true, + "showWeekNumberInCalendar": true, + "use12hourFormat": false, + "useFahrenheit": false, + "weatherEnabled": true, + "weatherShowEffects": true, + "weatherTaliaMascotAlways": false + }, + "network": { + "bluetoothAutoConnect": false, + "bluetoothDetailsViewMode": "grid", + "bluetoothHideUnnamedDevices": false, + "bluetoothRssiPollIntervalMs": 60000, + "bluetoothRssiPollingEnabled": false, + "disableDiscoverability": false, + "networkPanelView": "wifi", + "wifiDetailsViewMode": "grid" + }, + "nightLight": { + "autoSchedule": false, + "dayTemp": "6500", + "enabled": true, + "forced": true, + "manualSunrise": "06:30", + "manualSunset": "18:30", + "nightTemp": "4577" + }, + "noctaliaPerformance": { + "disableDesktopWidgets": true, + "disableWallpaper": true + }, + "notifications": { + "backgroundOpacity": 1, + "clearDismissed": true, + "criticalUrgencyDuration": 15, + "density": "default", + "enableBatteryToast": true, + "enableKeyboardLayoutToast": false, + "enableMarkdown": true, + "enableMediaToast": false, + "enabled": true, + "location": "top_right", + "lowUrgencyDuration": 3, + "monitors": [ + ], + "normalUrgencyDuration": 8, + "overlayLayer": true, + "respectExpireTimeout": true, + "saveToHistory": { + "critical": true, + "low": true, + "normal": true + }, + "sounds": { + "criticalSoundFile": "", + "enabled": false, + "excludedApps": "discord,firefox,chrome,chromium,edge", + "lowSoundFile": "", + "normalSoundFile": "", + "separateSounds": false, + "volume": 0.5 + } + }, + "osd": { + "autoHideMs": 2000, + "backgroundOpacity": 1, + "enabled": true, + "enabledTypes": [ + 0, + 1, + 2 + ], + "location": "top_right", + "monitors": [ + ], + "overlayLayer": true + }, + "plugins": { + "autoUpdate": false, + "notifyUpdates": true + }, + "sessionMenu": { + "countdownDuration": 10000, + "enableCountdown": true, + "largeButtonsLayout": "single-row", + "largeButtonsStyle": true, + "position": "center", + "powerOptions": [ + { + "action": "lock", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "1" + }, + { + "action": "suspend", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "2" + }, + { + "action": "hibernate", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "3" + }, + { + "action": "reboot", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "4" + }, + { + "action": "logout", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "5" + }, + { + "action": "shutdown", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "6" + }, + { + "action": "rebootToUefi", + "command": "", + "countdownEnabled": true, + "enabled": true, + "keybind": "7" + }, + { + "action": "userspaceReboot", + "command": "", + "countdownEnabled": true, + "enabled": false, + "keybind": "" + } + ], + "showHeader": true, + "showKeybinds": true + }, + "settingsVersion": 59, + "systemMonitor": { + "batteryCriticalThreshold": 5, + "batteryWarningThreshold": 20, + "cpuCriticalThreshold": 90, + "cpuWarningThreshold": 80, + "criticalColor": "", + "diskAvailCriticalThreshold": 10, + "diskAvailWarningThreshold": 20, + "diskCriticalThreshold": 90, + "diskWarningThreshold": 80, + "enableDgpuMonitoring": true, + "externalMonitor": "resources || missioncenter || jdsystemmonitor || corestats || system-monitoring-center || gnome-system-monitor || plasma-systemmonitor || mate-system-monitor || ukui-system-monitor || deepin-system-monitor || pantheon-system-monitor", + "gpuCriticalThreshold": 90, + "gpuWarningThreshold": 80, + "memCriticalThreshold": 90, + "memWarningThreshold": 80, + "swapCriticalThreshold": 90, + "swapWarningThreshold": 80, + "tempCriticalThreshold": 90, + "tempWarningThreshold": 80, + "useCustomColors": false, + "warningColor": "" + }, + "templates": { + "activeTemplates": [ + ], + "enableUserTheming": false + }, + "ui": { + "boxBorderEnabled": false, + "fontDefault": "Noto Sans", + "fontDefaultScale": 1, + "fontFixed": "monospace", + "fontFixedScale": 1, + "panelBackgroundOpacity": 0.93, + "panelsAttachedToBar": true, + "scrollbarAlwaysVisible": true, + "settingsPanelMode": "attached", + "settingsPanelSideBarCardStyle": false, + "tooltipsEnabled": true, + "translucentWidgets": true + }, + "wallpaper": { + "automationEnabled": false, + "directory": "/home/benq/Pictures/Wallpapers", + "enableMultiMonitorDirectories": false, + "enabled": true, + "favorites": [ + ], + "fillColor": "#000000", + "fillMode": "crop", + "hideWallpaperFilenames": false, + "linkLightAndDarkWallpapers": true, + "monitorDirectories": [ + ], + "overviewBlur": 0.4, + "overviewEnabled": false, + "overviewTint": 0.6, + "panelPosition": "follow_bar", + "randomIntervalSec": 300, + "setWallpaperOnAllMonitors": true, + "showHiddenFiles": false, + "skipStartupTransition": false, + "solidColor": "#1a1a2e", + "sortOrder": "name", + "transitionDuration": 1500, + "transitionEdgeSmoothness": 0.05, + "transitionType": [ + "fade", + "disc", + "stripes", + "wipe", + "pixelate", + "honeycomb" + ], + "useOriginalImages": false, + "useSolidColor": false, + "useWallhaven": false, + "viewMode": "single", + "wallhavenApiKey": "", + "wallhavenCategories": "111", + "wallhavenOrder": "desc", + "wallhavenPurity": "100", + "wallhavenQuery": "", + "wallhavenRatios": "", + "wallhavenResolutionHeight": "", + "wallhavenResolutionMode": "atleast", + "wallhavenResolutionWidth": "", + "wallhavenSorting": "relevance", + "wallpaperChangeMode": "random" + } +}