mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
feat: notification on specific monitor
This commit is contained in:
@@ -399,6 +399,10 @@ Singleton {
|
||||
|
||||
property JsonObject notifications: JsonObject {
|
||||
property int timeout: 7000
|
||||
property JsonObject monitor: JsonObject {
|
||||
property bool enable: false
|
||||
property string name: "" // Name of the monitor to show notifications on, like "eDP-1". Find out with 'hyprctl monitors' command
|
||||
}
|
||||
}
|
||||
|
||||
property JsonObject osd: JsonObject {
|
||||
|
||||
@@ -14,7 +14,7 @@ Scope {
|
||||
PanelWindow {
|
||||
id: root
|
||||
visible: (Notifications.popupList.length > 0) && !GlobalStates.screenLocked
|
||||
screen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name) ?? null
|
||||
screen: Quickshell.screens.find(s => Config.options.notifications.monitor.enable ? s.name === Config.options.notifications.monitor.name : s.name === Hyprland.focusedMonitor?.name) ?? null
|
||||
|
||||
WlrLayershell.namespace: "quickshell:notificationPopup"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
@@ -265,6 +265,31 @@ ContentPage {
|
||||
Config.options.notifications.timeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
ConfigSwitch {
|
||||
buttonIcon: "monitor"
|
||||
text: Translation.tr("Show on specific monitor")
|
||||
checked: Config.options.notifications.monitor.enable
|
||||
onCheckedChanged: {
|
||||
Config.options.notifications.monitor.enable = checked;
|
||||
}
|
||||
StyledToolTip {
|
||||
text: Translation.tr("If you have multiple monitors and want notifications to only show on one of them, enable this and enter the monitor name below (e.g., eDP-1)")
|
||||
}
|
||||
}
|
||||
|
||||
ConfigRow {
|
||||
enabled: Config.options.notifications.monitor.enable
|
||||
MaterialTextArea {
|
||||
Layout.fillWidth: true
|
||||
placeholderText: Translation.tr("Monitor name to show notifications on (e.g., eDP-1)")
|
||||
text: Config.options.notifications.monitor.name
|
||||
wrapMode: TextEdit.Wrap
|
||||
onTextChanged: {
|
||||
Config.options.notifications.monitor.name = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContentSection {
|
||||
|
||||
Reference in New Issue
Block a user