forked from Shinonome/dots-hyprland
icon guess: fix steam regex
This commit is contained in:
@@ -27,7 +27,7 @@ Singleton {
|
|||||||
})
|
})
|
||||||
property var regexSubstitutions: [
|
property var regexSubstitutions: [
|
||||||
{
|
{
|
||||||
"regex": /^steam_app_(\\d+)$/,
|
"regex": /^steam_app_(\d+)$/,
|
||||||
"replace": "steam_icon_$1"
|
"replace": "steam_icon_$1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -72,6 +72,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function iconExists(iconName) {
|
function iconExists(iconName) {
|
||||||
|
if (!iconName || iconName.length == 0) return false;
|
||||||
return (Quickshell.iconPath(iconName, true).length > 0)
|
return (Quickshell.iconPath(iconName, true).length > 0)
|
||||||
&& !iconName.includes("image-missing");
|
&& !iconName.includes("image-missing");
|
||||||
}
|
}
|
||||||
@@ -103,7 +104,7 @@ Singleton {
|
|||||||
// Guess: normalize to kebab case
|
// Guess: normalize to kebab case
|
||||||
guessStr = str.toLowerCase().replace(/\s+/g, "-");
|
guessStr = str.toLowerCase().replace(/\s+/g, "-");
|
||||||
if (iconExists(guessStr)) return guessStr;
|
if (iconExists(guessStr)) return guessStr;
|
||||||
// Guess: First fuzze desktop entry match
|
// Guess: First fuzzy desktop entry match
|
||||||
const searchResults = root.fuzzyQuery(str);
|
const searchResults = root.fuzzyQuery(str);
|
||||||
if (searchResults.length > 0) {
|
if (searchResults.length > 0) {
|
||||||
const firstEntry = searchResults[0];
|
const firstEntry = searchResults[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user