346 Commits

Author SHA1 Message Date
Kim Silkebækken
8b8de32be9 Improve vim plugin loading
Several of the plugin loading methods have been joined into one plugin
file that will be loaded by updating the runtimepath. More informative
error messages will be displayed if Python support is missing or if the
module import fails.

Note that this commit will break existing plugin loading, the new
method with updating the runtimepath will be required.

Closes #156.
Closes #181.
2013-02-07 12:14:15 +01:00
Kim Silkebækken
c2e7124da0 Fix statusline highlighting after leaving a cmdwin
Because vim doesn't trigger any autocmds after leaving a cmdwin the
statusline in the window the user returned to from the cmdwin would be
highlighted as non-current even if it should have been current.

This issue is resolved by storing the last current window ID in a script
variable, and when leaving the cmdwin we show the last current window as
current instead of detecting it after the WinEnter autocmd has been
triggered (which doesn't happen after leaving a cmdwin).

Closes #184.
2013-02-06 13:18:49 +01:00
ZyX
2e5b9383a5 Properly escape color codes in bash
Closes #177.
Closes #179.
2013-02-06 09:15:13 +01:00
Kim Silkebækken
4fa17f6ff5 Catch more errors in weather segment 2013-02-06 09:14:17 +01:00
Kim Silkebækken
9a95d738d5 Fix e-mail segment UTF-8 issues
Closes #178.
2013-02-06 09:14:17 +01:00
Kim Silkebækken
c8d4e58a93 Add repository_status vim segment
Split segment highlighting compared to the file_vcs_status segment is
missing.

Refs #173.
2013-02-06 09:14:17 +01:00
Kim Silkebækken
5cc265affd Fix repo.status() functions 2013-02-06 09:14:17 +01:00
Kim Silkebækken
e3ce4adc3d Fix UTF-8 encoding issue with weather segment
Closes #172.
2013-02-06 09:14:03 +01:00
Kim Silkebækken
56e661b21b Handle more request errors in common segments 2013-02-06 08:51:47 +01:00
Kim Silkebækken
184dac1bff Add solarized support for shell exit status segments
Closes #165.
2013-02-05 13:48:33 +01:00
ZyX
6f69322024 Add support for zsh/zpython
Closes #163.
2013-02-05 12:00:03 +01:00
Kim Silkebækken
b99e9cb074 Revert "Make 'powerline' a namespace package"
This reverts commit 57bd0af2721bf5ad18b512f347d6a08468ce0767.
2013-02-04 13:04:17 +01:00
ZyX
7a25ab1d53 Fix “'NoneType' object is not iterable” error
Fixes #158
2013-02-04 00:19:04 +04:00
Kim Silkebækken
57bd0af272 Make 'powerline' a namespace package
This will allow third-party plugins to use the 'powerline' namespace for
contributed segments.

Refs #3.
2013-02-03 16:27:30 +01:00
Kim Silkebækken
7e14a84cc9 Add cmus player to now_playing segment
Closes #162.
2013-02-01 22:35:01 +01:00
Kim Silkebækken
def7a1e82e Update now_playing methods to use common formatting methods 2013-02-01 22:33:24 +01:00
Kim Silkebækken
e8ebb07662 Add common player conversion methods 2013-02-01 22:33:07 +01:00
Kim Silkebækken
ea32006715 Fix Unicode issues with mail segment 2013-02-01 22:32:39 +01:00
Kim Silkebækken
4cda38e214 Remove support for persistent memoization
A different form of persistent memoization should be reimplemented later.

Refs #159.
2013-02-01 22:04:35 +01:00
Kim Silkebækken
260e40a544 Replace spaces *before* highlighting contents
The previous change obviously didn't work for renderers like the Pango
markup renderer since the highlighting code uses regular spaces and not
no-break spaces. Now spaces are replaced in the contents and dividers
only, and it's done before highlighting the segment so the added
highlighting code stays untouched.

Refs #113.
2013-02-01 16:45:10 +01:00
Kim Silkebækken
bfdb7f8028 Refactor segment rendering
This commit introduces the following changes to themes and segment
rendering:

- Spacer segments are now regular string/function type segments with
  "width": "auto" in the themes.
- The "rjust"/"ljust" properties have been replaced by the "width"
  option combined with a new "align" option.
- Renderer._render_segments() is now a generator which renders each
  segment separately, and assigns the rendered contents to
  "_rendered_hl" and "_rendered_raw" in the segment dict.
- Renderer.render() returns the segments by joining the "_rendered_hl"
  values for each segment.
- Spacer segment widths are calculated in the render() method, and
  assigned to "_space_left" and "_space_right" in the segment dict.
  These spaces are then applied in Renderer._render_segments().
- All space characters are converted to no-break spaces (U+00A0) in the
  "_rendered_hl" property.

Refs #113.
Refs #154.
2013-02-01 16:22:08 +01:00
Gaurav Narula
cb860ce5d0 Add Rhythmbox to now_playing segment
Closes #155.
2013-01-31 14:23:23 +01:00
Kim Silkebækken
0ad417cc79 Refactor now_playing segment slightly 2013-01-31 10:53:33 +01:00
Kim Silkebækken
5f9b8d5172 Swap quotes in email_alert segment 2013-01-31 10:36:10 +01:00
Kim Silkebækken
91c143bdd0 Update Arch Linux PKGBUILDs 2013-01-31 10:36:10 +01:00
Kim Silkebækken
7fb67e7350 Create now playing segment
The segment currently provides info from mpd or Spotify.
2013-01-31 10:35:21 +01:00
Kim Silkebækken
fd5cd92101 Fix rendering of dividers without custom highlight group 2013-01-31 07:51:09 +01:00
Kim Silkebækken
7022b47ed9 Fix updating issue with Qtile widget 2013-01-30 10:53:28 +01:00
Kim Silkebækken
597f67b85a Add Qtile widget 2013-01-30 10:35:01 +01:00
Kim Silkebækken
fb929b76cc Fix vim matcher string comparison
Refs 2f361711febaa822e4eb221f809b710cd650bf5b.
2013-01-30 09:54:34 +01:00
Kim Silkebækken
cc9b0daefc Pad powerline segments with no-break spaces
Some applications using Pango and/or Cairo draw square unknown character
glyphs next to divider glyphs instead of regular spaces. Non-breaking
spaces resolves this issue, and they are probably more correct to use
(no application should break lines at the padding spaces since they
"glue" the segment and dividers together as one unit).

This commit appears to work fine in all supported applications on Linux.

This commit resolves the gvim font rendering problems mentioned in
issue #113.
2013-01-30 09:54:34 +01:00
Kim Silkebækken
fb7a0d46e6 Rename AwesomeRenderer to PangoMarkupRenderer
Awesome WM uses the Pango Text Attribute Markup Language
(http://developer.gnome.org/pango/stable/PangoMarkupFormat.html), and
since other applications and window managers may use the same markup
language it's better to have a common renderer for this markup language.
2013-01-30 09:54:31 +01:00
Kim Silkebækken
1f9741b8a2 Move awesome theme to generic WM theme 2013-01-29 13:47:13 +01:00
Kim Silkebækken
b918057c40 Use timedelta.total_seconds() to fetch seconds in uptime segment
Closes #143.
2013-01-29 11:57:31 +01:00
Kim Silkebækken
59c316cb34 Remove percent placeholder from vim help theme 2013-01-29 08:58:44 +01:00
Kim Silkebækken
2f361711fe Add cmdwin statusline for vim 2013-01-29 08:58:22 +01:00
Kim Silkebækken
29793259e1 Improve argument handling in powerline script
Modules can now be any string, and an informative error message will be
written to sys.stdout if the module doesn't exist. The
`last_pipe_status` argument will also automatically be split into
a list.
2013-01-28 17:29:02 +01:00
Kim Silkebækken
5db6f47562 Catch ImportErrors when importing renderer module 2013-01-28 17:28:00 +01:00
Kim Silkebækken
52a52c8eb6 Hide e-mail alert segment if there are no unseen e-mails 2013-01-28 14:09:51 +01:00
Kim Silkebækken
f8d6f53a24 Don't check for mail if username or password is missing 2013-01-28 14:06:19 +01:00
Kim Silkebækken
3f2ce0a570 Catch the correct imaplib exception 2013-01-28 14:02:03 +01:00
Kim Silkebækken
a3600158de Add a quick setup guide to the docs 2013-01-28 13:55:45 +01:00
Kim Silkebækken
8c003c2683 Add e-mail alert segment 2013-01-28 13:55:36 +01:00
Kim Silkebækken
bda7384aa7 Add Awesome WM widget 2013-01-28 12:30:11 +01:00
Kim Silkebækken
1e4c3612ee Pass segment contents to renderer hl() methods
This allows the hl() methods to wrap highlighting code *around* the
segment contents, this is required for e.g. Pango markup in Awesome
statuslines (segments must be wrapped in <span ...>...</span> tags).
2013-01-28 11:51:26 +01:00
Kim Silkebækken
7a1d7ecaf4 Add width argument to shell script 2013-01-28 07:40:42 +01:00
Kim Silkebækken
091400c84f Join tmux/prompt shell scripts into one common script 2013-01-28 07:16:55 +01:00
Kim Silkebækken
57876a87e9 Make highlight_group optional if set in segment function 2013-01-28 06:55:22 +01:00
ZyX
17639a9e25 Add last_status and last_pipe_status segments 2013-01-28 06:52:10 +01:00
ZyX
c566064053 Add setopt promptpercent and promptsubst
These options are required for Powerline to work in zsh, but the latter
is off by default.
2013-01-28 06:40:27 +01:00