2013-01-23 10:24:07 +01:00
|
|
|
********
|
2012-12-14 15:23:26 +01:00
|
|
|
Overview
|
2013-01-23 10:24:07 +01:00
|
|
|
********
|
2012-12-14 15:23:26 +01:00
|
|
|
|
|
|
|
Requirements
|
2013-01-23 10:24:07 +01:00
|
|
|
============
|
2012-12-14 15:23:26 +01:00
|
|
|
|
2013-01-21 20:42:57 +01:00
|
|
|
Powerline requires Python 3.3 or Python 2.7 to work.
|
2012-12-17 15:24:42 +01:00
|
|
|
|
|
|
|
Vim plugin requirements
|
2013-01-23 10:24:07 +01:00
|
|
|
-----------------------
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-21 20:42:57 +01:00
|
|
|
The vim plugin requires a vim version with Python support compiled in. You
|
|
|
|
can check if your vim supports Python by running ``vim --version | grep
|
|
|
|
+python``.
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-21 20:42:57 +01:00
|
|
|
If your vim version doesn't have support for Python, you'll have to compile
|
2013-01-23 10:24:07 +01:00
|
|
|
it with the ``--enable-pythoninterp`` flag (``--enable-python3interp`` if
|
|
|
|
you want Python 3 support instead). Note that this also requires the related
|
2013-01-21 20:42:57 +01:00
|
|
|
Python headers to be installed on your system. Please consult your
|
2012-12-21 11:19:53 +01:00
|
|
|
distribution's documentation for details on how to compile and install
|
|
|
|
packages.
|
|
|
|
|
2012-12-17 15:24:42 +01:00
|
|
|
Vim version 7.3.661 or newer is recommended for performance reasons.
|
|
|
|
|
2013-01-25 10:48:44 +01:00
|
|
|
Terminal emulator requirements
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
Powerline uses several special glyphs to get the arrow effect and some
|
|
|
|
custom symbols for developers. This requires that you either have a symbol
|
|
|
|
font or a patched font on your system. Your terminal emulator must also
|
|
|
|
support either patched fonts or fontconfig for Powerline to work properly.
|
|
|
|
|
|
|
|
You can also enable :ref:`24-bit color support <config-term_24bit_colors>`
|
|
|
|
if your terminal emulator supports it.
|
|
|
|
|
|
|
|
.. table:: Application/terminal emulator feature support matrix
|
|
|
|
:name: term-feature-support-matrix
|
|
|
|
|
|
|
|
===================== ======= ===================== ===================== =====================
|
|
|
|
Name OS Patched font support Fontconfig support 24-bit color support
|
|
|
|
===================== ======= ===================== ===================== =====================
|
|
|
|
Gnome Terminal Linux |i_yes| |i_yes| |i_no|
|
|
|
|
Gvim Linux |i_yes| |i_no| |i_yes|
|
|
|
|
iTerm2 OS X |i_yes| |i_no| |i_no|
|
|
|
|
Konsole Linux |i_yes| |i_yes| |i_yes|
|
|
|
|
lxterminal Linux |i_yes| |i_yes| |i_no|
|
|
|
|
MacVim OS X |i_yes| |i_no| |i_yes|
|
|
|
|
rxvt-unicode Linux |i_partial| [#]_ |i_no| |i_no|
|
|
|
|
st Linux |i_yes| |i_yes| |i_no|
|
|
|
|
Terminal.app OS X |i_yes| |i_no| |i_no|
|
|
|
|
Xfce Terminal Linux |i_yes| |i_yes| |i_no|
|
|
|
|
xterm Linux |i_yes| |i_no| |i_partial| [#]_
|
|
|
|
===================== ======= ===================== ===================== =====================
|
|
|
|
|
|
|
|
.. |i_yes| image:: _static/img/icons/tick.png
|
|
|
|
.. |i_no| image:: _static/img/icons/cross.png
|
|
|
|
.. |i_partial| image:: _static/img/icons/error.png
|
|
|
|
|
|
|
|
.. [#] Must be compiled with ``--enable-unicode3`` for the
|
|
|
|
patched font to work.
|
|
|
|
.. [#] Uses nearest color from 8-bit palette.
|
|
|
|
|
2013-01-22 14:23:21 +01:00
|
|
|
Optional dependencies
|
2013-01-23 10:24:07 +01:00
|
|
|
---------------------
|
2013-01-21 20:38:41 +01:00
|
|
|
|
|
|
|
The following Python packages are not required by all segments, but
|
2013-01-23 10:24:07 +01:00
|
|
|
recommended for optimal performance and extra features:
|
2013-01-21 20:38:41 +01:00
|
|
|
|
|
|
|
* ``pygit2``
|
2013-01-22 14:23:21 +01:00
|
|
|
* ``mercurial``
|
2013-01-21 20:38:41 +01:00
|
|
|
* ``psutil``
|
|
|
|
|
2012-12-13 22:43:58 +01:00
|
|
|
Installation
|
2013-01-23 10:24:07 +01:00
|
|
|
============
|
2012-12-13 22:43:58 +01:00
|
|
|
|
2013-01-24 17:35:16 +01:00
|
|
|
* :ref:`installation-linux`
|
|
|
|
* :ref:`installation-osx`
|
2013-01-18 10:58:23 +01:00
|
|
|
|
2012-12-14 15:23:26 +01:00
|
|
|
Usage
|
2013-01-23 10:24:07 +01:00
|
|
|
=====
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-17 09:42:39 +01:00
|
|
|
Vim statusline
|
2013-01-23 10:24:07 +01:00
|
|
|
--------------
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-24 17:35:16 +01:00
|
|
|
Add the following line to your :file:`vimrc`:
|
2013-01-21 10:14:21 +01:00
|
|
|
|
|
|
|
.. code-block:: vim
|
|
|
|
|
|
|
|
python from powerline.bindings.vim import source_plugin; source_plugin()
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-21 22:03:56 +01:00
|
|
|
If you want to enable Python 3 support, substitute the ``python`` command
|
|
|
|
above with ``python3``. Note that this is somewhat experimental as some
|
|
|
|
segments don't have support for Python 3 yet.
|
|
|
|
|
2012-12-19 14:46:14 +01:00
|
|
|
If Powerline is installed somewhere other than Python's site-packages
|
2013-01-21 10:14:21 +01:00
|
|
|
directories you'll either have to use a plugin manager like Vundle, or
|
|
|
|
source the vim plugin file with an absolute path to the plugin location.
|
2012-12-17 15:24:42 +01:00
|
|
|
|
2013-01-23 10:24:07 +01:00
|
|
|
Add the following line to your :file:`vimrc`, where ``{path}`` is the path
|
|
|
|
to the main Powerline project directory:
|
2013-01-21 10:14:21 +01:00
|
|
|
|
|
|
|
.. code-block:: vim
|
|
|
|
|
|
|
|
source {path}/powerline/bindings/vim/plugin/source_plugin.vim
|
|
|
|
|
2013-01-22 17:26:01 +01:00
|
|
|
Shell prompts
|
2013-01-23 10:24:07 +01:00
|
|
|
-------------
|
2013-01-17 09:42:39 +01:00
|
|
|
|
2013-01-17 17:06:45 +01:00
|
|
|
Bash prompt
|
2013-01-23 10:24:07 +01:00
|
|
|
^^^^^^^^^^^
|
2013-01-17 09:42:39 +01:00
|
|
|
|
2013-01-23 10:24:07 +01:00
|
|
|
Add the following line to your :file:`bashrc`, where ``{path}`` is the
|
|
|
|
absolute path to your Powerline installation directory:
|
2013-01-17 17:06:45 +01:00
|
|
|
|
2013-01-21 10:16:34 +01:00
|
|
|
.. code-block:: bash
|
2013-01-17 17:06:45 +01:00
|
|
|
|
2013-01-22 17:51:26 +01:00
|
|
|
. {path}/powerline/bindings/bash/powerline.sh
|
2013-01-17 09:42:39 +01:00
|
|
|
|
2013-01-17 17:06:45 +01:00
|
|
|
Zsh prompt
|
2013-01-23 10:24:07 +01:00
|
|
|
^^^^^^^^^^
|
2013-01-17 17:06:45 +01:00
|
|
|
|
2013-01-23 10:24:07 +01:00
|
|
|
Add the following line to your :file:`zshrc`, where ``{path}`` is the
|
|
|
|
absolute path to your Powerline installation directory:
|
2013-01-17 17:06:45 +01:00
|
|
|
|
2013-01-21 10:16:34 +01:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2013-01-22 17:51:26 +01:00
|
|
|
. {path}/powerline/bindings/zsh/powerline.zsh
|
2013-01-17 09:42:39 +01:00
|
|
|
|
|
|
|
Tmux statusline
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
2013-01-23 10:24:07 +01:00
|
|
|
Add the following line to your :file:`tmux.conf`, where ``{path}`` is the
|
2013-01-22 17:26:01 +01:00
|
|
|
absolute path to your Powerline installation directory::
|
|
|
|
|
|
|
|
source '{path}/powerline/bindings/tmux/powerline.conf'
|
2013-01-24 19:36:46 +01:00
|
|
|
|
|
|
|
IPython prompt
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
For IPython<0.11 add the following lines to your
|
|
|
|
:file:`.ipython/ipy_user_conf.py`::
|
|
|
|
|
|
|
|
# top
|
|
|
|
from powerline.bindings.ipython.pre_0_11 import setup as powerline_setup
|
|
|
|
|
|
|
|
# main() function (assuming you launched ipython without configuration to
|
|
|
|
# create skeleton ipy_user_conf.py file):
|
|
|
|
powerline_setup()
|
|
|
|
|
|
|
|
For IPython>=0.11 add the following line to your :file:`ipython_config.py`
|
|
|
|
file in the profile you are using::
|
|
|
|
|
|
|
|
c.InteractiveShellApp.extensions = [
|
|
|
|
'powerline.bindings.ipython.post_0_11'
|
|
|
|
]
|
|
|
|
|
|
|
|
IPython=0.11* is not supported and does not work. IPython<0.10 was not
|
|
|
|
tested (not installable by pip).
|
2013-01-28 12:30:11 +01:00
|
|
|
|
|
|
|
Awesome widget
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. note:: Powerline currently only supports awesome 3.5.
|
|
|
|
|
|
|
|
.. note:: The Powerline widget will spawn a shell script that runs in the
|
|
|
|
background and updates the statusline with ``awesome-client``.
|
|
|
|
|
|
|
|
Add the following to your :file:`rc.lua`, where ``{path}`` is the absolute
|
|
|
|
path to your Powerline installation directory:
|
|
|
|
|
|
|
|
.. code-block:: lua
|
|
|
|
|
|
|
|
package.path = package.path .. ';{path}/powerline/bindings/awesome/?.lua'
|
|
|
|
require('powerline')
|
|
|
|
|
|
|
|
Then add the ``powerline_widget`` to your ``wibox``:
|
|
|
|
|
|
|
|
.. code-block:: lua
|
|
|
|
|
|
|
|
right_layout:add(powerline_widget)
|
2013-01-30 10:35:01 +01:00
|
|
|
|
|
|
|
Qtile widget
|
|
|
|
------------
|
|
|
|
|
|
|
|
Add the following to your :file:`~/.config/qtile/config.py`:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
from powerline.bindings.qtile.widget import Powerline
|
|
|
|
|
|
|
|
screens = [
|
|
|
|
Screen(
|
|
|
|
top=bar.Bar([
|
|
|
|
# ...
|
|
|
|
Powerline(timeout=2),
|
|
|
|
# ...
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|