Compare commits

..

2 commits

Author SHA1 Message Date
Damocles
a53616523b fix corners 2026-04-12 15:21:13 +02:00
Damocles
3a6ba994c5 weather options 2026-04-12 15:20:38 +02:00
4 changed files with 71 additions and 65 deletions

View file

@ -27,6 +27,8 @@ QtObject {
property bool battery: true property bool battery: true
property bool wlogout: true property bool wlogout: true
property var weatherArgs: ["--nerd"]
property FileView _file: FileView { property FileView _file: FileView {
path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/modules.json" path: (Quickshell.env("XDG_CONFIG_HOME") || (Quickshell.env("HOME") + "/.config")) + "/nova-shell/modules.json"
watchChanges: true watchChanges: true
@ -45,5 +47,7 @@ QtObject {
if (k in root && typeof root[k] === "boolean") if (k in root && typeof root[k] === "boolean")
root[k] = data[k]; root[k] = data[k];
} }
if (Array.isArray(data.weatherArgs))
root.weatherArgs = data.weatherArgs;
} }
} }

View file

@ -3,10 +3,8 @@ import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import "." as M import "." as M
// Empty region = no input area clicks pass through to windows below
// Draws rounded black corners at the edges of each screen. // Draws rounded black corners at the edges of each screen.
// Disabled when screenRadius is 0 (the default). // Disabled when screenRadius is 0.
Item { Item {
id: root id: root
@ -14,20 +12,13 @@ Item {
readonly property int _r: M.Theme.screenRadius readonly property int _r: M.Theme.screenRadius
Repeater { component Corner: PanelWindow {
model: root._r > 0 ? [ id: win
{ top: true, left: true, right: false, bottom: false, corner: 0 },
{ top: true, left: false, right: true, bottom: false, corner: 1 },
{ top: false, left: true, right: false, bottom: true, corner: 2 },
{ top: false, left: false, right: true, bottom: true, corner: 3 }
] : []
delegate: PanelWindow { property int corner: 0
id: cornerWindow
required property var modelData
screen: root.screen screen: root.screen
visible: root._r > 0
color: "transparent" color: "transparent"
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
@ -35,11 +26,6 @@ Item {
WlrLayershell.namespace: "nova-corners" WlrLayershell.namespace: "nova-corners"
mask: Region {} mask: Region {}
anchors.top: cornerWindow.modelData.top
anchors.left: cornerWindow.modelData.left
anchors.right: cornerWindow.modelData.right
anchors.bottom: cornerWindow.modelData.bottom
implicitWidth: root._r implicitWidth: root._r
implicitHeight: root._r implicitHeight: root._r
@ -52,7 +38,7 @@ Item {
ctx.fillStyle = "black"; ctx.fillStyle = "black";
ctx.beginPath(); ctx.beginPath();
switch (cornerWindow.modelData.corner) { switch (win.corner) {
case 0: // top-left case 0: // top-left
ctx.moveTo(0, 0); ctx.moveTo(0, 0);
ctx.lineTo(r, 0); ctx.lineTo(r, 0);
@ -83,5 +69,9 @@ Item {
} }
} }
} }
}
Corner { corner: 0; anchors.top: true; anchors.left: true }
Corner { corner: 1; anchors.top: true; anchors.right: true }
Corner { corner: 2; anchors.bottom: true; anchors.left: true }
Corner { corner: 3; anchors.bottom: true; anchors.right: true }
} }

View file

@ -12,7 +12,7 @@ M.BarSection {
Process { Process {
id: proc id: proc
running: true running: true
command: ["wttrbar", "--nerd"] command: ["wttrbar"].concat(M.Modules.weatherArgs)
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
try { try {

View file

@ -86,6 +86,17 @@ in
}; };
}; };
weatherArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "--nerd" ];
description = "Arguments passed to wttrbar.";
example = [
"--nerd"
"--location"
"Berlin"
];
};
theme = lib.mkOption { theme = lib.mkOption {
type = lib.types.attrsOf lib.types.anything; type = lib.types.attrsOf lib.types.anything;
default = { }; default = { };
@ -120,7 +131,8 @@ in
++ lib.optional cfg.modules.weather pkgs.wttrbar; ++ lib.optional cfg.modules.weather pkgs.wttrbar;
xdg.configFile."nova-shell/modules.json".source = xdg.configFile."nova-shell/modules.json".source =
(pkgs.formats.json { }).generate "nova-shell-modules.json" cfg.modules; (pkgs.formats.json { }).generate "nova-shell-modules.json"
(cfg.modules // { weatherArgs = cfg.weatherArgs; });
xdg.configFile."nova-shell/theme.json".source = xdg.configFile."nova-shell/theme.json".source =
let let