initial commit

This commit is contained in:
2025-09-09 12:03:05 +02:00
commit 2d5299c8fa
15 changed files with 622 additions and 0 deletions

30
bar/Music.qml Normal file
View File

@@ -0,0 +1,30 @@
import QtQuick
import Quickshell.Services.Mpris
Text {
required property MprisPlayer player
text: `${player.trackTitle} - ${player.trackArtist || "Unknown Artist"}`
color: "white"
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
if (mouse.button === Qt.RightButton) {
parent.player.canGoNext && parent.player.next()
} else if (mouse.button === Qt.LeftButton) {
parent.player.canTogglePlaying && parent.player.togglePlaying()
}
}
onWheel: (event) => {
if (!parent.player.volumeSupported || !parent.player.canControl){
return
}
parent.player.volume = parent.player.volume + (event.angleDelta.y / 120 * 0.05)
}
}
}

24
bar/Pill.qml Normal file
View File

@@ -0,0 +1,24 @@
import QtQuick
import QtQuick.Shapes
import QtQuick.Layouts
Rectangle {
id: pill
default property alias content: container.data
// Center in the middle of the bar
anchors.verticalCenter: parent.verticalCenter
implicitWidth: container.childrenRect.width + 15
implicitHeight: container.childrenRect.height + 12
color: "#939ab7"
radius: 18
Loader {
id: container
width: childrenRect.width
height: childrenRect.height
anchors.centerIn: parent
}
}

54
bar/StatusBar.qml Normal file
View File

@@ -0,0 +1,54 @@
import Quickshell
import QtQuick
import Quickshell.Io
import Quickshell.Hyprland
import QtQuick.Layouts
import Quickshell.Services.Mpris
import "root:/singeltons"
PanelWindow {
required property ShellScreen modelData
screen: modelData
anchors {
top: true
left: true
right: true
}
height: 30
color: "transparent"
Pill {
Workspaces {}
}
Pill {
anchors.centerIn: parent
Text {
text: Time.time
color: "white"
font.pixelSize: 14
}
}
Pill {
anchors.verticalCenter: parent.verticalCenter
anchors.right: music.left
anchors.rightMargin: 10
Volume {}
}
Pill {
id: music
anchors.right: parent.right
anchors.rightMargin: 10
Music {
player: Mpris.players.values[0]
}
}
}

16
bar/Volume.qml Normal file
View File

@@ -0,0 +1,16 @@
import QtQuick
import "root:singeltons"
Text {
text: `${Pipewire.volumePercent}% ${Pipewire.micMuted}`
color: "white"
MouseArea {
anchors.fill: parent
onWheel: (event) => {
Pipewire.setVolume(Pipewire.volume + (event.angleDelta.y / 120 * 0.05))
}
}
}

51
bar/Workspaces.qml Normal file
View File

@@ -0,0 +1,51 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import QtQuick.Layouts
Rectangle {
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
color: "transparent"
Row {
id: content
anchors.fill: parent
Repeater {
model: ScriptModel {
values: Hyprland.workspaces.values.filter(e => e.id >= 0)
}
Rectangle {
required property HyprlandWorkspace modelData
property bool hovered: false
width: 25
height: 20
color: "transparent"
Text {
text: modelData.name
color: modelData.active ? "#09608c" : "#cccccc"
anchors.centerIn: parent
font.pixelSize: 14
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
modelData.activate()
parent.hovered = false
}
onEntered: parent.hovered = !modelData.active
onExited: parent.hovered = false
}
}
}
}
}