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 {
|
function serializeGeneral(): var {
|
||||||
return {
|
return {
|
||||||
logo: general.logo,
|
logo: general.logo,
|
||||||
|
excludedScreens: general.excludedScreens,
|
||||||
apps: {
|
apps: {
|
||||||
terminal: general.apps.terminal,
|
terminal: general.apps.terminal,
|
||||||
audio: general.apps.audio,
|
audio: general.apps.audio,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import Quickshell.Io
|
||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property string logo: ""
|
property string logo: ""
|
||||||
|
property list<string> excludedScreens: []
|
||||||
property Apps apps: Apps {}
|
property Apps apps: Apps {}
|
||||||
property Idle idle: Idle {}
|
property Idle idle: Idle {}
|
||||||
property Battery battery: Battery {}
|
property Battery battery: Battery {}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.components.containers
|
import qs.components.containers
|
||||||
import qs.components.misc
|
import qs.components.misc
|
||||||
|
import qs.services
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
@ -15,7 +16,7 @@ Scope {
|
||||||
property bool clipboardOnly
|
property bool clipboardOnly
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Screens.screens
|
||||||
|
|
||||||
StyledWindow {
|
StyledWindow {
|
||||||
id: win
|
id: win
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Loader {
|
||||||
active: Config.background.enabled
|
active: Config.background.enabled
|
||||||
|
|
||||||
sourceComponent: Variants {
|
sourceComponent: Variants {
|
||||||
model: Quickshell.screens
|
model: Screens.screens
|
||||||
|
|
||||||
StyledWindow {
|
StyledWindow {
|
||||||
id: win
|
id: win
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Screens.screens
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
id: scope
|
id: scope
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ Singleton {
|
||||||
Variants {
|
Variants {
|
||||||
id: variants
|
id: variants
|
||||||
|
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens // Don't respect excluded screens cause ipc
|
||||||
|
|
||||||
Monitor {}
|
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