1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-05 05:12:05 -04:00

launcher v2: meta improvements

- Allow disabling each plugin from "all" mode
- add IPCs for toggling specific modes
- niri: overview respect size & default to apps mode
- fix unicode icon handling
This commit is contained in:
bbedward
2026-01-21 11:38:48 -05:00
parent eebb4827c4
commit 3922070488
11 changed files with 312 additions and 15 deletions

View File

@@ -431,14 +431,14 @@ Item {
if (searchMode === "all") {
if (searchQuery) {
var allPluginIds = getAllLauncherPluginIds();
var allPluginIds = getVisibleLauncherPluginIds();
for (var i = 0; i < allPluginIds.length; i++) {
var pluginId = allPluginIds[i];
var pItems = getPluginItems(pluginId, searchQuery);
allItems = allItems.concat(pItems);
}
var allBuiltInIds = getAllBuiltInLauncherIds();
var allBuiltInIds = getVisibleBuiltInLauncherIds();
for (var i = 0; i < allBuiltInIds.length; i++) {
var pluginId = allBuiltInIds[i];
var blItems = AppSearchService.getBuiltInLauncherItems(pluginId, searchQuery);
@@ -858,7 +858,10 @@ Item {
}
function getEmptyTriggerPlugins() {
return PluginService.getPluginsWithEmptyTrigger();
var plugins = PluginService.getPluginsWithEmptyTrigger();
return plugins.filter(function (pluginId) {
return SettingsData.getPluginAllowWithoutTrigger(pluginId);
});
}
function getAllLauncherPluginIds() {
@@ -866,11 +869,25 @@ Item {
return Object.keys(launchers);
}
function getVisibleLauncherPluginIds() {
var launchers = PluginService.getLauncherPlugins();
return Object.keys(launchers).filter(function (pluginId) {
return SettingsData.getPluginAllowWithoutTrigger(pluginId);
});
}
function getAllBuiltInLauncherIds() {
var launchers = AppSearchService.getBuiltInLauncherPlugins();
return Object.keys(launchers);
}
function getVisibleBuiltInLauncherIds() {
var launchers = AppSearchService.getBuiltInLauncherPlugins();
return Object.keys(launchers).filter(function (pluginId) {
return SettingsData.getPluginAllowWithoutTrigger(pluginId);
});
}
function getPluginBrowseItems() {
var items = [];
@@ -930,7 +947,10 @@ Item {
}
function getBuiltInEmptyTriggerLaunchers() {
return AppSearchService.getBuiltInLauncherPluginsWithEmptyTrigger();
var plugins = AppSearchService.getBuiltInLauncherPluginsWithEmptyTrigger();
return plugins.filter(function (pluginId) {
return SettingsData.getPluginAllowWithoutTrigger(pluginId);
});
}
function getPluginItems(pluginId, query) {
@@ -947,12 +967,14 @@ Item {
function detectIconType(iconName) {
if (!iconName)
return "material";
if (iconName.indexOf("/") >= 0 || iconName.indexOf(".") >= 0)
return "image";
if (iconName.startsWith("unicode:"))
return "unicode";
if (iconName.startsWith("material:"))
return "material";
if (iconName.startsWith("image:"))
return "image";
if (iconName.indexOf("/") >= 0 || iconName.indexOf(".") >= 0)
return "image";
if (/^[a-z]+-[a-z]/.test(iconName.toLowerCase()))
return "image";
return "material";
@@ -961,6 +983,8 @@ Item {
function stripIconPrefix(iconName) {
if (!iconName)
return "extension";
if (iconName.startsWith("unicode:"))
return iconName.substring(8);
if (iconName.startsWith("material:"))
return iconName.substring(9);
if (iconName.startsWith("image:"))