fix some things and create batter and volume impl

This commit is contained in:
lucy 2026-01-15 15:14:29 +01:00
parent 92e9232629
commit 0a0a333472
11 changed files with 96 additions and 16 deletions

View File

@ -36,12 +36,12 @@ Variants {
} }
Row { Row {
spacing: 10
id: rightStuff id: rightStuff
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
CustomText { Volume {}
text: "status shit goes here" Battery {}
}
} }
} }
} }

36
modules/Bar/Battery.qml Normal file
View File

@ -0,0 +1,36 @@
import Quickshell
import Quickshell.Services.UPower
import QtQuick
import Quickshell.Widgets
import "../../reusables/"
import "../../"
import "../../settings/"
Item {
id: root
implicitWidth: batRow.implicitWidth
implicitHeight: Settings.config.barHeight
Rectangle {
id: batRow
implicitWidth: batText.implicitWidth + batIcon.implicitWidth + 10
color: "transparent"
implicitHeight: Settings.config.barHeight
Row {
anchors.centerIn: batRow
anchors.verticalCenter: batRow.verticalCenter
CustomText {
id: batText
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
}
IconImage {
anchors.verticalCenter: batRow.verticalCenter
id: batIcon
source: Quickshell.iconPath(UPower.displayDevice.iconName)
implicitSize: 14
}
}
}
}

View File

View File

View File

@ -6,19 +6,13 @@ import "../../"
import Quickshell.Hyprland import Quickshell.Hyprland
Item { Item {
id: root
implicitHeight: Settings.config.barHeight
implicitWidth: textContainer.implicitWidth
Rectangle {
id: textContainer id: textContainer
color: Colors.foreground implicitWidth: text.implicitWidth
implicitWidth: text.implicitWidth + 10
implicitHeight: Settings.config.barHeight implicitHeight: Settings.config.barHeight
CustomText { CustomText {
id: text id: text
color: Colors.background anchors.horizontalCenter: parent.horizontalCenter
anchors.centerIn: textContainer anchors.verticalCenter: parent.verticalCenter
text: Hyprland.activeToplevel.activated ? Hyprland.activeToplevel.title : "sigma" text: Hyprland.activeToplevel.activated ? Hyprland.activeToplevel.title : "sigma"
} }
} }
}

0
modules/Bar/TrayItem.qml Normal file
View File

20
modules/Bar/Volume.qml Normal file
View File

@ -0,0 +1,20 @@
import Quickshell
import QtQuick
import Quickshell.Services.Pipewire
import "../../reusables/"
import "../../settings/"
import "../../"
Item {
id: root
implicitWidth: volumeText.implicitWidth + 10
implicitHeight: Settings.config.barHeight
CustomText {
id: volumeText
anchors.centerIn: parent
PwObjectTracker {
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
}
text: Pipewire.ready ? Pipewire.defaultAudioSink.audio.muted ? "mut: " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100) + "%" : "vol: " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100) + "%" : "failure"
}
}

View File

@ -0,0 +1,26 @@
import Quickshell
import QtQuick
import Quickshell.Wayland
import "../../settings/"
Variants {
id: root
model: Quickshell.screens
delegate: WlrLayershell {
required property var modelData
id: wpShell
anchors {
left: true
top: true
bottom: true
right: true
}
layer: WlrLayer.Background
Image {
fillMode: Image.Stretch
source: Settings.config.currentWall
width: modelData.width
height: modelData.height
}
}
}

View File

@ -21,6 +21,7 @@ Singleton {
adapter: JsonAdapter { adapter: JsonAdapter {
id: settingsAdapter id: settingsAdapter
property var currentWall: "/home/lucy/.walls/faris.jpg"
property var barHeight: 18 property var barHeight: 18
property var font: "JetBrainsMono Nerd Font" property var font: "JetBrainsMono Nerd Font"
property var fontSize: 12 property var fontSize: 12

View File

@ -1,5 +1,6 @@
{ {
"barHeight": 18, "barHeight": 18,
"currentWall": "/home/lucy/.walls/faris.jpg",
"floating": true, "floating": true,
"font": "JetBrainsMono Nerd Font", "font": "JetBrainsMono Nerd Font",
"fontSize": 12, "fontSize": 12,

View File

@ -2,8 +2,10 @@ import Quickshell
import QtQuick import QtQuick
import "./settings/" import "./settings/"
import "./modules/Bar/" import "./modules/Bar/"
import "./modules/overlays/"
ShellRoot { ShellRoot {
id: root id: root
Bar {} Bar {}
Wallpaper {}
} }