usable
This commit is contained in:
@@ -12,7 +12,22 @@ PanelWindow {
|
||||
|
||||
property real radius: 10
|
||||
|
||||
onRadiusChanged: Hyprland.dispatch("exec hyprctl keyword decoration:rounding " + radius)
|
||||
property list<string> hyprcmds: [
|
||||
"exec hyprctl --batch '" +
|
||||
"keyword general:gaps_out 5;" +
|
||||
"keyword general:border_size 1;" +
|
||||
"keyword windowrule match:title lockscreen, no_blur on, fullscreen on;" +
|
||||
"keyword misc:session_lock_xray true;" +
|
||||
"keyword decoration:blur:enabled true;" +
|
||||
"keyword decoration:active_opacity 0.96;" +
|
||||
"keyword decoration:inactive_opacity 0.96;" +
|
||||
"keyword decoration:rounding " + radius + ";" +
|
||||
"keyword monitor " + Hyprland.monitorFor(root.screen).name + ",1920x1080@60,0x0,1" + ";" +
|
||||
"keyword monitor " + Hyprland.monitorFor(root.screen).name + ",addreserved," + topEx + "," + botEx + "," + leftEx + "," + rightEx + ";" +
|
||||
"'"
|
||||
]
|
||||
|
||||
onRadiusChanged: root.hyprcmds.forEach((c) => Hyprland.dispatch(c))
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
@@ -21,32 +36,10 @@ PanelWindow {
|
||||
bottom: true
|
||||
}
|
||||
|
||||
Lock {
|
||||
id: lock
|
||||
bg_path: "/tmp/nathan/tmp.jpg"
|
||||
//locked: true
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: lt
|
||||
interval: 30000
|
||||
|
||||
running: false
|
||||
|
||||
repeat: false
|
||||
|
||||
onTriggered: lock.locked = false
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
Hyprland.dispatch("exec hyprctl keyword monitor " + Hyprland.monitorFor(root.screen).name + ",addreserved," + topEx + "," + botEx + "," + leftEx + "," + rightEx)
|
||||
Hyprland.dispatch("exec hyprctl keyword decoration:rounding " + radius)
|
||||
|
||||
for(let toplv = 0; toplv < Hyprland.toplevels.values.length; toplv++) {
|
||||
//console.log(Hyprland.toplevels.values[toplv].title)
|
||||
}
|
||||
root.hyprcmds.forEach((c) => { Hyprland.dispatch(c) })
|
||||
}
|
||||
|
||||
property int topEx: topRect.reserve
|
||||
@@ -55,6 +48,7 @@ PanelWindow {
|
||||
property int leftEx: leftRect.reserve
|
||||
property int rightEx: rightRect.reserve
|
||||
|
||||
property color bg: (Pywal.special.background)
|
||||
|
||||
id: root
|
||||
|
||||
@@ -81,43 +75,47 @@ PanelWindow {
|
||||
Region {
|
||||
item: dash.visible ? dash : leftRect
|
||||
}
|
||||
|
||||
Region {
|
||||
item: botRect
|
||||
}
|
||||
|
||||
Region {
|
||||
item: botRect.midFO.visible ? botRect.midFO : botRect
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BarBottom {
|
||||
id: botRect
|
||||
radius: root.radius
|
||||
hyprcmds: root.hyprcmds
|
||||
x: leftRect.x + leftRect.width
|
||||
implicitWidth: rightRect.x - (leftRect.x + leftRect.width)
|
||||
color: root.bg
|
||||
}
|
||||
|
||||
BarLeft {
|
||||
id: leftRect
|
||||
window: root
|
||||
|
||||
Button {
|
||||
implicitWidth: 30
|
||||
implicitHeight: 30
|
||||
|
||||
x: leftRect.x + leftRect.width / 2 - width / 2
|
||||
y: 200
|
||||
onClicked: {
|
||||
lock.locked = true
|
||||
lt.running = true
|
||||
}
|
||||
}
|
||||
color: root.bg
|
||||
}
|
||||
|
||||
BarRight {
|
||||
id: rightRect
|
||||
color: root.bg
|
||||
}
|
||||
|
||||
Shape {
|
||||
|
||||
x: leftRect.x + leftRect.width - 1
|
||||
x: leftRect.cornerX
|
||||
y: topRect.cornerY
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 4
|
||||
strokeColor: Pywal.special.background
|
||||
fillColor: Pywal.special.background
|
||||
strokeWidth: 1
|
||||
|
||||
strokeColor: "transparent"
|
||||
fillColor: Pywal.argb(Pywal.special.background)
|
||||
startX: 0; startY: 0
|
||||
|
||||
PathLine { relativeX: 0; relativeY: radius }
|
||||
@@ -132,13 +130,15 @@ PanelWindow {
|
||||
}
|
||||
Shape {
|
||||
|
||||
x: rightRect.x + 1
|
||||
x: rightRect.x
|
||||
y: topRect.cornerY
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 4
|
||||
strokeColor: Pywal.special.background
|
||||
fillColor: Pywal.special.background
|
||||
strokeWidth: 1
|
||||
|
||||
strokeColor: "transparent"
|
||||
fillColor: Pywal.argb(Pywal.special.background)
|
||||
|
||||
startX: 0; startY: 0
|
||||
|
||||
PathLine { relativeX: 0; relativeY: radius }
|
||||
@@ -154,13 +154,15 @@ PanelWindow {
|
||||
}
|
||||
Shape {
|
||||
|
||||
x: leftRect.x + leftRect.width - 1
|
||||
y: botRect.y + 1
|
||||
x: leftRect.cornerX
|
||||
y: botRect.cornerY
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 4
|
||||
strokeColor: Pywal.special.background
|
||||
fillColor: Pywal.special.background
|
||||
strokeWidth: 1
|
||||
|
||||
strokeColor: "transparent"
|
||||
fillColor: Pywal.argb(Pywal.special.background)
|
||||
|
||||
startX: 0; startY: 0
|
||||
|
||||
PathLine { relativeX: 0; relativeY: -radius }
|
||||
@@ -176,13 +178,14 @@ PanelWindow {
|
||||
}
|
||||
Shape {
|
||||
|
||||
x: rightRect.x + 1
|
||||
y: botRect.y + 1
|
||||
x: rightRect.x
|
||||
y: botRect.cornerY
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 4
|
||||
strokeColor: Pywal.special.background
|
||||
fillColor: Pywal.special.background
|
||||
strokeWidth: 1
|
||||
strokeColor: "transparent"
|
||||
fillColor: Pywal.argb(Pywal.special.background)
|
||||
|
||||
startX: 0; startY: 0
|
||||
|
||||
PathLine { relativeX: 0; relativeY: -radius }
|
||||
@@ -203,6 +206,7 @@ PanelWindow {
|
||||
//y: topRect.y + topRect.height - 1
|
||||
window: root
|
||||
radius: root.radius
|
||||
color: root.bg
|
||||
|
||||
onShowDashChanged: dash.visible = showDash
|
||||
}
|
||||
|
||||
@@ -9,11 +9,49 @@ import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
|
||||
Rectangle {
|
||||
property real reserve: height
|
||||
id: botRect
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
property real reserve: botRectArea.height
|
||||
|
||||
required property real radius
|
||||
required property color color
|
||||
|
||||
property real cornerY: y + botRectArea.y
|
||||
|
||||
required property list<string> hyprcmds
|
||||
|
||||
property Item midFO: midFO
|
||||
|
||||
y: parent.height - height
|
||||
color: Pywal.special.background
|
||||
implicitHeight: 10
|
||||
|
||||
implicitWidth: parent.width
|
||||
spacing: -10
|
||||
|
||||
Launcher {
|
||||
id: midFO
|
||||
radius: root.radius
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
hyprcmds: root.hyprcmds
|
||||
color: root.color
|
||||
}
|
||||
|
||||
WrapperMouseArea {
|
||||
id: botRectArea
|
||||
Rectangle {
|
||||
id: botRect
|
||||
color: root.color
|
||||
anchors.fill: parent
|
||||
}
|
||||
implicitHeight: 10
|
||||
implicitWidth: parent.width
|
||||
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
midFO.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ Rectangle {
|
||||
id: leftRect
|
||||
|
||||
property real reserve: width
|
||||
property real cornerX: width
|
||||
|
||||
required property QsWindow window
|
||||
|
||||
@@ -21,10 +22,7 @@ Rectangle {
|
||||
|
||||
implicitWidth: 40
|
||||
|
||||
color: Pywal.special.background
|
||||
|
||||
|
||||
Launcher {
|
||||
LauncherButton {
|
||||
id: launcher
|
||||
x: parent.width / 2 - implicitWidth / 2
|
||||
y: implicitWidth / 3
|
||||
|
||||
@@ -13,7 +13,6 @@ Rectangle {
|
||||
property real reserve: width
|
||||
id: rightRect
|
||||
x: parent.width - width
|
||||
color: Pywal.special.background
|
||||
implicitWidth: 10
|
||||
implicitHeight: parent.height
|
||||
}
|
||||
|
||||
@@ -10,15 +10,16 @@ import Quickshell.Hyprland
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
spacing: -1
|
||||
spacing: 0
|
||||
|
||||
id: root
|
||||
required property color color
|
||||
|
||||
WrapperMouseArea {
|
||||
id: topRectArea
|
||||
Rectangle {
|
||||
id: topRect
|
||||
color: Pywal.special.background
|
||||
color: root.color
|
||||
anchors.fill: parent
|
||||
}
|
||||
implicitHeight: 10
|
||||
@@ -34,7 +35,7 @@ ColumnLayout {
|
||||
|
||||
required property real radius
|
||||
|
||||
property real cornerY: topRectArea.height - 1
|
||||
property real cornerY: topRectArea.height
|
||||
|
||||
//property real reserve: midFO.visible ? root.height : topRectArea.height
|
||||
property real reserve: topRectArea.height
|
||||
@@ -52,7 +53,7 @@ ColumnLayout {
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
color: Pywal.special.background
|
||||
color: root.color
|
||||
|
||||
visible: true
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ ClippingWrapperRectangle {
|
||||
|
||||
Text {
|
||||
id: text
|
||||
text: UPower.displayDevice.percentage * 100 + "%"
|
||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||
|
||||
padding: 10
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ WrapperMouseArea {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: Qt.formatDateTime(clock.date, "dddd HH:mm:ss MM/dd/yyyy")
|
||||
font.pointSize: 11
|
||||
color: Pywal.special.background
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
|
||||
@@ -23,6 +23,19 @@ Item {
|
||||
|
||||
property int selected: 0
|
||||
|
||||
IpcHandler {
|
||||
target: "dashboard"
|
||||
|
||||
function show() { root.visible = true; }
|
||||
function hide() { root.visible = false; }
|
||||
function toggle() { root.visible = !root.visible; }
|
||||
}
|
||||
|
||||
Power {
|
||||
id: power
|
||||
visible: false
|
||||
}
|
||||
|
||||
|
||||
VFlyoutDown {
|
||||
|
||||
@@ -68,7 +81,7 @@ Item {
|
||||
implicitHeight: 40
|
||||
radius: root.radius
|
||||
color: index == selected ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
//Launcher { anchors.centerIn: parent }
|
||||
//LauncherButton { anchors.centerIn: parent }
|
||||
Text {
|
||||
font.pointSize: 14
|
||||
text: switch(index) {
|
||||
@@ -128,27 +141,29 @@ Item {
|
||||
|
||||
onNotification: (n) => {
|
||||
n.tracked = !n.transient
|
||||
n.closed.connect(() => { console.log("notif closed") })
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
|
||||
readonly property Component launcher: Launcher {}
|
||||
readonly property Component launcher: LauncherButton {}
|
||||
readonly property Component notifs: Notifications { server: nserver }
|
||||
|
||||
readonly property Component bt: Bluetooth {}
|
||||
readonly property Component vol: Volume {}
|
||||
|
||||
readonly property Component bat: PowerMode {}
|
||||
readonly property Component mon: Launcher {}
|
||||
readonly property Component mon: LauncherButton {}
|
||||
|
||||
readonly property Component net: Launcher {}
|
||||
readonly property Component mus: Launcher {}
|
||||
readonly property Component net: LauncherButton {}
|
||||
readonly property Component mus: LauncherButton {}
|
||||
|
||||
readonly property Component clk: Clock {}
|
||||
readonly property Component wal: Launcher {}
|
||||
readonly property Component wal: LauncherButton {}
|
||||
|
||||
sourceComponent: switch(selected) {
|
||||
case 0:
|
||||
@@ -191,7 +206,7 @@ Item {
|
||||
radius: root.radius
|
||||
property bool use: false
|
||||
color: use ? Pywal.colors.color13 : Pywal.colors.color4
|
||||
//Launcher { anchors.centerIn: parent }
|
||||
//LauncherButton { anchors.centerIn: parent }
|
||||
Text {
|
||||
font.pointSize: 14
|
||||
text: switch(index) {
|
||||
@@ -235,6 +250,7 @@ Item {
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
power.visible = true
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingWrapperRectangle {
|
||||
radius: 3
|
||||
implicitWidth: 30; implicitHeight: 30
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.fill: parent
|
||||
text: " "
|
||||
font.pointSize: 16
|
||||
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
color: {
|
||||
containsMouse
|
||||
? Pywal.colors.color12
|
||||
: Pywal.colors.color1
|
||||
VFlyoutUp {
|
||||
id: midFO
|
||||
|
||||
required property list<string> hyprcmds
|
||||
|
||||
visible: false
|
||||
|
||||
item: content
|
||||
|
||||
onExited: visible = false
|
||||
|
||||
ClippingRectangle {
|
||||
id: content
|
||||
radius: root.radius
|
||||
implicitWidth: 700
|
||||
implicitHeight: 450
|
||||
|
||||
color: Pywal.colors.color1
|
||||
|
||||
Wallpaper {
|
||||
implicitWidth: 700
|
||||
//implicitHeight: 350
|
||||
hyprcmds: midFO.hyprcmds
|
||||
}
|
||||
}
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
Process {
|
||||
id: launcher
|
||||
running: false
|
||||
command: ["rofi", "-show", "drun", "-show-icons" ]
|
||||
}
|
||||
|
||||
onClicked: launcher.running = true
|
||||
}
|
||||
|
||||
36
config/aurora/modules/LauncherButton.qml
Normal file
36
config/aurora/modules/LauncherButton.qml
Normal file
@@ -0,0 +1,36 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Controls
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingWrapperRectangle {
|
||||
radius: 3
|
||||
implicitWidth: 30; implicitHeight: 30
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.fill: parent
|
||||
text: " "
|
||||
font.pointSize: 16
|
||||
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
color: {
|
||||
containsMouse
|
||||
? Pywal.colors.color12
|
||||
: Pywal.colors.color1
|
||||
}
|
||||
}
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
Process {
|
||||
id: launcher
|
||||
running: false
|
||||
command: ["rofi", "-show", "drun", "-show-icons" ]
|
||||
}
|
||||
|
||||
onClicked: launcher.running = true
|
||||
}
|
||||
@@ -15,17 +15,19 @@ Item {
|
||||
|
||||
property bool locked: false
|
||||
|
||||
onLockedChanged: lock.locked = locked
|
||||
onLockedChanged: {
|
||||
lock.locked = locked
|
||||
}
|
||||
|
||||
required property string bg_path
|
||||
|
||||
property color fieldColor: ctx.failed ? "red" : Pywal.colors.color1
|
||||
property color fieldColor: ctx.failed ? Pywal.colors.color6 : Pywal.colors.color1
|
||||
|
||||
IpcHandler {
|
||||
target: "lockscreen"
|
||||
|
||||
function lock() { lock.locked = true; }
|
||||
function unlock() { lock.locked = false; }
|
||||
function lock() { root.locked = true; }
|
||||
function unlock() { root.locked = false; }
|
||||
}
|
||||
|
||||
LockCtx {
|
||||
@@ -33,6 +35,11 @@ Item {
|
||||
|
||||
onShouldUnlock: lock.locked = false
|
||||
}
|
||||
|
||||
LockScreen {
|
||||
id: lockscreen
|
||||
visible: root.locked
|
||||
}
|
||||
|
||||
WlSessionLock {
|
||||
|
||||
@@ -47,50 +54,52 @@ Item {
|
||||
|
||||
WlSessionLockSurface {
|
||||
color: "transparent"
|
||||
Image {
|
||||
/*Image {
|
||||
anchors.fill: parent
|
||||
|
||||
source: Qt.resolvedUrl(bg_path)
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
}*/
|
||||
ClippingWrapperRectangle {
|
||||
|
||||
|
||||
anchors.centerIn: parent
|
||||
radius: 10
|
||||
anchors.centerIn: parent
|
||||
radius: 10
|
||||
|
||||
color: Pywal.special.background
|
||||
color: Pywal.special.background
|
||||
|
||||
RowLayout {
|
||||
ClippingWrapperRectangle {
|
||||
color: root.fieldColor
|
||||
implicitWidth: 200
|
||||
TextInput {
|
||||
text: ""
|
||||
RowLayout {
|
||||
ClippingWrapperRectangle {
|
||||
color: root.fieldColor
|
||||
implicitWidth: 200
|
||||
TextInput {
|
||||
text: ""
|
||||
|
||||
onTextChanged: {
|
||||
ctx.pass = text
|
||||
}
|
||||
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
|
||||
font.pointSize: 30
|
||||
//echoMode: TextInput.Password
|
||||
color: Pywal.special.foreground
|
||||
onTextChanged: {
|
||||
ctx.pass = text
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "unlock"
|
||||
onClicked: {
|
||||
ctx.doUnlock()
|
||||
}
|
||||
}
|
||||
echoMode: TextInput.Password
|
||||
|
||||
Button {
|
||||
text: "exit"
|
||||
onClicked: root.locked = false
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
font.pointSize: 30
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "unlock"
|
||||
onClicked: {
|
||||
ctx.doUnlock()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "exit"
|
||||
onClicked: root.locked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
config/aurora/modules/LockScreen.qml
Normal file
17
config/aurora/modules/LockScreen.qml
Normal file
@@ -0,0 +1,17 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
FloatingWindow {
|
||||
title: "lockscreen"
|
||||
|
||||
visible: false
|
||||
|
||||
color: "transparent"
|
||||
}
|
||||
@@ -1,120 +1,126 @@
|
||||
import Quickshell
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Item {
|
||||
width: 30
|
||||
height: 30
|
||||
PanelWindow {
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
id: root
|
||||
|
||||
required property PanelWindow window
|
||||
required property real popupOffset
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
radius: 5
|
||||
width: 30; height: 30
|
||||
Button {
|
||||
id: button
|
||||
text: " "
|
||||
font.pointSize: 16
|
||||
|
||||
onClicked: {
|
||||
menu.visible = true
|
||||
grab.active = true
|
||||
}
|
||||
implicitHeight: parent.height
|
||||
}
|
||||
mask: Region {
|
||||
item: out
|
||||
}
|
||||
|
||||
PopupWindow {
|
||||
|
||||
id: menu
|
||||
color: "#99000000"
|
||||
|
||||
anchor.window: window
|
||||
anchor.rect.x: popupOffset
|
||||
anchor.rect.y: 50
|
||||
implicitWidth: 150
|
||||
implicitHeight: 250
|
||||
visible: false
|
||||
Lock {
|
||||
id: lock
|
||||
bg_path: "/tmp/nathan/tmp.jpg"
|
||||
//locked: true
|
||||
}
|
||||
|
||||
color: "transparent"
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
radius: 5
|
||||
MouseArea {
|
||||
|
||||
implicitHeight: parent.height - 20
|
||||
implicitWidth: parent.width
|
||||
|
||||
ColumnLayout {
|
||||
id: out
|
||||
|
||||
spacing: 0
|
||||
anchors.fill: parent
|
||||
|
||||
Button {
|
||||
Layout.topMargin: 5
|
||||
x: (parent.width - width) / 2
|
||||
implicitWidth: parent.width - 10
|
||||
implicitHeight: parent.height / 5 - parent.spacing
|
||||
onClicked: {
|
||||
root.visible = false
|
||||
}
|
||||
|
||||
text: 'shutdown'
|
||||
onClicked: shutdown.running = true
|
||||
Process {
|
||||
id: shutdown
|
||||
running: false
|
||||
command: ["systemctl", "poweroff"]
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: (parent.width - width) / 2
|
||||
implicitWidth: parent.width - 10
|
||||
implicitHeight: parent.height / 5 - parent.spacing
|
||||
text: 'reboot'
|
||||
onClicked: reboot.running = true
|
||||
Process {
|
||||
id: reboot
|
||||
running: false
|
||||
command: ["systemctl", "reboot"]
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: (parent.width - width) / 2
|
||||
implicitWidth: parent.width - 10
|
||||
implicitHeight: parent.height / 5 - parent.spacing
|
||||
text: 'logout'
|
||||
onClicked: logout.running = true
|
||||
Process {
|
||||
id: logout
|
||||
running: false
|
||||
command: ["loginctl", "kill-session", "self" ]
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
Layout.bottomMargin: 10
|
||||
x: (parent.width - width) / 2
|
||||
implicitWidth: parent.width - 10
|
||||
implicitHeight: parent.height / 5 - parent.spacing
|
||||
text: 'sleep'
|
||||
onClicked: sleep.running = true
|
||||
Process {
|
||||
id: sleep
|
||||
running: false
|
||||
command: ["systemctl", "sleep"]
|
||||
ClippingRectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 200
|
||||
id: main
|
||||
anchors.centerIn: parent
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
GridLayout {
|
||||
columns: 2
|
||||
rows: 2
|
||||
|
||||
Repeater {
|
||||
model: 4
|
||||
WrapperMouseArea {
|
||||
ClippingWrapperRectangle {
|
||||
radius: 10
|
||||
Text {
|
||||
text: switch(index) {
|
||||
case 0:
|
||||
return ""
|
||||
case 1:
|
||||
return " "
|
||||
case 2:
|
||||
return " "
|
||||
case 3:
|
||||
return " "
|
||||
default:
|
||||
return " "
|
||||
break;
|
||||
}
|
||||
font.pointSize: 16
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
color: Pywal.special.foreground
|
||||
}
|
||||
|
||||
implicitHeight: 60
|
||||
implicitWidth: 60
|
||||
color: parent.contansMouse ? Pywal.colors.color12 : Pywal.colors.color4
|
||||
}
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered: {
|
||||
child.color = Pywal.colors.color12
|
||||
}
|
||||
|
||||
onExited: {
|
||||
child.color = Pywal.colors.color4
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
root.visible = false
|
||||
switch(index) {
|
||||
case 0:
|
||||
Hyprland.dispatch("exec loginctl kill-session self")
|
||||
break;
|
||||
case 1:
|
||||
Hyprland.dispatch("exec systemctl reboot")
|
||||
break;
|
||||
case 2:
|
||||
Hyprland.dispatch("exec loginctl lock-session")
|
||||
break;
|
||||
case 3:
|
||||
Hyprland.dispatch("exec systemctl poweroff")
|
||||
break;
|
||||
default:
|
||||
lock.locked = true
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HyprlandFocusGrab {
|
||||
id: grab
|
||||
windows: [ menu ]
|
||||
onCleared: menu.visible = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ ColumnLayout {
|
||||
text: 'performance'
|
||||
onClicked: PowerProfiles.profile = PowerProfile.Performance
|
||||
visible: PowerProfiles.hasPerformanceProfile
|
||||
|
||||
background: Rectangle { color: PowerProfiles.profile == PowerProfile.Performance ? Pywal.colors.color13 : Pywal.colors.color4 }
|
||||
}
|
||||
Button {
|
||||
Layout.topMargin: 5
|
||||
@@ -29,6 +31,7 @@ ColumnLayout {
|
||||
|
||||
text: 'balanced'
|
||||
onClicked: PowerProfiles.profile = PowerProfile.Balanced
|
||||
background: Rectangle { color: PowerProfiles.profile == PowerProfile.Balanced ? Pywal.colors.color13 : Pywal.colors.color4 }
|
||||
}
|
||||
Button {
|
||||
Layout.topMargin: 5
|
||||
@@ -38,5 +41,6 @@ ColumnLayout {
|
||||
|
||||
text: 'power saver'
|
||||
onClicked: PowerProfiles.profile = PowerProfile.PowerSaver
|
||||
background: Rectangle { color: PowerProfiles.profile == PowerProfile.PowerSaver ? Pywal.colors.color13 : Pywal.colors.color4 }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,15 @@ Singleton {
|
||||
|
||||
property string wallpaper: json.wallpaper
|
||||
|
||||
property string alpha: json.alpha
|
||||
property string alpha: Math.round(parseInt(json.alpha, 10) * 0xFF / 100).toString(16)
|
||||
|
||||
property JsonObject special: json.special
|
||||
property JsonObject colors: json.colors
|
||||
|
||||
function argb(c) {
|
||||
return c.slice(0, 1) + Pywal.alpha + c.slice(1)
|
||||
}
|
||||
|
||||
FileView {
|
||||
|
||||
path: "/home/nathan/.cache/wal/colors.json"
|
||||
|
||||
@@ -17,7 +17,7 @@ MouseArea {
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
item.y = pad
|
||||
item.y = root.y + pad
|
||||
}
|
||||
|
||||
width: shape.width
|
||||
@@ -30,8 +30,8 @@ MouseArea {
|
||||
ShapePath {
|
||||
id: path
|
||||
|
||||
strokeWidth: 4
|
||||
strokeColor: root.color
|
||||
strokeWidth: 1
|
||||
strokeColor: "transparent"
|
||||
fillColor: root.color
|
||||
|
||||
startX: -root.radius - pad; startY: 0
|
||||
|
||||
@@ -17,7 +17,7 @@ MouseArea {
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
item.y = pad
|
||||
item.x = pad
|
||||
}
|
||||
|
||||
width: shape.width
|
||||
@@ -34,8 +34,19 @@ MouseArea {
|
||||
strokeColor: root.color
|
||||
fillColor: root.color
|
||||
|
||||
startX: -root.radius - pad; startY: 0
|
||||
startX: 0; startY: -root.radius - pad
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: root.radius
|
||||
}
|
||||
PathLine { x: item.width + 2 * pad - root.radius; relativeY: 0 }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
@@ -50,13 +61,13 @@ MouseArea {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeX: -root.radius
|
||||
relativeY: root.radius
|
||||
}
|
||||
|
||||
PathLine { x: item.width + pad - root.radius; relativeY: 0 }
|
||||
PathLine { relativeX: -item.width - 2 * pad + 2 * root.radius; relativeY: 0 }
|
||||
|
||||
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
@@ -64,21 +75,12 @@ MouseArea {
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: -root.radius
|
||||
relativeX: -root.radius
|
||||
relativeY: root.radius
|
||||
}
|
||||
|
||||
PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { x: -root.radius - pad; y: 0 }
|
||||
PathLine { x: 0; y: -root.radius - pad }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ MouseArea {
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
item.y = pad
|
||||
item.x = pad
|
||||
}
|
||||
|
||||
width: shape.width
|
||||
@@ -34,29 +34,17 @@ MouseArea {
|
||||
strokeColor: root.color
|
||||
fillColor: root.color
|
||||
|
||||
startX: -root.radius - pad; startY: 0
|
||||
startX: 0; startY: pad
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: root.radius
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { relativeX: 0; relativeY: 2 * pad + item.height - 2 * root.radius }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: root.radius
|
||||
}
|
||||
|
||||
PathLine { x: item.width + pad - root.radius; relativeY: 0 }
|
||||
|
||||
PathLine { x: item.width + 2 * pad - root.radius; relativeY: 0 }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
@@ -68,17 +56,31 @@ MouseArea {
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad }
|
||||
PathLine { relativeX: 0; relativeY: 2 * pad + item.height + 2 * root.radius }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
relativeX: root.radius
|
||||
direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: -root.radius
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { x: -root.radius - pad; y: 0 }
|
||||
PathLine { relativeX: -item.width - 2 * pad + 2 * root.radius; relativeY: 0 }
|
||||
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
|
||||
relativeX: -root.radius
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { x: 0; y: pad }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,65 +17,71 @@ MouseArea {
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
item.y = pad
|
||||
item.y = root.y - pad
|
||||
|
||||
//console.log(height)
|
||||
}
|
||||
|
||||
width: shape.width
|
||||
height: shape.height
|
||||
height: item.height + 2 * pad
|
||||
|
||||
Shape {
|
||||
id: shape
|
||||
|
||||
y: root.y + root.item.height
|
||||
|
||||
//anchors.centerIn: parent
|
||||
ShapePath {
|
||||
id: path
|
||||
|
||||
strokeWidth: 4
|
||||
strokeColor: root.color
|
||||
strokeWidth: 1
|
||||
strokeColor: "transparent"
|
||||
fillColor: root.color
|
||||
|
||||
startX: -root.radius - pad; startY: 0
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
radiusY: -root.radius
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: root.radius
|
||||
relativeY: -root.radius
|
||||
direction: PathArc.Counterclockwise
|
||||
}
|
||||
|
||||
PathLine { relativeX: 0; relativeY: 2 * pad + item.height - 2 * root.radius }
|
||||
PathLine { relativeX: 0; relativeY: -(2 * pad + item.height - 2 * root.radius) }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
radiusY: -root.radius
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
//direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: root.radius
|
||||
relativeY: -root.radius
|
||||
}
|
||||
|
||||
PathLine { x: item.width + pad - root.radius; relativeY: 0 }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
radiusY: -root.radius
|
||||
|
||||
direction: PathArc.Counterclockwise
|
||||
//direction: PathArc.Counterclockwise
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: -root.radius
|
||||
relativeY: root.radius
|
||||
}
|
||||
|
||||
PathLine { relativeX: 0; relativeY: -item.height + 2 * root.radius - 2 * pad }
|
||||
PathLine { relativeX: 0; relativeY: -(-item.height + 2 * root.radius - 2 * pad) }
|
||||
|
||||
PathArc {
|
||||
radiusX: root.radius
|
||||
radiusY: root.radius
|
||||
radiusY: -root.radius
|
||||
|
||||
relativeX: root.radius
|
||||
relativeY: -root.radius
|
||||
relativeY: root.radius
|
||||
direction: PathArc.Counterclockwise
|
||||
}
|
||||
|
||||
PathLine { x: -root.radius - pad; y: 0 }
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import Quickshell // for PanelWindow
|
||||
import QtQuick // for Text
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
|
||||
|
||||
ScrollView {
|
||||
//anchors.fill: parent
|
||||
|
||||
required property list<string> hyprcmds
|
||||
|
||||
id: root
|
||||
|
||||
property string dir: "/home/nathan/Pictures/Wallpaper/"
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOn
|
||||
|
||||
Process {
|
||||
id: ls
|
||||
//command: ["find", root.dir + "*"]
|
||||
command: ["ls", dir]
|
||||
running: true
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
rep.model = text.split("\n").filter((s) => { return s != ""; })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
||||
Repeater {
|
||||
id: rep
|
||||
model: 0
|
||||
|
||||
WrapperMouseArea {
|
||||
ClippingWrapperRectangle {
|
||||
radius: 10
|
||||
implicitWidth: 192 * 2; implicitHeight: 108 * 2
|
||||
Image {
|
||||
width: 192 * 2; height: 108 * 2
|
||||
source: Qt.resolvedUrl(root.dir + rep.model[index])
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: 192 * 2
|
||||
sourceSize.height: 108 * 2
|
||||
}
|
||||
}
|
||||
|
||||
property Process sw: Process {
|
||||
command: ["setWallpaper", root.dir + rep.model[index]]
|
||||
running: false
|
||||
onRunningChanged: {
|
||||
root.hyprcmds.forEach((c) => Hyprland.dispatch(c))
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
sw.running = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,15 @@ Item {
|
||||
Repeater {
|
||||
id: rep
|
||||
|
||||
property var ws: {
|
||||
let arr = [];
|
||||
Hyprland.workspaces.values.forEach((w) => { if(w.id > 0) arr.push(w) })
|
||||
return arr;
|
||||
}
|
||||
model: Hyprland.workspaces.values.filter((w) => {
|
||||
if(w != null) {
|
||||
if(w.id > 0) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
model: ws
|
||||
WrapperMouseArea {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
ClippingWrapperRectangle {
|
||||
@@ -34,7 +36,7 @@ Item {
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
Hyprland?.focusedWorkspace?.id == rep.model[index].id
|
||||
? Pywal.colors.color13
|
||||
: containsMouse
|
||||
? Pywal.colors.color12
|
||||
@@ -48,7 +50,7 @@ Item {
|
||||
text: rep.model[index].id
|
||||
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
Hyprland?.focusedWorkspace?.id == rep.model[index].id
|
||||
? Pywal.colors.color1
|
||||
: Pywal.special.foreground
|
||||
}
|
||||
@@ -56,7 +58,9 @@ Item {
|
||||
}
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
rep.model[index].activate()
|
||||
if(Hyprland?.focusedWorkspace?.id != rep.model[index].id) {
|
||||
rep.model[index].activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user