minor fixes and icons

This commit is contained in:
lucy 2026-05-14 20:35:11 +02:00
commit cf4696fe04
10 changed files with 82 additions and 11 deletions

View file

@ -3,6 +3,7 @@ import Quickshell.Hyprland
import QtQuick import QtQuick
import qs import qs
import qs.widgets import qs.widgets
import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
@ -10,6 +11,7 @@ WrapperRectangle {
color: Colors.base01 color: Colors.base01
required property int barHeight required property int barHeight
required property double vertMargin required property double vertMargin
radius: Config.rounding
topMargin: vertMargin topMargin: vertMargin
bottomMargin: vertMargin bottomMargin: vertMargin
leftMargin: 8 leftMargin: 8

View file

@ -3,6 +3,7 @@ import Quickshell.Widgets
import QtQuick import QtQuick
import qs import qs
import qs.widgets import qs.widgets
import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
@ -14,6 +15,7 @@ WrapperRectangle {
bottomMargin: vertMargin bottomMargin: vertMargin
leftMargin: 8 leftMargin: 8
rightMargin: 8 rightMargin: 8
radius: Config.rounding
SystemClock { SystemClock {
id: clock id: clock
precision: SystemClock.Seconds precision: SystemClock.Seconds

View file

@ -4,6 +4,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs import qs
import qs.widgets import qs.widgets
import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
@ -16,6 +17,7 @@ WrapperRectangle {
leftMargin: 8 leftMargin: 8
rightMargin: 8 rightMargin: 8
color: Colors.base01 color: Colors.base01
radius: Config.rounding
function findSpotify() { function findSpotify() {
for (let i = 0; i < Mpris.players.values.length; i++) { for (let i = 0; i < Mpris.players.values.length; i++) {
let current = Mpris.players.values[i]; let current = Mpris.players.values[i];
@ -25,7 +27,22 @@ WrapperRectangle {
} }
return null; return null;
} }
StyledText { child: WrapperMouseArea {
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists id: clickHandler
acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: Qt.PointingHandCursor
onClicked: mouse => {
if (mouse.button == Qt.RightButton) {
root.spotify.togglePlaying();
}
}
child: RowLayout {
MaterialIcon {
text: "music_note_2"
}
StyledText {
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
}
}
} }
} }

View file

@ -1,8 +1,10 @@
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import Quickshell.Widgets import Quickshell.Widgets
import QtQuick import QtQuick
import QtQuick.Layouts
import qs import qs
import qs.widgets import qs.widgets
import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
@ -10,16 +12,39 @@ WrapperRectangle {
required property int barHeight required property int barHeight
property double vertMargin: barHeight / 4 - 4 property double vertMargin: barHeight / 4 - 4
property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null
property string status: defaultAudio?.audio.muted ? "mut " : "vol " property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
radius: Config.rounding
topMargin: vertMargin topMargin: vertMargin
bottomMargin: vertMargin bottomMargin: vertMargin
leftMargin: 8 leftMargin: 8
rightMargin: 8 rightMargin: 8
function getVolumeIcon() {
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
if (root.mute) {
return "\ue04f";
}
if (volume <= 0.33) {
return "\ue04e";
}
if (volume <= 0.66) {
return "\ue04d";
}
if (volume >= 0.66) {
return "\ue050";
}
}
PwObjectTracker { PwObjectTracker {
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null] objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
} }
child: StyledText { child: RowLayout {
text: root.status + Math.floor(root.defaultAudio?.audio.volume * 100) + "%" spacing: 4
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0 MaterialIcon {
text: root.getVolumeIcon()
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
}
StyledText {
text: Math.floor(root.defaultAudio?.audio.volume * 100) + "%"
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
}
} }
} }

View file

@ -1,12 +1,11 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import Quickshell import Quickshell
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import Quickshell.DBusMenu
import Quickshell.Widgets import Quickshell.Widgets
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs import qs
import qs.widgets import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
@ -15,6 +14,7 @@ WrapperRectangle {
required property int barHeight required property int barHeight
property double vertMargin: barHeight / 4 - 4 property double vertMargin: barHeight / 4 - 4
topMargin: vertMargin topMargin: vertMargin
radius: Config.rounding
bottomMargin: vertMargin bottomMargin: vertMargin
leftMargin: 8 leftMargin: 8
rightMargin: 8 rightMargin: 8

View file

@ -6,13 +6,15 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs import qs
import qs.widgets import qs.widgets
import qs.settings
WrapperRectangle { WrapperRectangle {
id: root id: root
required property ShellScreen barScreen required property ShellScreen barScreen
required property int barHeight required property int barHeight
readonly property double vertMargin: barHeight / 4 - 4 readonly property double vertMargin: barHeight / 4 - 4
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen) property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
radius: Config.rounding
color: Colors.base01 color: Colors.base01
topMargin: vertMargin topMargin: vertMargin
bottomMargin: vertMargin bottomMargin: vertMargin
@ -20,6 +22,7 @@ WrapperRectangle {
rightMargin: 8 rightMargin: 8
child: RowLayout { child: RowLayout {
id: wsLayout id: wsLayout
spacing: 8
Repeater { Repeater {
id: wsRepeater id: wsRepeater
model: Hyprland.workspaces model: Hyprland.workspaces

View file

@ -9,6 +9,10 @@ IpcHandler {
Config.font = newFont; Config.font = newFont;
} }
function setIconSize(newSize: int) {
Config.iconSize = newSize;
}
function setFontSize(newSize: int) { function setFontSize(newSize: int) {
Config.fontSize = newSize; Config.fontSize = newSize;
} }

View file

@ -7,6 +7,7 @@ Singleton {
id: root id: root
property string font: "Adwaita Mono Nerd Font Propo" property string font: "Adwaita Mono Nerd Font Propo"
property int fontSize: 12 property int fontSize: 12
property int iconSize: 14
property int barHeight: 30 property int barHeight: 30
property int rounding: 0 property int rounding: 0
property url wallpaper: "file:///home/lucy/.walls/frierensuff.png" property url wallpaper: "file:///home/lucy/.walls/frierensuff.png"

View file

@ -1,6 +1,6 @@
[General] [General]
barHeight=32 barHeight=30
font=0xProto Nerd Font Propo font=0xProto Nerd Font Propo
fontSize=12 fontSize=12
roudning=0 roudning=16
wallpaper=@Variant(\0\0\0\x11\0\0\0\"file:///home/lucy/.walls/mooon.png) wallpaper=@Variant(\0\0\0\x11\0\0\0\"file:///home/lucy/.walls/mooon.png)

17
widgets/MaterialIcon.qml Normal file
View file

@ -0,0 +1,17 @@
import qs
import qs.settings
import QtQuick
Text {
font.family: "Material Symbols Rounded"
color: Colors.base07
font.pixelSize: Config.iconSize
property bool fill: true
renderType: Text.NativeRendering
font.variableAxes: {
"FILL": fill ? 1 : 0,
"opsz": Config.iconSize,
"wght": 400,
"GRAD": 0
}
}