switch back to svg icons
This commit is contained in:
parent
0a80d099bc
commit
be45e63c77
@ -4,6 +4,8 @@ import QtQuick
|
|||||||
import "../../"
|
import "../../"
|
||||||
import "../settings/"
|
import "../settings/"
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@ -11,35 +13,6 @@ Item {
|
|||||||
implicitWidth: masterLayout.implicitWidth
|
implicitWidth: masterLayout.implicitWidth
|
||||||
height: 34
|
height: 34
|
||||||
property bool isCharging: UPower.displayDevice.state === UPowerDeviceState.Charging
|
property bool isCharging: UPower.displayDevice.state === UPowerDeviceState.Charging
|
||||||
function getBatteryIcon() {
|
|
||||||
if (isCharging) {
|
|
||||||
return "battery_android_frame_bolt";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.12) {
|
|
||||||
return "battery_android_frame_0";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.24) {
|
|
||||||
return "battery_android_frame_1";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.36) {
|
|
||||||
return "battery_android_frame_2";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.48) {
|
|
||||||
return "battery_android_frame_3";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.60) {
|
|
||||||
return "battery_android_frame_4";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.72) {
|
|
||||||
return "battery_android_frame_5";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage < 0.84) {
|
|
||||||
return "battery_android_frame_6";
|
|
||||||
}
|
|
||||||
if (UPower.displayDevice.percentage > 0.84) {
|
|
||||||
return "battery_android_full";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: masterLayout
|
id: masterLayout
|
||||||
implicitWidth: botText.width
|
implicitWidth: botText.width
|
||||||
@ -54,8 +27,10 @@ Item {
|
|||||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||||
color: Colors.foreground
|
color: Colors.foreground
|
||||||
}
|
}
|
||||||
Icons {
|
IconImage {
|
||||||
text: root.getBatteryIcon()
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
implicitSize: 12
|
||||||
|
source: Quickshell.iconPath(UPower.displayDevice.iconName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import QtQuick
|
|||||||
import Quickshell.Services.Pipewire
|
import Quickshell.Services.Pipewire
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import "../../"
|
import "../../"
|
||||||
import "../settings/"
|
import "../settings/"
|
||||||
@ -25,28 +26,29 @@ Item {
|
|||||||
command: ["pavucontrol"] // The command and args list
|
command: ["pavucontrol"] // The command and args list
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logic to pick the correct icon name
|
// Logic to pick the correct icon name
|
||||||
function getVolumeIcon() {
|
function getVolumeIcon() {
|
||||||
// Safety check: if Pipewire is dead or sink is missing
|
// Safety check: if Pipewire is dead or sink is missing
|
||||||
if (!sink)
|
if (!sink)
|
||||||
return "volume_off";
|
return "audio-volume-muted-symbolic";
|
||||||
|
|
||||||
// If muted, show the hush icon
|
// If muted, show the hush icon
|
||||||
if (sink.audio.muted)
|
if (sink.audio.muted)
|
||||||
return "volume_off";
|
return "audio-volume-muted-symbolic";
|
||||||
|
|
||||||
// Volume is usually 0.0 to 1.0 (0% to 100%)
|
// Volume is usually 0.0 to 1.0 (0% to 100%)
|
||||||
const vol = sink.audio.volume;
|
const vol = sink.audio.volume;
|
||||||
|
|
||||||
if (vol <= 0.25)
|
if (vol <= 0.25)
|
||||||
return "volume_mute";
|
return "audio-volume-low-symbolic";
|
||||||
if (vol < 0.75)
|
if (vol < 0.75)
|
||||||
return "volume_down";
|
return "audio-volume-medium-symbolic";
|
||||||
if (vol < 1.00)
|
if (vol <= 1.00)
|
||||||
return "volume_up";
|
return "audio-volume-high-symbolic";
|
||||||
|
|
||||||
// If it's loud, prepare the ears!
|
// If it's loud, prepare the ears!
|
||||||
return "volume_up";
|
return "audio-volume-high-danger-symbolic";
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@ -55,10 +57,13 @@ Item {
|
|||||||
spacing: 0
|
spacing: 0
|
||||||
implicitWidth: botText.width
|
implicitWidth: botText.width
|
||||||
Row {
|
Row {
|
||||||
spacing: 2
|
|
||||||
|
spacing: 5
|
||||||
Text {
|
Text {
|
||||||
id: topText
|
id: topText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
|
|
||||||
objects: Pipewire.ready ? root.sink : []
|
objects: Pipewire.ready ? root.sink : []
|
||||||
}
|
}
|
||||||
font.weight: 900
|
font.weight: 900
|
||||||
@ -66,10 +71,13 @@ Item {
|
|||||||
font.family: Settings.font
|
font.family: Settings.font
|
||||||
font.pixelSize: Settings.fontSize
|
font.pixelSize: Settings.fontSize
|
||||||
text: Pipewire.ready ? root.sink.audio.volume.toFixed(2) + "%" : "0%"
|
text: Pipewire.ready ? root.sink.audio.volume.toFixed(2) + "%" : "0%"
|
||||||
|
onTextChanged: console.log(Quickshell.iconPath)
|
||||||
}
|
}
|
||||||
Icons {
|
IconImage {
|
||||||
id: icon
|
id: icon
|
||||||
text: root.getVolumeIcon()
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
implicitSize: 12
|
||||||
|
source: Quickshell.iconPath(root.getVolumeIcon())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
|||||||
@ -9,6 +9,14 @@ Singleton {
|
|||||||
property alias font: jsonAdapter.font
|
property alias font: jsonAdapter.font
|
||||||
property alias fontSize: jsonAdapter.fontSize
|
property alias fontSize: jsonAdapter.fontSize
|
||||||
property alias wallDir: jsonAdapter.wallDir
|
property alias wallDir: jsonAdapter.wallDir
|
||||||
|
onCurrentWallChanged: settingsView.writeAdapter()
|
||||||
|
onWallDirChanged: settingsView.writeAdapter()
|
||||||
|
onFontChanged: {
|
||||||
|
Quickshell.reload();
|
||||||
|
settingsView.writeAdapter();
|
||||||
|
}
|
||||||
|
onFontSizeChanged: settingsView.writeAdapter()
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: settingsView
|
id: settingsView
|
||||||
path: "/home/lucy/.config/quickshell/modules/settings/config.json"
|
path: "/home/lucy/.config/quickshell/modules/settings/config.json"
|
||||||
@ -21,12 +29,8 @@ Singleton {
|
|||||||
id: jsonAdapter
|
id: jsonAdapter
|
||||||
property string currentWall: ""
|
property string currentWall: ""
|
||||||
property string wallDir: "/home/lucy/.walls/"
|
property string wallDir: "/home/lucy/.walls/"
|
||||||
property string font: "MonaSpiceXe Nerd Font Propo"
|
property string font: "Google Sans"
|
||||||
property real fontSize: 13
|
property real fontSize: 14
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onCurrentWallChanged: settingsView.writeAdapter()
|
|
||||||
onWallDirChanged: settingsView.writeAdapter()
|
|
||||||
onFontChanged: settingsView.writeAdapter()
|
|
||||||
onFontSizeChanged: settingsView.writeAdapter()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"currentWall": "file:///home/lucy/.walls/gentoo-abducted-1680x1050.png",
|
"currentWall": "file:///home/lucy/.walls/ayanami.png",
|
||||||
"font": "MonaSpiceXe Nerd Font Propo",
|
"font": "SFMono Nerd Font Propo",
|
||||||
"fontSize": 13,
|
"fontSize": 13,
|
||||||
"wallDir": "/home/lucy/.walls/"
|
"wallDir": "/home/lucy/.walls/"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import "."
|
|||||||
WlrLayershell {
|
WlrLayershell {
|
||||||
id: overlayRoot
|
id: overlayRoot
|
||||||
required property var modelData
|
required property var modelData
|
||||||
property var padding: 2
|
property var padding: 0
|
||||||
property var rounding: 15
|
property var rounding: 25
|
||||||
property var hyprgaps: 15
|
property var hyprgaps: 20
|
||||||
onPaddingChanged: {
|
onPaddingChanged: {
|
||||||
hyprGaps.exec(hyprGaps.command);
|
hyprGaps.exec(hyprGaps.command);
|
||||||
console.log(hyprGaps.command);
|
console.log(hyprGaps.command);
|
||||||
@ -20,15 +20,15 @@ WlrLayershell {
|
|||||||
id: hyprGaps
|
id: hyprGaps
|
||||||
running: true
|
running: true
|
||||||
property bool isZero: overlayRoot.padding === 0
|
property bool isZero: overlayRoot.padding === 0
|
||||||
property var top: isZero ? 10 : overlayRoot.padding * 2 + overlayRoot.hyprgaps
|
property var top: overlayRoot.hyprgaps
|
||||||
property var sides: overlayRoot.padding + overlayRoot.hyprgaps
|
property var sides: isZero ? overlayRoot.hyprgaps : overlayRoot.padding + overlayRoot.hyprgaps
|
||||||
property var gaps: top + "," + sides + "," + sides + "," + sides
|
property var gaps: top + "," + sides + "," + sides + "," + sides
|
||||||
command: ["hyprctl", "keyword", "general:gaps_out", gaps]
|
command: ["hyprctl", "keyword", "general:gaps_out", gaps]
|
||||||
onStarted: console.log("set gaps to ", gaps)
|
onStarted: console.log("set gaps to ", gaps)
|
||||||
}
|
}
|
||||||
Process {
|
Process {
|
||||||
id: hyprRounding
|
id: hyprRounding
|
||||||
property var rounding: overlayRoot.rounding - 5
|
property var rounding: overlayRoot.rounding
|
||||||
running: true
|
running: true
|
||||||
command: ["hyprctl", "keyword", "decoration:rounding", rounding]
|
command: ["hyprctl", "keyword", "decoration:rounding", rounding]
|
||||||
onStarted: console.log("set rounding to ", overlayRoot.rounding)
|
onStarted: console.log("set rounding to ", overlayRoot.rounding)
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
//@ pragma UseQApplication
|
//@ pragma UseQApplication
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import "./modules/bar/"
|
import "./modules/bar/"
|
||||||
import "./modules/wallpaper/"
|
import "./modules/wallpaper/"
|
||||||
import "./modules/notifications/"
|
import "./modules/notifications/"
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
|
id: shellRoot
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
id: barVariants
|
id: barVariants
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user