forked from Shinonome/dots-hyprland
show biggest app icon on workspaces, faster keybinds
This commit is contained in:
@@ -113,4 +113,21 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "overviewToggle"
|
||||
description: "Toggles overview on press"
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
||||
}
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "overviewToggleRelease"
|
||||
description: "Toggles overview on release"
|
||||
|
||||
onReleased: {
|
||||
GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import "./icons.js" as Icons
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -128,7 +127,7 @@ Item {
|
||||
Repeater { // Window repeater
|
||||
model: windowAddresses.filter((address) => {
|
||||
var win = windowByAddress[address]
|
||||
return (root.workspaceGroup * root.workspacesShown < win.workspace.id && win.workspace.id <= (root.workspaceGroup + 1) * root.workspacesShown)
|
||||
return (root.workspaceGroup * root.workspacesShown < win?.workspace?.id && win?.workspace?.id <= (root.workspaceGroup + 1) * root.workspacesShown)
|
||||
})
|
||||
delegate: OverviewWindow {
|
||||
id: window
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import "root:/modules/common/functions/icons.js" as Icons
|
||||
import "root:/services/"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
@@ -8,7 +9,6 @@ import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
import "./icons.js" as Icons
|
||||
|
||||
Rectangle { // Window
|
||||
id: root
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
const substitutions = {
|
||||
"code-url-handler": "visual-studio-code",
|
||||
"Code": "visual-studio-code",
|
||||
"GitHub Desktop": "github-desktop",
|
||||
"Minecraft* 1.20.1": "minecraft",
|
||||
"gnome-tweaks": "org.gnome.tweaks",
|
||||
"pavucontrol-qt": "pavucontrol",
|
||||
"wps": "wps-office2019-kprometheus",
|
||||
"wpsoffice": "wps-office2019-kprometheus",
|
||||
"footclient": "foot",
|
||||
"": "image-missing"
|
||||
}
|
||||
const regexSubstitutions = [
|
||||
{
|
||||
"regex": "/^steam_app_(\\d+)$/",
|
||||
"replace": "steam_icon_$1"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
function iconExists(iconName) {
|
||||
return false; // TODO: Make this work without Gtk
|
||||
}
|
||||
|
||||
function substitute(str) {
|
||||
// Normal substitutions
|
||||
if (substitutions[str])
|
||||
return substitutions[str];
|
||||
|
||||
// Regex substitutions
|
||||
for (let i = 0; i < regexSubstitutions.length; i++) {
|
||||
const substitution = regexSubstitutions[i];
|
||||
const replacedName = str.replace(
|
||||
substitution.regex,
|
||||
substitution.replace,
|
||||
);
|
||||
if (replacedName != str) return replacedName;
|
||||
}
|
||||
|
||||
// Guess: convert to kebab case
|
||||
if (!iconExists(str)) str = str.toLowerCase().replace(/\s+/g, "-");
|
||||
|
||||
// Original string
|
||||
return str;
|
||||
}
|
||||
|
||||
function noKnowledgeIconGuess(str) {
|
||||
if (!str) return "image-missing";
|
||||
|
||||
// Normal substitutions
|
||||
if (substitutions[str])
|
||||
return substitutions[str];
|
||||
|
||||
// Regex substitutions
|
||||
for (let i = 0; i < regexSubstitutions.length; i++) {
|
||||
const substitution = regexSubstitutions[i];
|
||||
const replacedName = str.replace(
|
||||
substitution.regex,
|
||||
substitution.replace,
|
||||
);
|
||||
if (replacedName != str) return replacedName;
|
||||
}
|
||||
|
||||
// Guess: convert to kebab case if it's not reverse domain name notation
|
||||
if (!str.includes('.')) {
|
||||
str = str.toLowerCase().replace(/\s+/g, "-");
|
||||
}
|
||||
|
||||
// Original string
|
||||
return str;
|
||||
}
|
||||
Reference in New Issue
Block a user