0
jump to
@@ -0,0 +1,14 @@
+pragma Singleton +import QtQuick +import Quickshell +import "." + +Singleton { + readonly property var chargeState: ({ + 0: Style.orange, + 1: Style.saffron, + 2: Style.orange, + 3: Style.fg, + 4: Style.orange + }) +}
@@ -4,50 +4,60 @@ import Quickshell
Singleton { id: root - + property var bamum_sunset: ({ + true: `<span style='color:${Style.orange};'>𖡹</span>`, + false: `<span style='color:${Style.orange};'>𖥸</span>` + }) property var modules: { - "sunset": "", - "size": "" - } - property var volume: { - "mute": "", - "off": "", - "low": "", - "high": "" - } - property var network: { - "ethernet": "", - "nobar": "", - "bar0": "", - "bar1": "", - "bar2": "", - "bar3": "", - "bar4": "" - } - property var devices: { - "battery": "", - "headphones": "", - "controller": "", - "earbuds": "", - "gaming input": "", - "keyboard": "", - "mouse": "", - "unknown": "", - "speakers": "", - "printer": "", - "camera": "", - "phone": "" - } - property var battery: { - "10": "", - "20": "", - "30": "", - "40": "", - "50": "", - "60": "", - "70": "", - "80": "", - "90": "", - "100": "" + "sunset": `<span style='color:${Style.orange};'> </span>`, + "size": `<span style='color:${Style.orange};'> </span>`, + "ram": `<span style='color:${Style.orange};'> </span>`, + "ram_bamum": `<span style='color:${Style.orange};'>𖡶</span>` } + property var music_player: ({ + 0: "", + 1: `<span style='color:${Style.orange};'> </span>`, + 2: `<span style='color:${Style.orange};'> </span>` + }) + property var volume: ({ + 0: `<span style='color:${Style.scarlet};'> </span>`, + 1: `<span style='color:${Style.orange};'> </span>`, + 2: `<span style='color:${Style.orange};'> </span>`, + 3: `<span style='color:${Style.orange};'> </span>` + }) + property var network: ({ + // "ethernet": "", + 0: `<span style='color:${Style.altbg};'> </span>`, + 1: `<span style='color:${Style.orange};'> </span>`, + 2: `<span style='color:${Style.orange};'> </span>`, + 3: `<span style='color:${Style.orange};'> </span>`, + 4: `<span style='color:${Style.orange};'> </span>`, + 5: `<span style='color:${Style.orange};'> </span>` + }) + property var devices: ({ + 0: "", + 2: "", + 5: "", + 6: "", + 8: "", + 12: "", + 17: "", + 19: "", + 18: "", + 23: "", + 25: "" + }) + property var jotm: "<span style='color:#897bc7;'></span>" + property var battery: ({ + 1: "", + 2: "", + 3: "", + 4: "", + 5: "", + 6: "", + 7: "", + 8: "", + 9: "", + 10: "" + }) }
@@ -20,18 +20,17 @@ - lock/sleep/power off screen?
- wifi? - SSH launcher - volume OSD +- tray icons +- clay-witch palette swap Others: - package moon-phases into the AUR -### post-niri - -- look into converting the bar display into a single-line monospace text display -- redo workspace icons - ## known issues - bluetooth headphones battery disappears sometimes - network doesn't show disconnection, simply retains last network - dies when pluging an external monitor, look into +- battery code is spahgetti +- scale still has those inverse values
@@ -1,25 +1,10 @@
pragma Singleton import QtQuick import Quickshell +import "." Singleton { - id: root - property var palette: { - "fg": "#afd2e9", - "bg": "#3b3228", - "bg95": "#43392d", - "bg75": "#4c4134", - "altbg": "#5d4f40", - "bg25": "#6b6055", - "sand": "#c1a387", - "scarlet": "#e86045", - "moss": "#92a650", - "celadon": "#ace1af", - "orange": "#e68d53", - "saffron": "#f8e2a0", - "cyan": "#3eccbe", - "grey": "#868686" - } + readonly property string sep: `<span style='color:${Style.sand};'>│</span>` property var fontsize: { "topbar_text": 16 * Size.scale, "topbar_bamum": 14 * Size.scale,
@@ -0,0 +1,40 @@
+pragma Singleton +import QtQuick +import Quickshell + +Singleton { + readonly property color fg: "#afd2e9" + readonly property color bg: "#3b3228" + readonly property color bg95: "#43392d" + readonly property color bg75: "#4c4134" + readonly property color altbg: "#5d4f40" + readonly property color bg25: "#6b6055" + readonly property color sand: "#c1a387" + readonly property color scarlet: "#e86045" + readonly property color moss: "#92a650" + readonly property color celadon: "#ace1af" + readonly property color orange: "#e68d53" + readonly property color saffron: "#f8e2a0" + readonly property color cyan: "#3eccbe" +} +// accent : color (since 6.6) +// alternateBase : color +// base : color +// brightText : color +// button : color +// buttonText : color +// dark : color +// highlight : color +// highlightedText : color +// light : color +// link : color +// linkVisited : color +// mid : color +// midlight : color +// placeholderText : color (since 6.2) +// shadow : color +// text : "#afd2e9" +// toolTipBase : color +// toolTipText : color +// window : color +// windowText : color
@@ -24,8 +24,7 @@ bottomCenterContent: [
Music {} ] bottomLeftContent: [ - Network {}, - NetTest {} + Network {} ] } }
@@ -11,25 +11,27 @@ anchors.bottom: true
anchors.left: true anchors.right: true implicitHeight: Resources.barsize.bottombar - color: Resources.palette.bg - - Row { + color: Style.bg + Item { id: bottomRow anchors.fill: parent - spacing: 2 Row { // LEFT id: bottomLeft - anchors.left: bottomRow.left leftPadding: 8 + anchors.left: bottomRow.left + anchors.verticalCenter: bottomRow.verticalCenter } Row { // CENTER id: bottomCenter anchors.centerIn: bottomRow + anchors.verticalCenter: bottomRow.verticalCenter + anchors.horizontalCenter: bottomRow.horizontalCenter } Row { // RIGHT id: bottomRight + rightPadding: 8 anchors.right: bottomRow.right - rightPadding: 8 + anchors.verticalCenter: bottomRow.verticalCenter } } }
@@ -1,43 +0,0 @@
-import Quickshell -import QtQuick -import QtQuick.Layouts -import ".." - -PanelWindow { - id: bottomBar - property alias bottomRightContent: bottomRight.children - property alias bottomCenterContent: bottomCenter.children - property alias bottomLeftContent: bottomLeft.children - anchors.bottom: true - anchors.left: true - anchors.right: true - implicitHeight: Resources.barsize.bottombar - color: Resources.palette.bg - - RowLayout { // LEFT - id: bottomRow - anchors.fill: parent - spacing: 2 - uniformCellSizes:false - RowLayout { - id: bottomLeft - Layout.alignment: Qt.AlignLeft - Layout.leftMargin: 8 - } - RowLayout { // CENTER - id: bottomCenter - anchors.centerIn: bottomRow - Layout.fillWidth: true - } - // Item { Layout.fillWidth: true } - RowLayout { // RIGHT - id: bottomRight - Layout.alignment: Qt.AlignRight - Layout.rightMargin: 8 - } - } - // RowLayout { // CENTER - // id: bottomCenter - // anchors.centerIn: bottomRow - // } -}
@@ -1,48 +0,0 @@
-import Quickshell -import QtQuick -import QtQuick.Layouts -import ".." - -PanelWindow { - id: bottomBar - property alias bottomRightContent: bottomRight.children - property alias bottomCenterContent: bottomCenter.children - property alias bottomLeftContent: bottomLeft.children - aboveWindows: false - anchors { - bottom: true - left: true - right: true - } - implicitHeight: Resources.barsize.bottombar - color: Resources.palette.bg - - RowLayout { //BOTTOM RIGHT - id: bottomRight - Item {Layout.rightMargin: 8} - spacing: 2 - layoutDirection: Qt.RightToLeft - anchors { - right: parent.right - verticalCenter: parent.verticalCenter - } - } - - RowLayout { - id: bottomCenter - spacing: 2 - anchors { - horizontalCenter: parent.horizontalCenter - verticalCenter: parent.verticalCenter - } - } - - RowLayout { - id: bottomLeft - spacing: 2 - Item {Layout.leftMargin: 8} - anchors { - verticalCenter: parent.verticalCenter - } - } -}
@@ -11,25 +11,28 @@ anchors.top: true
anchors.left: true anchors.right: true implicitHeight: Resources.barsize.topbar - color: Resources.palette.bg + color: Style.bg - Row { + Item { id: topRow anchors.fill: parent - spacing: 2 Row { // LEFT id: topLeft + leftPadding: 8 anchors.left: topRow.left - leftPadding: 8 + anchors.verticalCenter: topRow.verticalCenter } Row { // CENTER id: topCenter anchors.centerIn: topRow + anchors.verticalCenter: topRow.verticalCenter + anchors.horizontalCenter: topRow.horizontalCenter } Row { // RIGHT id: topRight + rightPadding: 8 anchors.right: topRow.right - rightPadding: 8 + anchors.verticalCenter: topRow.verticalCenter } } }
@@ -1,46 +0,0 @@
-import Quickshell -import QtQuick -import QtQuick.Layouts -import ".." - -PanelWindow { - id: topBar - property alias topRightContent: topRight.children - property alias topCenterContent: topCenter.children - property alias topLeftContent: topLeft.children - anchors { - top: true - left: true - right: true - } - implicitHeight: Resources.barsize.topbar - color: Resources.palette.bg - - RowLayout { //TOP RIGHT - id: topRight - spacing: 2 - layoutDirection: Qt.RightToLeft - Item {Layout.rightMargin: 8} - anchors { - right: parent.right - verticalCenter: parent.verticalCenter - } - } - RowLayout { // TOP CENTER - id: topCenter - spacing: 2 - anchors { - horizontalCenter: parent.horizontalCenter - verticalCenter: parent.verticalCenter - } - } - RowLayout { //TOP LEFT - id: topLeft - spacing: 2 - Item {Layout.leftMargin: 8} - anchors { - left: parent.left - verticalCenter: parent.verticalCenter - } - } -}
@@ -1,59 +1,20 @@
import "../.." import QtQuick -import QtQuick.Layouts import Quickshell.Services.UPower import "classes" -RowLayout { +Row { layoutDirection: Qt.RightToLeft + spacing: 2 Repeater { - model: UPower.devices.values.filter(d => { - return d.model; - }) - - RowLayout { + model: UPower.devices.values.filter(d => d.model) + BarText { + required property var modelData property var lvl: Math.round(modelData.percentage * 100) - property var charge_state: UPowerDeviceState.toString(modelData.state) - property var device_type: UPowerDeviceType.toString(modelData.type) - - spacing: 2 - layoutDirection: Qt.RightToLeft - - Text { - id: battery_level_indicator - - Layout.alignment: Qt.AlignCenter - font.pixelSize: 16 * Size.scale - renderType: Text.NativeRendering - font.family: font_proggy.name - text: lvl + "%" - color: (charge_state == "Charging") ? Resources.palette.saffron : (lvl < 20) ? Resources.palette.scarlet : Resources.palette.fg - } - - Text { - id: battery_device_icon - - Layout.alignment: Qt.AlignCenter - font.family: font_icon.name - text: modelData.isLaptopBattery ? Icons.devices.battery : modelData.model == "Jupiter of the Monkey" ? Icons.devices.headphones : { - "Headphones": Icons.devices.headphones, - "Headset": Icons.devices.headphones, - "Gaming Input": Icons.devices.controller, - "Keyboard": Icons.devices.keyboard, - "Mouse": Icons.devices.mouse, - "Unknown": Icons.devices.unknown, - "Speakers": Icons.devices.speaker, - "Printer": Icons.devices.printer, - "Camera": Icons.devices.camera, - "Phone": Icons.devices.phone - }[device_type] ?? modelData.model - font.pixelSize: (device_type == "Gaming Input") ? 14 * Size.scale : Resources.fontsize.bottombar_icon - color: modelData.model == "Jupiter of the Monkey" ? "#897bc7" : (charge_state == "Charging") ? Resources.palette.saffron : lvl < 20 ? Resources.palette.scarlet : (charge_state == "FullyCharged") ? Resources.palette.cyan : Resources.palette.orange - } - - Sep { - Layout.alignment: Qt.AlignBaseline - } + property var jotm: modelData.model == "Jupiter of the Monkey" + property var icon: (jotm) ? Icons.jotm : `<span style='color:${Enum.chargeState[modelData.state]};'>${Icons.devices[modelData.type]}</span>` + text: Resources.sep + icon + " " + lvl + "%" + color: (modelData.state == 1) ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.fg } } }
@@ -1,31 +1,10 @@
-// Sunset.qml import QtQuick -import QtQuick.Layouts import Quickshell.Services.Mpris +import "../.." import "classes" -RowLayout { - id: music - Layout.alignment: Qt.AlignCenter - spacing: 4 - // property var player: Mpris.players.values[1] +BarText { property var player: Mpris.players.values?.find(x => x.identity == "Music Player Daemon") - BottombarIcon { - // font.pixelSize: this+2 - text: ({ - 0: "", - 1: "", - 2: "" - })[music.player?.playbackState] ?? "" - } - BarText { - // font.pixelSize: this-1 - // text: music.player.desktopEntry - text: (music.player?.playbackState != 0) ? (music.player?.trackTitle + " - " + music.player?.trackArtist) : "" - } + property var output: Icons.music_player[player?.playbackState] + player?.trackTitle + " — " + player?.trackArtist + text: (player?.playbackState != 0) ? output : "" } -// TODO: make alt-player for firefox/youtube/audiobookshelf -// TODO: KDEconnect? -// TODO: duration? -// TODO: Buttons, play/pause, goto source. next/prev -// TODO: keyboard keys
@@ -1,13 +0,0 @@
-import QtQuick -import Quickshell -// import Quickshell.Networking -import QtQuick.Layouts -import "../../" -import "classes" - -RowLayout { - Text { - text: '<span style="color: red;">Hello</span> <span style="color: blue;">World</span>' - textFormat: Text.RichText - } -}
@@ -1,42 +1,12 @@
import QtQuick -import Quickshell -import Quickshell.Io -import QtQuick.Layouts -import "../../" +import Quickshell.Networking +import "../.." import "classes" -RowLayout { - property var wifi_strength - property var zwj - Text { - id: indicator - color: Resources.palette.orange - font.family: font_icon.name - property var indicator_data - font.pixelSize: Resources.fontsize.network_indicator - text: (indicator_data == 100) ? Icons.network.ethernet : (indicator_data == 404) ? Icons.network.nobar : (indicator_data > -50) ? Icons.network.bar4 : (indicator_data > -60) ? Icons.network.bar3 : (indicator_data > -70) ? Icons.network.bar2 : (indicator_data > -80) ? Icons.network.bar1 : Icons.network.bar0 - } - BarText { - id: network - font.family: zwj ? font_emoji.name : font_proggy.name - Process { - id: network_script - command: ["bar/scripts/network.sh"] - workingDirectory: Quickshell.shellDir - running: true - stdout: StdioCollector { - onStreamFinished: { - network.text = this.text.trim().split(" ")[1]; - indicator.indicator_data = this.text.split(" ")[0].trim(); - zwj = [...network.text].includes('\u200d'); - } - } - } - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: network_script.running = true - } - } +BarText { + property var network: Networking.devices.values.find(x => x.connected)?.networks.values.find(x => x.connected) ?? 0 + property var host: network?.name ?? "" + property var str: network.signalStrength + property var icon: str >= 0.8 ? 5 : str >= 0.7 ? 4 : str >= 0.6 ? 3 : str >= 0.5 ? 2 : str < 0.5 ? 1 : 0 + text: Icons.network[icon] + host }
@@ -6,27 +6,21 @@ import QtQuick.Layouts
import "../.." import "classes" -RowLayout { - id: ram_module - spacing: 2 - BarText { - id: ram - textFormat: Text.RichText - Process { - id: ram_script - command: ["bar/scripts/ram.sh"] - workingDirectory: Quickshell.shellDir - running: true - stdout: StdioCollector { - onStreamFinished: ram.text = '<span style="color:#c1a387;">│</span>' + " " + this.text.trim() + "%" - } - } - - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: ram_script.running = true +BarText { + id: ram + Process { + id: ram_script + command: ["bar/scripts/ram.sh"] + workingDirectory: Quickshell.shellDir + running: true + stdout: StdioCollector { + onStreamFinished: ram.text = Resources.sep + Icons.modules.ram_bamum + this.text.trim() + "%" } + } + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: ram_script.running = true } }
@@ -1,18 +1,7 @@
-//Scale.qml import QtQuick -import Quickshell -import QtQuick.Layouts -import Quickshell.Services.UPower import "../.." import "classes" -RowLayout { - spacing: 4 - TopbarIcon { - text: (Size.scale == 1.5) ? Icons.modules.size : "" - font.family: font_icon.name - // anchors.centerIn: parent - Layout.alignment: Qt.AlignHCenter - leftPadding: 4 - } +BarText { + text: (Size.scale == 1.5) ? Icons.modules.size : "" }
@@ -2,17 +2,12 @@ // Sunset.qml
import QtQuick import Quickshell import Quickshell.Io -import QtQuick.Layouts import "../.." import "classes" -// TopbarIcon { -// id: sunset_indicator -// text: sunset.text[0] == "+" ? "𖡹" : "𖥸" -// font.pixelSize: Resources.fontsize.topbar_bamum -// } BarText { id: sunset + property var daynight: Icons.bamum_sunset[sunset.text.includes("+")] Process { id: sunset_script command: ["bar/scripts/suntime.sh"]@@ -20,7 +15,7 @@ workingDirectory: Quickshell.shellDir
running: true stdout: StdioCollector { onStreamFinished: { - sunset.text = '<span style="color:#c1a387;">│</span>' + Icons.modules.sunset + this.text.trim(); + sunset.text = Resources.sep + sunset.daynight + this.text.trim(); } } }
@@ -1,43 +0,0 @@
-// taskwarrior.qml -import QtQuick -import Quickshell -import Quickshell.Io -import QtQuick.Layouts -import QtQuick.Controls -import "classes" -import "../../" - -RowLayout { - spacing: 2 - id: taskwarrior_module - // TopbarSVG {icon.source: "../../icons/phosphor/regular/list-checks.svg"} - Sep {} - TopbarIcon { - text: "𖣋" - font.pixelSize: Resources.fontsize.topbar_bamum - - } - TopbarText { - id: taskwarrior - // Layout.alignment: Qt.AlignBottom - // anchors.bottom: taskwarrior_module.top - Process { - id: taskwarrior_script - command: ["task", "rc.verbose:", "rc.report.next.columns:description", "rc.report.next.labels:1", "limit:1 next"] - workingDirectory: Quickshell.shellDir - running: true - stdout: StdioCollector { - onStreamFinished: taskwarrior.text = this.text.trim() - } - } - - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: taskwarrior_script.running = true - } - } -} - -// "task", "rc.verbose:", "rc.report.next.columns:description", "rc.report.next.labels:1", "limit:1 next"
@@ -1,11 +1,12 @@
// Timedate.qml import QtQuick import Quickshell +import "../.." import "classes" BarText { id: timedate - text: '<span style="color:#c1a387;">│</span>' + Qt.formatDateTime(clock.date, "MMM dd (ddd)") + '<span style="color:#c1a387;">│</span>' + Qt.formatDateTime(clock.date, "hh:mm") + text: Resources.sep + Qt.formatDateTime(clock.date, "MMM dd (ddd)") + Resources.sep + Qt.formatDateTime(clock.date, "hh:mm") SystemClock { id: clock precision: SystemClock.Seconds
@@ -8,24 +8,9 @@ id: volume_indicator
PwObjectTracker { objects: [Pipewire.defaultAudioSink] } - property var muted: Pipewire.defaultAudioSink?.audio.muted property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) - text: '<span style="color:#c1a387;">│</span>' + Icons.volume.low + " " + vol + "%" + property var indicator: (muted) ? 0 : vol < 20 ? 1 : vol <= 50 ? 2 : 3 + text: Resources.sep + Icons.volume[indicator] + vol + "%" + color: (muted) ? Style.altbg : Style.fg } - -// TopbarIcon { -// text: (muted) -// ? "" -// : (volume_indicator.vol == 0) -// ? "" -// : (volume_indicator.vol <= 50) -// ? "" -// : (volume_indicator.vol > 50) -// ? "" -// : Icons.volume.low -// color: (muted) -// ? Resources.palette.scarlet -// : Resources.palette.orange -// bottomPadding: 0.5 -// }
@@ -2,9 +2,11 @@ import QtQuick
import "../../.." Text { - font.pixelSize: Resources.fontsize.topbar_text - font.family: font_proggy.name - color: Resources.palette.fg + // font.pixelSize: Resources.fontsize.topbar_text + font.pixelSize: 12 + // font.family: font_proggy.name + font.family: font_jetbrains.name + color: Style.fg renderType: Text.NativeRendering textFormat: Text.RichText }
@@ -4,8 +4,6 @@ import "../../.."
Text { font.pixelSize: Resources.fontsize.bottombar_icon - color: Resources.palette.orange + color: Style.orange font.family: font_icon.name } - -
@@ -1,12 +0,0 @@
-//TopSep.qml -import QtQuick -import "../../.." - -BarText { - id: separator - // text: "|" - text: "│" - color: Resources.palette.sand - padding: 0 - // anchors.verticalCenter : parent -}
@@ -1,10 +0,0 @@
-//TopbarIcon.qml -import QtQuick -import "../../.." - -Text { - font.pixelSize: Resources.fontsize.topbar_icon - color: Resources.palette.orange - font.family: font_icon.name - // anchors.verticalCenter: verticalCenter -}
@@ -1,15 +0,0 @@
-import QtQuick -import QtQuick.Controls -import "../../.." - -Button { - padding: 0 - icon.color: Resources.palette.orange - icon.width: Resources.fontsize.topbar_text - icon.height: Resources.fontsize.topbar_text - background: Rectangle { - color: Resources.palette.bg - width:0 - height:0 - } -}
@@ -1,7 +1,3 @@
module Classes -BottombarIcon BottombarIcon.qml BarText BarText.qml -Sep Sep.qml -TopbarIcon TopbarIcon.qml -TopbarSVG TopbarSVG.qml
@@ -0,0 +1,59 @@
+import "../.." +import QtQuick +import QtQuick.Layouts +import Quickshell.Services.UPower +import "classes" + +RowLayout { + layoutDirection: Qt.RightToLeft + Repeater { + model: UPower.devices.values.filter(d => { + return d.model; + }) + + RowLayout { + property var lvl: Math.round(modelData.percentage * 100) + property var charge_state: UPowerDeviceState.toString(modelData.state) + property var device_type: UPowerDeviceType.toString(modelData.type) + + spacing: 2 + layoutDirection: Qt.RightToLeft + + Text { + id: battery_level_indicator + + Layout.alignment: Qt.AlignCenter + font.pixelSize: 16 * Size.scale + renderType: Text.NativeRendering + font.family: font_proggy.name + text: lvl + "%" + color: (charge_state == "Charging") ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.fg + } + + Text { + id: battery_device_icon + + Layout.alignment: Qt.AlignCenter + font.family: font_icon.name + text: modelData.isLaptopBattery ? Icons.devices.battery : modelData.model == "Jupiter of the Monkey" ? Icons.devices.headphones : { + "Headphones": Icons.devices.headphones, + "Headset": Icons.devices.headphones, + "Gaming Input": Icons.devices.controller, + "Keyboard": Icons.devices.keyboard, + "Mouse": Icons.devices.mouse, + "Unknown": Icons.devices.unknown, + "Speakers": Icons.devices.speaker, + "Printer": Icons.devices.printer, + "Camera": Icons.devices.camera, + "Phone": Icons.devices.phone + }[device_type] ?? modelData.model + font.pixelSize: (device_type == "Gaming Input") ? 14 * Size.scale : Resources.fontsize.bottombar_icon + color: modelData.model == "Jupiter of the Monkey" ? "#897bc7" : (charge_state == "Charging") ? Style.saffron : lvl < 20 ? Style.scarlet : (charge_state == "FullyCharged") ? Style.cyan : Style.orange + } + + Sep { + Layout.alignment: Qt.AlignBaseline + } + } + } +}
@@ -0,0 +1,35 @@
+//TODO let's start by simplifying the output, then see about simpifying the +//input +import "../.." +import QtQuick +import QtQuick.Layouts +import Quickshell.Services.UPower +import "classes" + +RowLayout { + layoutDirection: Qt.RightToLeft + Repeater { + model: UPower.devices.values.filter(d => d.model) + + RowLayout { + spacing: 2 + layoutDirection: Qt.RightToLeft + property var lvl: Math.round(modelData.percentage * 100) + property var charge_state: UPowerDeviceState.toString(modelData.state) + property var device_type: UPowerDeviceType.toString(modelData.type) + + BarText { + text: lvl + "%" + color: (charge_state == "Charging") ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.fg + } + + BarText { + text: modelData.model == "Jupiter of the Monkey" ? Icons.jotm : Icons.devices[modelData.type] + color: (charge_state == "Charging") ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.orange + } + BarText { + text: Resources.sep + } + } + } +}
@@ -0,0 +1,32 @@
+// Sunset.qml +import QtQuick +import QtQuick.Layouts +import Quickshell.Services.Mpris +import "classes" + +RowLayout { + id: music + Layout.alignment: Qt.AlignCenter + spacing: 4 + // property var player: Mpris.players.values[1] + property var player: Mpris.players.values?.find(x => x.identity == "Music Player Daemon") + BottombarIcon { + // font.pixelSize: this+2 + text: ({ + 0: "", + 1: "", + 2: "" + })[music.player?.playbackState] ?? "" + } + BarText { + // font.pixelSize: this-1 + // text: music.player.desktopEntry + text: (music.player?.playbackState != 0) ? (music.player?.trackTitle + " - " + music.player?.trackArtist) : "" + // text: Mpris.players[2].values.desktopEntry + } +} +// TODO: make alt-player for firefox/youtube/audiobookshelf +// TODO: KDEconnect? +// TODO: duration? +// TODO: Buttons, play/pause, goto source. next/prev +// TODO: keyboard keys
@@ -0,0 +1,15 @@
+import QtQuick +import Quickshell +import Quickshell.Networking +import QtQuick.Layouts +import "../../" +import "classes" + +// property var obj: Networking.devices.values[0].networks.values[0] +BarText { + property var network: Networking.devices.values[0].networks.values[0].name + property var connection: Networking.devices.values[0].connected + property var str: Networking.devices.values[0].networks.values[0].signalStrength + property var icon: (!connection) ? 0 : str >= 0.8 ? 5 : str >= 0.7 ? 4 : str >= 0.6 ? 3 : str >= 0.5 ? 2 : 1 + text: Icons.network[icon] + (connection ? " " + network : "") +}
@@ -0,0 +1,18 @@
+import QtQuick +import Quickshell +import Quickshell.Networking +import QtQuick.Layouts +import "../../" +import "classes" + +Item { + property var obj: Networking.devices.values[0].networks.values[0] + BarText { + text: Networking.devices.values[0].networks.values[0].name + } + Component.onCompleted: { + for (var prop in obj) { + print(prop += " (" + typeof (obj[prop]) + ") = " + obj[prop]); + } + } +}
@@ -7,6 +7,5 @@ Volume Volume.qml
Ram Ram.qml Scale Scale.qml Sunset Sunset.qml -Taskwarrior Taskwarrior.qml Timedate Timedate.qml -NetTest NetTest.qml +
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash - -# Find the first wireless interface -ethernet_name=$(nmcli device status | grep ethernet | awk '{print $4}' || false) -if [ $ethernet_name ]; then - echo 100 $ethernet_name -else - wifi_name=$(nmcli device status | grep -m 1 wifi | awk '{print $4}' || false) - if [ $wifi_name ]; then - wifi_device=$(nmcli device status | grep -m 1 wifi | awk '{print $1}') - signal_strength=$(iw dev $wifi_device link | awk '/signal:/ {print $2}') - echo -n "$signal_strength" "$wifi_name" - else - echo 404 - fi -fi -
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash - -# Find the first wireless interface -is_ethernet=$(nmcli device status | grep ethernet && true || false) -connection_type=$(iw dev | awk '$1=="Interface"{print $2; exit}') #gets network type (wired/wifi) -network_name=$(iw dev $connection_type link | awk -F': ' '/^\s*SSID:/ {print $2}') -signal_strength=$(iw dev $connection_type link | awk '/signal:/ {print $2}') -if [ is ethernet ]; then - echo -n 100 ethernet $network_name -else - if [ -n $signal_strength ]; then - echo -n "$signal_strength"+"$network_name" - fi -fi -
@@ -1,1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M184,128h40a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="128" y1="24" x2="128" y2="128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="80 80 128 128 176 80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="188" cy="168" r="12"/></svg>
@@ -1,1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><circle cx="88" cy="184" r="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="128 184 128 40 208 64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
@@ -1,1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><circle cx="56" cy="136" r="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="128" cy="88" r="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="200" cy="168" r="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="56" y1="40" x2="56" y2="112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="40" x2="200" y2="144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="128" y1="40" x2="128" y2="64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="56" y1="160" x2="56" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="192" x2="200" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="128" y1="112" x2="128" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
@@ -1,1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="40" y1="64" x2="216" y2="64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="40" y1="104" x2="168" y2="104" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="40" y1="144" x2="216" y2="144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="40" y1="184" x2="168" y2="184" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
@@ -1,1 +0,0 @@
-<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0, 0, 400,400"><g id="svgg"><path id="path0" d="" stroke="none" fill="#000000" fill-rule="evenodd"></path></g></svg>
@@ -15,5 +15,5 @@ left: 8
right:8 } implicitHeight: Resources.barsize.bottombar - color: Resources.palette.bg + color: Style.bg }
@@ -20,5 +20,5 @@ // bottom: 0
// } implicitHeight:100 width: parent - color: Resources.palette.bg25 + color: Style.bg25 }
@@ -21,5 +21,5 @@ implicitHeight: (I3.focusedMonitor?.name == "eDP-1")
? Resources.barsize.topbar_twister : Resources.barsize.topbar - color: Resources.palette.bg + color: Style.bg }
@@ -18,5 +18,5 @@ top: 0
bottom: 0 } height: Resources.barsize.topbar - color: Resources.palette.bg + color: Style.bg }
@@ -7,7 +7,7 @@ import "../.."
Text { font.pixelSize: Resources.fontsize.bottombar_icon - color: Resources.palette.orange + color: Style.orange font.family: font_icon.name }
@@ -1,14 +0,0 @@
-//TopSep.qml -import QtQuick -import Quickshell -import ".." -import "../.." - -TopbarText { - id: separator - // text: "|" - text: "│" - color: Resources.palette.sand - padding: 0 - // anchors.verticalCenter : parent -}
@@ -7,7 +7,7 @@ import "../.."
Text { font.pixelSize: Resources.fontsize.topbar_icon - color: Resources.palette.orange + color: Style.orange font.family: font_icon.name // anchors.verticalCenter: verticalCenter }
@@ -9,11 +9,11 @@ import QtQuick.VectorImage
Button { padding: 0 - icon.color: Resources.palette.orange + icon.color: Style.orange icon.width: Resources.fontsize.topbar_text icon.height: Resources.fontsize.topbar_text background: Rectangle { - color: Resources.palette.bg + color: Style.bg width:0 height:0 }
@@ -8,6 +8,6 @@
Text { font.pixelSize: Resources.fontsize.topbar_text font.family: font_proggy.name - color: Resources.palette.fg + color: Style.fg renderType: Text.NativeRendering }
@@ -42,12 +42,12 @@ color:
modelData.model == "Jupiter of the Monkey" ? "#897bc7" : (charge_state == "Charging") - ? Resources.palette.saffron + ? Style.saffron : lvl < 20 - ? Resources.palette.scarlet + ? Style.scarlet : (charge_state == "FullyCharged") - ? Resources.palette.cyan - : Resources.palette.orange + ? Style.cyan + : Style.orange } Class.TopbarText { id: battery_level_indicator@@ -55,10 +55,10 @@ text: lvl+"%"
font.family: font_proggy.name color: (charge_state == "Charging") - ? Resources.palette.saffron + ? Style.saffron : (lvl < 20) - ? Resources.palette.scarlet - : Resources.palette.fg + ? Style.scarlet + : Style.fg } } }
@@ -11,7 +11,7 @@ spacing: 2
Class.Sep {} Class.TopbarText { id: moonphase - color: Resources.palette.saffron + color: Style.saffron font.pixelSize: 13 font.family: font_icon.name bottomPadding: 0
@@ -12,7 +12,7 @@ property var wifi_strength
property var zwj Text { id: indicator - color: Resources.palette.orange + color: Style.orange font.family: font_icon.name property var indicator_data font.pixelSize: Resources.fontsize.network_indicator
@@ -32,8 +32,8 @@ ? "../../icons/phosphor/light/speaker-high-light.svg"
: "../../icons/phosphor/light/speaker-low-light.svg" icon.color: muted - ? Resources.palette.scarlet - : Resources.palette.orange + ? Style.scarlet + : Style.orange icon.width: Resources.fontsize.topbar_text-1 icon.height: Resources.fontsize.topbar_text-1
@@ -20,7 +20,7 @@ property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100)
text: (muted) ? "" : vol + "%" - color: Resources.palette.fg + color: Style.fg } Class.TopbarIcon { text: (muted)@@ -33,8 +33,8 @@ : (volume_indicator.vol > 50)
? "" : Icons.volume.low color: (muted) - ? Resources.palette.scarlet - : Resources.palette.orange + ? Style.scarlet + : Style.orange bottomPadding: 0.5 } Class.Sep{}
@@ -31,8 +31,8 @@ "11": "../../icons/phosphor/regular/download.svg",
"12": "../../icons/phosphor/regular/music.svg", }) [modelData.name] ?? modelData.name icon.color: (modelData.name == ws_focused) - ? Resources.palette.bg - : Resources.palette.fg + ? Style.bg + : Style.fg icon.width: Resources.fontsize.topbar_text-1 icon.height: Resources.fontsize.topbar_text-1 padding: 0@@ -44,10 +44,10 @@ implicitHeight: Resources.barsize.topbar
implicitWidth: Resources.barsize.topbar anchors.verticalCenter: parent.verticalCenter color: (modelData.name == ws_focused) - ? Resources.palette.orange + ? Style.orange : ws_mouse_area.containsMouse - ? Resources.palette.altbg - : Resources.palette.bg + ? Style.altbg + : Style.bg } Class.TopbarText {@@ -58,8 +58,8 @@ text: ws_special
? "" : modelData.number color: (modelData.name == ws_focused) - ? Resources.palette.bg - : Resources.palette.fg + ? Style.bg + : Style.fg } } }
@@ -30,10 +30,10 @@ height: Resources.barsize.topbar
anchors.centerIn: parent color: (modelData.name == ws_focused) - ? Resources.palette.orange + ? Style.orange : ws_button.containsMouse - ? Resources.palette.altbg - : Resources.palette.bg + ? Style.altbg + : Style.bg } contentItem: Text {@@ -49,8 +49,8 @@ "12": Icons.workspaces.volume_mixer
}) [modelData.name] ?? modelData.name color: (modelData.name == ws_focused) - ? Resources.palette.bg - : Resources.palette.fg + ? Style.bg + : Style.fg font.family: (ws_special) ? font_icon.name