fix some things and create batter and volume impl
This commit is contained in:
parent
92e9232629
commit
0a0a333472
@ -36,12 +36,12 @@ Variants {
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: 10
|
||||
id: rightStuff
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
CustomText {
|
||||
text: "status shit goes here"
|
||||
}
|
||||
Volume {}
|
||||
Battery {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
36
modules/Bar/Battery.qml
Normal file
36
modules/Bar/Battery.qml
Normal 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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
0
modules/Bar/PowerProfiles.qml
Normal file
0
modules/Bar/PowerProfiles.qml
Normal file
0
modules/Bar/SystemTray.qml
Normal file
0
modules/Bar/SystemTray.qml
Normal file
@ -6,19 +6,13 @@ import "../../"
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Item {
|
||||
id: root
|
||||
implicitHeight: Settings.config.barHeight
|
||||
implicitWidth: textContainer.implicitWidth
|
||||
Rectangle {
|
||||
id: textContainer
|
||||
color: Colors.foreground
|
||||
implicitWidth: text.implicitWidth + 10
|
||||
implicitWidth: text.implicitWidth
|
||||
implicitHeight: Settings.config.barHeight
|
||||
CustomText {
|
||||
id: text
|
||||
color: Colors.background
|
||||
anchors.centerIn: textContainer
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Hyprland.activeToplevel.activated ? Hyprland.activeToplevel.title : "sigma"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
modules/Bar/TrayItem.qml
Normal file
0
modules/Bar/TrayItem.qml
Normal file
20
modules/Bar/Volume.qml
Normal file
20
modules/Bar/Volume.qml
Normal 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"
|
||||
}
|
||||
}
|
||||
26
modules/overlays/Wallpaper.qml
Normal file
26
modules/overlays/Wallpaper.qml
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,6 +21,7 @@ Singleton {
|
||||
|
||||
adapter: JsonAdapter {
|
||||
id: settingsAdapter
|
||||
property var currentWall: "/home/lucy/.walls/faris.jpg"
|
||||
property var barHeight: 18
|
||||
property var font: "JetBrainsMono Nerd Font"
|
||||
property var fontSize: 12
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{
|
||||
"barHeight": 18,
|
||||
"currentWall": "/home/lucy/.walls/faris.jpg",
|
||||
"floating": true,
|
||||
"font": "JetBrainsMono Nerd Font",
|
||||
"fontSize": 12,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user