From 8a3678428bbde020b5789d22eba34171a013520b Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Sun, 28 Dec 2025 00:14:00 +0000 Subject: [PATCH] Squash merge bar-rework into main --- .gitignore | 1 + modules/nixvim/home.nix | 8 ++ modules/quickshell/home.nix | 2 +- .../quickshell/quickshell/assets/bar/Mic.svg | 2 +- .../quickshell/assets/bar/MutedMic.svg | 2 +- .../quickshell/assets/bar/MutedSpeaker.svg | 2 +- .../quickshell/assets/bar/Speaker.svg | 2 +- .../quickshell/assets/bar/V2/mic.svg | 1 + .../quickshell/assets/bar/V2/micOff.svg | 1 + .../quickshell/assets/bar/V2/speaker.svg | 1 + .../quickshell/assets/bar/V2/speakerOff.svg | 1 + .../quickshell/assets/bar/batt/1.svg | 1 + .../quickshell/assets/bar/batt/2.svg | 1 + .../quickshell/assets/bar/batt/3.svg | 1 + .../quickshell/assets/bar/batt/4.svg | 1 + .../quickshell/assets/bar/batt/5.svg | 1 + .../quickshell/assets/bar/batt/6.svg | 1 + .../quickshell/assets/bar/batt/7.svg | 1 + modules/quickshell/quickshell/bar/Bar.qml | 95 ++++++++----------- .../quickshell/bar/widgets/Audio.qml | 87 +++++++++-------- .../quickshell/bar/widgets/Battery.qml | 76 +++++++++++++++ .../quickshell/bar/widgets/BatteryData.qml | 0 .../quickshell/bar/widgets/Demo.qml | 41 ++++++++ .../quickshell/bar/widgets/V2/Audio.qml | 59 ++++++++++++ .../quickshell/bar/widgets/Wireless.qml | 58 +++++++++++ .../quickshell/bar/widgets/Workspaces.qml | 2 +- .../quickshell/bar/widgets/clock/Clock.qml | 27 ++++-- .../quickshell/bar/widgets/clock/Date.qml | 19 ++-- .../bar/widgets/common/ChildContainer.qml | 14 +++ .../quickshell/bar/widgets/common/Colors.qml | 11 ++- .../quickshell/bar/widgets/common/Icons.qml | 66 +++++++++---- .../bar/widgets/common/ImageColorShader.qml | 30 ++++++ .../bar/widgets/common/ParentContainer.qml | 17 ++++ .../bar/widgets/common/VerticalSeprator.qml | 12 ++- modules/quickshell/quickshell/shell.qml | 2 +- 35 files changed, 502 insertions(+), 144 deletions(-) create mode 100755 modules/quickshell/quickshell/assets/bar/V2/mic.svg create mode 100755 modules/quickshell/quickshell/assets/bar/V2/micOff.svg create mode 100755 modules/quickshell/quickshell/assets/bar/V2/speaker.svg create mode 100755 modules/quickshell/quickshell/assets/bar/V2/speakerOff.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/1.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/2.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/3.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/4.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/5.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/6.svg create mode 100644 modules/quickshell/quickshell/assets/bar/batt/7.svg create mode 100644 modules/quickshell/quickshell/bar/widgets/Battery.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/BatteryData.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/Demo.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/V2/Audio.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/Wireless.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/common/ChildContainer.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/common/ImageColorShader.qml create mode 100644 modules/quickshell/quickshell/bar/widgets/common/ParentContainer.qml diff --git a/.gitignore b/.gitignore index 49c32e1..c5a7c60 100755 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ nix/nixos.qcow2 nix_file.tar.gz nvim tmux/plugins +modules/quickshell/quickshell/.qmlls.ini diff --git a/modules/nixvim/home.nix b/modules/nixvim/home.nix index 98ac014..a2a5b7d 100644 --- a/modules/nixvim/home.nix +++ b/modules/nixvim/home.nix @@ -37,12 +37,16 @@ in configs = true; }; plugins = { + todo-comments.enable = true; lsp-status.enable = true; lsp = { enable = true; servers = { qmlls = { enable = true; + config = { + cmd = "-E"; + }; }; rust_analyzer = { enable = true; @@ -57,6 +61,10 @@ in }; }; }; + lsp-format = { + enable = true; + # lspServersToEnable = [ "qmlls" ]; + }; notify.enable = true; mini-cursorword.enable = true; # mini-statusline.enable = true; diff --git a/modules/quickshell/home.nix b/modules/quickshell/home.nix index 8180462..619086c 100644 --- a/modules/quickshell/home.nix +++ b/modules/quickshell/home.nix @@ -17,7 +17,7 @@ in }; config.xdg.configFile."quickshell" = lib.mkIf cfg.enable { recursive = true; - source = config.lib.file.mkOutOfStoreSymlink "${nix-meow.flakeRoot}/modules/quickshell/quickshell"; + source = config.lib.file.mkOutOfStoreSymlink /home/doloro/dotfiles/modules/quickshell/quickshell; }; config.systemd.user.services.quickshell = lib.mkIf cfg.enable { Unit = { diff --git a/modules/quickshell/quickshell/assets/bar/Mic.svg b/modules/quickshell/quickshell/assets/bar/Mic.svg index b11891e..8331678 100755 --- a/modules/quickshell/quickshell/assets/bar/Mic.svg +++ b/modules/quickshell/quickshell/assets/bar/Mic.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/MutedMic.svg b/modules/quickshell/quickshell/assets/bar/MutedMic.svg index 1f54754..7120ce1 100755 --- a/modules/quickshell/quickshell/assets/bar/MutedMic.svg +++ b/modules/quickshell/quickshell/assets/bar/MutedMic.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/MutedSpeaker.svg b/modules/quickshell/quickshell/assets/bar/MutedSpeaker.svg index 0a5c295..7be2869 100755 --- a/modules/quickshell/quickshell/assets/bar/MutedSpeaker.svg +++ b/modules/quickshell/quickshell/assets/bar/MutedSpeaker.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/Speaker.svg b/modules/quickshell/quickshell/assets/bar/Speaker.svg index b5c71be..1b75429 100755 --- a/modules/quickshell/quickshell/assets/bar/Speaker.svg +++ b/modules/quickshell/quickshell/assets/bar/Speaker.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/V2/mic.svg b/modules/quickshell/quickshell/assets/bar/V2/mic.svg new file mode 100755 index 0000000..8331678 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/V2/mic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/V2/micOff.svg b/modules/quickshell/quickshell/assets/bar/V2/micOff.svg new file mode 100755 index 0000000..7120ce1 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/V2/micOff.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/V2/speaker.svg b/modules/quickshell/quickshell/assets/bar/V2/speaker.svg new file mode 100755 index 0000000..1b75429 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/V2/speaker.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/V2/speakerOff.svg b/modules/quickshell/quickshell/assets/bar/V2/speakerOff.svg new file mode 100755 index 0000000..7be2869 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/V2/speakerOff.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/1.svg b/modules/quickshell/quickshell/assets/bar/batt/1.svg new file mode 100644 index 0000000..dfedcde --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/2.svg b/modules/quickshell/quickshell/assets/bar/batt/2.svg new file mode 100644 index 0000000..5cf37f7 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/3.svg b/modules/quickshell/quickshell/assets/bar/batt/3.svg new file mode 100644 index 0000000..8ef1896 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/4.svg b/modules/quickshell/quickshell/assets/bar/batt/4.svg new file mode 100644 index 0000000..3f715c2 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/5.svg b/modules/quickshell/quickshell/assets/bar/batt/5.svg new file mode 100644 index 0000000..dc3eac9 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/6.svg b/modules/quickshell/quickshell/assets/bar/batt/6.svg new file mode 100644 index 0000000..9fb13a8 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/assets/bar/batt/7.svg b/modules/quickshell/quickshell/assets/bar/batt/7.svg new file mode 100644 index 0000000..7bb97d7 --- /dev/null +++ b/modules/quickshell/quickshell/assets/bar/batt/7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/quickshell/quickshell/bar/Bar.qml b/modules/quickshell/quickshell/bar/Bar.qml index 5e84935..e45f202 100755 --- a/modules/quickshell/quickshell/bar/Bar.qml +++ b/modules/quickshell/quickshell/bar/Bar.qml @@ -12,65 +12,50 @@ import "widgets/common" as Common import "widgets/clock" as Clock import "widgets/workspace" as Workspace -// Tako kindly threatened you to sort the naming schema and to put all the svg's in an asset folder, so please do that +PanelWindow { + property var modelData + screen: modelData.values[0] - PanelWindow { - property var modelData - screen: modelData.values[0]; + color: Common.Colors.colors.mainBackground + anchors { + top: true + left: true + right: true + } - color: '#20ffffff' + implicitHeight: 31 + RowLayout { + height: 30 anchors { - top: true - left: true - right: true + top: parent.top + left: parent.left + right: parent.right + // bottomMargin: 2 + leftMargin: 5 + rightMargin: 5 } - - implicitHeight: 32 RowLayout { - height: 28 - anchors { - top: parent.top - left: parent.left - right: parent.right - // bottomMargin: 2 - leftMargin: 10 - rightMargin: 10 - } - RowLayout { // Left - Layout.alignment: Qt.AlignLeft - Clock.Date {} - Clock.Clock {} - Workspace.WorkspaceWidget {} - } - RowLayout { // Center - // TODO: add icons of the active window per workspace in the workspace tab - anchors.centerIn: parent - } - RowLayout { // Right - Layout.alignment: Qt.AlignRight - Loader { - sourceComponent: Widgets.Audio {} - } - RowLayout { - Text { - text: HyprlandWindowTracker.HyprlandWindowTracker.aaaa - } - visible: Player.activePlayer.isPlaying() - Player.PlayerWidgetV2 { - } - } - Widgets.SystemTray { - id: systemTray - } - } + // Left + Layout.alignment: Qt.AlignLeft + Widgets.Workspaces {} } - Rectangle { - anchors { - bottom: parent.bottom - left: parent.left - right: parent.right - } - height: 1 - color: "#8d8d8d" + RowLayout { + // Center + Layout.alignment: Qt.AlignCenter } - } + RowLayout { + // Right + Layout.alignment: Qt.AlignRight + Widgets.Demo {} + } + } + // Rectangle { + // anchors { + // bottom: parent.bottom + // left: parent.left + // right: parent.right + // } + // height: 1 + // color: "#8d8d8d" + // } +} diff --git a/modules/quickshell/quickshell/bar/widgets/Audio.qml b/modules/quickshell/quickshell/bar/widgets/Audio.qml index f12e85d..f35d0aa 100755 --- a/modules/quickshell/quickshell/bar/widgets/Audio.qml +++ b/modules/quickshell/quickshell/bar/widgets/Audio.qml @@ -4,56 +4,55 @@ import QtQuick import QtQuick.Layouts import Quickshell.Widgets import Quickshell.Services.Pipewire +import QtQuick.VectorImage +import QtQuick.Effects +import QtQuick.Shapes 1.10 +import QtQuick.Effects import "common" as Common - -Item { +Rectangle { id: root property PwNode speakerNode: Pipewire.defaultAudioSink property PwNode microphoneNode: Pipewire.defaultAudioSource - PwObjectTracker { objects: [ root.microphoneNode, root.speakerNode ] } - - width: row.width - height: row.height - - // console.log("a"); - + PwObjectTracker { + objects: [root.microphoneNode, root.speakerNode] + } + implicitWidth: itemContent.width + 8 + implicitHeight: 24 + radius: 5.5 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + color: Common.Colors.colors.secondary // Define item color + // color: "#2a2a2a" RowLayout { - id: row - Item { - implicitWidth: 28 - implicitHeight: 28 - Rectangle { - width: parent.width - height: parent.height - radius: 7 - color: "black" - } - Text { - anchors.centerIn: parent - // implicitSize: 25 - font.pixelSize: 28 - color: root.speakerNode.audio.muted ? "#FF474C" : "white" - font.family: "CaskaydiaCove Nerd Font Mono" - text: root.speakerNode.audio.muted ? Common.Icons.audioIcons.speakerMuted : Common.Icons.audioIcons.speaker - } - } - Item { - implicitWidth: 28 - implicitHeight: 28 - Rectangle { - width: parent.width - height: parent.height - radius: 7 - color: "black" - } - Text { - anchors.centerIn: parent - // implicitSize: 25 - font.pixelSize: 34 - color: root.microphoneNode.audio.muted ? "#FF474C" : "white" - font.family: "CaskaydiaCove Nerd Font Mono" - text: root.microphoneNode.audio.muted ? Common.Icons.audioIcons.microphoneMuted : Common.Icons.audioIcons.microphone + id: itemContent + anchors.centerIn: parent + // spacing: 100 + Repeater { + model: [ + { + on: Common.Icons.audioIcons["speaker"], + off: Common.Icons.audioIcons["speakerMuted"], + node: root.speakerNode + }, + { + on: Common.Icons.audioIcons["microphone"], + off: Common.Icons.audioIcons["microphoneMuted"], + node: root.microphoneNode + }, + ] + Item { + id: meow + implicitWidth: 24 + Layout.alignment: Qt.AlignHCenter + implicitHeight: 24 + Text { + id: textElement + anchors.centerIn: parent // Ensure the text fills the parent item + text: modelData.node.audio.muted ? modelData.off : modelData.on + font.pointSize: 18.25 + font.weight: Font.DemiBold + color: modelData.node.audio.muted ? Common.Colors.colors.critial2 : Common.Colors.colors.primary + } } } } diff --git a/modules/quickshell/quickshell/bar/widgets/Battery.qml b/modules/quickshell/quickshell/bar/widgets/Battery.qml new file mode 100644 index 0000000..e82e9df --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/Battery.qml @@ -0,0 +1,76 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import Quickshell.Services.Pipewire +import QtQuick.VectorImage +import QtQuick.Effects +import Quickshell.Services.UPower +import "common" as Common + +Rectangle { + // TODO eventually fix the alignment (it isnt centered horizentally) + id: root + property int battPercent: 58 + implicitWidth: itemContent.width + 8 + implicitHeight: 24 + visible: {if (UPower.displayDevice.ready) { true } else {false}} + radius: 5.5 + Layout.alignment: Qt.AlignVCenter + color: "#2a2a2a" // Define item color + RowLayout { + id: itemContent + implicitWidth: 24 + implicitHeight: 24 + anchors.centerIn: parent + Text { + // anchors.centerIn: parent + text: UPower.displayDevice.percentage + "%" + color: Common.Colors.colors.primary + font.weight: Font.DemiBold + font.pointSize: 12 + } + Item { + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + Text { + anchors.centerIn: parent + text: root.getBatteryState(UPower.displayDevice.percentage, (UPower.displayDevice.changeRate > 0)) + color: root.getBatteryColor(UPower.displayDevice.percentage) + font.weight: Font.DemiBold + font.pointSize: 24/1.4 + } + } + } +function getBatteryState(level, isCharging) { + if (level === null || level === 0) { + // Return the battery empty icon + return isCharging ? Common.Icons.battery.charging["1"] : Common.Icons.battery["0"]; + } + + if (level === 100) { + // Return the battery full icon + return isCharging ? Common.Icons.battery.charging["10"] : Common.Icons.battery["10"]; + } + + // Calculate step as a value between 1 and 10 (divide level into 10 ranges) + let step = Math.ceil(level / 10); // Range mapping + if (step > 10) step = 10; // Clamp to 10 if it exceeds bounds + + // Return the correct icon based on state + return isCharging ? Common.Icons.battery.charging[String(step)] : Common.Icons.battery[String(step)]; +} +function getBatteryColor(level) { + if (level === null || level === 0) { + // Use critical color for empty battery + return Common.Colors.colors.critial2; + } + + if (level > 0 && level <= 20) { + // Use critical color for low battery + return Common.Colors.colors.critial2; + } + // Default color if no specific condition is met + return Common.Colors.colors.primary; +} +} diff --git a/modules/quickshell/quickshell/bar/widgets/BatteryData.qml b/modules/quickshell/quickshell/bar/widgets/BatteryData.qml new file mode 100644 index 0000000..e69de29 diff --git a/modules/quickshell/quickshell/bar/widgets/Demo.qml b/modules/quickshell/quickshell/bar/widgets/Demo.qml new file mode 100644 index 0000000..746b926 --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/Demo.qml @@ -0,0 +1,41 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import Quickshell.Services.Pipewire +import "common" as Common +import "clock" as Clock + +Rectangle { + id: backgroundRect + implicitWidth: rowLayout.implicitWidth + 6 // Account for padding (2px left + 2px right) + implicitHeight: rowLayout.implicitHeight + 4 // Account for padding (2px top + 2px bottom) + color: Common.Colors.colors.background + radius: 6.5 // Background rectangle with rounded corners + // border.color: "gray" + // border.width: 1 + + // Inner Rectangle for padding and layout + Rectangle { + id: content + anchors.fill: parent + anchors.margins: 2 // Create 2px padding on all sides + anchors.leftMargin: 3 + anchors.rightMargin: 3 + color: "transparent" + + RowLayout { + id: rowLayout + anchors.fill: parent + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter // Center content + spacing: 10 // Space between items + + Audio {} + Battery {} + Common.VerticalSeprator {} + Clock.Date {} + Clock.Clock {} + } + } +} diff --git a/modules/quickshell/quickshell/bar/widgets/V2/Audio.qml b/modules/quickshell/quickshell/bar/widgets/V2/Audio.qml new file mode 100644 index 0000000..6dece1f --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/V2/Audio.qml @@ -0,0 +1,59 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import Quickshell.Services.Pipewire +import "common" as Common + +Item { + id: root + property PwNode speakerNode: Pipewire.defaultAudioSink + property PwNode microphoneNode: Pipewire.defaultAudioSource + PwObjectTracker { + objects: [root.microphoneNode, root.speakerNode] + } + + width: row.width + height: row.height + + // console.log("a"); + + RowLayout { + id: row + Item { + implicitWidth: 28 + implicitHeight: 28 + Rectangle { + width: parent.width + height: parent.height + radius: 7 + color: "black" + } + Text { + anchors.centerIn: parent + font.pixelSize: 28 + color: root.speakerNode.audio.muted ? "#B1B2B5" : "white" + font.family: "CaskaydiaCove Nerd Font Mono" + text: root.speakerNode.audio.muted ? Common.Icons.audioIcons.speakerMuted : Common.Icons.audioIcons.speaker + } + } + Item { + implicitWidth: 28 + implicitHeight: 28 + Rectangle { + width: parent.width + height: parent.height + radius: 7 + color: "black" + } + Text { + anchors.centerIn: parent + font.pixelSize: 34 + color: root.microphoneNode.audio.muted ? "#B1B2B5" : "white" + font.family: "CaskaydiaCove Nerd Font Mono" + text: root.microphoneNode.audio.muted ? Common.Icons.audioIcons.microphoneMuted : Common.Icons.audioIcons.microphone + } + } + } +} diff --git a/modules/quickshell/quickshell/bar/widgets/Wireless.qml b/modules/quickshell/quickshell/bar/widgets/Wireless.qml new file mode 100644 index 0000000..9745928 --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/Wireless.qml @@ -0,0 +1,58 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import Quickshell.Services.Pipewire +import QtQuick.VectorImage +import QtQuick.Effects +import "common" as Common + +Rectangle { + id: root + implicitWidth: itemContent.width + 4 + implicitHeight: 24 + radius: 5.5 + Layout.alignment: Qt.AlignVCenter + color: "#2a2a2a" // Define item color + RowLayout { + id: itemContent + Repeater { + model: [ + { + on: "../../assets/bar/V2/speaker.svg", + off: "../../assets/bar/V2/speakerOff.svg", + node: root.speakerNode + }, + { + on: "../../assets/bar/V2/mic.svg", + off: "../../assets/bar/V2/micOff.svg", + node: root.microphoneNode + }, + ] + Item { + implicitWidth: 24 + implicitHeight: 24 + // anchors.centerIn: parent + VectorImage { + id: svgImage + width: parent.width + height: parent.height + source: modelData.node.audio.muted ? modelData.off : modelData.on + visible: false + fillMode: Image.PreserveAspectFit // Adjusts the SVG while keeping the aspect ratio + } + MultiEffect { + source: svgImage + width: parent.width + height: parent.height + // anchors.centerIn: parent + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + colorization: 1 + brightness: 1 + colorizationColor: modelData.node.audio.muted ? "#e53b3c" : "#b1b2b5" + } + } + } + } +} diff --git a/modules/quickshell/quickshell/bar/widgets/Workspaces.qml b/modules/quickshell/quickshell/bar/widgets/Workspaces.qml index 61df8a6..d5a1ee4 100755 --- a/modules/quickshell/quickshell/bar/widgets/Workspaces.qml +++ b/modules/quickshell/quickshell/bar/widgets/Workspaces.qml @@ -36,7 +36,7 @@ RowLayout { Hyprland.dispatch('workspace ' + index_workspace.id); } for (x in index_workspace.toplevels.values) { - console.log(index_workspace.toplevels.values[x].title) + console.log(index_workspace.toplevels.values[x].title); } } } diff --git a/modules/quickshell/quickshell/bar/widgets/clock/Clock.qml b/modules/quickshell/quickshell/bar/widgets/clock/Clock.qml index 2d95795..23d0017 100755 --- a/modules/quickshell/quickshell/bar/widgets/clock/Clock.qml +++ b/modules/quickshell/quickshell/bar/widgets/clock/Clock.qml @@ -1,19 +1,28 @@ import Quickshell import Quickshell.Io import QtQuick +import QtQuick.Layouts +import Quickshell.Widgets +import Quickshell.Services.Pipewire +import QtQuick.VectorImage +import QtQuick.Effects +import "common" as Common -import "../common" as Common - -Item { +Rectangle { id: root - width: text.width + 15 - height: text.height - Common.Container {} + implicitWidth: clock.width + 4 + implicitHeight: clock.height + radius: 5.5 + color: "#2a2a2a" // Define item color Text { + id: clock + // width: parent.width - 4 + height: 24 anchors.centerIn: parent - id: text + verticalAlignment: Qt.AlignVCenter text: ClockData.time - font.pointSize: 10.25 - color: "white" + font.pixelSize: 16 + lineHeight: 1 + color: "#cacaca" } } diff --git a/modules/quickshell/quickshell/bar/widgets/clock/Date.qml b/modules/quickshell/quickshell/bar/widgets/clock/Date.qml index c67df9b..2bd6cfe 100755 --- a/modules/quickshell/quickshell/bar/widgets/clock/Date.qml +++ b/modules/quickshell/quickshell/bar/widgets/clock/Date.qml @@ -4,16 +4,21 @@ import QtQuick import "../common" as Common -Item { +Rectangle { id: root - width: text.width + 15 - height: text.height - Common.Container {} + implicitWidth: clock.width + 4 + implicitHeight: clock.height + radius: 5.5 + color: "#2a2a2a" // Define item color Text { + id: clock + // width: parent.width - 4 + height: 24 anchors.centerIn: parent - id: text + verticalAlignment: Qt.AlignVCenter text: ClockData.date - font.pointSize: 10.25 - color: "white" + font.pixelSize: 16 + lineHeight: 1 + color: "#cacaca" } } diff --git a/modules/quickshell/quickshell/bar/widgets/common/ChildContainer.qml b/modules/quickshell/quickshell/bar/widgets/common/ChildContainer.qml new file mode 100644 index 0000000..d6c2a49 --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/common/ChildContainer.qml @@ -0,0 +1,14 @@ +import Quickshell +import QtQuick + +Rectangle { + z: 1 + color: "#2a2a2a" + opacity: 20 + anchors { + verticalCenter: parent.verticalCenter + } + height: 24 + width: parent.width + radius: 5.5 +} diff --git a/modules/quickshell/quickshell/bar/widgets/common/Colors.qml b/modules/quickshell/quickshell/bar/widgets/common/Colors.qml index 310f069..340835f 100755 --- a/modules/quickshell/quickshell/bar/widgets/common/Colors.qml +++ b/modules/quickshell/quickshell/bar/widgets/common/Colors.qml @@ -6,7 +6,16 @@ import Quickshell.Io Singleton { id: root + // XX (alpha) XXXXXX (color) + + // For oled screen that risk burn in, set up these colors as semi-transparent and have a rotating wallpaper (!!) readonly property var colors: ({ - "primary": "", + primary: "#59b1b2b5", // Icons & Text colors + secondary: "#BF2a2a2a", // Pill container colors + background: "#BF000000", // Background of containers + mainBackground: "#20ffffff", // Color of the main bar + warning: "#E9D502", // (i.e battery nearing low) + critial: "#e53b3c", // (i.e battery is low) + critial2: "#e53b3c", // (Speaker and Mic being off) }) } diff --git a/modules/quickshell/quickshell/bar/widgets/common/Icons.qml b/modules/quickshell/quickshell/bar/widgets/common/Icons.qml index f148639..722355c 100755 --- a/modules/quickshell/quickshell/bar/widgets/common/Icons.qml +++ b/modules/quickshell/quickshell/bar/widgets/common/Icons.qml @@ -6,25 +6,57 @@ import Quickshell.Io Singleton { id: root + // readonly property var svgs: ({ + // micOff: "../../../assets/bar/V2/micOff.svg", + // mic: "../../../assets/bar/V2/mic.svg", + // speaker: "../../../assets/bar/V2/speaker.svg", + // speakerOff: "../../../assets/bar/V2/speakerOff.svg" + // }) + readonly property var battery: ({ + "0": "󰂎", + "1": "󰁺", + "2": "󰁻", + "3": "󰁼", + "4": "󰁾", + "5": "󰁾", + "6": "󰁿", + "7": "󰂀", + "8": "󰂁", + "9": "󰂂", + "10": "󰁹", + charging: ({ + "1": "󰢜", + "2": "󰂆", + "3": "󰂇", + "4": "󰂈", + "5": "󰢝", + "6": "󰂉", + "7": "󰢞", + "8": "󰂊", + "9": "󰂋", + "10": "󰂅", + }) + }) + readonly property var audioIcons: ({ - microphone: "", - microphoneMuted: "", - speaker: "󰕾", - speakerMuted: "󰖁", - }) + microphone: "󰍬", + microphoneMuted: "󰍭", + speaker: "󰕾", + speakerMuted: "󰖁" + }) // {class}: {icon} readonly property var appIcons: ({ - "vesktop": "", - "steam": "", - "org.telegram.desktop": "", - "chromium": "", - "dev.zed.Zed": "", - "foot": "", - "gamescope": "󰺵", - "blender": "󰂫", - "Spotify": "", - "Unity": "", - "fallback": "󰏩" - }) + "vesktop": "", + "steam": "", + "org.telegram.desktop": "", + "chromium": "", + "dev.zed.Zed": "", + "foot": "", + "gamescope": "󰺵", + "blender": "󰂫", + "Spotify": "", + "Unity": "", + "fallback": "󰏩" + }) } diff --git a/modules/quickshell/quickshell/bar/widgets/common/ImageColorShader.qml b/modules/quickshell/quickshell/bar/widgets/common/ImageColorShader.qml new file mode 100644 index 0000000..5b18b18 --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/common/ImageColorShader.qml @@ -0,0 +1,30 @@ +// ColorOverlayShader.qml +import QtQuick 2.15 + Rectangle { + id: mainContent + anchors.fill: parent + color: "blue" + + // Clip the rectangle to a shape + clip: true + + Shape { + anchors.fill: parent + + // Custom Path defined as a vector + Path { + PathSvg { + path: "M10,80 C40,10 65,10 95,80 S150,150 180,80" // Vector path + } + } + + ShapePath { + strokeColor: "transparent" // No stroke, act only as the mask + fillColor: "blue" + fillGradient: Gradient { + GradientStop { position: 0.0; color: "yellow" } + GradientStop { position: 1.0; color: "orange" } + } + } + } + } diff --git a/modules/quickshell/quickshell/bar/widgets/common/ParentContainer.qml b/modules/quickshell/quickshell/bar/widgets/common/ParentContainer.qml new file mode 100644 index 0000000..e13255f --- /dev/null +++ b/modules/quickshell/quickshell/bar/widgets/common/ParentContainer.qml @@ -0,0 +1,17 @@ +import Quickshell +import QtQuick +import QtQuick.Layouts + +Item { + RowLayout { + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + } + Rectangle { + z: -1 + color: "black" + // anchors: parent.anchors + height: 28 + width: parent.width + radius: 6.5 + } +} diff --git a/modules/quickshell/quickshell/bar/widgets/common/VerticalSeprator.qml b/modules/quickshell/quickshell/bar/widgets/common/VerticalSeprator.qml index 3287f01..6ef0139 100755 --- a/modules/quickshell/quickshell/bar/widgets/common/VerticalSeprator.qml +++ b/modules/quickshell/quickshell/bar/widgets/common/VerticalSeprator.qml @@ -2,12 +2,16 @@ import Quickshell import QtQml import QtQuick - Rectangle { - id: a + Item { + id: root anchors { top: parent.top bottom: parent.bottom } - width: 2 - color: "#8d8d8d" + Rectangle { + anchors.centerIn: root + implicitHeight: root.height - 4 + width: 1 + color: "#8d8d8d" + } } diff --git a/modules/quickshell/quickshell/shell.qml b/modules/quickshell/quickshell/shell.qml index 7914389..5ff864f 100755 --- a/modules/quickshell/quickshell/shell.qml +++ b/modules/quickshell/quickshell/shell.qml @@ -1,4 +1,4 @@ -//@ pragma UseQApplication +// @ pragma UseQApplication import Quickshell import QtQuick import "bar" as Bar