dotfiles/config/powerline-shell/segments/aws_profile.py
2021-04-20 13:12:35 +02:00

13 lines
457 B
Python

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)