Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions default/i18n/en/shell.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@
"diskSpeedtest.failed": "Disk speed test failed",
"diskSpeedtest.read": "READ",
"diskSpeedtest.write": "WRITE",
"dock.apps": "Apps",
"dock.autoHide": "Auto-hide",
"dock.keepInDock": "Keep in Dock",
"dock.minimize": "Minimize",
"dock.newWindow": "New Window",
"dock.noAppsMatch": "No apps match “%1”",
"dock.open": "Open",
Expand Down
26 changes: 16 additions & 10 deletions shell/plugins/dock/Dock.qml
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,10 @@ Item {
root.launches = next
}

// Opens one more window of an app, which may already be running. The app
// library's launcher can answer a running app by focusing it, so this runs
// the entry itself: its own "new window" action when it has one, otherwise
// its Exec line, which for single-instance apps such as Files is what asks
// the running instance for a window. An app that has to run in a terminal
// still goes through the library, which knows how to open one.
// Opens one more window of an app, which may already be running. Use its
// "new window" action when it has one, otherwise its Exec line, which for
// single-instance apps such as Files asks the running instance for a window.
// Both run in the app's own UWSM scope.
function newWindow(item) {
var entry = entryFor(item)
if (!entry) return
Expand All @@ -190,13 +188,13 @@ Item {
var actions = entry.actions || []
for (var i = 0; i < actions.length; i++) {
var action = actions[i]
if (action && /^new[-_ ]?window$/i.test(String(action.id || "")) && typeof action.execute === "function") {
action.execute()
if (action && /^new[-_ ]?window$/i.test(String(action.id || "")) && action.command && action.command.length > 0) {
if (root.appLibrary) root.appLibrary.launchCommand(action.command)
return
}
}

if (!entry.runInTerminal && entry.command && entry.command.length > 0 && typeof entry.execute === "function") entry.execute()
if (!entry.runInTerminal && entry.command && entry.command.length > 0 && root.appLibrary) root.appLibrary.launchCommand(entry.command)
else root.launchEntry(entry)
}

Expand Down Expand Up @@ -233,12 +231,20 @@ Item {
Util.execDetached("omarchy-hyprland-window-minimize " + Util.shellQuote(address))
}

function minimizeWorkspaceId() {
var monitor = Hyprland.focusedMonitor
return monitor && monitor.activeWorkspace ? monitor.activeWorkspace.id : -1
}

// Every window of the app that is in view.
function minimize(item) {
if (!item) return
var workspaceId = root.minimizeWorkspaceId()
if (!(workspaceId >= 1)) return
var commands = []
for (var i = 0; i < item.windows.length; i++) {
var address = item.windows[i].minimized ? "" : root.hexAddress(item.windows[i])
var window = item.windows[i]
var address = !window.minimized && window.workspaceId === workspaceId ? root.hexAddress(window) : ""
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
if (address) commands.push("omarchy-hyprland-window-minimize " + Util.shellQuote(address))
}
if (commands.length > 0) Util.execDetached(commands.join("; "))
Expand Down
13 changes: 12 additions & 1 deletion shell/plugins/dock/DockWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -818,12 +818,21 @@ PanelWindow {
spacing: Style.spacing.sm

Text {
id: tipHeading
textFormat: Text.PlainText
text: tip.lastSlot ? tip.lastSlot.tip : ""
color: Commons.Color.tooltip.text
font.family: Style.font.family
font.pixelSize: Style.font.bodySmall
font.bold: tip.previewing
elide: Text.ElideRight
}

Binding {
target: tipHeading
property: "width"
value: Math.max(0, window.popupRoom - tip.contentLeftInset - tip.contentRightInset)
when: window.vertical
}

Grid {
Expand Down Expand Up @@ -952,7 +961,9 @@ PanelWindow {
readonly property var item: window.menuItem
readonly property bool hasEntry: !!item && !!window.dock && !!window.dock.entryFor(item)
readonly property bool running: !!item && item.windows.length > 0
readonly property bool inView: !!item && item.windows.some(function(other) { return !other.minimized })
readonly property bool inView: !!item && !!window.dock && item.windows.some(function(other) {
return !other.minimized && other.workspaceId === window.dock.minimizeWorkspaceId()
})

visible: window.contentShown && (!!item || window.settingsMenu)
width: Math.max(Style.space(140), menuColumn.implicitWidth) + padding * 2
Expand Down
8 changes: 7 additions & 1 deletion shell/services/AppLibrary.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ Item {
// inherit wayland-wm@.service. Keeping gtk-launch as the desktop-entry
// resolver supports IDs with spaces and entries that UWSM rejects.
// Keep the .desktop suffix or ids like org.telegram.desktop won't resolve.
Util.execDetached("uwsm-app -- gtk-launch " + Util.shellQuote(id + ".desktop"))
root.launchCommand(["gtk-launch", id + ".desktop"])
}

function launchCommand(command) {
var words = (command || []).filter(function(word) { return !/^%[a-zA-Z]$/.test(String(word)) })
if (words.length === 0) return
Util.execDetached("uwsm-app -- " + words.map(function(word) { return Util.shellQuote(word) }).join(" "))
}

// The command a terminal entry runs, without the field codes it leaves for a
Expand Down
Loading