feat: add excluded screens config opt
Completely disables everything (except lock) for screen
This commit is contained in:
parent
27cb290423
commit
c1795d187a
7 changed files with 27 additions and 4 deletions
|
|
@ -139,6 +139,7 @@ Singleton {
|
|||
function serializeGeneral(): var {
|
||||
return {
|
||||
logo: general.logo,
|
||||
excludedScreens: general.excludedScreens,
|
||||
apps: {
|
||||
terminal: general.apps.terminal,
|
||||
audio: general.apps.audio,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import Quickshell.Io
|
|||
|
||||
JsonObject {
|
||||
property string logo: ""
|
||||
property list<string> excludedScreens: []
|
||||
property Apps apps: Apps {}
|
||||
property Idle idle: Idle {}
|
||||
property Battery battery: Battery {}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import qs.components.containers
|
||||
import qs.components.misc
|
||||
import qs.services
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Io
|
||||
|
|
@ -15,7 +16,7 @@ Scope {
|
|||
property bool clipboardOnly
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
model: Screens.screens
|
||||
|
||||
StyledWindow {
|
||||
id: win
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Loader {
|
|||
active: Config.background.enabled
|
||||
|
||||
sourceComponent: Variants {
|
||||
model: Quickshell.screens
|
||||
model: Screens.screens
|
||||
|
||||
StyledWindow {
|
||||
id: win
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import QtQuick
|
|||
import QtQuick.Effects
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
model: Screens.screens
|
||||
|
||||
Scope {
|
||||
id: scope
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ Singleton {
|
|||
Variants {
|
||||
id: variants
|
||||
|
||||
model: Quickshell.screens
|
||||
model: Quickshell.screens // Don't respect excluded screens cause ipc
|
||||
|
||||
Monitor {}
|
||||
}
|
||||
|
|
|
|||
20
services/Screens.qml
Normal file
20
services/Screens.qml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
pragma Singleton
|
||||
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property list<ShellScreen> screens: {
|
||||
const excluded = Config.general.excludedScreens;
|
||||
if (excluded.length === 0)
|
||||
return Quickshell.screens;
|
||||
return Quickshell.screens.filter(s => !Strings.testRegexList(excluded, s.name));
|
||||
}
|
||||
|
||||
function isExcluded(screen: ShellScreen): bool {
|
||||
return Strings.testRegexList(Config.general.excludedScreens, screen.name);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue