From df6f7e5686420e35124bbb79810e0c3b8d1eed53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 6 Jul 2024 00:22:01 +0200 Subject: [PATCH] Sat 6 Jul 00:22:01 CEST 2024 --- home/ags/default.nix | 7 +++++++ home/ags/files/config.js | 28 ++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/home/ags/default.nix b/home/ags/default.nix index 911cfc3..d855b56 100644 --- a/home/ags/default.nix +++ b/home/ags/default.nix @@ -46,6 +46,13 @@ margin-right: 0.3em; } + .battery-item { + padding-left: 0.6em; + padding-right: 0.6em; + margin-right: 0.6em; + border-radius: 0.3em; + } + .item, .clients box { background: #1f2430; padding-left: 0.7em; diff --git a/home/ags/files/config.js b/home/ags/files/config.js index 06ba904..6679680 100644 --- a/home/ags/files/config.js +++ b/home/ags/files/config.js @@ -16,7 +16,7 @@ const batteryIndicator = Widget.Box({ const icon = thresholds.find(threshold => threshold >= battery.percent) self.icon = battery.charging? `battery-level-${icon}-charging-symbolic` : `battery-level-${icon}-symbolic` self.tooltip_text = `Battery ${battery.percent}%` - self.class_name = "blue systray-item"; + self.class_name = "blue battery-item"; }), Widget.Button({ class_name: "item", @@ -168,18 +168,26 @@ function Right() { SysTray(), batteryIndicator, volumeIndicator, - Widget.Label({ + Widget.Box({ class_name: "item", - label: Variable("", { - poll: [2000, 'top -b -n 1', out => "CPU " + out.split('\n') - .find(line => line.includes('Cpu(s)')) - .split(/\s+/)[1] - .replace(',', '.').toString() + "%"], - }).bind() - }), + children: [ + Widget.Icon({ + vexpand: false, + size: 16, + icon: "speedometer", + }), + Widget.Label({ + label: Variable("", { + poll: [2000, 'top -b -n 1', out => " " + out.split('\n') + .find(line => line.includes('Cpu(s)')) + .split(/\s+/)[1] + .replace(',', '.').toString() + "%"], + }).bind() + }) + ]}), Widget.Label({ class_name: "item blue", - label: Variable("", { poll: [5000, 'bash -c "cat /proc/cpuinfo | grep \\"MHz\\" | awk \'{print \\$4}\' | sort -n | tail -1 | awk \'{printf \\"%.2f GHz\\", \\$1/1000}\'"'] }).bind(), + label: Variable("", { poll: [5000, 'bash -c "cat /proc/cpuinfo | grep \\"MHz\\" | awk \'{print \\$4}\' | sort -n | tail -1 | awk \'{printf \\"%.2f\\", \\"GHz\\", \\$1/1000}\'"'] }).bind(), }), Widget.Label({ class_name: "item",