From e09392924cfcaee76607a643a4556d18d8c5534c Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:04:54 +0700 Subject: [PATCH] uptime: use uptime command cuz faster than w --- .config/ags/modules/sideright/sideright.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/ags/modules/sideright/sideright.js b/.config/ags/modules/sideright/sideright.js index c9ac81834..79c7a4001 100644 --- a/.config/ags/modules/sideright/sideright.js +++ b/.config/ags/modules/sideright/sideright.js @@ -30,7 +30,7 @@ const timeRow = Box({ className: 'txt-small txt', setup: (self) => self .poll(5000, label => { - execAsync(['bash', '-c', `w | sed -n '1p' | cut -d, -f1 | cut -d' ' -f4-`]) + execAsync(['bash', '-c', `uptime -p | sed -e 's/...//;s/ day\\| days/d/;s/ hour\\| hours/h/;s/ minute\\| minutes/m/;s/,[^,]*//2'`]) .then(upTimeString => { label.label = `Uptime ${upTimeString}`; }).catch(print);