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

11 lines
361 B
Python

import os
from ..utils import BasicSegment
class Segment(BasicSegment):
def add_to_powerline(self):
powerline = self.powerline
if not os.access(powerline.cwd, os.W_OK):
powerline.append(' %s ' % powerline.lock,
powerline.theme.READONLY_FG,
powerline.theme.READONLY_BG)