mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-19 04:08:48 +00:00
icon guessing: add quickshell's heuristic lookup
This commit is contained in:
parent
4f0522d913
commit
c39901e95d
2 changed files with 5 additions and 3 deletions
|
|
@ -21,7 +21,7 @@ DockButton {
|
|||
property bool appIsActive: appToplevel.toplevels.find(t => (t.activated == true)) !== undefined
|
||||
|
||||
property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
||||
property var desktopEntry: DesktopEntries.byId(appToplevel.appId)
|
||||
property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||
enabled: !isSeparator
|
||||
implicitWidth: isSeparator ? 1 : implicitHeight - topInset - bottomInset
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ Singleton {
|
|||
"wps": "wps-office2019-kprometheus",
|
||||
"wpsoffice": "wps-office2019-kprometheus",
|
||||
"footclient": "foot",
|
||||
"zen": "zen-browser",
|
||||
"brave-browser": "brave-desktop"
|
||||
})
|
||||
property var regexSubstitutions: [
|
||||
{
|
||||
|
|
@ -91,6 +89,10 @@ Singleton {
|
|||
function guessIcon(str) {
|
||||
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
|
||||
if (substitutions[str]) return substitutions[str];
|
||||
if (substitutions[str.toLowerCase()]) return substitutions[str.toLowerCase()];
|
||||
|
|
|
|||
Loading…
Reference in a new issue