dotfiles/config/powerline-shell/segments/aws_profile.py

13 lines
457 B
Python
Raw Permalink Normal View History

2021-04-20 11:12:35 +00:00
from ..utils import BasicSegment
import os
class Segment(BasicSegment):
def add_to_powerline(self):
aws_profile = os.environ.get("AWS_PROFILE") or \
os.environ.get("AWS_DEFAULT_PROFILE")
if aws_profile:
self.powerline.append(" aws:%s " % os.path.basename(aws_profile),
self.powerline.theme.AWS_PROFILE_FG,
self.powerline.theme.AWS_PROFILE_BG)