Compare commits

...

13 Commits

8 changed files with 213 additions and 18 deletions

View File

@@ -33,13 +33,7 @@ PanelWindow {
// fullscreen windows.
WlrLayershell.layer: WlrLayer.Overlay
Pill {
Text {
text: "Ahhh"
}
}
ColumnLayout {
ColumnLayout {
id: content
Text {

View File

@@ -16,7 +16,7 @@ PanelWindow {
right: true
}
height: 30
implicitHeight: 30
color: "transparent"
@@ -36,8 +36,10 @@ PanelWindow {
}
Pill {
id: volume
anchors.verticalCenter: parent.verticalCenter
anchors.right: music.left
anchors.right: parent.right
anchors.rightMargin: 10
Volume {}
}
@@ -45,10 +47,10 @@ PanelWindow {
Pill {
id: music
anchors.right: parent.right
anchors.right: volume.left
anchors.rightMargin: 10
Music {
player: Mpris.players.values[0]
player: Mpris.players.values.find(e => e.identity == "Spotify")
}
}
}

31
bar/SystemTray.qml Normal file
View File

@@ -0,0 +1,31 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.SystemTray
import Quickshell.Widgets
RowLayout {
Repeater {
model: ScriptModel {
values: SystemTray.items.values.filter(e => e.status != Status.Passive)
}
IconImage {
required property SystemTrayItem modelData
width: 25
height: 15
source: modelData.icon
MouseArea {
anchors.fill: parent
onClicked: (event) => {
console.log( JSON.stringify(parent.modelData))
// parent.modelData.display(parent,0,0)
// menu.open()
}
}
}
}
}

View File

@@ -3,13 +3,14 @@ import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Quickshell.Wayland
import Quickshell.Hyprland
import Quickshell.Io
import "root:/singeltons"
import "root:/utils"
PanelWindow {
id: root
property bool show: true
property bool show: false
implicitWidth: 600
implicitHeight: 400
@@ -20,14 +21,18 @@ PanelWindow {
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.layer: WlrLayer.Top
HyprlandWindow.opacity: 0.9
CustomShortcut {
name: "openLauncher"
description: "Open launcher"
onPressed: {root.show = true; }
}
// Main window
Rectangle {
anchors.fill: parent
anchors.centerIn: parent
color: Qt.hsla(0, 0, 1, 0.5)
color: "#363a4f"
border.color: Qt.hsla(0, 0, 1, 0.2)
border.width: 2
radius: 12
@@ -60,6 +65,7 @@ PanelWindow {
case (Qt.Key_Escape):
root.show = false
event.accepted = true
searchInput.clear()
break
case (Qt.Key_Return):
case (Qt.Key_Enter):
@@ -69,6 +75,7 @@ PanelWindow {
}
root.show = false
event.accepted = true
searchInput.clear()
break
case (Qt.Key_Down):
case (Qt.Key_Tab):

131
launcher/Powermenu.qml Normal file
View File

@@ -0,0 +1,131 @@
import Quickshell
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Quickshell.Wayland
import Quickshell.Io
import "root:/singeltons"
import "root:/utils"
PanelWindow {
id: root
property bool show: false
property int selectedIndex: 0
property int buttonCount: 5
implicitWidth: 600
implicitHeight: 150
visible: show
focusable: true
color: "transparent"
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
WlrLayershell.layer: WlrLayer.Top
CustomShortcut {
name: "openPowermenu"
description: "Open powermenu"
onPressed: {root.show = true; }
}
function executeButton(index){
switch (index){
case 0:
Quickshell.execDetached(["systemctl", "poweroff"])
break
case 1:
Quickshell.execDetached(["systemctl", "reboot"])
break
case 2:
Quickshell.execDetached(["loginctl", "lock-session"])
break
case 3:
Quickshell.execDetached(["hyprctl", "dispatch", "exit"])
break
case 4:
Quickshell.execDetached(["sh", "-c", "boot-windows && systemctl reboot"])
break
}
}
// Main window
Rectangle {
anchors.fill: parent
anchors.centerIn: parent
focus: true
color: "#363a4f"
border.color: Qt.hsla(0, 0, 1, 0.2)
border.width: 2
radius: 12
Keys.onPressed: (event) => {
switch (event.key){
case (Qt.Key_Escape):
root.show = false
event.accepted = true
break
case (Qt.Key_Return):
case (Qt.Key_Enter):
root.show = false
executeButton(root.selectedIndex)
event.accepted = true
break
case (Qt.Key_Tab):
case (Qt.Key_Right):
root.selectedIndex = (root.selectedIndex + 1) % root.buttonCount
event.accepted = true
break
case (Qt.Key_Left):
root.selectedIndex = (root.selectedIndex - 1 + root.buttonCount) % root.buttonCount
event.accepted = true
break
}
}
RowLayout {
anchors.fill: parent
anchors.margins: 20
PowermenuButton {
active: root.selectedIndex == 0
icon: "⏻"
}
Item { Layout.fillWidth: true } // spacer
PowermenuButton {
active: root.selectedIndex == 1
icon: ""
}
Item { Layout.fillWidth: true } // spacer
PowermenuButton {
active: root.selectedIndex == 2
icon: ""
}
Item { Layout.fillWidth: true } // spacer
PowermenuButton {
active: root.selectedIndex == 3
icon: ""
}
Item { Layout.fillWidth: true } // spacer
PowermenuButton {
active: root.selectedIndex == 4
icon: ""
}
}
}
}

View File

@@ -0,0 +1,24 @@
import Quickshell
import QtQuick
Rectangle {
implicitWidth: 100
implicitHeight: 50
property bool active: false
property string icon: "?"
color: active
? "#5b6078"
: "#494d64"
radius: 12
Text {
anchors.centerIn: parent
text: parent.icon
font.pointSize: 28
color: "#cad3f5"
}
}

View File

@@ -10,12 +10,13 @@ ShellRoot{
//
// ActivateLinux {}
// }
//
Variants {
model: Quickshell.screens
StatusBar {}
}
// Launcher {}
Launcher {}
Powermenu {}
}

5
utils/CustomShortcut.qml Normal file
View File

@@ -0,0 +1,5 @@
import Quickshell.Hyprland
GlobalShortcut {
appid: "quickshell"
}