Compare commits

..
12 changed files with 173 additions and 107 deletions

View file

@ -1 +1 @@
/nix/store/l7wgb12q1ackaqs9v9g79p2pr567dsgk-home-manager-files/.config/quickshell/Colors.js /nix/store/yj22sprk8zwdhbc8jcf5nqbkc2vwd5yz-home-manager-files/.config/quickshell/Colors.js

View file

@ -7,11 +7,11 @@ import "Colors.js" as Colors
Singleton { Singleton {
id: root id: root
readonly property color accent: base0D readonly property color accent: base0B
readonly property color rootBarColor: base00 readonly property color rootBarColor: base01
readonly property color barBg: Qt.rgba(rootBarColor.r,rootBarColor.g,rootBarColor.b,Config.opacity) readonly property color barBg: Qt.rgba(rootBarColor.r,rootBarColor.g,rootBarColor.b,Config.opacity)
readonly property color moduleBg: base02 readonly property color moduleBg: base02
readonly property color activeModuleBg: base04 readonly property color activeModuleBg: base03
readonly property color text: base05 readonly property color text: base05
readonly property color base00: Colors.colors.base00 readonly property color base00: Colors.colors.base00
readonly property color base01: Colors.colors.base01 readonly property color base01: Colors.colors.base01

View file

@ -1,20 +0,0 @@
pragma Singleton
import Quickshell
import Quickshell.Wayland
Singleton {
id: root
// Screen des gerade fokussierten Fensters, oder null wenn keins fokussiert ist.
// Reagiert sowohl auf Fokuswechsel als auch darauf, dass das fokussierte
// Fenster auf einen anderen Monitor wandert.
readonly property ShellScreen liveScreen: ToplevelManager.activeToplevel?.screens?.[0] ?? null
property ShellScreen focusedScreen: Quickshell.screens[0] ?? null
onLiveScreenChanged: {
if (liveScreen)
root.focusedScreen = liveScreen;
}
}

View file

@ -2,7 +2,7 @@ import Quickshell
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.settings import qs.settings
import qs.widgets import qs.modules.applets
import qs import qs
Variants { Variants {
@ -19,13 +19,13 @@ Variants {
color: 'transparent' color: 'transparent'
implicitHeight: Config.cfg.bar.height implicitHeight: Config.cfg.bar.height
margins.top: Config.cfg.bar.floating ?? 10 margins.top: Config.cfg.bar.floating ? 10 : 0
margins.left: Config.cfg.bar.floating ?? 10 margins.left: Config.cfg.bar.floating ? 10 : 0
margins.right: Config.cfg.bar.floating ?? 10 margins.right: Config.cfg.bar.floating ? 10 : 0
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: Colors.barBg color: Colors.barBg
radius: Config.cfg.bar.floating ?? Config.cfg.appearance.rounding radius: Config.cfg.bar.floating ? Config.cfg.appearance.rounding : 0
RowLayout { RowLayout {
anchors.leftMargin: 4 anchors.leftMargin: 4
anchors.left: parent.left anchors.left: parent.left
@ -33,9 +33,7 @@ Variants {
Ws { Ws {
barScreen: root.modelData barScreen: root.modelData
} }
ActiveWindow { ActiveWindow {screen: root.modelData}
screen: root.modelData
}
} }
RowLayout { RowLayout {
anchors.centerIn: parent anchors.centerIn: parent
@ -45,46 +43,15 @@ Variants {
anchors.rightMargin: 4 anchors.rightMargin: 4
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Mpris { Mpris {}
id: mpris Bat {}
} Tray {}
StyledText { WallPickerButton {barScreen: root.modelData}
text: "|"
visible: mpris.visible
}
Bat {
id: bat
}
StyledText {
text: "|"
visible: bat.visible
}
Tray {
id: tray
}
StyledText {
text: "|"
visible: tray.visible
}
WallPickerButton {
id: wpButton
barScreen: root.modelData
}
StyledText {
text: "|"
}
Pw { Pw {
id: pw
barScreen: root.modelData barScreen: root.modelData
} }
StyledText { Netstatus {}
text: "|"
}
Netstatus {
id: net
}
} }
} }
} }

View file

@ -11,17 +11,25 @@ BarComponent {
required property ShellScreen barScreen required property ShellScreen barScreen
implicitWidth: wsLayout.implicitWidth implicitWidth: wsLayout.implicitWidth
RowLayout { RowLayout {
id: wsLayout id: wsLayout
anchors.centerIn: parent anchors.centerIn: parent
spacing: 4 spacing: 0
Repeater { Repeater {
model: WindowManager.screenProjection(root.barScreen).windowsets model: WindowManager.screenProjection(root.barScreen).windowsets
delegate: BarComponent { delegate: BarComponent {
id: wsContainer id: wsContainer
required property var modelData required property var modelData
implicitWidth: root.implicitHeight / 1.5 visible: modelData.shouldDisplay
implicitHeight: implicitWidth implicitWidth: modelData.active ? root.implicitHeight * 2.2 : root.implicitHeight
color: modelData.active ? Colors.accent : 'transparent' color: modelData.active ? Colors.accent : 'transparent'
Behavior on implicitWidth {
PropertyAnimation {
duration: 350
easing.type: Easing.InOutBack
easing.overshoot: 1.2
}
}
MouseArea { MouseArea {
id: clickHandler id: clickHandler
anchors.fill: parent anchors.fill: parent
@ -33,8 +41,7 @@ BarComponent {
id: wsText id: wsText
anchors.centerIn: parent anchors.centerIn: parent
text: parent.modelData.name text: parent.modelData.name
color: parent.modelData.shouldDisplay ? parent.modelData.active ? Colors.base00 : Colors.base05 : Colors.base03 color: parent.modelData.active ? Colors.base00 : Colors.text
font.bold: parent.modelData.active
} }
} }
} }

View file

@ -0,0 +1,38 @@
pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import Quickshell.Wayland
import qs.settings
import Quickshell.Hyprland
Variants {
model: Quickshell.screens
delegate: WlrLayershell {
required property ShellScreen modelData
id: notiPopup
exclusionMode: ExclusionMode.Ignore
layer: WlrLayer.Overlay
screen: modelData
anchors {
top: true
right: true
}
margins.top: Config.cfg.bar.height + 8 + (Config.cfg.bar.floating ? 10 : 0)
margins.right: 8
implicitHeight: notiList.contentHeight
implicitWidth: modelData.width / 6
color: 'transparent'
visible: NotiServer.notifications.values.length > 0
ListView {
id: notiList
anchors.fill: parent
model: NotiServer.notifications
spacing: 6
delegate: NotiCard {
required property var modelData
nScreen: notiPopup.screen
notification: modelData
}
}
}
}

View file

@ -5,7 +5,7 @@ import QtQuick
Singleton { Singleton {
id: root id: root
property list<Notification> notifications: server.trackedNotifications.values property alias notifications: server.trackedNotifications
NotificationServer { NotificationServer {
id: server id: server
imageSupported: true imageSupported: true

101
modules/overlays/#Top.qml# Normal file
View file

@ -0,0 +1,101 @@
import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.modules.Services
import qs.modules.applets
import qs.settings
Variants {
model: Quickshell.screens
delegate: PanelWindow {
id: root
required property ShellScreen modelData
property bool shown: WidgetTracker.current !== "" && WidgetTracker.screen === modelData
screen: modelData
anchors {
top: true
left: true
bottom: true
right: true
}
exclusionMode: ExclusionMode.Ignore
color: 'transparent'
visible: true
mask: Region {
item: root.shown ? dismisser : null
}
WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
Item {
anchors.fill: parent
focus: true
Keys.onEscapePressed: event => {
WidgetTracker.close();
event.accepted = true;
}
VolPopup {
id: volPopup
z: 1
property bool shown: root.shown && WidgetTracker.current === "volume"
opacity: shown ? 1 : 0
visible: opacity > 0
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height
anchors.rightMargin: 10
Behavior on opacity {
NumberAnimation {
duration: 140
easing.type: Easing.OutCubic
}
}
transform: Translate {
y: volPopup.shown ? 0 : -12
Behavior on y {
NumberAnimation {
duration: 140
easing.type: Easing.OutCubic
}
}
}
}
WallPicker {
id: wallpapers
z: 1
property bool shown: root.shown && WidgetTracker.current === "wallpapers"
opacity: shown ? 1 : 0
visible: opacity > 0
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 20
implicitWidth: 1000
implicitHeight: 200
Behavior on opacity {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
transform: Translate {
y: wallpapers.shown ? 0 : 12
Behavior on y {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
}
}
MouseArea {
id: dismisser
z: 0
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: WidgetTracker.close()
}
}
}
}

View file

@ -4,7 +4,6 @@ import Quickshell.Wayland
import qs.modules.Services import qs.modules.Services
import qs.modules.applets import qs.modules.applets
import qs.settings import qs.settings
import qs.modules.notifications
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
@ -24,12 +23,7 @@ Variants {
color: 'transparent' color: 'transparent'
visible: true visible: true
mask: Region { mask: Region {
Region { item: root.shown ? dismisser : null
item: notiList.visible ? notiList : null
}
Region {
item: root.shown ? dismisser : null
}
} }
WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
Item { Item {
@ -47,7 +41,7 @@ Variants {
visible: opacity > 0 visible: opacity > 0
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height + 10 anchors.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height
anchors.rightMargin: 10 anchors.rightMargin: 10
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {
@ -65,27 +59,6 @@ Variants {
} }
} }
} }
ListView {
id: notiList
z: 2
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Config.cfg.bar.height + 10 + (Config.cfg.bar.floating ? 10 : 0)
anchors.rightMargin: 10
width: root.modelData.width / 6
height: contentHeight
interactive: false
visible: count > 0 && Compositor.focusedScreen === root.modelData
model: NotiServer.notifications
spacing: 6
delegate: NotiCard {
required property var modelData
nScreen: root.modelData
notification: modelData
}
}
WallPicker { WallPicker {
id: wallpapers id: wallpapers
z: 1 z: 1

View file

@ -6,12 +6,12 @@
"rounding": 16 "rounding": 16
}, },
"bar": { "bar": {
"floating": false, "floating": true,
"height": 34, "height": 34,
"opacity": 1 "opacity": 1
}, },
"wallpaper": { "wallpaper": {
"wallDir": "/home/lucy/.walls/", "wallDir": "/home/lucy/.walls/",
"wallpaper": "/home/lucy/.walls/walkingcastle.png" "wallpaper": "/home/lucy/.walls/faris.png"
} }
} }

View file

@ -8,6 +8,7 @@ import qs.modules.Services
ShellRoot { ShellRoot {
Bar {} Bar {}
NotiPopup {}
Bottom {} Bottom {}
Top {} Top {}
} }

View file

@ -5,8 +5,7 @@ import qs.settings
Rectangle { Rectangle {
property bool active: false property bool active: false
color: active ? Colors.activeModuleBg : Colors.barBg color: active ? Colors.activeModuleBg : Colors.moduleBg
implicitHeight: Config.cfg.bar.height - 8 implicitHeight: Config.cfg.bar.height - 8
radius: Config.cfg.appearance.rounding radius: Config.cfg.appearance.rounding
} }