Sat 6 Jul 00:22:01 CEST 2024

This commit is contained in:
Thomas Avé 2024-07-06 00:22:01 +02:00
parent 8238826e66
commit df6f7e5686
2 changed files with 25 additions and 10 deletions

View File

@ -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;

View File

@ -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",