mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +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 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()];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue