Exemplo n.º 1
0
    def use(self, context):
        if context.in_titlebar or context.in_statusbar:
            return Default.use(self, context)

        else:
            # Don't use sym|hardlink hilighting
            link_sav = context.link
            context.link = False

            fg, bg, attr = Default.use(self, context)

            if context.directory and not context.marked and not context.inactive_pane and not context.selected:
                attr &= (~bold)

            if context.tab and context.good:
                fg = black

            if link_sav:
                attr |= (bold | underline
                         )  # make links distinguishable (see Note.1)
                if context.bad:
                    fg = magenta

            if not context.selected and (context.cut or context.copied):
                attr |= bold
                fg = magenta
                bg = black

            if context.marked:
                fg = yellow

            # Revert
            context.link = link_sav

            return fg, bg, attr
Exemplo n.º 2
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.border:
            fg = blue

        return fg, bg, attr
Exemplo n.º 3
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        # if context.directory and not context.marked and not context.link \
        #         and not context.inactive_pane:
        #     fg = green

        # if context.in_titlebar and context.hostname:
        #     fg = red if context.bad else blue

        if context.video_linked and context.link and not context.marked:
            # fg = white if context.good else red
            if context.video_linked_badname:
                fg = red
            elif context.good:
                fg = blue if context.video_linked_tvshow else white
            else:
                fg = red
            # if context.directory:
            #     fg = blue
            if not context.selected:
                attr = normal

        if context.in_titlebar:
            if context.hostname:
                fg = red if context.bad else cyan
            if context.tab and context.good:
                fg = black
                bg = blue
            attr = normal

        return fg, bg, attr
Exemplo n.º 4
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if curses.COLORS < 88:
            return fg, bg, attr

        try:
            translate = {
                blue: 22,
                yellow: 72,
                green: 20,
                cyan: 21,
                white: 79,
                red: 32,
                magenta: magenta,
            }
            fg = translate[fg]
        except KeyError:
            pass

        if context.in_browser:
            if context.main_column and context.marked:
                if context.selected:
                    fg = 77
                else:
                    fg = 68
                    attr |= reverse

        return fg, bg, attr
Exemplo n.º 5
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.border:
            return black, bg, attr

        return fg, bg, attr
Exemplo n.º 6
0
	def use(self, context):
		fg, bg, attr = Default.use(self, context)

		if curses.COLORS < 88:
			return fg, bg, attr

		try:
			translate = {
				blue: 22,
				yellow: 72,
				green: 20,
				cyan: 21,
				white: 79,
				red: 32,
				magenta: magenta,
			}
			fg = translate[fg]
		except KeyError:
			pass

		if context.in_browser:
			if context.main_column and context.marked:
				if context.selected:
					fg = 77
				else:
					fg = 68
					attr |= reverse

		return fg, bg, attr
Exemplo n.º 7
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link \
                and not context.inactive_pane:
            fg = 165

        elif context.link:
            fg = 122 if context.good or context.in_titlebar else 198

        elif context.in_titlebar and context.hostname:
            fg = 84

        elif context.container:
            fg = 162

        elif context.media:
            if context.image:
                fg = 227
            else:
                fg = 174

        elif context.executable and not \
                any((context.media, context.container,
                     context.fifo, context.socket, context.link)):
            attr |= bold
            fg = 47

        if context.main_column:
            if context.marked and not context.selected:
                attr |= bold
                attr |= reverse
                fg = 214

        return fg, bg, attr
Exemplo n.º 8
0
Arquivo: hut.py Projeto: hut/dotfiles
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if getattr(context, 'scaffold', False):
            fg = 208

        return fg, bg, attr
Exemplo n.º 9
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_browser:
            if context.media:
                if context.image:
                    fg = magenta
                else:
                    fg = magenta
                    fg += BRIGHT

            if context.directory:
                attr |= bold
                fg = blue
            elif context.executable and not \
                    any((context.media, context.container,
                         context.fifo, context.socket)):
                attr |= bold
                fg = green

            if context.fifo or context.device:
                fg = yellow
                if context.device:
                    attr |= bold

            if context.link:
                fg = cyan if context.good else red
                if not context.good:
                    bg = black

        return fg, bg, attr
Exemplo n.º 10
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.reset:
            pass

        elif context.in_browser:
            if context.selected:
                attr = normal
                bg = white
            if context.directory:
                fg = blue
            if context.media:
                fg = black
            if context.fifo or context.device:
                fg = magenta
            if context.main_column:
                if context.marked:
                    attr |= bold
                    fg = black

        elif context.in_titlebar:
            if context.tab:
                attr = normal
                bg = white
                if context.good:
                    bg = yellow

        elif context.in_statusbar:
            if context.marked:
                attr = normal
                bg = white
                fg = black

        return fg, bg, attr
Exemplo n.º 11
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_titlebar and context.tab and context.good:
            bg = white
            fg = black

        return fg, bg, attr
Exemplo n.º 12
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link \
                and not context.inactive_pane:
            fg = 33

        return fg, bg, attr
Exemplo n.º 13
0
    def use(self, context):  # pylint: disable=too-many-branches,too-many-statements
        fg, bg, attr = Default.use(self, context)

        if context.in_browser and context.selected:
            if context.container:
                bg = white

        return fg, bg, attr
Exemplo n.º 14
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_titlebar:
            if context.tab:
                if not context.good:
                    fg = black

        return fg, bg, attr
Exemplo n.º 15
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link:
            fg = green

        if context.in_titlebar and context.hostname:
            fg = red if context.bad else blue

        return fg, bg, attr
Exemplo n.º 16
0
	def use(self, context):
		fg, bg, attr = Default.use(self, context)

		if context.directory and not context.marked and not context.link:
			fg = green

		if context.in_titlebar and context.hostname:
			fg = red if context.bad else blue

		return fg, bg, attr
Exemplo n.º 17
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_titlebar and context.hostname:
            fg = red if context.bad else blue

        if context.in_titlebar and context.directory:
            fg = green

        return fg, bg, attr
Exemplo n.º 18
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link \
                and not context.inactive_pane:
            fg = self.progress_bar_color

        if context.in_titlebar and context.hostname:
            fg = blue if context.bad else yellow

        return fg, bg, attr
Exemplo n.º 19
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link \
                and not context.inactive_pane:
            fg = red

        if context.in_titlebar and context.hostname:
            fg = yellow if context.bad else blue

        return fg, bg, attr
Exemplo n.º 20
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_titlebar:
            if context.tab:
                if not context.good:
                    bg = cyan
            elif context.file:
                fg = default
        elif context.in_browser:
            if context.main_column and context.selected:
                fg = yellow

        return fg, bg, attr
Exemplo n.º 21
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link \
                and not context.inactive_pane:
            fg = self.progress_bar_color

        if context.line_number and not context.selected:
            fg = self.progress_bar_color
            attr &= ~bold

        if context.in_titlebar and context.hostname:
            fg = red if context.bad else blue

        return fg, bg, attr
Exemplo n.º 22
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.in_browser:
            if context.inactive_pane:
                fg = black

        elif context.in_titlebar:
            if context.tab:
                if context.good:
                    bg = default
                    fg = default
                else:
                    fg = black

        return fg, bg, attr
Exemplo n.º 23
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if curses.COLORS < 88:
            return fg, bg, attr

        dircolor = 55
        dircolor_selected = {True: 79, False: 78}
        linkcolor = {True: 84, False: 48}

        if context.in_browser:
            if context.media:
                if context.image:
                    fg = 48
                elif context.video:
                    fg = 61
                elif context.audio:
                    fg = 42

            if context.container:
                fg = 52

            if context.directory:
                fg = dircolor
            elif context.executable and not \
                    any((context.media, context.container)):
                fg = 40

            if context.link and not context.directory:
                fg = linkcolor[context.good]

            if context.main_column:
                if context.selected:
                    attr |= bold
                if context.marked:
                    attr |= bold
                    fg = 56

            if context.in_titlebar:
                if context.hostname:
                    fg = context.bad and 61 or 54
                elif context.directory:
                    fg = dircolor
                elif context.link:
                    fg = linkcolor[True]

        return fg, bg, attr
Exemplo n.º 24
0
	def use(self, context):
		fg, bg, attr = Default.use(self, context)

		if curses.COLORS < 88:
			return fg, bg, attr

		dircolor = 77
		dircolor_selected = {True: 79, False: 78}
		linkcolor = {True: 21, False: 48}

		if context.in_browser:
			if context.media:
				if context.image:
					fg = 20
				elif context.video:
					fg = 22
				elif context.audio:
					fg = 23

			if context.container:
				fg = 32
			if context.directory:
				fg = dircolor
				if context.selected:
					fg = dircolor_selected[context.main_column]
			elif context.executable and not \
					any((context.media, context.container)):
				fg = 82
			if context.link:
				fg = linkcolor[context.good]

			if context.main_column:
				if context.selected:
					attr |= bold
				if context.marked:
					attr |= bold
					fg = 53

		if context.in_titlebar:
			if context.hostname:
				fg = context.bad and 48 or 82
			elif context.directory:
				fg = dircolor
			elif context.link:
				fg = linkcolor[True]

		return fg, bg, attr
Exemplo n.º 25
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if curses.COLORS < 88:
            return fg, bg, attr

        dircolor = 55
        dircolor_selected = { True: 79, False: 78 }
        linkcolor = { True: 84, False: 48 }

        if context.in_browser:
            if context.media:
                if context.image:
                    fg = 48
                elif context.video:
                    fg = 61
                elif context.audio:
                    fg = 42 

            if context.container:
                fg = 52

            if context.directory:
                fg = dircolor
            elif context.executable and not \
                    any((context.media, context.container)):
                fg = 40
            
            if context.link and not context.directory:
                fg = linkcolor[context.good]

            if context.main_column:
                if context.selected:
                    attr |= bold
                if context.marked:
                    attr |= bold
                    fg = 56

            if context.in_titlebar:
                if context.hostname:
                    fg = context.bad and 61 or 54
                elif context.directory:
                    fg = dircolor
                elif context.link:
                    fg = linkcolor[True]

        return fg, bg, attr
Exemplo n.º 26
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if curses.COLORS < 88:
            return fg, bg, attr

        dircolor = 77
        dircolor_selected = {True: 79, False: 78}
        linkcolor = {True: 21, False: 48}

        if context.in_browser:
            if context.media:
                if context.image:
                    fg = 20
                elif context.video:
                    fg = 22
                elif context.audio:
                    fg = 23

            if context.container:
                fg = 32
            if context.directory:
                fg = dircolor
                if context.selected:
                    fg = dircolor_selected[context.main_column]
            elif context.executable and not \
              any((context.media, context.container)):
                fg = 82
            if context.link:
                fg = linkcolor[context.good]

            if context.main_column:
                if context.selected:
                    attr |= bold
                if context.marked:
                    attr |= bold
                    fg = 53

        if context.in_titlebar:
            if context.hostname:
                fg = context.bad and 48 or 82
            elif context.directory:
                fg = dircolor
            elif context.link:
                fg = linkcolor[True]

        return fg, bg, attr
Exemplo n.º 27
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)


        if context.in_titlebar:
            if context.hostname:
                attr = bold
                fg = red
            elif context.directory:
                fg = yellow
            elif context.tab:
                pass
                fg = context.good and 47 or 33
            elif context.link:
                attr = underline
                fg = cyan





        return fg, bg, attr
Exemplo n.º 28
0
    def use(self, context):

        fg, bg, attr = Default.use(self, context)

        if context.border:
            fg = fg_super_dim

        elif context.in_browser:
            attr = normal
            if context.empty or context.error:
                fg = fg_very_dim
                bg = default
            if context.file:
                fg = foreground
            if context.marked:
                fg = foreground
                bg = fg_super_dim
            if context.selected:
                if context.marked:
                    bg = fg_very_dim
                else:
                    bg = bg_accent

        elif context.in_titlebar:

            if context.hostname:
                fg = red if context.bad else foreground
            elif context.directory:
                fg = foreground

            attr = normal

        elif context.in_taskview:
            pass

        elif context.in_statusbar:
            pass

        return fg, bg, attr
Exemplo n.º 29
0
    def use(self, context):
        fg, bg, attr = Default.use(self, context)

        if context.directory and not context.marked and not context.link:
            fg = blue

        if context.in_titlebar:
            if context.hostname:
                if context.good:
                    fg = cyan
                elif context.bad:
                    fg = red
            else:
                fg = default

        if context.reset:
            return default_colors

        if context.border:
            fg = blue

        if context.in_taskview:
            fg = green

        if context.in_statusbar:
            if context.permissions:
                if context.good:
                    fg = magenta
                elif context.bad:
                    fg = red
            if context.message:
                if context.good:
                    attr |= bold
                    fg = yellow
                elif context.bad:
                    attr |= bold
                    fg = red

        return fg, bg, attr
Exemplo n.º 30
0
 def use(self, context):
     fg, bg, attr = Default.use(self, context)
     attr &= ~bold
     return fg, bg, attr