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',
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user