diff --git a/modules/bar/ActiveWindow.qml b/modules/bar/ActiveWindow.qml index 758da19..df55b33 100644 --- a/modules/bar/ActiveWindow.qml +++ b/modules/bar/ActiveWindow.qml @@ -3,6 +3,7 @@ import Quickshell.Hyprland import QtQuick import qs import qs.widgets +import qs.settings WrapperRectangle { id: root @@ -10,6 +11,7 @@ WrapperRectangle { color: Colors.base01 required property int barHeight required property double vertMargin + radius: Config.rounding topMargin: vertMargin bottomMargin: vertMargin leftMargin: 8 diff --git a/modules/bar/Clock.qml b/modules/bar/Clock.qml index e95cf46..2def93f 100644 --- a/modules/bar/Clock.qml +++ b/modules/bar/Clock.qml @@ -3,6 +3,7 @@ import Quickshell.Widgets import QtQuick import qs import qs.widgets +import qs.settings WrapperRectangle { id: root @@ -14,6 +15,7 @@ WrapperRectangle { bottomMargin: vertMargin leftMargin: 8 rightMargin: 8 + radius: Config.rounding SystemClock { id: clock precision: SystemClock.Seconds diff --git a/modules/bar/Mpris.qml b/modules/bar/Mpris.qml index 8dd80b3..fc6eb35 100644 --- a/modules/bar/Mpris.qml +++ b/modules/bar/Mpris.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Layouts import qs import qs.widgets +import qs.settings WrapperRectangle { id: root @@ -16,6 +17,7 @@ WrapperRectangle { leftMargin: 8 rightMargin: 8 color: Colors.base01 + radius: Config.rounding function findSpotify() { for (let i = 0; i < Mpris.players.values.length; i++) { let current = Mpris.players.values[i]; @@ -25,7 +27,22 @@ WrapperRectangle { } return null; } - StyledText { - text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists + child: WrapperMouseArea { + 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 + } + } } } diff --git a/modules/bar/Pw.qml b/modules/bar/Pw.qml index adf63e9..18b5c6c 100644 --- a/modules/bar/Pw.qml +++ b/modules/bar/Pw.qml @@ -1,8 +1,10 @@ import Quickshell.Services.Pipewire import Quickshell.Widgets import QtQuick +import QtQuick.Layouts import qs import qs.widgets +import qs.settings WrapperRectangle { id: root @@ -10,16 +12,39 @@ WrapperRectangle { required property int barHeight property double vertMargin: barHeight / 4 - 4 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 bottomMargin: vertMargin leftMargin: 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 { objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null] } - child: StyledText { - text: root.status + Math.floor(root.defaultAudio?.audio.volume * 100) + "%" - opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0 + child: RowLayout { + spacing: 4 + 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 + } } } diff --git a/modules/bar/Tray.qml b/modules/bar/Tray.qml index f3d0919..100ed1c 100644 --- a/modules/bar/Tray.qml +++ b/modules/bar/Tray.qml @@ -1,12 +1,11 @@ pragma ComponentBehavior: Bound import Quickshell import Quickshell.Services.SystemTray -import Quickshell.DBusMenu import Quickshell.Widgets import QtQuick import QtQuick.Layouts import qs -import qs.widgets +import qs.settings WrapperRectangle { id: root @@ -15,6 +14,7 @@ WrapperRectangle { required property int barHeight property double vertMargin: barHeight / 4 - 4 topMargin: vertMargin + radius: Config.rounding bottomMargin: vertMargin leftMargin: 8 rightMargin: 8 diff --git a/modules/bar/Ws.qml b/modules/bar/Ws.qml index 8135c87..32ee289 100644 --- a/modules/bar/Ws.qml +++ b/modules/bar/Ws.qml @@ -6,13 +6,15 @@ import QtQuick import QtQuick.Layouts import qs import qs.widgets +import qs.settings WrapperRectangle { id: root required property ShellScreen barScreen required property int barHeight 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 topMargin: vertMargin bottomMargin: vertMargin @@ -20,6 +22,7 @@ WrapperRectangle { rightMargin: 8 child: RowLayout { id: wsLayout + spacing: 8 Repeater { id: wsRepeater model: Hyprland.workspaces diff --git a/modules/ipc/Ipc.qml b/modules/ipc/Ipc.qml index c01c863..fee4dab 100644 --- a/modules/ipc/Ipc.qml +++ b/modules/ipc/Ipc.qml @@ -9,6 +9,10 @@ IpcHandler { Config.font = newFont; } + function setIconSize(newSize: int) { + Config.iconSize = newSize; + } + function setFontSize(newSize: int) { Config.fontSize = newSize; } diff --git a/settings/Config.qml b/settings/Config.qml index cdf7fb6..74456e1 100644 --- a/settings/Config.qml +++ b/settings/Config.qml @@ -7,6 +7,7 @@ Singleton { id: root property string font: "Adwaita Mono Nerd Font Propo" property int fontSize: 12 + property int iconSize: 14 property int barHeight: 30 property int rounding: 0 property url wallpaper: "file:///home/lucy/.walls/frierensuff.png" diff --git a/settings/settings.ini b/settings/settings.ini index d40d0a6..cffe451 100644 --- a/settings/settings.ini +++ b/settings/settings.ini @@ -1,6 +1,6 @@ [General] -barHeight=32 +barHeight=30 font=0xProto Nerd Font Propo fontSize=12 -roudning=0 +roudning=16 wallpaper=@Variant(\0\0\0\x11\0\0\0\"file:///home/lucy/.walls/mooon.png) diff --git a/widgets/MaterialIcon.qml b/widgets/MaterialIcon.qml new file mode 100644 index 0000000..c654e3b --- /dev/null +++ b/widgets/MaterialIcon.qml @@ -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 + } +}