mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-25 14:02:53 -05:00
settings: add index extractor script for search
This commit is contained in:
@@ -71,6 +71,8 @@ Item {
|
||||
settingKey: "dockVisibility"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showDock"
|
||||
tags: ["dock", "show", "display", "enable"]
|
||||
text: I18n.tr("Show Dock")
|
||||
description: I18n.tr("Display a dock with pinned and running applications")
|
||||
checked: SettingsData.showDock
|
||||
@@ -78,6 +80,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dockAutoHide"
|
||||
tags: ["dock", "autohide", "hide", "hover"]
|
||||
text: I18n.tr("Auto-hide Dock")
|
||||
description: I18n.tr("Hide the dock when not in use and reveal it when hovering near the dock area")
|
||||
checked: SettingsData.dockAutoHide
|
||||
@@ -86,6 +90,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dockOpenOnOverview"
|
||||
tags: ["dock", "overview", "niri"]
|
||||
text: I18n.tr("Show on Overview")
|
||||
description: I18n.tr("Always show the dock when niri's overview is open")
|
||||
checked: SettingsData.dockOpenOnOverview
|
||||
@@ -101,6 +107,8 @@ Item {
|
||||
settingKey: "dockBehavior"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dockIsolateDisplays"
|
||||
tags: ["dock", "isolate", "monitor", "multi-monitor"]
|
||||
text: I18n.tr("Isolate Displays")
|
||||
description: I18n.tr("Only show windows from the current monitor on each dock")
|
||||
checked: SettingsData.dockIsolateDisplays
|
||||
@@ -108,6 +116,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dockGroupByApp"
|
||||
tags: ["dock", "group", "windows", "app"]
|
||||
text: I18n.tr("Group by App")
|
||||
description: I18n.tr("Group multiple windows of the same app together with a window count indicator")
|
||||
checked: SettingsData.dockGroupByApp
|
||||
@@ -115,6 +125,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsButtonGroupRow {
|
||||
settingKey: "dockIndicatorStyle"
|
||||
tags: ["dock", "indicator", "style", "circle", "line"]
|
||||
text: I18n.tr("Indicator Style")
|
||||
model: ["Circle", "Line"]
|
||||
currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1
|
||||
@@ -133,6 +145,8 @@ Item {
|
||||
settingKey: "dockSizing"
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "dockIconSize"
|
||||
tags: ["dock", "icon", "size", "scale"]
|
||||
text: I18n.tr("Icon Size")
|
||||
value: SettingsData.dockIconSize
|
||||
minimum: 24
|
||||
|
||||
@@ -250,6 +250,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "launcherLogoSizeOffset"
|
||||
tags: ["launcher", "logo", "size", "offset", "scale"]
|
||||
text: I18n.tr("Size Offset")
|
||||
minimum: -12
|
||||
maximum: 12
|
||||
@@ -267,6 +269,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "launcherLogoBrightness"
|
||||
tags: ["launcher", "logo", "brightness", "color"]
|
||||
text: I18n.tr("Brightness")
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
@@ -277,6 +281,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "launcherLogoContrast"
|
||||
tags: ["launcher", "logo", "contrast", "color"]
|
||||
text: I18n.tr("Contrast")
|
||||
minimum: 0
|
||||
maximum: 200
|
||||
@@ -287,6 +293,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "launcherLogoColorInvertOnMode"
|
||||
tags: ["launcher", "logo", "invert", "mode", "color"]
|
||||
text: I18n.tr("Invert on mode change")
|
||||
checked: SettingsData.launcherLogoColorInvertOnMode
|
||||
onToggled: checked => SettingsData.set("launcherLogoColorInvertOnMode", checked)
|
||||
@@ -324,6 +332,8 @@ Item {
|
||||
settingKey: "launcherSorting"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "sortAppsAlphabetically"
|
||||
tags: ["launcher", "sort", "alphabetically", "apps", "order"]
|
||||
text: I18n.tr("Sort Alphabetically")
|
||||
description: I18n.tr("When enabled, apps are sorted alphabetically. When disabled, apps are sorted by usage frequency.")
|
||||
checked: SettingsData.sortAppsAlphabetically
|
||||
@@ -331,6 +341,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "appLauncherGridColumns"
|
||||
tags: ["launcher", "grid", "columns", "layout"]
|
||||
text: I18n.tr("Grid Columns")
|
||||
description: I18n.tr("Adjust the number of columns in grid view mode.")
|
||||
minimum: 2
|
||||
@@ -348,6 +360,8 @@ Item {
|
||||
visible: CompositorService.isNiri
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "spotlightCloseNiriOverview"
|
||||
tags: ["launcher", "niri", "overview", "close", "launch"]
|
||||
text: I18n.tr("Close Overview on Launch")
|
||||
description: I18n.tr("Auto-close Niri overview when launching apps.")
|
||||
checked: SettingsData.spotlightCloseNiriOverview
|
||||
@@ -355,6 +369,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "niriOverviewOverlayEnabled"
|
||||
tags: ["launcher", "niri", "overview", "overlay", "enable"]
|
||||
text: I18n.tr("Enable Overview Overlay")
|
||||
description: I18n.tr("Show launcher overlay when typing in Niri overview. Disable to use another launcher.")
|
||||
checked: SettingsData.niriOverviewOverlayEnabled
|
||||
|
||||
@@ -28,36 +28,48 @@ Item {
|
||||
settingKey: "lockLayout"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowPowerActions"
|
||||
tags: ["lock", "screen", "power", "actions", "shutdown", "reboot"]
|
||||
text: I18n.tr("Show Power Actions", "Enable power action icon on the lock screen window")
|
||||
checked: SettingsData.lockScreenShowPowerActions
|
||||
onToggled: checked => SettingsData.set("lockScreenShowPowerActions", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowSystemIcons"
|
||||
tags: ["lock", "screen", "system", "icons", "status"]
|
||||
text: I18n.tr("Show System Icons", "Enable system status icons on the lock screen window")
|
||||
checked: SettingsData.lockScreenShowSystemIcons
|
||||
onToggled: checked => SettingsData.set("lockScreenShowSystemIcons", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowTime"
|
||||
tags: ["lock", "screen", "time", "clock", "display"]
|
||||
text: I18n.tr("Show System Time", "Enable system time display on the lock screen window")
|
||||
checked: SettingsData.lockScreenShowTime
|
||||
onToggled: checked => SettingsData.set("lockScreenShowTime", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowDate"
|
||||
tags: ["lock", "screen", "date", "calendar", "display"]
|
||||
text: I18n.tr("Show System Date", "Enable system date display on the lock screen window")
|
||||
checked: SettingsData.lockScreenShowDate
|
||||
onToggled: checked => SettingsData.set("lockScreenShowDate", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowProfileImage"
|
||||
tags: ["lock", "screen", "profile", "image", "avatar", "picture"]
|
||||
text: I18n.tr("Show Profile Image", "Enable profile image display on the lock screen window")
|
||||
checked: SettingsData.lockScreenShowProfileImage
|
||||
onToggled: checked => SettingsData.set("lockScreenShowProfileImage", checked)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockScreenShowPasswordField"
|
||||
tags: ["lock", "screen", "password", "field", "input", "visible"]
|
||||
text: I18n.tr("Show Password Field", "Enable password field display on the lock screen window")
|
||||
description: I18n.tr("If the field is hidden, it will appear as soon as a key is pressed.")
|
||||
checked: SettingsData.lockScreenShowPasswordField
|
||||
@@ -81,6 +93,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "loginctlLockIntegration"
|
||||
tags: ["lock", "screen", "loginctl", "dbus", "integration", "external"]
|
||||
text: I18n.tr("Enable loginctl lock integration")
|
||||
description: I18n.tr("Bind lock screen to dbus signals from loginctl. Disable if using an external lock screen")
|
||||
checked: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
|
||||
@@ -93,6 +107,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockBeforeSuspend"
|
||||
tags: ["lock", "screen", "suspend", "sleep", "automatic"]
|
||||
text: I18n.tr("Lock before suspend")
|
||||
description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
|
||||
checked: SettingsData.lockBeforeSuspend
|
||||
@@ -101,6 +117,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "enableFprint"
|
||||
tags: ["lock", "screen", "fingerprint", "authentication", "biometric", "fprint"]
|
||||
text: I18n.tr("Enable fingerprint authentication")
|
||||
description: I18n.tr("Use fingerprint reader for lock screen authentication (requires enrolled fingerprints)")
|
||||
checked: SettingsData.enableFprint
|
||||
@@ -126,6 +144,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: lockScreenMonitorDropdown
|
||||
settingKey: "lockScreenActiveMonitor"
|
||||
tags: ["lock", "screen", "monitor", "display", "active"]
|
||||
text: I18n.tr("Active Lock Screen Monitor")
|
||||
options: {
|
||||
var opts = [I18n.tr("All Monitors")];
|
||||
|
||||
@@ -93,6 +93,8 @@ Item {
|
||||
settingKey: "notificationPopups"
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationPopupPosition"
|
||||
tags: ["notification", "popup", "position", "screen", "location"]
|
||||
text: I18n.tr("Popup Position")
|
||||
description: I18n.tr("Choose where notification popups appear on screen")
|
||||
currentValue: {
|
||||
@@ -135,6 +137,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "notificationOverlayEnabled"
|
||||
tags: ["notification", "overlay", "fullscreen", "priority"]
|
||||
text: I18n.tr("Notification Overlay")
|
||||
description: I18n.tr("Display all priorities over fullscreen apps")
|
||||
checked: SettingsData.notificationOverlayEnabled
|
||||
@@ -149,6 +153,8 @@ Item {
|
||||
settingKey: "doNotDisturb"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "doNotDisturb"
|
||||
tags: ["notification", "dnd", "mute", "silent", "suppress"]
|
||||
text: I18n.tr("Enable Do Not Disturb")
|
||||
description: I18n.tr("Suppress notification popups while enabled")
|
||||
checked: SessionData.doNotDisturb
|
||||
@@ -163,6 +169,8 @@ Item {
|
||||
settingKey: "notificationTimeouts"
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationTimeoutLow"
|
||||
tags: ["notification", "timeout", "low", "priority", "duration"]
|
||||
text: I18n.tr("Low Priority")
|
||||
description: I18n.tr("Timeout for low priority notifications")
|
||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutLow)
|
||||
@@ -178,6 +186,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationTimeoutNormal"
|
||||
tags: ["notification", "timeout", "normal", "priority", "duration"]
|
||||
text: I18n.tr("Normal Priority")
|
||||
description: I18n.tr("Timeout for normal priority notifications")
|
||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutNormal)
|
||||
@@ -193,6 +203,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
settingKey: "notificationTimeoutCritical"
|
||||
tags: ["notification", "timeout", "critical", "priority", "duration"]
|
||||
text: I18n.tr("Critical Priority")
|
||||
description: I18n.tr("Timeout for critical priority notifications")
|
||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutCritical)
|
||||
|
||||
@@ -64,6 +64,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "fadeToLockEnabled"
|
||||
tags: ["fade", "lock", "screen", "idle", "grace period"]
|
||||
text: I18n.tr("Fade to lock screen")
|
||||
description: I18n.tr("Gradually fade the screen before locking with a configurable grace period")
|
||||
checked: SettingsData.fadeToLockEnabled
|
||||
@@ -71,6 +73,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "lockBeforeSuspend"
|
||||
tags: ["lock", "suspend", "sleep", "security"]
|
||||
text: I18n.tr("Lock before suspend")
|
||||
description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
|
||||
checked: SettingsData.lockBeforeSuspend
|
||||
@@ -80,6 +84,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: fadeGracePeriodDropdown
|
||||
settingKey: "fadeToLockGracePeriod"
|
||||
tags: ["fade", "grace", "period", "timeout", "lock"]
|
||||
property var periodOptions: ["1 second", "2 seconds", "3 seconds", "4 seconds", "5 seconds", "10 seconds", "15 seconds", "20 seconds", "30 seconds"]
|
||||
property var periodValues: [1, 2, 3, 4, 5, 10, 15, 20, 30]
|
||||
|
||||
@@ -103,6 +109,8 @@ Item {
|
||||
}
|
||||
SettingsDropdownRow {
|
||||
id: powerProfileDropdown
|
||||
settingKey: "powerProfile"
|
||||
tags: ["power", "profile", "performance", "balanced", "saver", "battery"]
|
||||
property var profileOptions: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
|
||||
property var profileValues: ["", "0", "1", "2"]
|
||||
|
||||
@@ -148,6 +156,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: lockDropdown
|
||||
settingKey: "lockTimeout"
|
||||
tags: ["lock", "timeout", "idle", "automatic", "security"]
|
||||
text: I18n.tr("Automatically lock after")
|
||||
options: root.timeoutOptions
|
||||
|
||||
@@ -179,6 +189,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: monitorDropdown
|
||||
settingKey: "monitorTimeout"
|
||||
tags: ["monitor", "display", "screen", "timeout", "off", "idle"]
|
||||
text: I18n.tr("Turn off monitors after")
|
||||
options: root.timeoutOptions
|
||||
|
||||
@@ -210,6 +222,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: suspendDropdown
|
||||
settingKey: "suspendTimeout"
|
||||
tags: ["suspend", "sleep", "timeout", "idle", "system"]
|
||||
text: I18n.tr("Suspend system after")
|
||||
options: root.timeoutOptions
|
||||
|
||||
@@ -307,6 +321,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "powerMenuGridLayout"
|
||||
tags: ["power", "menu", "grid", "layout", "list"]
|
||||
text: I18n.tr("Use Grid Layout")
|
||||
description: I18n.tr("Display power menu actions in a grid instead of a list")
|
||||
checked: SettingsData.powerMenuGridLayout
|
||||
@@ -315,6 +331,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: defaultActionDropdown
|
||||
settingKey: "powerMenuDefaultAction"
|
||||
tags: ["power", "menu", "default", "action", "reboot", "logout", "shutdown"]
|
||||
text: I18n.tr("Default selected action")
|
||||
options: ["Reboot", "Log Out", "Power Off", "Lock", "Suspend", "Restart DMS", "Hibernate"]
|
||||
property var actionValues: ["reboot", "logout", "poweroff", "lock", "suspend", "restart", "hibernate"]
|
||||
@@ -381,6 +399,8 @@ Item {
|
||||
|
||||
SettingsToggleRow {
|
||||
required property var modelData
|
||||
settingKey: "powerMenuAction_" + modelData.key
|
||||
tags: ["power", "menu", "action", "show", modelData.key]
|
||||
text: modelData.label
|
||||
description: modelData.desc || ""
|
||||
visible: !modelData.hibernate || SessionService.hibernateSupported
|
||||
@@ -406,6 +426,8 @@ Item {
|
||||
settingKey: "powerConfirmation"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "powerActionConfirm"
|
||||
tags: ["power", "confirm", "hold", "button", "safety"]
|
||||
text: I18n.tr("Hold to Confirm Power Actions")
|
||||
description: I18n.tr("Require holding button/key to confirm power off, restart, suspend, hibernate and logout")
|
||||
checked: SettingsData.powerActionConfirm
|
||||
@@ -414,6 +436,8 @@ Item {
|
||||
|
||||
SettingsDropdownRow {
|
||||
id: holdDurationDropdown
|
||||
settingKey: "powerActionHoldDuration"
|
||||
tags: ["power", "hold", "duration", "confirm", "time"]
|
||||
property var durationOptions: ["250 ms", "500 ms", "750 ms", "1 second", "2 seconds", "3 seconds", "5 seconds", "10 seconds"]
|
||||
property var durationValues: [0.25, 0.5, 0.75, 1, 2, 3, 5, 10]
|
||||
|
||||
@@ -518,6 +542,8 @@ Item {
|
||||
expanded: false
|
||||
|
||||
SettingsSliderRow {
|
||||
settingKey: "batteryChargeLimit"
|
||||
tags: ["battery", "charge", "limit", "percentage", "power"]
|
||||
text: I18n.tr("Battery Charge Limit")
|
||||
description: I18n.tr("Note: this only changes the percentage, it does not actually limit charging.")
|
||||
value: SettingsData.batteryChargeLimit
|
||||
|
||||
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
@@ -16,6 +17,46 @@ Item {
|
||||
|
||||
property string text: ""
|
||||
property string description: ""
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
let flickable = findParentFlickable();
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(settingKey, root, flickable);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (settingKey)
|
||||
SettingsSearchService.unregisterCard(settingKey);
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.primary, root.isHighlighted ? 0.2 : 0)
|
||||
visible: root.isHighlighted
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property alias model: buttonGroup.model
|
||||
property alias currentIndex: buttonGroup.currentIndex
|
||||
property alias selectionMode: buttonGroup.selectionMode
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
DankDropdown {
|
||||
@@ -10,6 +12,45 @@ DankDropdown {
|
||||
property var tags: []
|
||||
property string settingKey: ""
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
width: parent?.width ?? 0
|
||||
addHorizontalPadding: true
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.primary, root.isHighlighted ? 0.2 : 0)
|
||||
visible: root.isHighlighted
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
let flickable = findParentFlickable();
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(settingKey, root, flickable);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (settingKey)
|
||||
SettingsSearchService.unregisterCard(settingKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
@@ -16,6 +17,45 @@ Item {
|
||||
|
||||
property string text: ""
|
||||
property string description: ""
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
let flickable = findParentFlickable();
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(settingKey, root, flickable);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (settingKey)
|
||||
SettingsSearchService.unregisterCard(settingKey);
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.primary, root.isHighlighted ? 0.2 : 0)
|
||||
visible: root.isHighlighted
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
}
|
||||
property alias value: slider.value
|
||||
property alias minimum: slider.minimum
|
||||
property alias maximum: slider.maximum
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
DankToggle {
|
||||
@@ -10,5 +12,44 @@ DankToggle {
|
||||
property var tags: []
|
||||
property string settingKey: ""
|
||||
|
||||
readonly property bool isHighlighted: settingKey !== "" && SettingsSearchService.highlightSection === settingKey
|
||||
|
||||
width: parent?.width ?? 0
|
||||
|
||||
function findParentFlickable() {
|
||||
let p = root.parent;
|
||||
while (p) {
|
||||
if (p.hasOwnProperty("contentY") && p.hasOwnProperty("contentItem"))
|
||||
return p;
|
||||
p = p.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!settingKey)
|
||||
return;
|
||||
let flickable = findParentFlickable();
|
||||
if (flickable)
|
||||
SettingsSearchService.registerCard(settingKey, root, flickable);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (settingKey)
|
||||
SettingsSearchService.unregisterCard(settingKey);
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.primary, root.isHighlighted ? 0.2 : 0)
|
||||
visible: root.isHighlighted
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ Item {
|
||||
settingKey: "workspaceSettings"
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showWorkspaceIndex"
|
||||
tags: ["workspace", "index", "numbers", "labels"]
|
||||
text: I18n.tr("Workspace Index Numbers")
|
||||
description: I18n.tr("Show workspace index numbers in the top bar workspace switcher")
|
||||
checked: SettingsData.showWorkspaceIndex
|
||||
@@ -34,6 +36,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showWorkspacePadding"
|
||||
tags: ["workspace", "padding", "minimum"]
|
||||
text: I18n.tr("Workspace Padding")
|
||||
description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available")
|
||||
checked: SettingsData.showWorkspacePadding
|
||||
@@ -41,6 +45,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showWorkspaceApps"
|
||||
tags: ["workspace", "apps", "icons", "applications"]
|
||||
text: I18n.tr("Show Workspace Apps")
|
||||
description: I18n.tr("Display application icons in workspace indicators")
|
||||
checked: SettingsData.showWorkspaceApps
|
||||
@@ -89,6 +95,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "workspacesPerMonitor"
|
||||
tags: ["workspace", "per-monitor", "multi-monitor"]
|
||||
text: I18n.tr("Per-Monitor Workspaces")
|
||||
description: I18n.tr("Show only workspaces belonging to each specific monitor.")
|
||||
checked: SettingsData.workspacesPerMonitor
|
||||
@@ -96,6 +104,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "showOccupiedWorkspacesOnly"
|
||||
tags: ["workspace", "occupied", "active", "windows"]
|
||||
text: I18n.tr("Show Occupied Workspaces Only")
|
||||
description: I18n.tr("Display only workspaces that contain windows")
|
||||
checked: SettingsData.showOccupiedWorkspacesOnly
|
||||
@@ -104,6 +114,8 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
settingKey: "dwlShowAllTags"
|
||||
tags: ["dwl", "tags", "workspace"]
|
||||
text: I18n.tr("Show All Tags")
|
||||
description: I18n.tr("Show all 9 tags instead of only occupied tags (DWL only)")
|
||||
checked: SettingsData.dwlShowAllTags
|
||||
|
||||
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
|
||||
Singleton {
|
||||
@@ -13,6 +14,37 @@ Singleton {
|
||||
property string targetSection: ""
|
||||
property string highlightSection: ""
|
||||
property var registeredCards: ({})
|
||||
property var settingsIndex: []
|
||||
property bool indexLoaded: false
|
||||
|
||||
readonly property var conditionMap: ({
|
||||
"isNiri": () => CompositorService.isNiri,
|
||||
"isHyprland": () => CompositorService.isHyprland,
|
||||
"isDwl": () => CompositorService.isDwl,
|
||||
"keybindsAvailable": () => KeybindsService.available,
|
||||
"soundsAvailable": () => AudioService.soundsAvailable,
|
||||
"cupsAvailable": () => CupsService.cupsAvailable,
|
||||
"networkNotLegacy": () => !NetworkService.usingLegacy,
|
||||
"dmsConnected": () => DMSService.isConnected && DMSService.apiVersion >= 23,
|
||||
"matugenAvailable": () => Theme.matugenAvailable
|
||||
})
|
||||
|
||||
Component.onCompleted: indexFile.reload()
|
||||
|
||||
FileView {
|
||||
id: indexFile
|
||||
path: Qt.resolvedUrl("../translations/settings_search_index.json")
|
||||
onLoaded: {
|
||||
try {
|
||||
root.settingsIndex = JSON.parse(text());
|
||||
root.indexLoaded = true;
|
||||
} catch (e) {
|
||||
console.warn("SettingsSearchService: Failed to parse index:", e);
|
||||
root.settingsIndex = [];
|
||||
}
|
||||
}
|
||||
onLoadFailed: error => console.warn("SettingsSearchService: Failed to load index:", error)
|
||||
}
|
||||
|
||||
function registerCard(settingKey, item, flickable) {
|
||||
if (!settingKey)
|
||||
@@ -21,9 +53,8 @@ Singleton {
|
||||
item: item,
|
||||
flickable: flickable
|
||||
};
|
||||
if (targetSection === settingKey) {
|
||||
if (targetSection === settingKey)
|
||||
scrollTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
function unregisterCard(settingKey) {
|
||||
@@ -36,9 +67,8 @@ Singleton {
|
||||
|
||||
function navigateToSection(section) {
|
||||
targetSection = section;
|
||||
if (registeredCards[section]) {
|
||||
if (registeredCards[section])
|
||||
scrollTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
function scrollToTarget() {
|
||||
@@ -54,7 +84,8 @@ Singleton {
|
||||
if (!contentItem)
|
||||
return;
|
||||
const mapped = item.mapToItem(contentItem, 0, 0);
|
||||
const targetY = Math.max(0, mapped.y - 16);
|
||||
const maxY = Math.max(0, flickable.contentHeight - flickable.height);
|
||||
const targetY = Math.min(maxY, Math.max(0, mapped.y - 16));
|
||||
flickable.contentY = targetY;
|
||||
|
||||
highlightSection = targetSection;
|
||||
@@ -78,577 +109,27 @@ Singleton {
|
||||
onTriggered: root.highlightSection = ""
|
||||
}
|
||||
|
||||
readonly property var settingsIndex: [
|
||||
{
|
||||
label: I18n.tr("Wallpaper"),
|
||||
keywords: ["background", "image", "picture", "desktop"],
|
||||
tabIndex: 0,
|
||||
icon: "wallpaper",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "wallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Per-Mode Wallpapers"),
|
||||
keywords: ["light", "dark", "mode", "theme"],
|
||||
tabIndex: 0,
|
||||
icon: "contrast",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "wallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Blur on Overview"),
|
||||
keywords: ["niri", "blur", "overview", "compositor"],
|
||||
tabIndex: 0,
|
||||
icon: "blur_on",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "blurWallpaper",
|
||||
condition: () => CompositorService.isNiri
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Per-Monitor Wallpapers"),
|
||||
keywords: ["multi-monitor", "display", "screen"],
|
||||
tabIndex: 0,
|
||||
icon: "monitor",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "wallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Automatic Cycling"),
|
||||
keywords: ["cycle", "rotate", "slideshow", "interval"],
|
||||
tabIndex: 0,
|
||||
icon: "slideshow",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "wallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Transition Effect"),
|
||||
keywords: ["animation", "change", "effect"],
|
||||
tabIndex: 0,
|
||||
icon: "animation",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "wallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Disable Built-in Wallpapers"),
|
||||
keywords: ["external", "swww", "hyprpaper", "swaybg"],
|
||||
tabIndex: 0,
|
||||
icon: "wallpaper",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "disableWallpaper"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Duplicate Wallpaper with Blur"),
|
||||
keywords: ["blur", "layer", "niri", "compositor"],
|
||||
tabIndex: 0,
|
||||
icon: "blur_on",
|
||||
category: I18n.tr("Personalization"),
|
||||
section: "blurWallpaper",
|
||||
condition: () => CompositorService.isNiri
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Time Format"),
|
||||
keywords: ["clock", "12h", "24h", "am", "pm"],
|
||||
tabIndex: 1,
|
||||
icon: "schedule",
|
||||
category: I18n.tr("Time & Weather"),
|
||||
section: "timeFormat"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Date Format"),
|
||||
keywords: ["calendar", "day", "month", "year"],
|
||||
tabIndex: 1,
|
||||
icon: "calendar_today",
|
||||
category: I18n.tr("Time & Weather"),
|
||||
section: "dateFormat"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Weather"),
|
||||
keywords: ["city", "temperature", "forecast", "location"],
|
||||
tabIndex: 1,
|
||||
icon: "thermostat",
|
||||
category: I18n.tr("Time & Weather"),
|
||||
section: "weather"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Temperature Unit"),
|
||||
keywords: ["celsius", "fahrenheit", "weather"],
|
||||
tabIndex: 1,
|
||||
icon: "thermostat",
|
||||
category: I18n.tr("Time & Weather"),
|
||||
section: "weather"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Keyboard Shortcuts"),
|
||||
keywords: ["keybinds", "hotkeys", "bindings"],
|
||||
tabIndex: 2,
|
||||
icon: "keyboard",
|
||||
category: I18n.tr("Keyboard Shortcuts"),
|
||||
section: "keybinds",
|
||||
condition: () => KeybindsService.available
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Configurations"),
|
||||
keywords: ["panel", "multiple", "dankbar", "manage"],
|
||||
tabIndex: 3,
|
||||
icon: "dashboard",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barConfigurations"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Position"),
|
||||
keywords: ["top", "bottom", "left", "right", "panel"],
|
||||
tabIndex: 3,
|
||||
icon: "vertical_align_center",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barPosition"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Display Assignment"),
|
||||
keywords: ["monitor", "screen", "display"],
|
||||
tabIndex: 3,
|
||||
icon: "display_settings",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barDisplay"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Visibility"),
|
||||
keywords: ["bar", "hide", "show", "auto-hide", "panel"],
|
||||
tabIndex: 3,
|
||||
icon: "visibility_off",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barVisibility"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Spacing"),
|
||||
keywords: ["gap", "margin", "padding", "spacing"],
|
||||
tabIndex: 3,
|
||||
icon: "space_bar",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barSpacing"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Corners & Background"),
|
||||
keywords: ["rounded", "radius", "shape", "transparent"],
|
||||
tabIndex: 3,
|
||||
icon: "rounded_corner",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barCorners"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Transparency"),
|
||||
keywords: ["opacity", "alpha", "translucent"],
|
||||
tabIndex: 3,
|
||||
icon: "opacity",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "barTransparency"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Workspaces"),
|
||||
keywords: ["workspace", "label", "icon", "desktop"],
|
||||
tabIndex: 4,
|
||||
icon: "view_module",
|
||||
category: I18n.tr("Workspaces"),
|
||||
section: "workspaceSettings"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Workspace Icons"),
|
||||
keywords: ["workspace", "named", "icon"],
|
||||
tabIndex: 4,
|
||||
icon: "label",
|
||||
category: I18n.tr("Workspaces"),
|
||||
section: "workspaceIcons"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Position"),
|
||||
keywords: ["taskbar", "bottom", "left", "right"],
|
||||
tabIndex: 5,
|
||||
icon: "dock_to_bottom",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockPosition"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Visibility"),
|
||||
keywords: ["hide", "show", "auto-hide", "taskbar"],
|
||||
tabIndex: 5,
|
||||
icon: "visibility_off",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockVisibility"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Behavior"),
|
||||
keywords: ["pinned", "apps", "click"],
|
||||
tabIndex: 5,
|
||||
icon: "apps",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockBehavior"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Sizing"),
|
||||
keywords: ["icon", "size", "scale"],
|
||||
tabIndex: 5,
|
||||
icon: "photo_size_select_large",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockSizing"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Spacing"),
|
||||
keywords: ["gap", "margin", "padding"],
|
||||
tabIndex: 5,
|
||||
icon: "space_bar",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockSpacing"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Transparency"),
|
||||
keywords: ["opacity", "alpha"],
|
||||
tabIndex: 5,
|
||||
icon: "opacity",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockTransparency"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Dock Border"),
|
||||
keywords: ["outline", "stroke"],
|
||||
tabIndex: 5,
|
||||
icon: "border_style",
|
||||
category: I18n.tr("Dock"),
|
||||
section: "dockBorder"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Network"),
|
||||
keywords: ["wifi", "ethernet", "internet", "connection"],
|
||||
tabIndex: 7,
|
||||
icon: "wifi",
|
||||
category: I18n.tr("Network"),
|
||||
section: "network",
|
||||
condition: () => !NetworkService.usingLegacy
|
||||
},
|
||||
{
|
||||
label: I18n.tr("CUPS Print Server"),
|
||||
keywords: ["cups", "print", "paper", "printer"],
|
||||
tabIndex: 8,
|
||||
icon: "print",
|
||||
category: I18n.tr("System"),
|
||||
section: "printers",
|
||||
condition: () => CupsService.cupsAvailable
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Launcher Logo"),
|
||||
keywords: ["app", "button", "icon", "drawer"],
|
||||
tabIndex: 9,
|
||||
icon: "grid_view",
|
||||
category: I18n.tr("Launcher"),
|
||||
section: "launcherLogo"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Launch Prefix"),
|
||||
keywords: ["terminal", "command", "prefix"],
|
||||
tabIndex: 9,
|
||||
icon: "terminal",
|
||||
category: I18n.tr("Launcher"),
|
||||
section: "launchPrefix"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Sorting & Layout"),
|
||||
keywords: ["grid", "list", "sort", "order"],
|
||||
tabIndex: 9,
|
||||
icon: "sort_by_alpha",
|
||||
category: I18n.tr("Launcher"),
|
||||
section: "launcherSorting"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Recent Apps"),
|
||||
keywords: ["history", "recent", "apps"],
|
||||
tabIndex: 9,
|
||||
icon: "history",
|
||||
category: I18n.tr("Launcher"),
|
||||
section: "recentApps"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Theme Color"),
|
||||
keywords: ["palette", "accent", "primary", "appearance"],
|
||||
tabIndex: 10,
|
||||
icon: "palette",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "themeColor"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Color Mode"),
|
||||
keywords: ["light", "dark", "mode", "appearance"],
|
||||
tabIndex: 10,
|
||||
icon: "contrast",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "colorMode"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Widget Styling"),
|
||||
keywords: ["colorful", "default", "appearance", "transparency"],
|
||||
tabIndex: 10,
|
||||
icon: "widgets",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "widgetStyling"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Niri Layout Overrides"),
|
||||
keywords: ["gaps", "radius", "window", "niri"],
|
||||
tabIndex: 10,
|
||||
icon: "crop_square",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "niriLayout",
|
||||
condition: () => CompositorService.isNiri
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Modal Background"),
|
||||
keywords: ["overlay", "dim", "popup", "modal", "darken"],
|
||||
tabIndex: 10,
|
||||
icon: "brightness_low",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "modalBackground"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Applications"),
|
||||
keywords: ["dark", "system", "xdg", "portal", "terminal"],
|
||||
tabIndex: 10,
|
||||
icon: "apps",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "applications"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Matugen Templates"),
|
||||
keywords: ["gtk", "qt", "firefox", "theming"],
|
||||
tabIndex: 10,
|
||||
icon: "auto_awesome",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "matugenTemplates"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Icon Theme"),
|
||||
keywords: ["icons", "system", "adwaita"],
|
||||
tabIndex: 10,
|
||||
icon: "palette",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "iconTheme"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("System App Theming"),
|
||||
keywords: ["gtk", "qt", "application", "theming"],
|
||||
tabIndex: 10,
|
||||
icon: "settings",
|
||||
category: I18n.tr("Theme & Colors"),
|
||||
section: "systemAppTheming"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Lock Screen Layout"),
|
||||
keywords: ["lock", "power", "security", "layout"],
|
||||
tabIndex: 11,
|
||||
icon: "lock",
|
||||
category: I18n.tr("Lock Screen"),
|
||||
section: "lockLayout"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Lock Screen Behaviour"),
|
||||
keywords: ["dbus", "systemd", "lock", "behavior", "fingerprint"],
|
||||
tabIndex: 11,
|
||||
icon: "lock",
|
||||
category: I18n.tr("Lock Screen"),
|
||||
section: "lockBehavior"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Lock Screen Display"),
|
||||
keywords: ["display", "screen", "oled", "dpms", "monitor"],
|
||||
tabIndex: 11,
|
||||
icon: "monitor",
|
||||
category: I18n.tr("Lock Screen"),
|
||||
section: "lockDisplay"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Plugins"),
|
||||
keywords: ["extension", "addon", "widget"],
|
||||
tabIndex: 12,
|
||||
icon: "extension",
|
||||
category: I18n.tr("Plugins"),
|
||||
section: "plugins"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("About"),
|
||||
keywords: ["version", "info", "credits"],
|
||||
tabIndex: 13,
|
||||
icon: "info",
|
||||
category: I18n.tr("About"),
|
||||
section: "about"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Typography"),
|
||||
keywords: ["font", "family", "text", "typeface"],
|
||||
tabIndex: 14,
|
||||
icon: "text_fields",
|
||||
category: I18n.tr("Typography & Motion"),
|
||||
section: "typography"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Animation Speed"),
|
||||
keywords: ["motion", "speed", "transition", "duration"],
|
||||
tabIndex: 14,
|
||||
icon: "animation",
|
||||
category: I18n.tr("Typography & Motion"),
|
||||
section: "animationSpeed"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("System Sounds"),
|
||||
keywords: ["audio", "effects", "notification", "theme", "volume"],
|
||||
tabIndex: 15,
|
||||
icon: "volume_up",
|
||||
category: I18n.tr("Sounds"),
|
||||
section: "systemSounds",
|
||||
condition: () => AudioService.soundsAvailable
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Media Player"),
|
||||
keywords: ["mpris", "music", "controls", "style", "scroll"],
|
||||
tabIndex: 16,
|
||||
icon: "music_note",
|
||||
category: I18n.tr("Media Player"),
|
||||
section: "mediaPlayer"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Notification Popups"),
|
||||
keywords: ["toast", "alert", "message", "position"],
|
||||
tabIndex: 17,
|
||||
icon: "notifications",
|
||||
category: I18n.tr("Notifications"),
|
||||
section: "notificationPopups"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Do Not Disturb"),
|
||||
keywords: ["dnd", "quiet", "silent", "notification"],
|
||||
tabIndex: 17,
|
||||
icon: "notifications_off",
|
||||
category: I18n.tr("Notifications"),
|
||||
section: "doNotDisturb"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Notification Timeouts"),
|
||||
keywords: ["duration", "dismiss", "popup", "low", "normal", "critical"],
|
||||
tabIndex: 17,
|
||||
icon: "timer",
|
||||
category: I18n.tr("Notifications"),
|
||||
section: "notificationTimeouts"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("On-screen Displays"),
|
||||
keywords: ["osd", "volume", "brightness", "indicator", "position"],
|
||||
tabIndex: 18,
|
||||
icon: "tune",
|
||||
category: I18n.tr("On-screen Displays"),
|
||||
section: "osd"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Running Apps"),
|
||||
keywords: ["taskbar", "window", "active", "style"],
|
||||
tabIndex: 19,
|
||||
icon: "apps",
|
||||
category: I18n.tr("Running Apps"),
|
||||
section: "runningApps",
|
||||
condition: () => CompositorService.isNiri || CompositorService.isHyprland
|
||||
},
|
||||
{
|
||||
label: I18n.tr("System Updater"),
|
||||
keywords: ["package", "update", "upgrade", "widget"],
|
||||
tabIndex: 20,
|
||||
icon: "refresh",
|
||||
category: I18n.tr("System Updater"),
|
||||
section: "systemUpdater"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Idle Settings"),
|
||||
keywords: ["suspend", "hibernate", "idle", "timeout", "lock", "dpms"],
|
||||
tabIndex: 21,
|
||||
icon: "schedule",
|
||||
category: I18n.tr("Power & Sleep"),
|
||||
section: "idleSettings"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Power Menu"),
|
||||
keywords: ["shutdown", "reboot", "logout", "layout"],
|
||||
tabIndex: 21,
|
||||
icon: "power_settings_new",
|
||||
category: I18n.tr("Power & Sleep"),
|
||||
section: "powerMenu"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Power Confirmation"),
|
||||
keywords: ["hold", "confirm", "safety"],
|
||||
tabIndex: 21,
|
||||
icon: "check_circle",
|
||||
category: I18n.tr("Power & Sleep"),
|
||||
section: "powerConfirmation"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Custom Power Actions"),
|
||||
keywords: ["lock", "logout", "suspend", "script", "command"],
|
||||
tabIndex: 21,
|
||||
icon: "developer_mode",
|
||||
category: I18n.tr("Power & Sleep"),
|
||||
section: "customPowerActions"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Power Advanced"),
|
||||
keywords: ["battery", "charge", "limit", "inhibit", "caffeine"],
|
||||
tabIndex: 21,
|
||||
icon: "tune",
|
||||
category: I18n.tr("Power & Sleep"),
|
||||
section: "powerAdvanced"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Bar Widgets"),
|
||||
keywords: ["dankbar", "customize", "order", "left", "center", "right"],
|
||||
tabIndex: 22,
|
||||
icon: "widgets",
|
||||
category: I18n.tr("Dank Bar"),
|
||||
section: "widgets"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Clipboard"),
|
||||
keywords: ["copy", "paste", "cliphist", "history"],
|
||||
tabIndex: 23,
|
||||
icon: "content_paste",
|
||||
category: I18n.tr("System"),
|
||||
section: "clipboard",
|
||||
condition: () => DMSService.isConnected && DMSService.apiVersion >= 23
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Monitor Configuration"),
|
||||
keywords: ["display", "resolution", "refresh"],
|
||||
tabIndex: 24,
|
||||
icon: "display_settings",
|
||||
category: I18n.tr("Displays"),
|
||||
section: "displayConfig"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Gamma Control"),
|
||||
keywords: ["brightness", "color", "temperature", "night", "blue"],
|
||||
tabIndex: 25,
|
||||
icon: "brightness_6",
|
||||
category: I18n.tr("Displays"),
|
||||
section: "gammaControl"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Display Widgets"),
|
||||
keywords: ["monitor", "position", "screen"],
|
||||
tabIndex: 26,
|
||||
icon: "widgets",
|
||||
category: I18n.tr("Displays"),
|
||||
section: "displayWidgets"
|
||||
},
|
||||
{
|
||||
label: I18n.tr("Desktop Widgets"),
|
||||
keywords: ["clock", "monitor", "conky", "desktop"],
|
||||
tabIndex: 27,
|
||||
icon: "widgets",
|
||||
category: I18n.tr("Desktop Widgets"),
|
||||
section: "desktopWidgets"
|
||||
}
|
||||
]
|
||||
function checkCondition(item) {
|
||||
if (!item.conditionKey)
|
||||
return true;
|
||||
const condFn = conditionMap[item.conditionKey];
|
||||
if (!condFn)
|
||||
return true;
|
||||
return condFn();
|
||||
}
|
||||
|
||||
function translateItem(item) {
|
||||
return {
|
||||
section: item.section,
|
||||
label: I18n.tr(item.label),
|
||||
tabIndex: item.tabIndex,
|
||||
category: I18n.tr(item.category),
|
||||
keywords: item.keywords || [],
|
||||
icon: item.icon || "settings",
|
||||
description: item.description ? I18n.tr(item.description) : "",
|
||||
conditionKey: item.conditionKey
|
||||
};
|
||||
}
|
||||
|
||||
function search(text) {
|
||||
query = text;
|
||||
@@ -662,11 +143,12 @@ Singleton {
|
||||
const scored = [];
|
||||
|
||||
for (const item of settingsIndex) {
|
||||
if (item.condition && !item.condition())
|
||||
if (!checkCondition(item))
|
||||
continue;
|
||||
|
||||
const labelLower = item.label.toLowerCase();
|
||||
const categoryLower = item.category.toLowerCase();
|
||||
const translated = translateItem(item);
|
||||
const labelLower = translated.label.toLowerCase();
|
||||
const categoryLower = translated.category.toLowerCase();
|
||||
let score = 0;
|
||||
|
||||
if (labelLower === queryLower) {
|
||||
@@ -708,7 +190,7 @@ Singleton {
|
||||
|
||||
if (score > 0) {
|
||||
scored.push({
|
||||
item: item,
|
||||
item: translated,
|
||||
score: score
|
||||
});
|
||||
}
|
||||
|
||||
370
quickshell/translations/extract_settings_index.py
Executable file
370
quickshell/translations/extract_settings_index.py
Executable file
@@ -0,0 +1,370 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import re
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ABBREVIATIONS = {
|
||||
"on-screen displays": ["osd"],
|
||||
"on-screen display": ["osd"],
|
||||
"do not disturb": ["dnd"],
|
||||
"keyboard shortcuts": ["keybinds", "hotkeys", "bindings", "keys"],
|
||||
"notifications": ["notif", "notifs", "alerts"],
|
||||
"notification": ["notif", "alert"],
|
||||
"wallpaper": ["background", "bg", "image", "picture", "desktop"],
|
||||
"transparency": ["opacity", "alpha", "translucent", "transparent"],
|
||||
"visibility": ["visible", "hide", "show", "hidden", "autohide", "auto-hide"],
|
||||
"temperature": ["temp", "celsius", "fahrenheit"],
|
||||
"configuration": ["config", "configure", "setup"],
|
||||
"applications": ["apps", "programs"],
|
||||
"application": ["app", "program"],
|
||||
"animation": ["motion", "transition", "animate", "animations"],
|
||||
"typography": ["font", "fonts", "text", "typeface"],
|
||||
"workspaces": ["workspace", "desktops", "virtual"],
|
||||
"workspace": ["desktop", "virtual"],
|
||||
"bluetooth": ["bt"],
|
||||
"network": ["wifi", "wi-fi", "ethernet", "internet", "connection", "wireless"],
|
||||
"display": ["monitor", "screen", "output"],
|
||||
"displays": ["monitors", "screens", "outputs"],
|
||||
"brightness": ["bright", "dim", "backlight"],
|
||||
"volume": ["audio", "sound", "speaker", "loudness"],
|
||||
"battery": ["power", "charge", "charging"],
|
||||
"clock": ["time", "watch"],
|
||||
"calendar": ["date", "day", "month", "year"],
|
||||
"launcher": ["app drawer", "app menu", "start menu", "applications"],
|
||||
"dock": ["taskbar", "panel"],
|
||||
"bar": ["panel", "taskbar", "topbar", "statusbar"],
|
||||
"theme": ["appearance", "look", "style", "colors", "colour"],
|
||||
"color": ["colour", "hue", "tint"],
|
||||
"colors": ["colours", "palette"],
|
||||
"dark": ["night", "dark mode"],
|
||||
"light": ["day", "light mode"],
|
||||
"lock screen": ["lockscreen", "login", "security"],
|
||||
"power": ["shutdown", "reboot", "restart", "suspend", "hibernate", "sleep"],
|
||||
"idle": ["afk", "inactive", "timeout", "screensaver"],
|
||||
"gamma": ["color temperature", "night light", "blue light", "redshift"],
|
||||
"media player": ["mpris", "music", "audio", "playback"],
|
||||
"clipboard": ["copy", "paste", "cliphist", "history"],
|
||||
"updater": ["updates", "upgrade", "packages"],
|
||||
"plugins": ["extensions", "addons", "widgets"],
|
||||
"spacing": ["gap", "gaps", "margin", "margins", "padding"],
|
||||
"corner": ["corners", "rounded", "radius", "round"],
|
||||
"matugen": ["dynamic", "wallpaper colors", "material"],
|
||||
"running apps": ["taskbar", "windows", "active", "open"],
|
||||
"weather": ["forecast", "temperature", "climate"],
|
||||
"sounds": ["audio", "effects", "sfx"],
|
||||
"printers": ["print", "cups", "printing"],
|
||||
"widgets": ["components", "modules"],
|
||||
}
|
||||
|
||||
CATEGORY_KEYWORDS = {
|
||||
"Personalization": ["customize", "custom", "personal", "appearance"],
|
||||
"Time & Weather": ["clock", "forecast", "date"],
|
||||
"Keyboard Shortcuts": ["keys", "bindings", "hotkey"],
|
||||
"Dank Bar": ["panel", "topbar", "statusbar"],
|
||||
"Workspaces": ["virtual desktops", "spaces"],
|
||||
"Dock": ["taskbar", "launcher bar"],
|
||||
"Network": ["connectivity", "online"],
|
||||
"System": ["os", "linux"],
|
||||
"Launcher": ["start", "menu", "drawer"],
|
||||
"Theme & Colors": ["appearance", "look", "style", "scheme"],
|
||||
"Lock Screen": ["security", "login", "password"],
|
||||
"Plugins": ["extend", "addon"],
|
||||
"About": ["info", "version", "credits", "help"],
|
||||
"Typography & Motion": ["fonts", "animation", "text"],
|
||||
"Sounds": ["audio", "sfx", "effects"],
|
||||
"Media Player": ["music", "spotify", "mpris"],
|
||||
"Notifications": ["alerts", "messages", "toast"],
|
||||
"On-screen Displays": ["osd", "indicator", "popup"],
|
||||
"Running Apps": ["windows", "tasks", "active"],
|
||||
"System Updater": ["packages", "upgrade"],
|
||||
"Power & Sleep": ["shutdown", "suspend", "energy"],
|
||||
"Displays": ["monitor", "screen", "resolution"],
|
||||
"Desktop Widgets": ["conky", "desktop clock"],
|
||||
}
|
||||
|
||||
TAB_INDEX_MAP = {
|
||||
"WallpaperTab.qml": 0,
|
||||
"TimeWeatherTab.qml": 1,
|
||||
"KeybindsTab.qml": 2,
|
||||
"DankBarTab.qml": 3,
|
||||
"WorkspacesTab.qml": 4,
|
||||
"DockTab.qml": 5,
|
||||
"NetworkTab.qml": 7,
|
||||
"PrinterTab.qml": 8,
|
||||
"LauncherTab.qml": 9,
|
||||
"ThemeColorsTab.qml": 10,
|
||||
"LockScreenTab.qml": 11,
|
||||
"PluginsTab.qml": 12,
|
||||
"AboutTab.qml": 13,
|
||||
"TypographyMotionTab.qml": 14,
|
||||
"SoundsTab.qml": 15,
|
||||
"MediaPlayerTab.qml": 16,
|
||||
"NotificationsTab.qml": 17,
|
||||
"OSDTab.qml": 18,
|
||||
"RunningAppsTab.qml": 19,
|
||||
"SystemUpdaterTab.qml": 20,
|
||||
"PowerSleepTab.qml": 21,
|
||||
"WidgetsTab.qml": 22,
|
||||
"ClipboardTab.qml": 23,
|
||||
"DisplayConfigTab.qml": 24,
|
||||
"GammaControlTab.qml": 25,
|
||||
"DisplayWidgetsTab.qml": 26,
|
||||
"DesktopWidgetsTab.qml": 27,
|
||||
}
|
||||
|
||||
TAB_CATEGORY_MAP = {
|
||||
0: "Personalization",
|
||||
1: "Time & Weather",
|
||||
2: "Keyboard Shortcuts",
|
||||
3: "Dank Bar",
|
||||
4: "Workspaces",
|
||||
5: "Dock",
|
||||
7: "Network",
|
||||
8: "System",
|
||||
9: "Launcher",
|
||||
10: "Theme & Colors",
|
||||
11: "Lock Screen",
|
||||
12: "Plugins",
|
||||
13: "About",
|
||||
14: "Typography & Motion",
|
||||
15: "Sounds",
|
||||
16: "Media Player",
|
||||
17: "Notifications",
|
||||
18: "On-screen Displays",
|
||||
19: "Running Apps",
|
||||
20: "System Updater",
|
||||
21: "Power & Sleep",
|
||||
22: "Dank Bar",
|
||||
23: "System",
|
||||
24: "Displays",
|
||||
25: "Displays",
|
||||
26: "Displays",
|
||||
27: "Desktop Widgets",
|
||||
}
|
||||
|
||||
SEARCHABLE_COMPONENTS = [
|
||||
"SettingsCard",
|
||||
"SettingsToggleRow",
|
||||
"SettingsSliderCard",
|
||||
"SettingsDropdownRow",
|
||||
"SettingsButtonGroupRow",
|
||||
"SettingsSliderRow",
|
||||
"SettingsToggleCard",
|
||||
]
|
||||
|
||||
def enrich_keywords(label, description, category, existing_tags):
|
||||
keywords = set(existing_tags)
|
||||
|
||||
label_lower = label.lower()
|
||||
label_words = re.split(r'[\s\-_&/]+', label_lower)
|
||||
keywords.update(w for w in label_words if len(w) > 2)
|
||||
|
||||
for term, aliases in ABBREVIATIONS.items():
|
||||
if term in label_lower:
|
||||
keywords.update(aliases)
|
||||
|
||||
if description:
|
||||
desc_lower = description.lower()
|
||||
desc_words = re.split(r'[\s\-_&/,.]+', desc_lower)
|
||||
keywords.update(w for w in desc_words if len(w) > 3 and w.isalpha())
|
||||
for term, aliases in ABBREVIATIONS.items():
|
||||
if term in desc_lower:
|
||||
keywords.update(aliases)
|
||||
|
||||
if category in CATEGORY_KEYWORDS:
|
||||
keywords.update(CATEGORY_KEYWORDS[category])
|
||||
|
||||
cat_lower = category.lower()
|
||||
cat_words = re.split(r'[\s\-_&/]+', cat_lower)
|
||||
keywords.update(w for w in cat_words if len(w) > 2)
|
||||
|
||||
stopwords = {'the', 'and', 'for', 'with', 'from', 'this', 'that', 'are', 'was',
|
||||
'will', 'can', 'has', 'have', 'been', 'when', 'your', 'use', 'used',
|
||||
'using', 'instead', 'like', 'such', 'also', 'only', 'which', 'each',
|
||||
'other', 'some', 'into', 'than', 'then', 'them', 'these', 'those'}
|
||||
keywords = {k for k in keywords if k not in stopwords and len(k) > 1}
|
||||
|
||||
return sorted(keywords)
|
||||
|
||||
def extract_i18n_string(value):
|
||||
match = re.search(r'I18n\.tr\(["\']([^"\']+)["\']', value)
|
||||
if match:
|
||||
return match.group(1)
|
||||
match = re.search(r'^["\']([^"\']+)["\']$', value.strip())
|
||||
if match:
|
||||
return match.group(1)
|
||||
return None
|
||||
|
||||
def extract_tags(value):
|
||||
match = re.search(r'\[([^\]]+)\]', value)
|
||||
if not match:
|
||||
return []
|
||||
content = match.group(1)
|
||||
tags = re.findall(r'["\']([^"\']+)["\']', content)
|
||||
return tags
|
||||
|
||||
def parse_component_block(content, start_pos, component_name):
|
||||
brace_count = 0
|
||||
started = False
|
||||
block_start = start_pos
|
||||
|
||||
for i in range(start_pos, len(content)):
|
||||
if content[i] == '{':
|
||||
if not started:
|
||||
block_start = i
|
||||
started = True
|
||||
brace_count += 1
|
||||
elif content[i] == '}':
|
||||
brace_count -= 1
|
||||
if started and brace_count == 0:
|
||||
return content[block_start:i+1]
|
||||
return ""
|
||||
|
||||
def extract_property(block, prop_name):
|
||||
pattern = rf'{prop_name}\s*:\s*([^\n]+)'
|
||||
match = re.search(pattern, block)
|
||||
if match:
|
||||
return match.group(1).strip()
|
||||
return None
|
||||
|
||||
def find_settings_components(content, filename):
|
||||
results = []
|
||||
tab_index = TAB_INDEX_MAP.get(filename, -1)
|
||||
|
||||
if tab_index == -1:
|
||||
return results
|
||||
|
||||
for component in SEARCHABLE_COMPONENTS:
|
||||
pattern = rf'\b{component}\s*\{{'
|
||||
for match in re.finditer(pattern, content):
|
||||
block = parse_component_block(content, match.start(), component)
|
||||
if not block:
|
||||
continue
|
||||
|
||||
setting_key = extract_property(block, "settingKey")
|
||||
if setting_key:
|
||||
setting_key = setting_key.strip('"\'')
|
||||
|
||||
if not setting_key:
|
||||
continue
|
||||
|
||||
title_raw = extract_property(block, "title")
|
||||
text_raw = extract_property(block, "text")
|
||||
label = None
|
||||
if title_raw:
|
||||
label = extract_i18n_string(title_raw)
|
||||
if not label and text_raw:
|
||||
label = extract_i18n_string(text_raw)
|
||||
|
||||
if not label:
|
||||
continue
|
||||
|
||||
icon_raw = extract_property(block, "iconName")
|
||||
icon = None
|
||||
if icon_raw:
|
||||
icon = icon_raw.strip('"\'')
|
||||
if icon.startswith("{") or "?" in icon:
|
||||
icon = None
|
||||
|
||||
tags_raw = extract_property(block, "tags")
|
||||
tags = []
|
||||
if tags_raw:
|
||||
tags = extract_tags(tags_raw)
|
||||
|
||||
desc_raw = extract_property(block, "description")
|
||||
description = None
|
||||
if desc_raw:
|
||||
description = extract_i18n_string(desc_raw)
|
||||
|
||||
visible_raw = extract_property(block, "visible")
|
||||
condition_key = None
|
||||
if visible_raw:
|
||||
if "CompositorService.isNiri" in visible_raw:
|
||||
condition_key = "isNiri"
|
||||
elif "CompositorService.isHyprland" in visible_raw:
|
||||
condition_key = "isHyprland"
|
||||
elif "KeybindsService.available" in visible_raw:
|
||||
condition_key = "keybindsAvailable"
|
||||
elif "AudioService.soundsAvailable" in visible_raw:
|
||||
condition_key = "soundsAvailable"
|
||||
elif "CupsService.cupsAvailable" in visible_raw:
|
||||
condition_key = "cupsAvailable"
|
||||
elif "NetworkService.usingLegacy" in visible_raw:
|
||||
condition_key = "networkNotLegacy"
|
||||
elif "DMSService.isConnected" in visible_raw:
|
||||
condition_key = "dmsConnected"
|
||||
elif "Theme.matugenAvailable" in visible_raw:
|
||||
condition_key = "matugenAvailable"
|
||||
elif "CompositorService.isDwl" in visible_raw:
|
||||
condition_key = "isDwl"
|
||||
|
||||
category = TAB_CATEGORY_MAP.get(tab_index, "Settings")
|
||||
enriched_keywords = enrich_keywords(label, description, category, tags)
|
||||
|
||||
entry = {
|
||||
"section": setting_key,
|
||||
"label": label,
|
||||
"tabIndex": tab_index,
|
||||
"category": category,
|
||||
"keywords": enriched_keywords,
|
||||
}
|
||||
|
||||
if icon:
|
||||
entry["icon"] = icon
|
||||
if description:
|
||||
entry["description"] = description
|
||||
if condition_key:
|
||||
entry["conditionKey"] = condition_key
|
||||
|
||||
results.append(entry)
|
||||
|
||||
return results
|
||||
|
||||
def extract_settings_index(root_dir):
|
||||
settings_dir = Path(root_dir) / "Modules" / "Settings"
|
||||
all_entries = []
|
||||
seen_keys = set()
|
||||
|
||||
for qml_file in settings_dir.glob("*.qml"):
|
||||
if not qml_file.name.endswith("Tab.qml"):
|
||||
continue
|
||||
|
||||
with open(qml_file, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
entries = find_settings_components(content, qml_file.name)
|
||||
for entry in entries:
|
||||
key = entry["section"]
|
||||
if key not in seen_keys:
|
||||
seen_keys.add(key)
|
||||
all_entries.append(entry)
|
||||
|
||||
return all_entries
|
||||
|
||||
def main():
|
||||
script_dir = Path(__file__).parent
|
||||
root_dir = script_dir.parent
|
||||
|
||||
print("Extracting settings search index...")
|
||||
entries = extract_settings_index(root_dir)
|
||||
|
||||
entries.sort(key=lambda x: (x["tabIndex"], x["label"]))
|
||||
|
||||
output_path = script_dir / "settings_search_index.json"
|
||||
with open(output_path, 'w', encoding='utf-8') as f:
|
||||
json.dump(entries, f, indent=2, ensure_ascii=False)
|
||||
|
||||
print(f"Found {len(entries)} searchable settings")
|
||||
print(f"Output: {output_path}")
|
||||
|
||||
conditions = set()
|
||||
for entry in entries:
|
||||
if "conditionKey" in entry:
|
||||
conditions.add(entry["conditionKey"])
|
||||
|
||||
if conditions:
|
||||
print(f"Condition keys found: {', '.join(sorted(conditions))}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
3666
quickshell/translations/settings_search_index.json
Normal file
3666
quickshell/translations/settings_search_index.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user