Well if you can't figure out how to get it from `uptime` output and you
are on Linux you can always use /proc/uptime, try something like:
set -- $(</proc/uptime);y=${1%.*};printf "%02u:%02u:%02u" $((y/216000))
$((y/3600)) $((y%3600/60))
You'll probably want to put it in a script and call that from the tmux
prompt to avoid a nightmare of escaping.
On Tue, Jul 16, 2013 at 06:25:39AM +0100, Sharon Kimble wrote:
> I've been trying this for several days now and I just cant get it to
> work, how do you get your machines uptime in the status bar please?
>
> I've tried - #set -g status-left '#[fg=green]#H #[fg=black]???
> #[fg=green,bright]###(uptime|awk '{split(substr($0, index($0, "load")),
> a, ":"); print a[2]})'#[default]'
>
> and
>
> set -g status-right '#[fg=red,bg=default]#(uptime) #[fg=blue]%a
> %d-%m-%Y %H:%M:%S'
>
> What I'm looking for is just a straight uptime of days:hours:minutes,
> which will be updated every 30 seconds with the normal statusbar update.
>
> Can anyone help me out please?
>
> Thanks
> Sharon.
> --
> ???A taste of linux = http://www.sharons.org.uk/index.html
> efever = http://www.efever.blogspot.com/
> efever = http://sharon04.livejournal.com/
> Debian testing, Fluxbox 1.3.5, LibreOffice 4.0.3.3
> Registered Linux user 334501
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> tmux-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tmux-users
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users