about summary refs log tree commit diff stats
path: root/tools
Commit message (Expand)AuthorAgeFilesLines
* vim revisionSilvino Silva2016-11-181-1/+12
* fix tools gitolite hook deploywebSilvino Silva2016-10-263-10/+9
* fix tools gitolite with correct userSilvino Silva2016-10-261-2/+4
* Merge branch 'gitweb' into developSilvino Silva2016-10-258-168/+573
|\
| * update etc/gitweb.confSilvino Silva2016-10-252-4/+22
| * gitolite and gitweb revisionSilvino Silva2016-10-257-172/+555
| * initial gitwebSilvino Silva2016-10-232-0/+4
* | added script to find external portsSilvino Silva2016-10-251-0/+8
|/
* X revisionSilvino Silva2016-10-232-146/+191
* core reboot and tools tar document revisionSilvino Silva2016-10-211-2/+11
* deleted tool script iptablesSilvino Silva2016-10-161-361/+0
* tools storage and lvm revisionSilvino Silva2016-10-163-26/+36
* tools network revisionSilvino Silva2016-10-165-17/+33
* tools revisionSilvino Silva2016-10-1514-117/+460
* qemu partition disk imageSilvino Silva2016-10-081-6/+20
* tools postgresql configuration files revisionSilvino Silva2016-10-033-4/+628
* nginx documentation and configuration reviewSilvino Silva2016-10-036-123/+195
* review certificates for exim, nginx and postgresqlSilvino Silva2016-10-032-13/+121
* nginx and php revisionSilvino Silva2016-09-293-2/+6
* Merge branch 'f-postgres' into developSilvino Silva2016-09-294-90/+203
|\
| * postgresql revisionSilvino Silva2016-09-294-90/+203
* | tools storage and lvm revisionSilvino Silva2016-09-293-339/+169
|/
* network revisionSilvino Silva2016-09-287-73/+229
* nginx revision with mantisbtSilvino Silva2016-09-283-9/+31
* tools index revisionSilvino Silva2016-09-281-6/+6
* tools nginx fix script installSilvino Silva2016-09-282-6/+14
* nginx configuration fixSilvino Silva2016-09-282-2/+2
* tool ningx revision, added install scriptsSilvino Silva2016-09-2810-92/+507
* network name revisionSilvino Silva2016-09-282-10/+10
* Final revision 0.2.2Silvino Silva2016-09-242-47/+70
* tar backup script fixSilvino Silva2016-09-221-3/+4
* tools qemu and index document fixSilvino Silva2016-09-222-13/+12
* tools tar document fixSilvino Silva2016-09-221-1/+1
* tools gnupg document fixSilvino Silva2016-09-221-3/+4
* final 0.2.1 revisionSilvino Silva2016-09-227-176/+498
* Merge branch 'b-mail-system' into r-0.2.1Silvino Silva2016-09-211-22/+27
|\
| * initial exim and mutt local delivery testSilvino Silva2016-09-211-22/+27
* | dnsmasq and dnscrypt revisionSilvino Silva2016-09-215-12002/+28656
* | initial dnsmasq configurationSilvino Silva2016-09-212-0/+12844
|/
* tools qemu revisionSilvino Silva2016-09-211-51/+50
* tools dnsmasq revisionSilvino Silva2016-09-211-3/+3
* index's revisionSilvino Silva2016-09-211-16/+30
* tools tar fixSilvino Silva2016-09-211-1/+1
* gpg revisionSilvino Silva2016-09-212-58/+56
* moved tool config from coreSilvino Silva2016-09-2012-0/+592
* initial r-0.2.1Silvino Silva2016-09-203-10/+305
* nginx revisionSilvino Silva2016-09-201-1/+1
* index's revisionSilvino Silva2016-09-201-15/+41
* converted c9 Team to lower charSilvino Silva2016-09-1814-15/+15
* changed Silvino Silva to c9 Team and added team pageSilvino Silva2016-09-1814-15/+15
e information about the context. If the tag "in_titlebar" is set, you probably want to know about the color of a part of the titlebar now. There are a number of context tags, specified in /ranger/gui/context.py in the constant CONTEXT_KEYS. A Context object, defined in the same file, contains attributes with the names of all tags, whose values are either True or False. Implementation in the GUI Classes --------------------------------- The class CursesShortcuts in the file /ranger/gui/curses_shortcuts.py defines the methods color(*tags), color_at(y, x, wid, *tags) and color_reset(). This class is a superclass of Displayable, so these methods are available almost everywhere. Something like color("in_titlebar", "directory") will be called to get the color of directories in the titlebar. This creates a ranger.gui.context.Context object, sets its attributes "in_titlebar" and "directory" to True, leaves the others as False, and passes it to the colorscheme's use(context) method. The Color Scheme ---------------- A colorscheme should be a subclass of ranger.gui.ColorScheme and define the method use(context). By looking at the context, this use-method has to determine a 3-tuple of integers: (foreground, background, attribute) and return it. foreground and background are integers representing colors, attribute is another integer with each bit representing one attribute. These integers are interpreted by the used terminal emulator. Abbreviations for colors and attributes are defined in ranger.gui.color. Two attributes can be combined via bitwise OR: bold | reverse Once the color for a set of tags is determined, it will be cached by default. If you want more dynamic colorschemes (such as a different color for very large files), you will need to dig into the source code, perhaps add an own tag and modify the draw-method of the widget to use that tag. Run tc_colorscheme to check if your colorschemes are valid. Specify a Colorscheme --------------------- Colorschemes are searched for in these directories: ~/.ranger/colorschemes/ /ranger/colorschemes/ To specify which colorscheme to use, define the variable "colorscheme" in your options.py: colorscheme = colorschemes.default This means, use the (one) colorscheme contained in either ~/.ranger/colorschemes/default.py or /ranger/colorschemes/default.py. You can define more than one colorscheme in a colorscheme file. The one named "Scheme" will be chosen in that case. If there is no colorscheme named "Scheme", an arbitrary one will be picked. You could also explicitly specify which colorscheme to use in your options.py: colorscheme = colorschemes.default.MyOtherScheme Adapt a colorscheme ------------------- You may want to adapt a colorscheme to your needs without having a complete copy of it, but rather the changes only. Say, you want the exact same colors as in the default colorscheme, but the directories to be green rather than blue, because you find the blue hard to read. This is done in the jungle colorscheme ranger.colorschemes.jungle.Scheme, check it out for implementation details. In short, I made a subclass of the default scheme, set the initial colors to the result of the default use() method and modified the colors how I wanted. This has the obvious advantage that you need to write less, which results in less maintainance work and a greater chance that your colorscheme will work with future versions of ranger.