extract constants
This commit is contained in:
parent
bc3a85d18d
commit
b969f0824f
22 changed files with 106 additions and 63 deletions
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
visible: percent > 0
|
visible: percent > 0
|
||||||
tooltip: "Brightness: " + root.percent + "%"
|
tooltip: "Brightness: " + root.percent + "%"
|
||||||
|
|
||||||
|
|
@ -14,7 +14,8 @@ M.BarSection {
|
||||||
id: adjProc
|
id: adjProc
|
||||||
property string cmd: ""
|
property string cmd: ""
|
||||||
command: ["sh", "-c", cmd]
|
command: ["sh", "-c", cmd]
|
||||||
onRunningChanged: if (!running && cmd !== "") current.reload()
|
onRunningChanged: if (!running && cmd !== "")
|
||||||
|
current.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
function adjust(delta) {
|
function adjust(delta) {
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,15 @@ PanelWindow {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: 8
|
anchors.leftMargin: M.Theme.barPadding
|
||||||
anchors.rightMargin: 8
|
anchors.rightMargin: M.Theme.barPadding
|
||||||
|
|
||||||
// ---- center (declared first so left/right can anchor to it) ----
|
// ---- center (declared first so left/right can anchor to it) ----
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: centerSection
|
id: centerSection
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 8
|
spacing: M.Theme.barSpacing
|
||||||
|
|
||||||
M.Clock {}
|
M.Clock {}
|
||||||
M.Notifications {}
|
M.Notifications {}
|
||||||
|
|
@ -48,7 +48,7 @@ PanelWindow {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: centerSection.left
|
anchors.right: centerSection.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 8
|
spacing: M.Theme.barSpacing
|
||||||
|
|
||||||
M.Tray {
|
M.Tray {
|
||||||
bar: bar
|
bar: bar
|
||||||
|
|
@ -63,7 +63,7 @@ PanelWindow {
|
||||||
anchors.left: centerSection.right
|
anchors.left: centerSection.right
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 12
|
spacing: M.Theme.barSpacing
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ Text {
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
if (hovered && root.tooltip !== "") {
|
if (hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.text = root.tooltip
|
M.FlyoutState.text = root.tooltip;
|
||||||
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x
|
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x;
|
||||||
M.FlyoutState.visible = true
|
M.FlyoutState.visible = true;
|
||||||
} else if (!hovered && root.tooltip !== "") {
|
} else if (!hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.visible = false
|
M.FlyoutState.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ Text {
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
if (hovered && root.tooltip !== "") {
|
if (hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.text = root.tooltip
|
M.FlyoutState.text = root.tooltip;
|
||||||
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x
|
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x;
|
||||||
M.FlyoutState.visible = true
|
M.FlyoutState.visible = true;
|
||||||
} else if (!hovered && root.tooltip !== "") {
|
} else if (!hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.visible = false
|
M.FlyoutState.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ Row {
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
if (hovered && root.tooltip !== "") {
|
if (hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.text = root.tooltip
|
M.FlyoutState.text = root.tooltip;
|
||||||
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x
|
M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x;
|
||||||
M.FlyoutState.visible = true
|
M.FlyoutState.visible = true;
|
||||||
} else if (!hovered && root.tooltip !== "") {
|
} else if (!hovered && root.tooltip !== "") {
|
||||||
M.FlyoutState.visible = false
|
M.FlyoutState.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
visible: UPower.displayDevice?.isLaptopBattery ?? false
|
visible: UPower.displayDevice?.isLaptopBattery ?? false
|
||||||
tooltip: {
|
tooltip: {
|
||||||
const state = root.charging ? "Charging" : "Discharging";
|
const state = root.charging ? "Charging" : "Discharging";
|
||||||
|
|
@ -20,7 +20,8 @@ M.BarSection {
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
icon: {
|
icon: {
|
||||||
if (root.charging) return "\uDB80\uDC84";
|
if (root.charging)
|
||||||
|
return "\uDB80\uDC84";
|
||||||
const icons = ["\uDB80\uDC8E", "\uDB80\uDC7A", "\uDB80\uDC7B", "\uDB80\uDC7C", "\uDB80\uDC7D", "\uDB80\uDC7E", "\uDB80\uDC7F", "\uDB80\uDC80", "\uDB80\uDC81", "\uDB80\uDC82", "\uDB85\uDFE2"];
|
const icons = ["\uDB80\uDC8E", "\uDB80\uDC7A", "\uDB80\uDC7B", "\uDB80\uDC7C", "\uDB80\uDC7D", "\uDB80\uDC7E", "\uDB80\uDC7F", "\uDB80\uDC80", "\uDB80\uDC81", "\uDB80\uDC82", "\uDB85\uDFE2"];
|
||||||
return icons[Math.min(10, Math.floor(root.pct / 10))];
|
return icons[Math.min(10, Math.floor(root.pct / 10))];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
tooltip: root.status === "connected" ? "Bluetooth: " + root.device : "Bluetooth: on"
|
tooltip: root.status === "connected" ? "Bluetooth: " + root.device : "Bluetooth: on"
|
||||||
|
|
||||||
property string status: "off"
|
property string status: "off"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 2
|
spacing: Math.max(1, M.Theme.moduleSpacing - 2)
|
||||||
tooltip: "CPU: " + root.usage + "%\n" + root.freqGhz.toFixed(2) + " GHz"
|
tooltip: "CPU: " + root.usage + "%\n" + root.freqGhz.toFixed(2) + " GHz"
|
||||||
|
|
||||||
property int usage: 0
|
property int usage: 0
|
||||||
|
|
@ -25,7 +25,10 @@ M.BarSection {
|
||||||
if (dTotal > 0)
|
if (dTotal > 0)
|
||||||
root.usage = Math.round((1 - dIdle / dTotal) * 100);
|
root.usage = Math.round((1 - dIdle / dTotal) * 100);
|
||||||
}
|
}
|
||||||
root._prev = { idle, total };
|
root._prev = {
|
||||||
|
idle,
|
||||||
|
total
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileView {
|
FileView {
|
||||||
|
|
@ -33,7 +36,8 @@ M.BarSection {
|
||||||
path: "/proc/cpuinfo"
|
path: "/proc/cpuinfo"
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
const lines = text().split("\n").filter(l => l.startsWith("cpu MHz"));
|
const lines = text().split("\n").filter(l => l.startsWith("cpu MHz"));
|
||||||
if (lines.length === 0) return;
|
if (lines.length === 0)
|
||||||
|
return;
|
||||||
const sum = lines.reduce((a, l) => a + parseFloat(l.split(":")[1]), 0);
|
const sum = lines.reduce((a, l) => a + parseFloat(l.split(":")[1]), 0);
|
||||||
root.freqGhz = sum / lines.length / 1000;
|
root.freqGhz = sum / lines.length / 1000;
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +46,10 @@ M.BarSection {
|
||||||
interval: 1000
|
interval: 1000
|
||||||
running: true
|
running: true
|
||||||
repeat: true
|
repeat: true
|
||||||
onTriggered: { stat.reload(); cpuinfo.reload(); }
|
onTriggered: {
|
||||||
|
stat.reload();
|
||||||
|
cpuinfo.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 2
|
spacing: Math.max(1, M.Theme.moduleSpacing - 2)
|
||||||
tooltip: root.freePct + "% free of " + root.totalTb.toFixed(1) + " TB"
|
tooltip: root.freePct + "% free of " + root.totalTb.toFixed(1) + " TB"
|
||||||
|
|
||||||
property int freePct: 0
|
property int freePct: 0
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ PanelWindow {
|
||||||
color: M.Theme.base01
|
color: M.Theme.base01
|
||||||
border.color: M.Theme.base03
|
border.color: M.Theme.base03
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: M.Theme.radius
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: label
|
id: label
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 2
|
spacing: Math.max(1, M.Theme.moduleSpacing - 2)
|
||||||
tooltip: "Memory: " + root.percent + "% used"
|
tooltip: "Memory: " + root.percent + "% used"
|
||||||
|
|
||||||
property int percent: 0
|
property int percent: 0
|
||||||
|
|
@ -16,7 +16,8 @@ M.BarSection {
|
||||||
const m = {};
|
const m = {};
|
||||||
text().split("\n").forEach(l => {
|
text().split("\n").forEach(l => {
|
||||||
const [k, v] = l.split(":");
|
const [k, v] = l.split(":");
|
||||||
if (v) m[k.trim()] = parseInt(v.trim());
|
if (v)
|
||||||
|
m[k.trim()] = parseInt(v.trim());
|
||||||
});
|
});
|
||||||
const total = m.MemTotal;
|
const total = m.MemTotal;
|
||||||
const avail = m.MemAvailable;
|
const avail = m.MemAvailable;
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,19 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
visible: player !== null
|
visible: player !== null
|
||||||
tooltip: {
|
tooltip: {
|
||||||
const p = root.player;
|
const p = root.player;
|
||||||
if (!p) return "";
|
if (!p)
|
||||||
|
return "";
|
||||||
const parts = [];
|
const parts = [];
|
||||||
if (p.trackTitle) parts.push(p.trackTitle);
|
if (p.trackTitle)
|
||||||
if (p.trackArtists?.length) parts.push(p.trackArtists.join(", "));
|
parts.push(p.trackTitle);
|
||||||
if (p.trackAlbum) parts.push(p.trackAlbum);
|
if (p.trackArtists?.length)
|
||||||
|
parts.push(p.trackArtists.join(", "));
|
||||||
|
if (p.trackAlbum)
|
||||||
|
parts.push(p.trackAlbum);
|
||||||
return parts.join("\n") || p.identity;
|
return parts.join("\n") || p.identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,14 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
tooltip: {
|
tooltip: {
|
||||||
if (root.state === "wifi") return "WiFi: " + root.essid + (root.ifname ? "\nInterface: " + root.ifname : "");
|
if (root.state === "wifi")
|
||||||
if (root.state === "eth") return "Ethernet: " + root.ifname;
|
return "WiFi: " + root.essid + (root.ifname ? "\nInterface: " + root.ifname : "");
|
||||||
if (root.state === "linked") return "Linked: " + root.ifname;
|
if (root.state === "eth")
|
||||||
|
return "Ethernet: " + root.ifname;
|
||||||
|
if (root.state === "linked")
|
||||||
|
return "Linked: " + root.ifname;
|
||||||
return "Disconnected";
|
return "Disconnected";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,9 +53,12 @@ M.BarSection {
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
icon: {
|
icon: {
|
||||||
if (root.state === "wifi") return "\uF1EB";
|
if (root.state === "wifi")
|
||||||
if (root.state === "eth") return "\uDB80\uDE00";
|
return "\uF1EB";
|
||||||
if (root.state === "linked") return "\uDB85\uDE16";
|
if (root.state === "eth")
|
||||||
|
return "\uDB80\uDE00";
|
||||||
|
if (root.state === "linked")
|
||||||
|
return "\uDB85\uDE16";
|
||||||
return "\uDB82\uDCFD";
|
return "\uDB82\uDCFD";
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
tooltip: {
|
tooltip: {
|
||||||
const parts = [root.count + " notification" + (root.count !== 1 ? "s" : "")];
|
const parts = [root.count + " notification" + (root.count !== 1 ? "s" : "")];
|
||||||
if (root.dnd) parts.push("Do not disturb");
|
if (root.dnd)
|
||||||
if (root.inhibited) parts.push("Inhibited");
|
parts.push("Do not disturb");
|
||||||
|
if (root.inhibited)
|
||||||
|
parts.push("Inhibited");
|
||||||
return parts.join("\n");
|
return parts.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,8 +38,10 @@ M.BarSection {
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
icon: {
|
icon: {
|
||||||
if (root.inhibited) return root.count > 0 ? "\uDB80\uDC9B" : "\uDB82\uDE91";
|
if (root.inhibited)
|
||||||
if (root.dnd) return root.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
|
return root.count > 0 ? "\uDB80\uDC9B" : "\uDB82\uDE91";
|
||||||
|
if (root.dnd)
|
||||||
|
return root.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
|
||||||
return root.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
|
return root.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -61,5 +65,7 @@ M.BarSection {
|
||||||
clicker.running = true;
|
clicker.running = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Process { id: clicker }
|
Process {
|
||||||
|
id: clicker
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,12 @@ M.BarIcon {
|
||||||
property string profile: ""
|
property string profile: ""
|
||||||
|
|
||||||
icon: {
|
icon: {
|
||||||
if (root.profile === "performance") return "\uF0E7";
|
if (root.profile === "performance")
|
||||||
if (root.profile === "power-saver") return "\uF06C";
|
return "\uF0E7";
|
||||||
if (root.profile === "balanced") return "\uF24E";
|
if (root.profile === "power-saver")
|
||||||
|
return "\uF06C";
|
||||||
|
if (root.profile === "balanced")
|
||||||
|
return "\uF24E";
|
||||||
return "\uF0E7";
|
return "\uF0E7";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +37,8 @@ M.BarIcon {
|
||||||
id: setter
|
id: setter
|
||||||
property string next: ""
|
property string next: ""
|
||||||
command: ["powerprofilesctl", "set", next]
|
command: ["powerprofilesctl", "set", next]
|
||||||
onRunningChanged: if (!running && next !== "") proc.running = true
|
onRunningChanged: if (!running && next !== "")
|
||||||
|
proc.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 2
|
spacing: Math.max(1, M.Theme.moduleSpacing - 2)
|
||||||
tooltip: "Temperature: " + root.celsius + "\u00B0C"
|
tooltip: "Temperature: " + root.celsius + "\u00B0C"
|
||||||
|
|
||||||
property int celsius: 0
|
property int celsius: 0
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ QtObject {
|
||||||
property int fontSize: 12
|
property int fontSize: 12
|
||||||
property real barOpacity: 0.9
|
property real barOpacity: 0.9
|
||||||
property int barHeight: 32
|
property int barHeight: 32
|
||||||
|
property int barPadding: 8
|
||||||
|
property int barSpacing: 12
|
||||||
|
property int moduleSpacing: 4
|
||||||
|
property int radius: 4
|
||||||
|
|
||||||
property FileView _themeFile: FileView {
|
property FileView _themeFile: FileView {
|
||||||
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/theme.json"
|
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/theme.json"
|
||||||
|
|
@ -60,5 +64,13 @@ QtObject {
|
||||||
root.barOpacity = data.barOpacity;
|
root.barOpacity = data.barOpacity;
|
||||||
if (data.barHeight !== undefined)
|
if (data.barHeight !== undefined)
|
||||||
root.barHeight = data.barHeight;
|
root.barHeight = data.barHeight;
|
||||||
|
if (data.barPadding !== undefined)
|
||||||
|
root.barPadding = data.barPadding;
|
||||||
|
if (data.barSpacing !== undefined)
|
||||||
|
root.barSpacing = data.barSpacing;
|
||||||
|
if (data.moduleSpacing !== undefined)
|
||||||
|
root.moduleSpacing = data.moduleSpacing;
|
||||||
|
if (data.radius !== undefined)
|
||||||
|
root.radius = data.radius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Quickshell.Services.SystemTray
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
spacing: 6
|
spacing: M.Theme.moduleSpacing + 2
|
||||||
|
|
||||||
required property var bar
|
required property var bar
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,8 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
tooltip: (root.sink?.description ?? root.sink?.name ?? "Unknown sink") +
|
tooltip: (root.sink?.description ?? root.sink?.name ?? "Unknown sink") + "\nVolume: " + Math.round(root.volume * 100) + "%" + (root.muted ? "\nMuted" : "")
|
||||||
"\nVolume: " + Math.round(root.volume * 100) + "%" +
|
|
||||||
(root.muted ? "\nMuted" : "")
|
|
||||||
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: [Pipewire.defaultAudioSink]
|
objects: [Pipewire.defaultAudioSink]
|
||||||
|
|
@ -27,12 +25,14 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: if (root.sink?.audio) root.sink.audio.muted = !root.sink.audio.muted
|
onTapped: if (root.sink?.audio)
|
||||||
|
root.sink.audio.muted = !root.sink.audio.muted
|
||||||
}
|
}
|
||||||
|
|
||||||
WheelHandler {
|
WheelHandler {
|
||||||
onWheel: event => {
|
onWheel: event => {
|
||||||
if (!root.sink?.audio) return;
|
if (!root.sink?.audio)
|
||||||
|
return;
|
||||||
root.sink.audio.volume = Math.max(0, root.sink.audio.volume + (event.angleDelta.y > 0 ? 0.05 : -0.05));
|
root.sink.audio.volume = Math.max(0, root.sink.audio.volume + (event.angleDelta.y > 0 ? 0.05 : -0.05));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
id: root
|
id: root
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
tooltip: root.weatherTooltip
|
tooltip: root.weatherTooltip
|
||||||
|
|
||||||
property string weatherTooltip: ""
|
property string weatherTooltip: ""
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
// Placeholder — Quickshell.Services.Niri not yet available
|
// Placeholder — Quickshell.Services.Niri not yet available
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 4
|
spacing: M.Theme.moduleSpacing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,8 @@ in
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Theme overrides written to `$XDG_CONFIG_HOME/nova-shell/theme.json`.
|
Theme overrides written to `$XDG_CONFIG_HOME/nova-shell/theme.json`.
|
||||||
Keys: colors (base00-base0F), fontFamily, iconFontFamily, fontSize, barOpacity, barHeight.
|
Keys: colors (base00-base0F), fontFamily, iconFontFamily, fontSize,
|
||||||
|
barOpacity, barHeight, barPadding, barSpacing, moduleSpacing, radius.
|
||||||
Automatically populated from stylix when it is available.
|
Automatically populated from stylix when it is available.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue