mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-18 17:15:20 -04:00
fix(settings): dedupe search index tab entries (#2643)
This commit is contained in:
@@ -452,8 +452,14 @@ def parse_tabs_from_sidebar(sidebar_file):
|
|||||||
return tabs
|
return tabs
|
||||||
|
|
||||||
|
|
||||||
def generate_tab_entries(sidebar_file):
|
def generate_tab_entries(sidebar_file, settings_entries=None):
|
||||||
tabs = parse_tabs_from_sidebar(sidebar_file)
|
tabs = parse_tabs_from_sidebar(sidebar_file)
|
||||||
|
settings_entries = settings_entries or []
|
||||||
|
highlightable_labels = {
|
||||||
|
(entry["tabIndex"], entry["label"])
|
||||||
|
for entry in settings_entries
|
||||||
|
if not str(entry["section"]).startswith("_tab_")
|
||||||
|
}
|
||||||
|
|
||||||
label_counts = Counter([t["label"] for t in tabs])
|
label_counts = Counter([t["label"] for t in tabs])
|
||||||
|
|
||||||
@@ -466,6 +472,9 @@ def generate_tab_entries(sidebar_file):
|
|||||||
)
|
)
|
||||||
category = TAB_CATEGORY_MAP.get(tab["tabIndex"], "Settings")
|
category = TAB_CATEGORY_MAP.get(tab["tabIndex"], "Settings")
|
||||||
|
|
||||||
|
if (tab["tabIndex"], label) in highlightable_labels:
|
||||||
|
continue
|
||||||
|
|
||||||
keywords = enrich_keywords(tab["label"], None, category, [])
|
keywords = enrich_keywords(tab["label"], None, category, [])
|
||||||
|
|
||||||
if tab["parent"]:
|
if tab["parent"]:
|
||||||
@@ -543,7 +552,7 @@ def main():
|
|||||||
|
|
||||||
print("Extracting settings search index...")
|
print("Extracting settings search index...")
|
||||||
settings_entries = extract_settings_index(root_dir)
|
settings_entries = extract_settings_index(root_dir)
|
||||||
tab_entries = generate_tab_entries(sidebar_file)
|
tab_entries = generate_tab_entries(sidebar_file, settings_entries)
|
||||||
|
|
||||||
all_entries = tab_entries + settings_entries
|
all_entries = tab_entries + settings_entries
|
||||||
|
|
||||||
|
|||||||
@@ -428,6 +428,28 @@
|
|||||||
],
|
],
|
||||||
"description": "Automatically determine your location using your IP address"
|
"description": "Automatically determine your location using your IP address"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "calendarBackend",
|
||||||
|
"label": "Calendar Backend",
|
||||||
|
"tabIndex": 1,
|
||||||
|
"category": "Time & Weather",
|
||||||
|
"keywords": [
|
||||||
|
"backend",
|
||||||
|
"calendar",
|
||||||
|
"clock",
|
||||||
|
"daemon",
|
||||||
|
"dankcalendar",
|
||||||
|
"date",
|
||||||
|
"day",
|
||||||
|
"events",
|
||||||
|
"forecast",
|
||||||
|
"khal",
|
||||||
|
"month",
|
||||||
|
"time",
|
||||||
|
"weather",
|
||||||
|
"year"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "dateFormat",
|
"section": "dateFormat",
|
||||||
"label": "Date Format",
|
"label": "Date Format",
|
||||||
@@ -1818,21 +1840,6 @@
|
|||||||
"icon": "rounded_corner",
|
"icon": "rounded_corner",
|
||||||
"description": "Remove corner rounding from the bar"
|
"description": "Remove corner rounding from the bar"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_6",
|
|
||||||
"label": "Dank Bar",
|
|
||||||
"tabIndex": 6,
|
|
||||||
"category": "Dank Bar",
|
|
||||||
"keywords": [
|
|
||||||
"bar",
|
|
||||||
"dank",
|
|
||||||
"panel",
|
|
||||||
"statusbar",
|
|
||||||
"taskbar",
|
|
||||||
"topbar"
|
|
||||||
],
|
|
||||||
"icon": "toolbar"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "barAppearance",
|
"section": "barAppearance",
|
||||||
"label": "Dank Bar",
|
"label": "Dank Bar",
|
||||||
@@ -6369,25 +6376,6 @@
|
|||||||
],
|
],
|
||||||
"description": "Choose where on-screen displays appear on screen"
|
"description": "Choose where on-screen displays appear on screen"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_18",
|
|
||||||
"label": "On-screen Displays",
|
|
||||||
"tabIndex": 18,
|
|
||||||
"category": "On-screen Displays",
|
|
||||||
"keywords": [
|
|
||||||
"displays",
|
|
||||||
"indicator",
|
|
||||||
"monitor",
|
|
||||||
"monitors",
|
|
||||||
"osd",
|
|
||||||
"output",
|
|
||||||
"outputs",
|
|
||||||
"popup",
|
|
||||||
"screen",
|
|
||||||
"screens"
|
|
||||||
],
|
|
||||||
"icon": "tune"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "osd",
|
"section": "osd",
|
||||||
"label": "On-screen Displays",
|
"label": "On-screen Displays",
|
||||||
@@ -6523,20 +6511,6 @@
|
|||||||
"icon": "tune",
|
"icon": "tune",
|
||||||
"description": "Open a terminal and run a custom command instead of the in-shell upgrade flow."
|
"description": "Open a terminal and run a custom command instead of the in-shell upgrade flow."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_20",
|
|
||||||
"label": "System Updater",
|
|
||||||
"tabIndex": 20,
|
|
||||||
"category": "System Updater",
|
|
||||||
"keywords": [
|
|
||||||
"packages",
|
|
||||||
"system",
|
|
||||||
"updater",
|
|
||||||
"updates",
|
|
||||||
"upgrade"
|
|
||||||
],
|
|
||||||
"icon": "refresh"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "systemUpdater",
|
"section": "systemUpdater",
|
||||||
"label": "System Updater",
|
"label": "System Updater",
|
||||||
@@ -7991,19 +7965,6 @@
|
|||||||
],
|
],
|
||||||
"description": "Reveal the arcs where surfaces meet the frame"
|
"description": "Reveal the arcs where surfaces meet the frame"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_33",
|
|
||||||
"label": "Frame",
|
|
||||||
"tabIndex": 33,
|
|
||||||
"category": "Frame",
|
|
||||||
"keywords": [
|
|
||||||
"border",
|
|
||||||
"decoration",
|
|
||||||
"frame",
|
|
||||||
"window"
|
|
||||||
],
|
|
||||||
"icon": "frame_source"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "frameEnabled",
|
"section": "frameEnabled",
|
||||||
"label": "Frame",
|
"label": "Frame",
|
||||||
@@ -8882,23 +8843,6 @@
|
|||||||
],
|
],
|
||||||
"description": "Space between windows"
|
"description": "Space between windows"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_38",
|
|
||||||
"label": "Window Rules",
|
|
||||||
"tabIndex": 38,
|
|
||||||
"category": "Applications",
|
|
||||||
"keywords": [
|
|
||||||
"applications",
|
|
||||||
"apps",
|
|
||||||
"floating",
|
|
||||||
"matching",
|
|
||||||
"programs",
|
|
||||||
"rules",
|
|
||||||
"window"
|
|
||||||
],
|
|
||||||
"icon": "select_window",
|
|
||||||
"conditionKey": "windowRulesCapable"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "windowRules",
|
"section": "windowRules",
|
||||||
"label": "Window Rules",
|
"label": "Window Rules",
|
||||||
@@ -8922,19 +8866,6 @@
|
|||||||
"description": "Define compositor rules for window behavior",
|
"description": "Define compositor rules for window behavior",
|
||||||
"conditionKey": "windowRulesCapable"
|
"conditionKey": "windowRulesCapable"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_39",
|
|
||||||
"label": "Ethernet",
|
|
||||||
"tabIndex": 39,
|
|
||||||
"category": "Network",
|
|
||||||
"keywords": [
|
|
||||||
"connectivity",
|
|
||||||
"ethernet",
|
|
||||||
"network",
|
|
||||||
"online"
|
|
||||||
],
|
|
||||||
"icon": "settings_ethernet"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "networkEthernet",
|
"section": "networkEthernet",
|
||||||
"label": "Ethernet",
|
"label": "Ethernet",
|
||||||
@@ -8951,19 +8882,6 @@
|
|||||||
],
|
],
|
||||||
"icon": "settings_ethernet"
|
"icon": "settings_ethernet"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_40",
|
|
||||||
"label": "WiFi",
|
|
||||||
"tabIndex": 40,
|
|
||||||
"category": "Network",
|
|
||||||
"keywords": [
|
|
||||||
"connectivity",
|
|
||||||
"network",
|
|
||||||
"online",
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"icon": "wifi"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "networkWifi",
|
"section": "networkWifi",
|
||||||
"label": "WiFi",
|
"label": "WiFi",
|
||||||
@@ -8982,19 +8900,6 @@
|
|||||||
],
|
],
|
||||||
"icon": "wifi"
|
"icon": "wifi"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "_tab_41",
|
|
||||||
"label": "VPN",
|
|
||||||
"tabIndex": 41,
|
|
||||||
"category": "Network",
|
|
||||||
"keywords": [
|
|
||||||
"connectivity",
|
|
||||||
"network",
|
|
||||||
"online",
|
|
||||||
"vpn"
|
|
||||||
],
|
|
||||||
"icon": "vpn_key"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "networkVpn",
|
"section": "networkVpn",
|
||||||
"label": "VPN",
|
"label": "VPN",
|
||||||
|
|||||||
Reference in New Issue
Block a user