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

12 lines
361 B
Python
Raw Normal View History

2021-04-20 11:12:35 +00:00
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)