forked from Shinonome/dots-hyprland
icon guessing: add quickshell's heuristic lookup
This commit is contained in:
@@ -21,7 +21,7 @@ DockButton {
|
|||||||
property bool appIsActive: appToplevel.toplevels.find(t => (t.activated == true)) !== undefined
|
property bool appIsActive: appToplevel.toplevels.find(t => (t.activated == true)) !== undefined
|
||||||
|
|
||||||
property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
||||||
property var desktopEntry: DesktopEntries.byId(appToplevel.appId)
|
property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||||
enabled: !isSeparator
|
enabled: !isSeparator
|
||||||
implicitWidth: isSeparator ? 1 : implicitHeight - topInset - bottomInset
|
implicitWidth: isSeparator ? 1 : implicitHeight - topInset - bottomInset
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ Singleton {
|
|||||||
"wps": "wps-office2019-kprometheus",
|
"wps": "wps-office2019-kprometheus",
|
||||||
"wpsoffice": "wps-office2019-kprometheus",
|
"wpsoffice": "wps-office2019-kprometheus",
|
||||||
"footclient": "foot",
|
"footclient": "foot",
|
||||||
"zen": "zen-browser",
|
|
||||||
"brave-browser": "brave-desktop"
|
|
||||||
})
|
})
|
||||||
property var regexSubstitutions: [
|
property var regexSubstitutions: [
|
||||||
{
|
{
|
||||||
@@ -91,6 +89,10 @@ Singleton {
|
|||||||
function guessIcon(str) {
|
function guessIcon(str) {
|
||||||
if (!str || str.length == 0) return "image-missing";
|
if (!str || str.length == 0) return "image-missing";
|
||||||
|
|
||||||
|
// Quickshell's desktop entry lookup
|
||||||
|
const entry = DesktopEntries.heuristicLookup(str);
|
||||||
|
if (entry) return entry.icon;
|
||||||
|
|
||||||
// Normal substitutions
|
// Normal substitutions
|
||||||
if (substitutions[str]) return substitutions[str];
|
if (substitutions[str]) return substitutions[str];
|
||||||
if (substitutions[str.toLowerCase()]) return substitutions[str.toLowerCase()];
|
if (substitutions[str.toLowerCase()]) return substitutions[str.toLowerCase()];
|
||||||
|
|||||||
Reference in New Issue
Block a user