mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
Popout Control Example Plugin
This example plugin demonstrates:
- Using
PopoutServiceto trigger positioned popouts and modals - Using
pillClickActionwith position parameters - Using
PluginSettingswith dropdown selection - Dynamic widget text based on settings
The pillClickAction receives position parameters (x, y, width, section, screen) which are passed to PopoutService functions to properly position popouts relative to the widget.
PopoutService API
The PopoutService is automatically injected into plugin widgets and daemons as popoutService. It provides access to all shell popouts and modals.
Available Popouts
Control Center
popoutService.openControlCenter()
popoutService.closeControlCenter()
popoutService.toggleControlCenter()
Notification Center
popoutService.openNotificationCenter()
popoutService.closeNotificationCenter()
popoutService.toggleNotificationCenter()
App Drawer
popoutService.openAppDrawer()
popoutService.closeAppDrawer()
popoutService.toggleAppDrawer()
Process List (Popout)
popoutService.openProcessList()
popoutService.closeProcessList()
popoutService.toggleProcessList()
DankDash
popoutService.openDankDash(tabIndex) // tabIndex: 0=Calendar, 1=Media, 2=Weather
popoutService.closeDankDash()
popoutService.toggleDankDash(tabIndex)
Battery Popout
popoutService.openBattery()
popoutService.closeBattery()
popoutService.toggleBattery()
VPN Popout
popoutService.openVpn()
popoutService.closeVpn()
popoutService.toggleVpn()
System Update Popout
popoutService.openSystemUpdate()
popoutService.closeSystemUpdate()
popoutService.toggleSystemUpdate()
Available Modals
Settings Modal
popoutService.openSettings()
popoutService.closeSettings()
Clipboard History Modal
popoutService.openClipboardHistory()
popoutService.closeClipboardHistory()
Spotlight Modal
popoutService.openSpotlight()
popoutService.closeSpotlight()
Power Menu Modal
popoutService.openPowerMenu()
popoutService.closePowerMenu()
popoutService.togglePowerMenu()
Process List Modal (fullscreen)
popoutService.showProcessListModal()
popoutService.hideProcessListModal()
popoutService.toggleProcessListModal()
Color Picker Modal
popoutService.showColorPicker()
popoutService.hideColorPicker()
Notification Modal
popoutService.showNotificationModal()
popoutService.hideNotificationModal()
WiFi Password Modal
popoutService.showWifiPasswordModal()
popoutService.hideWifiPasswordModal()
Network Info Modal
popoutService.showNetworkInfoModal()
popoutService.hideNetworkInfoModal()
Notepad Slideout
popoutService.openNotepad()
popoutService.closeNotepad()
popoutService.toggleNotepad()
Usage in Plugins
Widget Plugins
import QtQuick
import qs.Common
import qs.Widgets
Rectangle {
id: root
property var popoutService: null // REQUIRED: Must declare for injection
MouseArea {
anchors.fill: parent
onClicked: {
popoutService?.toggleControlCenter()
}
}
}
Daemon Plugins
import QtQuick
import qs.Services
Item {
id: root
property var popoutService: null // REQUIRED: Must declare for injection
Connections {
target: NotificationService
function onNotificationReceived() {
popoutService?.openNotificationCenter()
}
}
}
Important: The popoutService property must be declared in your plugin component. Without it, you'll get errors like:
Error: Cannot assign to non-existent property "popoutService"
Example Use Cases
- Custom Launcher: Create a widget that opens the app drawer
- Quick Settings: Toggle control center from a custom button
- Notification Manager: Open notification center on new notifications
- System Monitor: Open process list on high CPU usage
- Power Management: Trigger power menu from a custom widget
Installation
- Copy the plugin directory to
~/.config/DankMaterialShell/plugins/ - Open Settings → Plugins
- Click "Scan for Plugins"
- Enable "Popout Control Example"
- Add
popoutControlExampleto your DankBar widget list
Notes
- The
popoutServiceproperty is automatically injected - no manual setup required - Always use optional chaining (
?.) when calling methods to handle null cases - Popouts are lazily loaded - first access may activate the loader
- Some popouts require specific system features to be available