From 8e51d566524ce143e19a8e25dbc3ebfcd8040337 Mon Sep 17 00:00:00 2001 From: Kiril Peyanski Date: Wed, 1 Feb 2023 16:05:32 +0200 Subject: [PATCH] WIP: support dock spacers --- package-lock.json | 2 +- utils.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e05d402..7cff355 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3741,4 +3741,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/utils.js b/utils.js index ff0168e..b1e985b 100644 --- a/utils.js +++ b/utils.js @@ -37,12 +37,16 @@ function getAppNamesToIconPaths(parsedDockData) { for (const parsedAppData of persistentApps) { const appName = parsedAppData.dict[0].string[1]; - const appDirectoryUrl = parsedAppData.dict[0].dict[0].string[0]; - const appDirectory = url.fileURLToPath(appDirectoryUrl) - - if (isAppNameAllowed(appName)) { - result[appName] = getIconPath(appDirectory); + if(Array.isArray(parsedAppData.dict[0].dict)) { + const appDirectoryUrl = parsedAppData.dict[0].dict[0].string[0]; + const appDirectory = url.fileURLToPath(appDirectoryUrl) + if (isAppNameAllowed(appName)) { + result[appName] = getIconPath(appDirectory); + } + } else if(parsedAppData.key.includes('tile-type')) { + // TODO: implement spacers } + } return result; }