1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

IPCs for dash

This commit is contained in:
bbedward
2025-09-09 22:56:19 -04:00
parent 5bb489f3c4
commit 5a9c80540e
4 changed files with 81 additions and 13 deletions

View File

@@ -6,7 +6,6 @@ import Quickshell
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
import Quickshell.Wayland import Quickshell.Wayland
import qs.Common import qs.Common
import qs.Services
import qs.Widgets import qs.Widgets
import qs.Modules.DankDash import qs.Modules.DankDash
@@ -181,7 +180,7 @@ DankPopout {
WeatherTab { WeatherTab {
id: weatherTab id: weatherTab
visible: SettingsData.weatherEnabled visible: SettingsData.weatherEnabled && root.currentTabIndex === 2
} }
} }
} }

View File

@@ -74,18 +74,11 @@ Item {
} }
StyledText { StyledText {
text: "No Media Playing" text: "No Active Players"
font.pixelSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeLarge
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7) color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
StyledText {
text: "Start playing media to see detailed controls"
font.pixelSize: Theme.fontSizeMedium
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5)
anchors.horizontalCenter: parent.horizontalCenter
}
} }
Item { Item {

View File

@@ -467,6 +467,19 @@ Notepad/scratchpad modal control for quick note-taking.
- `close` - Hide notepad modal - `close` - Hide notepad modal
- `toggle` - Toggle notepad modal visibility - `toggle` - Toggle notepad modal visibility
### Target: `dash`
Dashboard popup control with tab selection for overview, media, and weather information.
**Functions:**
- `open [tab]` - Show dashboard popup with optional tab selection
- Parameters: `tab` - Optional tab to open: "" (default), "overview", "media", or "weather"
- Returns: Success/failure message
- `close` - Hide dashboard popup
- Returns: Success/failure message
- `toggle [tab]` - Toggle dashboard popup visibility with optional tab selection
- Parameters: `tab` - Optional tab to open when showing: "" (default), "overview", "media", or "weather"
- Returns: Success/failure message
### Target: `file` ### Target: `file`
File browser controls for selecting wallpapers and profile images. File browser controls for selecting wallpapers and profile images.
@@ -500,6 +513,11 @@ dms ipc call powermenu toggle
# Open notepad # Open notepad
dms ipc call notepad toggle dms ipc call notepad toggle
# Show dashboard with specific tabs
dms ipc call dash open overview
dms ipc call dash toggle media
dms ipc call dash open weather
# Open file browsers # Open file browsers
dms ipc call file browse wallpaper dms ipc call file browse wallpaper
dms ipc call file browse profile dms ipc call file browse profile

View File

@@ -392,6 +392,64 @@ ShellRoot {
target: "processlist" target: "processlist"
} }
IpcHandler {
function open(tab: string): string {
dankDashPopoutLoader.active = true
if (dankDashPopoutLoader.item) {
switch (tab.toLowerCase()) {
case "media":
dankDashPopoutLoader.item.currentTabIndex = 1
break
case "weather":
dankDashPopoutLoader.item.currentTabIndex = SettingsData.weatherEnabled ? 2 : 0
break
default:
dankDashPopoutLoader.item.currentTabIndex = 0
break
}
dankDashPopoutLoader.item.setTriggerPosition(Screen.width / 2, Theme.barHeight + Theme.spacingS, 100, "center", Screen)
dankDashPopoutLoader.item.calendarVisible = true
return "DASH_OPEN_SUCCESS"
}
return "DASH_OPEN_FAILED"
}
function close(): string {
if (dankDashPopoutLoader.item) {
dankDashPopoutLoader.item.calendarVisible = false
return "DASH_CLOSE_SUCCESS"
}
return "DASH_CLOSE_FAILED"
}
function toggle(tab: string): string {
dankDashPopoutLoader.active = true
if (dankDashPopoutLoader.item) {
if (dankDashPopoutLoader.item.calendarVisible) {
dankDashPopoutLoader.item.calendarVisible = false
} else {
switch (tab.toLowerCase()) {
case "media":
dankDashPopoutLoader.item.currentTabIndex = 1
break
case "weather":
dankDashPopoutLoader.item.currentTabIndex = SettingsData.weatherEnabled ? 2 : 0
break
default:
dankDashPopoutLoader.item.currentTabIndex = 0
break
}
dankDashPopoutLoader.item.setTriggerPosition(Screen.width / 2, Theme.barHeight + Theme.spacingS, 100, "center", Screen)
dankDashPopoutLoader.item.calendarVisible = true
}
return "DASH_TOGGLE_SUCCESS"
}
return "DASH_TOGGLE_FAILED"
}
target: "dash"
}
IpcHandler { IpcHandler {
function getFocusedScreenName() { function getFocusedScreenName() {
if (CompositorService.isHyprland && Hyprland.focusedWorkspace && Hyprland.focusedWorkspace.monitor) { if (CompositorService.isHyprland && Hyprland.focusedWorkspace && Hyprland.focusedWorkspace.monitor) {
@@ -405,16 +463,16 @@ ShellRoot {
function getNotepadInstanceForScreen(screenName: string) { function getNotepadInstanceForScreen(screenName: string) {
if (!screenName || notepadSlideoutVariants.instances.length === 0) { if (!screenName || notepadSlideoutVariants.instances.length === 0) {
return null return
} }
for (var i = 0; i < notepadSlideoutVariants.instances.length; i++) { for (var i = 0; i < notepadSlideoutVariants.instances.length; i++) {
var loader = notepadSlideoutVariants.instances[i] var loader = notepadSlideoutVariants.instances[i]
if (loader.modelData && loader.modelData.name === screenName) { if (loader.modelData && loader.modelData.name === screenName) {
return loader.ensureLoaded() loader.ensureLoaded()
return
} }
} }
return null
} }
function getActiveNotepadInstance() { function getActiveNotepadInstance() {