forked from Shinonome/dots-hyprland
uptime: use uptime command cuz faster than w
This commit is contained in:
@@ -30,7 +30,7 @@ const timeRow = Box({
|
|||||||
className: 'txt-small txt',
|
className: 'txt-small txt',
|
||||||
setup: (self) => self
|
setup: (self) => self
|
||||||
.poll(5000, label => {
|
.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 => {
|
.then(upTimeString => {
|
||||||
label.label = `Uptime ${upTimeString}`;
|
label.label = `Uptime ${upTimeString}`;
|
||||||
}).catch(print);
|
}).catch(print);
|
||||||
|
|||||||
Reference in New Issue
Block a user