- Use dbus+UPower if available (code taken from kovidgoyal@7f73453 and
refactored).
- Use any battery from /sys/class/power_supply: replace hardcoded BAT0/BAT1 with
cycle.
- Use pmset.
- Use win32com.client with Win32_Battery object (code taken from an [SO
question][1] and refactored).
- Use ctypes + GetSystemPowerStatus (from [the same question][1]).
Completely untested (only know that syntax is correct), will probably have to
hear replies from users to merge.
[1]: http://stackoverflow.com/a/21083571/273566Closes#677.
Fixes#820.
Change made by @kovidgoyal. Comment:
Fix a bug in the inotify tree watcher that incorrectly marked a tree as
unchanged if an ignored event happens after a non-ignored event. This allows an
optimisation in the git backed to be used (ignoring changes to .git/index.lock).
--
Not including actual commit as I do not think removing pygit2 backend is a good
idea. Worse, removing pygit2 backend in the same commit fix is added is
definitely bad idea.
segment_info should have been initialized with self.segment_info, not updated:
new values must have priority. Refactored the result so that static values are
defined in VimRenderer.segment_info.
Notes:
- I had to launch script twice because tcsh does not actually support multiline
prompt: it squashes everything into one line.
- Thus I had to add POWERLINE_TCSH_NO_ABOVE_PROMPT: running python twice is not
nice for performance.
- Due to 1) tcsh shifting rprompt by 1 and 2) tcsh not accepting %{%}-escaped
color section at the very end of rprompt (actually it is accepting it, just
makes user input colored as that section) I had to reduce computed width by 2.
- As running powerline command in precmd modifies status code I had to use
POWERLINE_STATUS variable to save status.
- As tcsh does not accept names that start with underscore non-API powerline
variables do not start with underscore.
Notes:
- Unlike fish zsh outputs right prompt shifted by one to the left. Which means
I have to subtract 1 from computed width.
- PS2 and PS3 produce too lengthy prompts when fed with real width. Thus they
are fed with PS1 prompt width like in ipython (out prompts).