Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

↑ uptime segment #139

Merged
merged 2 commits into from
Jul 31, 2015
Merged

↑ uptime segment #139

merged 2 commits into from
Jul 31, 2015

Conversation

marcioAlmada
Copy link
Contributor

uptime

I've been using this segment on remote sessions so I know my VPNs uptime. Am I the only one who likes to see the server uptime all the time? πŸ™ˆ

@marcioAlmada
Copy link
Contributor Author

I'm trying to avoid dependency with uptime module. But if adding a new dependency it's not a problem things would get much cleaner:

from uptime import uptime
from datetime import timedelta

def add_uptime_segment():
    try:
        uptime_string = str(timedelta(seconds = int(uptime())))
        powerline.append(u' %s ↑ ' % uptime_string, Color.CWD_FG, Color.PATH_BG)
    except OSError:
        return

add_uptime_segment()

@b-ryan
Copy link
Owner

b-ryan commented Jul 31, 2015

Yeah I would like to avoid dependencies. This looks great. I wonder if the up arrow should come before the time.

@b-ryan
Copy link
Owner

b-ryan commented Jul 31, 2015

Thanks a lot for the change. It is working just fine from my testing.

b-ryan added a commit that referenced this pull request Jul 31, 2015
@b-ryan b-ryan merged commit e2ea9c8 into b-ryan:master Jul 31, 2015
amtrivedi91 added a commit to amtrivedi91/powerline-shell that referenced this pull request Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/powerline-shell that referenced this pull request Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants