Replace Waybar entirely with a single native Quickshell bar
Waybar is fully retired: logo, workspaces, active window title, tray, CPU/RAM/disk/GPU stats, volume, network, clock, and power all now live in one Bar.qml per monitor, laid out with real QML layouts instead of absolutely-positioned overlays guessing at Waybar's box model. This removes the whole class of collision/spacing bugs that came from two independent renderers (Waybar + Quickshell) trying to line up dynamic content (tray icon count, GPU/volume digit width) without either side knowing the other's actual position. Popups (power menu, calendar, tooltips) now anchor to their trigger button's live position within the shared row layout rather than hardcoded margins, so they stay correctly placed regardless of content width changes. Workspace/title logic uses the Quickshell.Hyprland module directly (IPC-driven, per-monitor active workspace and toplevel), replacing hyprland/workspaces and hyprland/window. Volume uses wpctl. GPU/CPU/RAM/ disk stats reuse the existing stats.sh script, extended with per-core usage and nvidia-smi output. System tray uses Quickshell's SystemTray service (StatusNotifierItem) with left-click activate / right-click menu. hyprland.conf no longer needs the exec-once wait-for-waybar wrapper since there's only one bar renderer now.
This commit is contained in:
@@ -57,7 +57,6 @@ $mainMod = SUPER
|
||||
# Autostart
|
||||
# ----------------------------------------------------------
|
||||
|
||||
exec-once = waybar
|
||||
exec-once = quickshell -c default
|
||||
exec-once = dunst
|
||||
exec-once = nm-applet --indicator
|
||||
|
||||
1074
quickshell/default/Bar.qml
Normal file
1074
quickshell/default/Bar.qml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,307 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Variants {
|
||||
id: root
|
||||
model: Quickshell.screens
|
||||
|
||||
readonly property bool isGerman: Qt.locale().name.startsWith("de")
|
||||
|
||||
function isoWeek(d) {
|
||||
let date = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
|
||||
let day = (date.getUTCDay() + 6) % 7;
|
||||
date.setUTCDate(date.getUTCDate() - day + 3);
|
||||
let firstThursday = date.getTime();
|
||||
date.setUTCMonth(0, 1);
|
||||
if (date.getUTCDay() !== 4) {
|
||||
date.setUTCMonth(0, 1 + ((4 - date.getUTCDay()) + 7) % 7);
|
||||
}
|
||||
return 1 + Math.round((firstThursday - date.getTime()) / (7 * 86400000));
|
||||
}
|
||||
|
||||
function buildCalendar(year, month, today) {
|
||||
const firstOfMonth = new Date(year, month, 1);
|
||||
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
||||
const leading = (firstOfMonth.getDay() + 6) % 7;
|
||||
|
||||
let cells = [];
|
||||
for (let i = 0; i < leading; i++) cells.push(null);
|
||||
for (let d = 1; d <= daysInMonth; d++) cells.push(d);
|
||||
while (cells.length % 7 !== 0) cells.push(null);
|
||||
|
||||
let weeksArr = [];
|
||||
for (let i = 0; i < cells.length; i += 7) {
|
||||
let weekCells = cells.slice(i, i + 7);
|
||||
let refDay = weekCells.find(c => c !== null) || 1;
|
||||
let refDate = new Date(year, month, refDay);
|
||||
weeksArr.push({
|
||||
weekNum: root.isoWeek(refDate),
|
||||
days: weekCells.map(c => ({
|
||||
day: c,
|
||||
isToday: c !== null && year === today.getFullYear() && month === today.getMonth() && c === today.getDate()
|
||||
}))
|
||||
});
|
||||
}
|
||||
return weeksArr;
|
||||
}
|
||||
|
||||
PanelWindow {
|
||||
id: panel
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
|
||||
anchors { top: true; right: true }
|
||||
implicitWidth: 130
|
||||
implicitHeight: 34
|
||||
margins.right: 54
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "clock-widget"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
property bool calendarOpen: false
|
||||
property bool hovering: false
|
||||
property var now: new Date()
|
||||
|
||||
Timer {
|
||||
interval: 1000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: panel.now = new Date()
|
||||
}
|
||||
|
||||
// Matches window#waybar's own backdrop tint so the widget blends into the bar.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(0.071, 0.075, 0.106, 0.18)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 4
|
||||
anchors.bottomMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
anchors.leftMargin: 2
|
||||
radius: 10
|
||||
color: clockArea.containsMouse ? "#1793d1" : Qt.rgba(0.102, 0.106, 0.149, 0.85)
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: Qt.formatDateTime(panel.now, "dd.MM. hh:mm")
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 13
|
||||
color: clockArea.containsMouse ? "#0f111a" : "#c0caf5"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: clockArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onEntered: panel.hovering = true
|
||||
onExited: panel.hovering = false
|
||||
onClicked: panel.calendarOpen = !panel.calendarOpen
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
active: panel.hovering && !panel.calendarOpen
|
||||
|
||||
PanelWindow {
|
||||
screen: panel.modelData
|
||||
anchors { top: true; right: true }
|
||||
margins { top: 34; right: 54 }
|
||||
implicitWidth: 230
|
||||
implicitHeight: tooltipCol.implicitHeight + 20
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "clock-tooltip"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 10
|
||||
color: "#e61a1b26"
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(0.478, 0.635, 0.969, 0.35)
|
||||
|
||||
ColumnLayout {
|
||||
id: tooltipCol
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
spacing: 4
|
||||
|
||||
Text {
|
||||
text: Qt.formatDateTime(panel.now, "dddd, dd. MMMM yyyy")
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: "#c0caf5"
|
||||
}
|
||||
Text {
|
||||
text: (root.isGerman ? "KW " : "Week ") + root.isoWeek(panel.now)
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 12
|
||||
color: "#7aa2f7"
|
||||
}
|
||||
Text {
|
||||
text: Qt.formatDateTime(panel.now, "hh:mm:ss")
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 12
|
||||
color: "#565f89"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
active: panel.calendarOpen
|
||||
|
||||
PanelWindow {
|
||||
id: calendarWindow
|
||||
screen: panel.modelData
|
||||
anchors { top: true; right: true }
|
||||
margins { top: 34; right: 54 }
|
||||
implicitWidth: 250
|
||||
implicitHeight: calCol.implicitHeight + 20
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "clock-calendar"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
property int viewYear: panel.now.getFullYear()
|
||||
property int viewMonth: panel.now.getMonth()
|
||||
property var weeks: root.buildCalendar(viewYear, viewMonth, panel.now)
|
||||
|
||||
HyprlandFocusGrab {
|
||||
windows: [ calendarWindow ]
|
||||
active: true
|
||||
onCleared: panel.calendarOpen = false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 10
|
||||
color: "#e61a1b26"
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(0.478, 0.635, 0.969, 0.35)
|
||||
|
||||
ColumnLayout {
|
||||
id: calCol
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
spacing: 6
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Text {
|
||||
text: "‹"
|
||||
font.pixelSize: 16
|
||||
color: "#7aa2f7"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -6
|
||||
onClicked: {
|
||||
if (calendarWindow.viewMonth === 0) {
|
||||
calendarWindow.viewMonth = 11
|
||||
calendarWindow.viewYear -= 1
|
||||
} else {
|
||||
calendarWindow.viewMonth -= 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: Qt.formatDateTime(new Date(calendarWindow.viewYear, calendarWindow.viewMonth, 1), "MMMM yyyy")
|
||||
font.bold: true
|
||||
font.pixelSize: 13
|
||||
color: "#c0caf5"
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "›"
|
||||
font.pixelSize: 16
|
||||
color: "#7aa2f7"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -6
|
||||
onClicked: {
|
||||
if (calendarWindow.viewMonth === 11) {
|
||||
calendarWindow.viewMonth = 0
|
||||
calendarWindow.viewYear += 1
|
||||
} else {
|
||||
calendarWindow.viewMonth += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 2
|
||||
|
||||
Text {
|
||||
Layout.preferredWidth: 22
|
||||
text: ""
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: 7
|
||||
Text {
|
||||
Layout.preferredWidth: 24
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: Qt.locale().dayName(index + 1, Locale.ShortFormat)
|
||||
font.pixelSize: 11
|
||||
color: "#565f89"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: calendarWindow.weeks
|
||||
|
||||
RowLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 2
|
||||
|
||||
Text {
|
||||
Layout.preferredWidth: 22
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: modelData.weekNum
|
||||
font.pixelSize: 10
|
||||
color: "#565f89"
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: modelData.days
|
||||
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
Layout.preferredWidth: 24
|
||||
Layout.preferredHeight: 22
|
||||
radius: 6
|
||||
color: modelData.isToday ? "#1793d1" : "transparent"
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: modelData.day ?? ""
|
||||
font.pixelSize: 11
|
||||
color: modelData.isToday ? "#0f111a" : (modelData.day ? "#c0caf5" : "transparent")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Variants {
|
||||
id: root
|
||||
model: Quickshell.screens
|
||||
|
||||
readonly property bool isGerman: Qt.locale().name.startsWith("de")
|
||||
|
||||
PanelWindow {
|
||||
id: panel
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
|
||||
anchors { top: true; right: true }
|
||||
implicitWidth: Math.max(72, content.implicitWidth + 28)
|
||||
implicitHeight: 34
|
||||
margins.right: 190
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "network-widget"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
property string connType: ""
|
||||
property string connName: ""
|
||||
property string localIp: ""
|
||||
property string publicIp: ""
|
||||
property bool publicIpLoading: false
|
||||
property bool showPublicIp: false
|
||||
property bool hovering: false
|
||||
|
||||
readonly property string icon: connType === "wifi" ? "" : connType === "ethernet" ? "" : ""
|
||||
readonly property string statusText: connType === "wifi" ? (connName || "WLAN") : connType === "ethernet" ? "LAN" : "offline"
|
||||
readonly property color statusColor: connType === "" ? "#565f89" : "#a6e3a1"
|
||||
|
||||
Process {
|
||||
id: refreshProc
|
||||
command: ["bash", "-c", "conn=$(nmcli -t -f TYPE,STATE,CONNECTION device status 2>/dev/null | awk -F: '$2==\"connected\"{print $1; exit}'); if [ \"$conn\" = \"wifi\" ]; then name=$(nmcli -t -f active,ssid dev wifi 2>/dev/null | awk -F: '$1==\"yes\"{print $2; exit}'); else name=\"LAN\"; fi; ip=$(ip route get 1.1.1.1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i==\"src\") print $(i+1)}'); echo \"${conn}|${name}|${ip}\""]
|
||||
stdout: StdioCollector { id: refreshCollector }
|
||||
onExited: {
|
||||
var parts = refreshCollector.text.trim().split("|")
|
||||
panel.connType = parts[0] || ""
|
||||
panel.connName = parts[1] || ""
|
||||
panel.localIp = parts[2] || ""
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 100
|
||||
running: true
|
||||
repeat: false
|
||||
onTriggered: refreshProc.running = true
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 8000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: refreshProc.running = true
|
||||
}
|
||||
|
||||
Process {
|
||||
id: publicIpProc
|
||||
command: ["bash", "-c", "curl -s -m 3 https://api.ipify.org"]
|
||||
stdout: StdioCollector { id: publicIpCollector }
|
||||
onExited: {
|
||||
var text = publicIpCollector.text.trim()
|
||||
panel.publicIp = text !== "" ? text : (root.isGerman ? "nicht verfügbar" : "unavailable")
|
||||
panel.publicIpLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
// Matches window#waybar's own backdrop tint so the widget blends into the bar.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(0.071, 0.075, 0.106, 0.18)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 4
|
||||
anchors.bottomMargin: 4
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 2
|
||||
radius: 10
|
||||
color: netArea.containsMouse ? "#1793d1" : Qt.rgba(0.102, 0.106, 0.149, 0.85)
|
||||
|
||||
Row {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
|
||||
Text {
|
||||
text: panel.icon
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 14
|
||||
color: netArea.containsMouse ? "#0f111a" : panel.statusColor
|
||||
}
|
||||
|
||||
Text {
|
||||
text: panel.statusText
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 13
|
||||
color: netArea.containsMouse ? "#0f111a" : "#c0caf5"
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: netArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onEntered: panel.hovering = true
|
||||
onExited: panel.hovering = false
|
||||
onClicked: {
|
||||
panel.showPublicIp = !panel.showPublicIp
|
||||
if (panel.showPublicIp) {
|
||||
panel.publicIpLoading = true
|
||||
publicIpProc.running = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
active: panel.hovering
|
||||
|
||||
PanelWindow {
|
||||
screen: panel.modelData
|
||||
anchors { top: true; right: true }
|
||||
margins { top: 34; right: 190 }
|
||||
implicitWidth: 220
|
||||
implicitHeight: tooltipCol.implicitHeight + 20
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "network-tooltip"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 10
|
||||
color: "#e61a1b26"
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(0.478, 0.635, 0.969, 0.35)
|
||||
|
||||
ColumnLayout {
|
||||
id: tooltipCol
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
spacing: 4
|
||||
|
||||
Text {
|
||||
text: panel.connType === "" ? (root.isGerman ? "Nicht verbunden" : "Not connected") : (panel.connType === "wifi" ? (root.isGerman ? "WLAN: " : "Wi-Fi: ") + panel.connName : (root.isGerman ? "Kabelgebunden" : "Wired"))
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: "#c0caf5"
|
||||
}
|
||||
|
||||
Text {
|
||||
text: (panel.showPublicIp ? (root.isGerman ? "Öffentliche IP: " : "Public IP: ") + (panel.publicIpLoading ? "…" : (panel.publicIp || "n/a")) : (root.isGerman ? "Lokale IP: " : "Local IP: ") + (panel.localIp || "n/a"))
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 12
|
||||
color: "#7aa2f7"
|
||||
}
|
||||
|
||||
Text {
|
||||
text: root.isGerman ? "Klicken zum Wechseln" : "Click to toggle"
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 11
|
||||
color: "#565f89"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Variants {
|
||||
id: root
|
||||
model: Quickshell.screens
|
||||
|
||||
readonly property bool isGerman: Qt.locale().name.startsWith("de")
|
||||
readonly property string logoutLabel: isGerman ? "Abmelden" : "Logout"
|
||||
readonly property string restartLabel: isGerman ? "Neustart" : "Restart"
|
||||
readonly property string shutdownLabel: isGerman ? "Herunterfahren" : "Shutdown"
|
||||
|
||||
PanelWindow {
|
||||
id: panel
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
|
||||
anchors { top: true; right: true }
|
||||
implicitWidth: 40
|
||||
implicitHeight: 34
|
||||
margins.right: 8
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "power-button"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
property bool menuOpen: false
|
||||
|
||||
Process { id: logoutProc; command: ["hyprctl", "dispatch", "exit"] }
|
||||
Process { id: rebootProc; command: ["systemctl", "reboot"] }
|
||||
Process { id: shutdownProc; command: ["systemctl", "poweroff"] }
|
||||
|
||||
// Matches window#waybar's own backdrop tint so the button blends into the bar
|
||||
// instead of floating over the wallpaper on its own transparent surface.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(0.071, 0.075, 0.106, 0.18)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
color: btnArea.containsMouse ? "#1793d1" : Qt.rgba(0.102, 0.106, 0.149, 0.85)
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: ""
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 15
|
||||
color: btnArea.containsMouse ? "#0f111a" : "#1793d1"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: btnArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: panel.menuOpen = !panel.menuOpen
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
active: panel.menuOpen
|
||||
|
||||
PanelWindow {
|
||||
id: menu
|
||||
screen: panel.modelData
|
||||
|
||||
anchors { top: true; right: true }
|
||||
margins { top: 34; right: 8 }
|
||||
|
||||
implicitWidth: 170
|
||||
implicitHeight: col.implicitHeight + 16
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "power-menu"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
HyprlandFocusGrab {
|
||||
windows: [ menu ]
|
||||
active: true
|
||||
onCleared: panel.menuOpen = false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 10
|
||||
color: "#e61a1b26"
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(0.478, 0.635, 0.969, 0.35)
|
||||
|
||||
ColumnLayout {
|
||||
id: col
|
||||
anchors.fill: parent
|
||||
anchors.margins: 8
|
||||
spacing: 4
|
||||
|
||||
MenuEntry {
|
||||
label: root.logoutLabel
|
||||
icon: ""
|
||||
onTriggered: {
|
||||
panel.menuOpen = false
|
||||
logoutProc.startDetached()
|
||||
}
|
||||
}
|
||||
|
||||
MenuEntry {
|
||||
label: root.restartLabel
|
||||
icon: ""
|
||||
onTriggered: {
|
||||
panel.menuOpen = false
|
||||
rebootProc.startDetached()
|
||||
}
|
||||
}
|
||||
|
||||
MenuEntry {
|
||||
label: root.shutdownLabel
|
||||
icon: ""
|
||||
onTriggered: {
|
||||
panel.menuOpen = false
|
||||
shutdownProc.startDetached()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
quickshell/default/scripts/stats.sh
Executable file
49
quickshell/default/scripts/stats.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# Emits pipe-separated system stats for the Quickshell StatsWidget:
|
||||
# cpu|memPct|memUsedGB|memTotalGB|diskPct|diskTotalGB|diskUsedGB|diskAvailGB|load1|load5|load15|tempC|core0,core1,...|gpuUtil|gpuTemp|gpuMemUsed|gpuMemTotal
|
||||
|
||||
snap1=$(mktemp)
|
||||
snap2=$(mktemp)
|
||||
grep '^cpu' /proc/stat > "$snap1"
|
||||
sleep 0.2
|
||||
grep '^cpu' /proc/stat > "$snap2"
|
||||
|
||||
cpu_result=$(awk '
|
||||
NR==FNR {
|
||||
idle1[$1] = $5+$6
|
||||
total1[$1] = $2+$3+$4+$5+$6+$7+$8+$9
|
||||
next
|
||||
}
|
||||
{
|
||||
idle2 = $5+$6
|
||||
total2 = $2+$3+$4+$5+$6+$7+$8+$9
|
||||
dt = total2 - total1[$1]
|
||||
di = idle2 - idle1[$1]
|
||||
pct = (dt > 0) ? int((dt-di)*100/dt) : 0
|
||||
print $1, pct
|
||||
}' "$snap1" "$snap2")
|
||||
rm -f "$snap1" "$snap2"
|
||||
|
||||
cpu=$(echo "$cpu_result" | awk '$1=="cpu"{print $2}')
|
||||
percore=$(echo "$cpu_result" | awk '$1!="cpu"{printf "%s,", $2}' | sed 's/,$//')
|
||||
|
||||
mem_line=$(awk '/MemTotal/{t=$2} /MemAvailable/{a=$2} END{printf "%d|%.1f|%.1f", (t-a)*100/t, (t-a)/1024/1024, t/1024/1024}' /proc/meminfo)
|
||||
|
||||
disk_line=$(df -P / | awk 'NR==2{gsub("%","",$5); printf "%s|%.0f|%.0f|%.0f", $5, $2/1024/1024, $3/1024/1024, $4/1024/1024}')
|
||||
|
||||
load=$(awk '{printf "%s|%s|%s", $1, $2, $3}' /proc/loadavg)
|
||||
|
||||
temp=$(sensors -j 2>/dev/null | python3 -c "
|
||||
import json, sys
|
||||
try:
|
||||
d = json.load(sys.stdin)
|
||||
print(round(d['k10temp-pci-00c3']['Tctl']['temp1_input']))
|
||||
except Exception:
|
||||
print('NA')
|
||||
" 2>/dev/null)
|
||||
[ -z "$temp" ] && temp="NA"
|
||||
|
||||
gpu_line=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits 2>/dev/null | tr -d ' ' | tr ',' '|')
|
||||
[ -z "$gpu_line" ] && gpu_line="NA|NA|NA|NA"
|
||||
|
||||
echo "${cpu}|${mem_line}|${disk_line}|${load}|${temp}|${percore}|${gpu_line}"
|
||||
7
quickshell/default/scripts/volume.sh
Executable file
7
quickshell/default/scripts/volume.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Emits "pct|muted" for the default audio sink, e.g. "72|0" or "72|1"
|
||||
out=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||
pct=$(echo "$out" | awk '{printf "%d", $2*100}')
|
||||
muted=0
|
||||
echo "$out" | grep -q MUTED && muted=1
|
||||
echo "${pct}|${muted}"
|
||||
@@ -2,7 +2,5 @@ import QtQuick
|
||||
import Quickshell
|
||||
|
||||
ShellRoot {
|
||||
PowerMenu {}
|
||||
ClockWidget {}
|
||||
NetworkWidget {}
|
||||
Bar {}
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"height": 34,
|
||||
"spacing": 6,
|
||||
"modules-left": [
|
||||
"custom/arch",
|
||||
"hyprland/workspaces"
|
||||
],
|
||||
"modules-center": [
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"cpu",
|
||||
"memory",
|
||||
"disk",
|
||||
"temperature",
|
||||
"custom/gpu",
|
||||
"pulseaudio",
|
||||
"custom/network-spacer",
|
||||
"custom/clock-spacer",
|
||||
"custom/power-spacer"
|
||||
],
|
||||
"custom/arch": {
|
||||
"format": "",
|
||||
"tooltip": false
|
||||
},
|
||||
"hyprland/workspaces": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "",
|
||||
"6": "",
|
||||
"7": "",
|
||||
"8": "",
|
||||
"9": "9",
|
||||
"active": "",
|
||||
"default": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": [],
|
||||
"6": [],
|
||||
"7": [],
|
||||
"8": [],
|
||||
"9": []
|
||||
}
|
||||
},
|
||||
"hyprland/window": {
|
||||
"format": "{}",
|
||||
"max-length": 70,
|
||||
"separate-outputs": true
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 16,
|
||||
"spacing": 8
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage}%",
|
||||
"tooltip": true,
|
||||
"interval": 2
|
||||
},
|
||||
"memory": {
|
||||
"format": " {}%",
|
||||
"tooltip": true,
|
||||
"interval": 2
|
||||
},
|
||||
"temperature": {
|
||||
"format": " {temperatureC}°C",
|
||||
"critical-threshold": 80,
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/network-spacer": {
|
||||
"format": " ",
|
||||
"tooltip": false,
|
||||
"interval": "once"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": " {volume}%",
|
||||
"format-muted": " muted",
|
||||
"scroll-step": 5,
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
"disk": {
|
||||
"interval": 30,
|
||||
"path": "/",
|
||||
"format": " {percentage_used}%",
|
||||
"tooltip": true,
|
||||
"tooltip-format": "Disk /\\nUsed: {used}\\nFree: {free}\\nTotal: {total}"
|
||||
},
|
||||
"custom/gpu": {
|
||||
"exec": "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used,memory.total --format=csv,noheader,nounits | awk -F ', ' '{printf \" %s%% %s°C %s/%sMiB\", $1, $2, $3, $4}'",
|
||||
"interval": 3,
|
||||
"return-type": "text",
|
||||
"tooltip": true
|
||||
},
|
||||
"custom/power-spacer": {
|
||||
"format": " ",
|
||||
"tooltip": false,
|
||||
"interval": "once"
|
||||
},
|
||||
"custom/clock-spacer": {
|
||||
"format": " ",
|
||||
"tooltip": false,
|
||||
"interval": "once"
|
||||
}
|
||||
}
|
||||
102
waybar/style.css
102
waybar/style.css
@@ -1,102 +0,0 @@
|
||||
@import url("file:///home/nico/.config/waybar/aether-colors.css");
|
||||
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "JetBrainsMono Nerd Font", "Noto Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: alpha(shade(@background, 0.7), 0.18);
|
||||
color: @foreground;
|
||||
border-bottom: 1px solid alpha(@accent, 0.45);
|
||||
}
|
||||
|
||||
#custom-arch {
|
||||
color: @accent;
|
||||
font-size: 18px;
|
||||
padding: 0 14px;
|
||||
margin: 4px 0 4px 8px;
|
||||
border-radius: 10px;
|
||||
background: alpha(@accent, 0.12);
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
margin: 4px 0;
|
||||
padding: 0 4px;
|
||||
border-radius: 10px;
|
||||
background: alpha(@background, 0.85);
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: @muted;
|
||||
padding: 0 9px;
|
||||
margin: 3px 2px;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: shade(@background, 0.7);
|
||||
background: @accent;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
color: @foreground;
|
||||
background: alpha(@blue, 0.22);
|
||||
}
|
||||
|
||||
#window {
|
||||
color: @foreground;
|
||||
padding: 0 14px;
|
||||
margin: 4px 0;
|
||||
border-radius: 10px;
|
||||
background: alpha(@background, 0.65);
|
||||
}
|
||||
|
||||
#tray,
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#custom-gpu,
|
||||
#temperature,
|
||||
#pulseaudio {
|
||||
color: @foreground;
|
||||
padding: 0 10px;
|
||||
margin: 4px 2px;
|
||||
border-radius: 10px;
|
||||
background: alpha(@background, 0.85);
|
||||
}
|
||||
|
||||
#cpu { color: @blue; }
|
||||
#memory { color: @cyan; }
|
||||
#temperature { color: @yellow; }
|
||||
#temperature.critical { color: @red; }
|
||||
#pulseaudio { color: @magenta; }
|
||||
#pulseaudio.muted { color: @muted; }
|
||||
|
||||
/* Reserved blank space where the Quickshell power button/menu renders on top. */
|
||||
#custom-power-spacer {
|
||||
min-width: 48px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Reserved blank space where the Quickshell clock/calendar widget renders on top. */
|
||||
#custom-clock-spacer {
|
||||
min-width: 130px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Reserved blank space where the Quickshell network widget renders on top. */
|
||||
#custom-network-spacer {
|
||||
min-width: 72px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
}
|
||||
Reference in New Issue
Block a user