standardize services import alias to S in applets and lock

This commit is contained in:
Damocles 2026-04-17 23:13:54 +02:00
parent 0160e4a1fb
commit 9a079fe2f1
10 changed files with 202 additions and 202 deletions

View file

@ -2,12 +2,12 @@ import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import "../services" as M
import "../services" as S
Scope {
id: root
readonly property bool _enabled: M.Modules.lock.enable
readonly property bool _enabled: S.Modules.lock.enable
property string _sessionPath: ""
WlSessionLock {

View file

@ -1,5 +1,5 @@
import QtQuick
import "../services" as M
import "../services" as S
Item {
id: root
@ -15,18 +15,18 @@ Item {
anchors.fill: parent
color: {
if (root.state === "fail" || root.state === "error")
return Qt.rgba(M.Theme.base08.r, M.Theme.base08.g, M.Theme.base08.b, 0.15);
return Qt.rgba(S.Theme.base08.r, S.Theme.base08.g, S.Theme.base08.b, 0.15);
if (root.state === "busy")
return Qt.rgba(M.Theme.base0D.r, M.Theme.base0D.g, M.Theme.base0D.b, 0.1);
return M.Theme.base02;
return Qt.rgba(S.Theme.base0D.r, S.Theme.base0D.g, S.Theme.base0D.b, 0.1);
return S.Theme.base02;
}
radius: height / 2
border.color: {
if (root.state === "fail" || root.state === "error")
return M.Theme.base08;
return S.Theme.base08;
if (root.state === "busy")
return M.Theme.base0D;
return M.Theme.base03;
return S.Theme.base0D;
return S.Theme.base03;
}
border.width: 1
@ -52,9 +52,9 @@ Item {
return "Too many attempts";
return "Enter password";
}
color: M.Theme.base04
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
opacity: root.buffer.length === 0 ? 1 : 0
Behavior on opacity {
@ -78,7 +78,7 @@ Item {
width: 10
height: 10
radius: 5
color: M.Theme.base05
color: S.Theme.base05
scale: 0
opacity: 0

View file

@ -4,7 +4,7 @@ import Quickshell
import Quickshell.Wayland
import Quickshell.Services.Mpris
import Quickshell.Services.Pipewire
import "../services" as M
import "../services" as S
import "../applets" as C
WlSessionLockSurface {
@ -13,7 +13,7 @@ WlSessionLockSurface {
required property WlSessionLock lock
required property LockAuth auth
color: M.Theme.base00
color: S.Theme.base00
property real _bgOpacity: 0
NumberAnimation on _bgOpacity {
@ -27,7 +27,7 @@ WlSessionLockSurface {
anchors.fill: parent
captureSource: root.screen
opacity: root._bgOpacity
visible: M.Modules.lock.screenshot ?? true
visible: S.Modules.lock.screenshot ?? true
layer.enabled: true
layer.effect: MultiEffect {
@ -41,7 +41,7 @@ WlSessionLockSurface {
// Dim overlay
Rectangle {
anchors.fill: parent
color: Qt.rgba(M.Theme.base00.r, M.Theme.base00.g, M.Theme.base00.b, 0.4)
color: Qt.rgba(S.Theme.base00.r, S.Theme.base00.g, S.Theme.base00.b, 0.4)
opacity: root._bgOpacity
}
@ -112,9 +112,9 @@ WlSessionLockSurface {
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: Qt.formatTime(new Date(), "HH:mm")
color: M.Theme.base05
color: S.Theme.base05
font.pixelSize: 72
font.family: M.Theme.fontFamily
font.family: S.Theme.fontFamily
font.bold: true
Timer {
@ -129,9 +129,9 @@ WlSessionLockSurface {
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: Qt.formatDate(new Date(), "dddd, d MMMM")
color: M.Theme.base04
font.pixelSize: M.Theme.fontSize + 2
font.family: M.Theme.fontFamily
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize + 2
font.family: S.Theme.fontFamily
Timer {
interval: 60000
@ -160,9 +160,9 @@ WlSessionLockSurface {
id: _errorText
anchors.horizontalCenter: parent.horizontalCenter
text: root.auth.message
color: M.Theme.base08
font.pixelSize: M.Theme.fontSize - 1
font.family: M.Theme.fontFamily
color: S.Theme.base08
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
opacity: root.auth.message ? 1 : 0
height: root.auth.message ? implicitHeight : 0
@ -192,11 +192,11 @@ WlSessionLockSurface {
anchors.horizontalCenter: parent.horizontalCenter
width: 280
height: _mprisContent.implicitHeight + 16
radius: M.Theme.radius + 2
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
radius: S.Theme.radius + 2
color: Qt.rgba(S.Theme.base01.r, S.Theme.base01.g, S.Theme.base01.b, 0.7)
border.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3)
border.width: 1
visible: (M.Modules.lock.mpris ?? true) && _mprisPlayer !== null
visible: (S.Modules.lock.mpris ?? true) && _mprisPlayer !== null
readonly property var _mprisPlayers: (Mpris.players.values ?? []).filter(p => p.trackTitle || p.playbackState === MprisPlaybackState.Playing || p.playbackState === MprisPlaybackState.Paused)
readonly property var _mprisPlayer: _mprisPlayers[0] ?? null
@ -211,7 +211,7 @@ WlSessionLockSurface {
player: _mprisCard._mprisPlayer
players: _mprisCard._mprisPlayers
playing: _mprisCard._playing
accentColor: M.Theme.base0D
accentColor: S.Theme.base0D
cachedArt: _mprisCard._mprisPlayer?.trackArtUrl ?? ""
}
}
@ -222,11 +222,11 @@ WlSessionLockSurface {
anchors.horizontalCenter: parent.horizontalCenter
width: 280
height: _volumeContent.implicitHeight + 16
radius: M.Theme.radius + 2
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
radius: S.Theme.radius + 2
color: Qt.rgba(S.Theme.base01.r, S.Theme.base01.g, S.Theme.base01.b, 0.7)
border.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3)
border.width: 1
visible: (M.Modules.lock.volume ?? true) && Pipewire.defaultAudioSink !== null
visible: (S.Modules.lock.volume ?? true) && Pipewire.defaultAudioSink !== null
PwObjectTracker {
objects: [Pipewire.defaultAudioSink]
@ -241,7 +241,7 @@ WlSessionLockSurface {
sink: Pipewire.defaultAudioSink
sinkList: []
streamList: []
accentColor: M.Theme.base0E
accentColor: S.Theme.base0E
}
}
}
@ -354,8 +354,8 @@ WlSessionLockSurface {
// so the bar's ScreenCorners aren't visible. Draw our own.
component LockCorner: Canvas {
property int corner: 0
readonly property int _r: M.Theme.screenRadius
visible: _r > 0 && M.Modules.screenCorners.enable
readonly property int _r: S.Theme.screenRadius
visible: _r > 0 && S.Modules.screenCorners.enable
width: _r
height: _r
z: 999