# Segment reference

## Segments

Segments are written in Python, and the default segments provided with Powerline are located in `powerline/segments/extension.py`. User-defined segments can be defined in any module in `sys.path` or paths common configuration option, import is always absolute.

Segments are regular Python functions, and they may accept arguments. All arguments should have a default value which will be used for themes that don’t provide an `args` dict.

More information is available in Writing segments section.

## Available segments

- Common segments
  - VCS submodule
    - `BranchSegment`
    - `StashSegment`
  - System properties
    - `CPULoadPercentSegment`
    - `system_load()`
    - `uptime()`
  - Network
    - `ExternalIpSegment`
    - `NetworkLoadSegment`
    - `hostname()`
    - `internal_ip()`
  - Current environment
    - `CwdSegment`
      - `CwdSegment.argspecobjs()`
      - `CwdSegment.omitted_args()`
    - `environment()`
    - `user()`
    - `virtualenv()`
  - Battery
    - `battery()`
  - Weather
    - `WeatherSegment`
  - Date and time
    - `date()`
    - `fuzzy_time()`
  - Mail
    - `EmailIMAPSegment`
  - Media players
    - `ClementinePlayerSegment`
    - `CmusPlayerSegment`
      - `CmusPlayerSegment.get_player_status()`
    - `DbusPlayerSegment`
    - `ITunesPlayerSegment`
    - `MocPlayerSegment`
      - `MocPlayerSegment.get_player_status()`
    - `MpdPlayerSegment`
    - `PlayerSegment`
      - `PlayerSegment.argspecobjs()`
      - `PlayerSegment.omitted_args()`
    - `RDIOPlayerSegment`
    - `RhythmboxPlayerSegment`
    - `SpotifyAppleScriptPlayerSegment`
    - `SpotifyDbusPlayerSegment`
- i3wm segments
  - `active_window()`
  - `mode()`
  - `scratchpad()`
  - `workspace()`
  - `workspaces()`
- PDB segments
  - `current_code_name()`
  - `current_context()`
  - `current_file()`
  - `current_line()`
  - `stack_depth()`
- Shell segments
  - `ShellCwdSegment`
  - `continuation()`
  - `jobnum()`
  - `last_pipe_status()`
  - `last_status()`
  - `mode()`
- Tmux segments
  - `attached_clients()`
- Vim segments
  - `VimBranchSegment`
  - `VimStashSegment`
  - `bufnr()`
  - `col_current()`
  - `csv_col_current()`
  - `file_bom()`
  - `file_directory()`
  - `file_encoding()`
  - `file_format()`
  - `file_name()`
  - `file_scheme()`
  - `file_size()`
  - `file_type()`
  - `file_vcs_status()`
  - `line_count()`
  - `line_current()`
  - `line_percent()`
  - `mode()`
  - `modified_buffers()`
  - `modified_indicator()`
  - `paste_indicator()`
  - `position()`
  - `readonly_indicator()`
  - `tab()`
  - `tab_modified_indicator()`
  - `tabnr()`
  - `trailing_whitespace()`
  - `virtcol_current()`
  - `visual_range()`
  - `window_title()`
  - `winnr()`
  - Plugin-specific segments
    - Asynchronous Linter Engine (ALE) segments
      - `ale()`
    - Syntastic segments
      - `syntastic()`
    - Command-T segments
      - `finder()`
      - `path()`
    - Tagbar segments
      - `current_tag()`
    - NERDTree segments
      - `nerdtree()`
    - Capslock segments
      - `capslock_indicator()`