quickshell work
This commit is contained in:
@@ -0,0 +1,81 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
anchors {
|
||||||
|
top: true
|
||||||
|
//left: true
|
||||||
|
//right: true
|
||||||
|
//bottom: true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
id: bar
|
||||||
|
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
WlrLayershell.layer: WlrLayer.Background
|
||||||
|
|
||||||
|
color: "#a0706050"
|
||||||
|
|
||||||
|
|
||||||
|
implicitHeight: 40
|
||||||
|
implicitWidth: 1900
|
||||||
|
|
||||||
|
Flow {
|
||||||
|
x: 0
|
||||||
|
padding: 5
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Launcher { id: l }
|
||||||
|
|
||||||
|
Workspaces { id: ws }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
x: (parent.width - cl.width) / 2 + parent.x - cl.x
|
||||||
|
y: parent.y + (parent.height - height) / 2
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Volume { id: v }
|
||||||
|
|
||||||
|
Battery { id: bat }
|
||||||
|
|
||||||
|
Hyprsunset { id: hs }
|
||||||
|
|
||||||
|
Clock { id: cl }
|
||||||
|
|
||||||
|
IdleInhibitor { id: ii }
|
||||||
|
|
||||||
|
Wifi { id: wifi }
|
||||||
|
|
||||||
|
Bluetooth { id: bt }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Flow {
|
||||||
|
x: parent.width + parent.x - width
|
||||||
|
padding: 5
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
|
||||||
|
Media { id: media }
|
||||||
|
|
||||||
|
Tray { id: tray; window: bar }
|
||||||
|
|
||||||
|
Notifications { id: notif }
|
||||||
|
|
||||||
|
Power {
|
||||||
|
id: power
|
||||||
|
window: bar
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
implicitWidth: 30; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " "
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: idlent
|
||||||
|
running: false
|
||||||
|
command: ["hyprsunset", "-t", "4000"]
|
||||||
|
|
||||||
|
onExited: {
|
||||||
|
running = button.text == " " ? false : true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
idlent.running = button.text == " " ? true : false
|
||||||
|
button.text = button.text == " " ? " " : " "
|
||||||
|
}
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import Quickshell // for PanelWindow
|
||||||
|
import QtQuick // for Text
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
|
||||||
|
property real interval: 100
|
||||||
|
id: root
|
||||||
|
|
||||||
|
radius: 5
|
||||||
|
implicitWidth: 30; height: 30
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: " "
|
||||||
|
font.pointSize: 16
|
||||||
|
Process {
|
||||||
|
id: idlent
|
||||||
|
running: false
|
||||||
|
command: ["systemd-inhibit", "--what=idle", "sleep", root.interval.toString()]
|
||||||
|
|
||||||
|
onExited: {
|
||||||
|
running = button.text == " " ? false : true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
idlent.running = button.text == " " ? true : false
|
||||||
|
button.text = button.text == " " ? " " : " "
|
||||||
|
}
|
||||||
|
implicitHeight: parent.height
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,7 +51,13 @@ Item {
|
|||||||
}
|
}
|
||||||
font.pointSize: 11
|
font.pointSize: 11
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
timer.running = !timer.running
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
id: timer
|
||||||
|
|
||||||
interval: 225
|
interval: 225
|
||||||
|
|
||||||
running: true
|
running: true
|
||||||
|
|||||||
@@ -1,28 +1,49 @@
|
|||||||
import QtQuick // for Text
|
import QtQuick // for Text
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Services.Notifications
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 30
|
width: 50
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
ClippingWrapperRectangle {
|
ClippingWrapperRectangle {
|
||||||
radius: 5
|
radius: 5
|
||||||
width: 30; height: 30
|
anchors.fill: parent
|
||||||
Button {
|
Button {
|
||||||
id: button
|
id: button
|
||||||
text: ""
|
text: ""
|
||||||
|
//icon.source: ''
|
||||||
font.pointSize: 16
|
font.pointSize: 16
|
||||||
Process {
|
|
||||||
id: launcher
|
onClicked: {
|
||||||
running: false
|
while(server.trackedNotifications.values.length > 0) {
|
||||||
command: ["rofi", "-show", "drun"]
|
server.trackedNotifications.values[0].dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
text = ""
|
||||||
}
|
}
|
||||||
onClicked: launcher.running = true
|
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NotificationServer {
|
||||||
|
id: server
|
||||||
|
persistenceSupported: true
|
||||||
|
imageSupported: true
|
||||||
|
actionsSupported: true
|
||||||
|
bodyImagesSupported: true
|
||||||
|
bodySupported: true
|
||||||
|
bodyHyperlinksSupported: true
|
||||||
|
inlineReplySupported: true
|
||||||
|
actionIconsSupported: true
|
||||||
|
|
||||||
|
onNotification: (n) => {
|
||||||
|
n.tracked = true
|
||||||
|
console.log(n?.body)
|
||||||
|
button.text = ' ' + (server.trackedNotifications.values.length + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import Quickshell
|
||||||
import QtQuick // for Text
|
import QtQuick // for Text
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -9,6 +10,10 @@ Item {
|
|||||||
width: 30
|
width: 30
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property var window: null
|
||||||
|
|
||||||
ClippingWrapperRectangle {
|
ClippingWrapperRectangle {
|
||||||
radius: 5
|
radius: 5
|
||||||
width: 30; height: 30
|
width: 30; height: 30
|
||||||
@@ -16,13 +21,59 @@ Item {
|
|||||||
id: button
|
id: button
|
||||||
text: " "
|
text: " "
|
||||||
font.pointSize: 16
|
font.pointSize: 16
|
||||||
Process {
|
|
||||||
id: launcher
|
onClicked: menu.visible = !menu.visible
|
||||||
running: false
|
|
||||||
command: ["rofi", "-show", "drun"]
|
|
||||||
}
|
|
||||||
onClicked: launcher.running = true
|
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PopupWindow {
|
||||||
|
|
||||||
|
id: menu
|
||||||
|
|
||||||
|
anchor.window: window
|
||||||
|
anchor.rect.x: root.parent.x + root.parent.width - width
|
||||||
|
anchor.rect.y: 50
|
||||||
|
implicitWidth: 250
|
||||||
|
implicitHeight: 150
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
radius: 5
|
||||||
|
|
||||||
|
implicitHeight: parent.height - 20
|
||||||
|
implicitWidth: parent.width
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
Button {
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
implicitWidth: parent.width - 10
|
||||||
|
implicitHeight: parent.height / 4 - parent.spacing
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
implicitWidth: parent.width - 10
|
||||||
|
implicitHeight: parent.height / 4 - parent.spacing
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
implicitWidth: parent.width - 10
|
||||||
|
implicitHeight: parent.height / 4 - parent.spacing
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
implicitWidth: parent.width - 10
|
||||||
|
implicitHeight: parent.height / 4 - parent.spacing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ Item {
|
|||||||
width: 10 + rep.count * (2 * lay.spacing + 20)
|
width: 10 + rep.count * (2 * lay.spacing + 20)
|
||||||
height: 30
|
height: 30
|
||||||
visible: SystemTray.items.values.length != 0
|
visible: SystemTray.items.values.length != 0
|
||||||
|
|
||||||
|
id: root
|
||||||
|
property var window: null
|
||||||
|
|
||||||
ClippingWrapperRectangle {
|
ClippingWrapperRectangle {
|
||||||
radius: 5
|
radius: 5
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -23,7 +27,7 @@ Item {
|
|||||||
radius: 10
|
radius: 10
|
||||||
implicitWidth: 20
|
implicitWidth: 20
|
||||||
implicitHeight: 20
|
implicitHeight: 20
|
||||||
AbstractButton {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
@@ -38,7 +42,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: console.log('clicked!')
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
if(mouse.button == Qt.LeftButton) {
|
||||||
|
SystemTray.items.values[index].activate()
|
||||||
|
} else if(mouse.button == Qt.RightButton) {
|
||||||
|
SystemTray.items.values[index].display(root.window, root.x + root.parent.x, 40)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,77 +2,13 @@
|
|||||||
//@ pragma Env QSG_RENDER_LOOP=threaded
|
//@ pragma Env QSG_RENDER_LOOP=threaded
|
||||||
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
|
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
|
||||||
|
|
||||||
import Quickshell // for PanelWindow
|
//@ pragma UseQApplication
|
||||||
import QtQuick // for Text
|
|
||||||
import QtQuick.Controls
|
import Quickshell // for ShellRoot
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.modules
|
import qs.modules
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
PanelWindow {
|
Bar {
|
||||||
anchors {
|
id: bar
|
||||||
top: true
|
|
||||||
//left: true
|
|
||||||
//right: true
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exclusionMode: ExclusionMode.Ignore
|
|
||||||
WlrLayershell.layer: WlrLayer.Background
|
|
||||||
|
|
||||||
color: "#a0706050"
|
|
||||||
|
|
||||||
|
|
||||||
implicitHeight: 40
|
|
||||||
implicitWidth: 1900
|
|
||||||
|
|
||||||
Flow {
|
|
||||||
x: 0
|
|
||||||
padding: 5
|
|
||||||
spacing: 10
|
|
||||||
|
|
||||||
Launcher { id: l }
|
|
||||||
|
|
||||||
Workspaces { id: ws }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
x: (parent.width - cl.width) / 2 + parent.x - cl.x
|
|
||||||
y: parent.y + (parent.height - height) / 2
|
|
||||||
spacing: 10
|
|
||||||
|
|
||||||
Volume { id: v }
|
|
||||||
|
|
||||||
Battery { id: bat }
|
|
||||||
|
|
||||||
Clock { id: cl }
|
|
||||||
|
|
||||||
Wifi { id: wifi }
|
|
||||||
|
|
||||||
Bluetooth { id: bt }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Flow {
|
|
||||||
x: parent.width + parent.x - width
|
|
||||||
padding: 5
|
|
||||||
spacing: 10
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
|
|
||||||
Media { id: media }
|
|
||||||
|
|
||||||
Tray { id: tray }
|
|
||||||
|
|
||||||
Notifications { id: notif }
|
|
||||||
|
|
||||||
Power { id: power }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user