Advertisement
m3m5

ranger colors

Nov 2nd, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. # Ranger theme
  2.  
  3. from ranger.gui.colorscheme import ColorScheme
  4. from ranger.gui.color import *
  5.  
  6. class Default(ColorScheme):
  7. def use(self, context):
  8. fg, bg, attr = default_colors
  9.  
  10. if context.reset:
  11. return default_colors
  12.  
  13. elif context.in_browser:
  14. if context.selected:
  15. attr = reverse
  16. else:
  17. attr = normal
  18. if context.empty or context.error:
  19. bg = red
  20. if context.border:
  21. attr |= bold
  22. fg = white
  23. if context.media:
  24. if context.image:
  25. fg = cyan
  26. else:
  27. fg = blue
  28. if context.container:
  29. attr |= bold
  30. fg = magenta
  31. if context.directory:
  32. attr |= bold
  33. fg = white
  34. elif context.executable and not \
  35. any((context.media, context.container,
  36. context.fifo, context.socket)):
  37. attr |= bold
  38. fg = green
  39. if context.socket:
  40. fg = magenta
  41. if context.fifo or context.device:
  42. fg = yellow
  43. if context.device:
  44. attr |= bold
  45. if context.link:
  46. fg = context.good and cyan or magenta
  47. if context.tag_marker and not context.selected:
  48. attr |= bold
  49. if fg in (red, magenta):
  50. fg = white
  51. else:
  52. fg = red
  53. if not context.selected and (context.cut or context.copied):
  54. fg = black
  55. attr |= bold
  56. if context.main_column:
  57. if context.selected:
  58. attr |= normal
  59. if context.marked:
  60. attr |= bold
  61. fg = yellow
  62. if context.badinfo:
  63. if attr & reverse:
  64. bg = magenta
  65. else:
  66. fg = magenta
  67.  
  68. elif context.in_titlebar:
  69. attr |= bold
  70. if context.hostname:
  71. attr |= bold
  72. fg = context.bad and black or black
  73. elif context.directory:
  74. fg = cyan
  75. elif context.tab:
  76. if context.good:
  77. bg = green
  78. elif context.link:
  79. fg = cyan
  80.  
  81. elif context.in_statusbar:
  82. if context.permissions:
  83. if context.good:
  84. fg = cyan
  85. elif context.bad:
  86. fg = magenta
  87. if context.marked:
  88. attr |= bold | reverse
  89. fg = yellow
  90. if context.message:
  91. if context.bad:
  92. attr |= bold
  93. fg = red
  94.  
  95. if context.text:
  96. if context.highlight:
  97. attr |= reverse
  98.  
  99. if context.in_taskview:
  100. if context.title:
  101. fg = blue
  102.  
  103. if context.selected:
  104. attr |= reverse
  105.  
  106. return fg, bg, attr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement