dashboard on right, change trigger to clock
This commit is contained in:
@@ -54,7 +54,7 @@ Variants {
|
|||||||
y: 34
|
y: 34
|
||||||
|
|
||||||
property list<Region> nullRegions: []
|
property list<Region> nullRegions: []
|
||||||
property bool hcurrent: ( panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") ) || visibilities.sidebar
|
property bool hcurrent: ( panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") ) || visibilities.sidebar || visibilities.dashboard
|
||||||
|
|
||||||
width: hcurrent ? 0 : bar.width
|
width: hcurrent ? 0 : bar.width
|
||||||
height: hcurrent ? 0 : bar.screen.height - backgroundRect.implicitHeight
|
height: hcurrent ? 0 : bar.screen.height - backgroundRect.implicitHeight
|
||||||
@@ -135,17 +135,19 @@ Variants {
|
|||||||
onPressed: event => {
|
onPressed: event => {
|
||||||
var traywithinX = mouseX >= panels.popouts.x + 8 && mouseX < panels.popouts.x + panels.popouts.implicitWidth;
|
var traywithinX = mouseX >= panels.popouts.x + 8 && mouseX < panels.popouts.x + panels.popouts.implicitWidth;
|
||||||
var traywithinY = mouseY >= panels.popouts.y + exclusionZone.implicitHeight && mouseY < panels.popouts.y + exclusionZone.implicitHeight + panels.popouts.implicitHeight;
|
var traywithinY = mouseY >= panels.popouts.y + exclusionZone.implicitHeight && mouseY < panels.popouts.y + exclusionZone.implicitHeight + panels.popouts.implicitHeight;
|
||||||
var sidebarwithinX = mouseX <= bar.width - panels.sidebar.width
|
var sidebarwithinX = mouseX >= bar.width - panels.sidebar.width
|
||||||
|
var dashboardWithinX = mouseX <= panels.dashboard.width + panels.dashboard.x
|
||||||
console.log(sidebarwithinX)
|
var dashboardWithinY = mouseY <= backgroundRect.implicitHeight + panels.dashboard.implicitHeight
|
||||||
|
|
||||||
if ( panels.popouts.hasCurrent ) {
|
if ( panels.popouts.hasCurrent ) {
|
||||||
if ( traywithinX && traywithinY ) {
|
if ( traywithinX && traywithinY ) {
|
||||||
} else {
|
} else {
|
||||||
panels.popouts.hasCurrent = false;
|
panels.popouts.hasCurrent = false;
|
||||||
}
|
}
|
||||||
} else if ( visibilities.sidebar && sidebarwithinX ) {
|
} else if ( visibilities.sidebar && !sidebarwithinX ) {
|
||||||
visibilities.sidebar = false;
|
visibilities.sidebar = false;
|
||||||
|
} else if ( visibilities.dashboard && ( !dashboardWithinX || !dashboardWithinY )) {
|
||||||
|
visibilities.dashboard = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Shape {
|
|||||||
Dashboard.Background {
|
Dashboard.Background {
|
||||||
wrapper: root.panels.dashboard
|
wrapper: root.panels.dashboard
|
||||||
|
|
||||||
startX: ( root.width - wrapper.width ) / 2 - rounding
|
startX: root.width - root.panels.dashboard.width - rounding
|
||||||
startY: 0
|
startY: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ Item {
|
|||||||
|
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-2
@@ -14,6 +14,8 @@ Singleton {
|
|||||||
property string autoGpuType: "NONE"
|
property string autoGpuType: "NONE"
|
||||||
property real gpuPerc
|
property real gpuPerc
|
||||||
property real gpuTemp
|
property real gpuTemp
|
||||||
|
property real gpuMemUsed
|
||||||
|
property real gpuMemTotal: 0
|
||||||
property real memUsed
|
property real memUsed
|
||||||
property real memTotal
|
property real memTotal
|
||||||
readonly property real memPerc: memTotal > 0 ? memUsed / memTotal : 0
|
readonly property real memPerc: memTotal > 0 ? memUsed / memTotal : 0
|
||||||
@@ -150,10 +152,22 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: oneshotMem
|
||||||
|
command: ["nvidia-smi", "--query-gpu=memory.total", "--format=csv,noheader,nounits"]
|
||||||
|
running: root.gpuType === "NVIDIA" && root.gpuMemTotal === 0
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
root.gpuMemTotal = Number(this.text.trim())
|
||||||
|
oneshotMem.running = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: gpuUsage
|
id: gpuUsage
|
||||||
|
|
||||||
command: root.gpuType === "GENERIC" ? ["sh", "-c", "cat /sys/class/drm/card*/device/gpu_busy_percent"] : root.gpuType === "NVIDIA" ? ["nvidia-smi", "--query-gpu=utilization.gpu,temperature.gpu", "--format=csv,noheader,nounits"] : ["echo"]
|
command: root.gpuType === "GENERIC" ? ["sh", "-c", "cat /sys/class/drm/card*/device/gpu_busy_percent"] : root.gpuType === "NVIDIA" ? ["nvidia-smi", "--query-gpu=utilization.gpu,temperature.gpu,memory.used", "--format=csv,noheader,nounits"] : ["echo"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
if (root.gpuType === "GENERIC") {
|
if (root.gpuType === "GENERIC") {
|
||||||
@@ -161,9 +175,10 @@ Singleton {
|
|||||||
const sum = percs.reduce((acc, d) => acc + parseInt(d, 10), 0);
|
const sum = percs.reduce((acc, d) => acc + parseInt(d, 10), 0);
|
||||||
root.gpuPerc = sum / percs.length / 100;
|
root.gpuPerc = sum / percs.length / 100;
|
||||||
} else if (root.gpuType === "NVIDIA") {
|
} else if (root.gpuType === "NVIDIA") {
|
||||||
const [usage, temp] = text.trim().split(",");
|
const [usage, temp, mem] = text.trim().split(",");
|
||||||
root.gpuPerc = parseInt(usage, 10) / 100;
|
root.gpuPerc = parseInt(usage, 10) / 100;
|
||||||
root.gpuTemp = parseInt(temp, 10);
|
root.gpuTemp = parseInt(temp, 10);
|
||||||
|
root.gpuMemUsed = parseInt(mem, 10) / root.gpuMemTotal;
|
||||||
} else {
|
} else {
|
||||||
root.gpuPerc = 0;
|
root.gpuPerc = 0;
|
||||||
root.gpuTemp = 0;
|
root.gpuTemp = 0;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ RowLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( visibilities.sidebar )
|
if ( visibilities.sidebar || visibilities.dashboard )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const id = ch.id;
|
const id = ch.id;
|
||||||
@@ -145,6 +145,7 @@ RowLayout {
|
|||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: NotifBell {
|
sourceComponent: NotifBell {
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
popouts: root.popouts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,6 +154,7 @@ RowLayout {
|
|||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: Clock {
|
sourceComponent: Clock {
|
||||||
popouts: root.popouts
|
popouts: root.popouts
|
||||||
|
visibilities: root.visibilities
|
||||||
loader: root
|
loader: root
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,14 +180,14 @@ RowLayout {
|
|||||||
sourceComponent: NetworkWidget {}
|
sourceComponent: NetworkWidget {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
// DelegateChoice {
|
||||||
roleValue: "dash"
|
// roleValue: "dash"
|
||||||
delegate: WrappedLoader {
|
// delegate: WrappedLoader {
|
||||||
sourceComponent: DashWidget {
|
// sourceComponent: DashWidget {
|
||||||
visibilities: root.visibilities
|
// visibilities: root.visibilities
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-6
@@ -1,3 +1,4 @@
|
|||||||
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Config
|
import qs.Config
|
||||||
@@ -6,6 +7,7 @@ import qs.Helpers as Helpers
|
|||||||
import qs.Components
|
import qs.Components
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
required property PersistentProperties visibilities
|
||||||
required property Wrapper popouts
|
required property Wrapper popouts
|
||||||
required property RowLayout loader
|
required property RowLayout loader
|
||||||
|
|
||||||
@@ -35,12 +37,15 @@ Item {
|
|||||||
StateLayer {
|
StateLayer {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if ( mouse.button === Qt.LeftButton && !visibilities.sidebar ) {
|
root.visibilities.dashboard = !root.visibilities.dashboard;
|
||||||
Helpers.Calendar.displayYear = new Date().getFullYear();
|
if ( root.visibilities.sidebar || root.popouts.hasCurrent ) {
|
||||||
Helpers.Calendar.displayMonth = new Date().getMonth();
|
// Helpers.Calendar.displayYear = new Date().getFullYear();
|
||||||
root.popouts.currentName = "calendar";
|
// Helpers.Calendar.displayMonth = new Date().getMonth();
|
||||||
root.popouts.currentCenter = Qt.binding( () => item.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
// root.popouts.currentName = "calendar";
|
||||||
root.popouts.hasCurrent = true;
|
// root.popouts.currentCenter = Qt.binding( () => item.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||||
|
// root.popouts.hasCurrent = true;
|
||||||
|
root.popouts.hasCurrent = false;
|
||||||
|
root.visibilities.sidebar = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: Appearance.padding.large
|
anchors.margins: Appearance.padding.smaller
|
||||||
|
|
||||||
radius: 8
|
radius: 6
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Flickable {
|
Item {
|
||||||
id: view
|
id: view
|
||||||
|
|
||||||
readonly property int currentIndex: root.state.currentTab
|
readonly property int currentIndex: root.state.currentTab
|
||||||
@@ -38,36 +38,9 @@ Item {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
flickableDirection: Flickable.HorizontalFlick
|
|
||||||
|
|
||||||
implicitWidth: currentItem.implicitWidth
|
implicitWidth: currentItem.implicitWidth
|
||||||
implicitHeight: currentItem.implicitHeight
|
implicitHeight: currentItem.implicitHeight
|
||||||
|
|
||||||
contentX: currentItem.x
|
|
||||||
contentWidth: row.implicitWidth
|
|
||||||
contentHeight: row.implicitHeight
|
|
||||||
|
|
||||||
onContentXChanged: {
|
|
||||||
if (!moving)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const x = contentX - currentItem.x;
|
|
||||||
if (x > currentItem.implicitWidth / 2)
|
|
||||||
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
|
|
||||||
else if (x < -currentItem.implicitWidth / 2)
|
|
||||||
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
onDragEnded: {
|
|
||||||
const x = contentX - currentItem.x;
|
|
||||||
if (x > currentItem.implicitWidth / 10)
|
|
||||||
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
|
|
||||||
else if (x < -currentItem.implicitWidth / 10)
|
|
||||||
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
|
|
||||||
else
|
|
||||||
contentX = Qt.binding(() => currentItem.x);
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
||||||
@@ -79,10 +52,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on contentX {
|
|
||||||
Anim {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+23
-20
@@ -15,8 +15,10 @@ GridLayout {
|
|||||||
required property PersistentProperties state
|
required property PersistentProperties state
|
||||||
readonly property bool dashboardVisible: visibilities.dashboard
|
readonly property bool dashboardVisible: visibilities.dashboard
|
||||||
|
|
||||||
rowSpacing: Appearance.spacing.normal
|
property int radius: 6
|
||||||
columnSpacing: Appearance.spacing.normal
|
|
||||||
|
rowSpacing: Appearance.spacing.smaller
|
||||||
|
columnSpacing: Appearance.spacing.smaller
|
||||||
|
|
||||||
opacity: 0
|
opacity: 0
|
||||||
scale: 0.9
|
scale: 0.9
|
||||||
@@ -63,7 +65,7 @@ GridLayout {
|
|||||||
Layout.preferredWidth: user.implicitWidth
|
Layout.preferredWidth: user.implicitWidth
|
||||||
Layout.preferredHeight: user.implicitHeight
|
Layout.preferredHeight: user.implicitHeight
|
||||||
|
|
||||||
radius: 6
|
radius: root.radius
|
||||||
|
|
||||||
User {
|
User {
|
||||||
id: user
|
id: user
|
||||||
@@ -78,31 +80,31 @@ GridLayout {
|
|||||||
Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
|
Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
radius: 6
|
radius: root.radius
|
||||||
|
|
||||||
Weather {}
|
Weather {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect {
|
// Rect {
|
||||||
Layout.row: 1
|
// Layout.row: 1
|
||||||
Layout.preferredWidth: dateTime.implicitWidth
|
// Layout.preferredWidth: dateTime.implicitWidth
|
||||||
Layout.fillHeight: true
|
// Layout.fillHeight: true
|
||||||
|
//
|
||||||
radius: 6
|
// radius: root.radius
|
||||||
|
//
|
||||||
DateTime {
|
// DateTime {
|
||||||
id: dateTime
|
// id: dateTime
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Rect {
|
Rect {
|
||||||
Layout.row: 1
|
Layout.row: 1
|
||||||
Layout.column: 1
|
Layout.column: 0
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: calendar.implicitHeight
|
Layout.preferredHeight: calendar.implicitHeight
|
||||||
|
|
||||||
radius: 6
|
radius: root.radius
|
||||||
|
|
||||||
Calendar {
|
Calendar {
|
||||||
id: calendar
|
id: calendar
|
||||||
@@ -113,11 +115,12 @@ GridLayout {
|
|||||||
|
|
||||||
Rect {
|
Rect {
|
||||||
Layout.row: 1
|
Layout.row: 1
|
||||||
Layout.column: 4
|
Layout.column: 3
|
||||||
|
Layout.columnSpan: 2
|
||||||
Layout.preferredWidth: resources.implicitWidth
|
Layout.preferredWidth: resources.implicitWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
radius: 6
|
radius: root.radius
|
||||||
|
|
||||||
Resources {
|
Resources {
|
||||||
id: resources
|
id: resources
|
||||||
@@ -131,7 +134,7 @@ GridLayout {
|
|||||||
Layout.preferredWidth: media.implicitWidth
|
Layout.preferredWidth: media.implicitWidth
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
radius: 6
|
radius: root.radius
|
||||||
|
|
||||||
Media {
|
Media {
|
||||||
id: media
|
id: media
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Row {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
padding: Appearance.padding.large
|
padding: Appearance.padding.large
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.large
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
service: SystemUsage
|
service: SystemUsage
|
||||||
@@ -29,6 +29,18 @@ Row {
|
|||||||
color: DynamicColors.palette.m3secondary
|
color: DynamicColors.palette.m3secondary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Resource {
|
||||||
|
icon: "gamepad"
|
||||||
|
value: SystemUsage.gpuPerc
|
||||||
|
color: DynamicColors.palette.m3primaryFixed
|
||||||
|
}
|
||||||
|
|
||||||
|
Resource {
|
||||||
|
icon: "host"
|
||||||
|
value: SystemUsage.gpuMemUsed
|
||||||
|
color: DynamicColors.palette.m3secondaryFixed
|
||||||
|
}
|
||||||
|
|
||||||
Resource {
|
Resource {
|
||||||
icon: "hard_disk"
|
icon: "hard_disk"
|
||||||
value: SystemUsage.storagePerc
|
value: SystemUsage.storagePerc
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property PersistentProperties visibilities
|
required property PersistentProperties visibilities
|
||||||
|
required property Wrapper popouts
|
||||||
|
|
||||||
implicitWidth: 25
|
implicitWidth: 25
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -40,8 +41,11 @@ Item {
|
|||||||
StateLayer {
|
StateLayer {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// Hyprland.dispatch("global zshell-nc:toggle-nc");
|
|
||||||
root.visibilities.sidebar = !root.visibilities.sidebar;
|
root.visibilities.sidebar = !root.visibilities.sidebar;
|
||||||
|
if ( root.visibilities.dashboard || root.popouts.hasCurrent ) {
|
||||||
|
root.popouts.hasCurrent = false;
|
||||||
|
root.visibilities.dashboard = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Singleton {
|
|||||||
processGpu.running = true
|
processGpu.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
interval = 1000
|
interval = 3000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ Item {
|
|||||||
if ( mouse.button === Qt.LeftButton ) {
|
if ( mouse.button === Qt.LeftButton ) {
|
||||||
root.item.activate();
|
root.item.activate();
|
||||||
} else if ( mouse.button === Qt.RightButton ) {
|
} else if ( mouse.button === Qt.RightButton ) {
|
||||||
if ( visibilities.sidebar ) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
root.popouts.currentName = `traymenu${ root.ind }`;
|
root.popouts.currentName = `traymenu${ root.ind }`;
|
||||||
root.popouts.currentCenter = Qt.binding( () => root.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
root.popouts.currentCenter = Qt.binding( () => root.mapToItem( root.loader, root.implicitWidth / 2, 0 ).x );
|
||||||
root.popouts.hasCurrent = true;
|
root.popouts.hasCurrent = true;
|
||||||
|
if ( visibilities.sidebar || visibilities.dashboard ) {
|
||||||
|
visibilities.sidebar = false;
|
||||||
|
visibilities.dashboard = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user