Polybar

一个快速和易于使用的状态栏。(A fast and easy-to-use status bar)

Github stars Tracking Chart

Polybar

一个快速且易于使用的创建状态栏的工具。

Polybar 旨在帮助用户为他们的桌面环境创建漂亮的、高度可定制的状态栏,而无需掌握 shell 脚本的黑带。下面是几张截图,向你展示它的样子。

sample screenshot sample screenshot sample screenshot sample screenshot

你可以在这里找到这些示例图像的 polybar 配置(和其他配置)。

介绍

Polybar 的主要目的是帮助用户创建很棒的状态栏。它内置了显示最常用服务信息的功能。到目前为止包括的一些服务:

  • Systray 图标
  • 窗口标题
  • 使用 libmpdclientMPD 进行播放控制和状态显示。
  • ALSAPulseAudio 音量控制
  • bspwmi3 的工作空间和桌面面板。
  • 符合 EWMH 标准的窗口管理器的工作空间模块。
  • 键盘布局和指示灯状态
  • CPU 和内存负载指示灯
  • 电池显示
  • 网络连接详情
  • 背光水平
  • 日期和时间标签
  • 基于时间的 shell 脚本执行
  • 命令输出尾随
  • 用户自定义菜单树
  • 进程间信息传递
  • 还有更多...
  • 更多详情请看 wiki

获得帮助

如果您发现自己陷入了困境,请查看我们的支持页面,在那里您可以找到帮助。

贡献

阅读我们的投稿指南,了解如何开始向 polybar 投稿。

入门

Polybar 已经为下面列出的发行版进行了打包。如果你在这里找不到你的发行版,你将不得不从源码构建

如果你使用的是 Debian (unstable 或 testing),你可以使用 sudo apt install polybar 来安装 polybar。如果你使用的是 Debian (buster/stable),你需要启用 backports,然后使用 sudo apt -t buster-backports 安装 polybar。

如果你使用的是 Arch Linux,你可以安装 AUR 包 polybar-git 来获得最新版本,或者 polybar 来获得最新的稳定版本。

如果你使用的是 Void Linux,你可以使用 xbps-install -S polybar 安装 polybar

如果你使用的是 NixOS,polybar 在稳定版和非稳定版渠道都有,可以用命令 nix-env -iA nixos.polybar 来安装。

如果你使用的是 Slackware,polybar 可以从 SlackBuilds 仓库中获得。

如果你使用的是 Source Mage GNU/Linux,polybar 咒语可以在 test grimoire 中找到,并且可以通过 cast polybar 安装。

如果你使用的是 openSUSE,polybar 可以从 OBS 仓库中获得。套件可用于 openSUSE Leap 15.1、openSUSE Leap 15.2 和 Tumbleweed。

如果你使用的是 FreeBSD,可以使用 pkg install polybar 来安装 polybar。确保你使用的是最新的软件包分支。

如果你使用的是 Gentoo,在 main 仓库中可以找到 release 和 git-master 两个版本。

如果您使用的是 Fedora,您可以使用 sudo dnf install polybar 来安装 polybar

安装

wiki 上的编译页面描述了构建和安装 polybar 的所有必要步骤。

配置

关于如何设置和配置栏和每个模块的细节已被移到 wiki 中。

安装示例配置

在编译目录下运行以下内容:

$ make userconfig

或者你可以从 /usr/share/doc/polybar/config 或 /usr/local/share/doc/polybar/config 中复制示例配置(取决于你的安装参数)。

启动示例栏

$ polybar example

运行

有关如何运行 polybar 的详细信息,请参阅 wiki

社区

想与我们取得联系?

  • 加入我们在 gitter.im/polybar/polybar 的 Gitter room。
  • 我们在 r/polybar 有自己的子网站。
  • chat.freenode.net 服务器上的 #polybar IRC 频道和我们聊天。

贡献者

Owner

维护人员

Logo 设计者

所有的贡献者

许可证

Polybar是根据 MIT 许可证授权的。有关详细信息,请参阅 LICENSE


(The first version translated by vz on 2020.12.05)

Overview

Name With Ownerpolybar/polybar
Primary LanguageC++
Program languageCMake (Language Count: 5)
PlatformBSD, Linux
License:MIT License
Release Count108
Last Release Name3.7.1 (Posted on 2023-11-27 17:19:58)
First Release Name0.1.0 (Posted on )
Created At2016-05-19 14:16:23
Pushed At2024-02-18 18:10:34
Last Commit At2024-01-13 10:04:51
Stargazers Count13.4k
Watchers Count125
Fork Count683
Commits Count2.3k
Has Issues Enabled
Issues Count2013
Issue Open Count141
Pull Requests Count684
Pull Requests Open Count72
Pull Requests Close Count123
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Polybar aims to help users build beautiful and highly customizable status bars
for their desktop environment, without the need of having a black belt in shell scripting.
Here are a few screenshots showing you what it can look like:

sample screenshot
sample screenshot
sample screenshot
sample screenshot

You can find polybar configs for these example images (and other configs) here.

If you need help, check out the Support page.

Please report any bugs you find by creating an issue ticket here on GitHub.
Make sure you include steps on how to reproduce it.

Table of Contents

Introduction

The main purpose of Polybar is to help users create awesome status bars.
It has built-in functionality to display information about the most commonly used services.
Some of the services included so far:

  • Systray icons
  • Window title
  • Playback controls and status display for MPD using libmpdclient
  • ALSA volume controls
  • Workspace and desktop panel for bspwm and i3
  • Workspace module for EWMH compliant window managers
  • Keyboard layout and indicator status
  • CPU and memory load indicator
  • Battery display
  • Network connection details
  • Backlight level
  • Date and time label
  • Time-based shell script execution
  • Command output tailing
  • User-defined menu tree
  • Inter-process messaging
  • And more...

See the wiki for more details.

Getting Help

If you find yourself stuck, have a look at our Support page for resources where you can find help.

Getting started

Polybar was already packaged for the distros listed below.
If you can't find your distro here, you will have to build from source.

If you create a package for any other distribution, please consider contributing the template.

If you are using Arch Linux, you can install the AUR package polybar-git to get the latest version, or
polybar for the latest stable release.

If you are using Void Linux, you can install polybar using xbps-install -S polybar.

If you are using NixOS, polybar is available in both the stable and unstable channels and can be installed with the command nix-env -iA nixos.polybar.

If you are using Slackware, polybar is available from the SlackBuilds repository.

If you are using Source Mage GNU/Linux, polybar spell is available in test grimoire and can be installed via cast polybar.

If you are using openSUSE, polybar is available from OBS repository. Package is available for openSUSE Leap 15 and Tumbleweed.

If you are using FreeBSD, polybar can be installed using pkg install polybar. Make sure you are using the latest package branch.

If you are using Gentoo, both release and git-master versions are available in the main repository.

If you are using Fedora, you can install polybar using sudo dnf install polybar.

Dependencies

A compiler with C++14 support (clang-3.4+, gcc-5.1+), cmake 3.1+, git

  • cairo
  • libxcb
  • python
  • xcb-proto
  • xcb-util-image
  • xcb-util-wm

Optional dependencies:

  • xcb-util-cursor required for the cursor-click and cursor-scroll settings
  • xcb-util-xrm required for accessing X resources with ${xrdb:...}

Optional dependencies for extended module support:

  • xcb-xkb required by internal/xkeyboard
  • alsa-lib required by internal/alsa
  • libpulse required by internal/pulseaudio
  • i3-wm required by internal/i3
  • jsoncpp required by internal/i3
  • libmpdclient required by internal/mpd
  • libcurl required by internal/github
  • libnl-genl or wireless_tools required by internal/network

Find a more complete list on the dedicated wiki page.

Building from source

Please report any problems you run into when building the project.

Download the polybar-<version>.tar for the version you want to build from the
release page, extract it with
tar xvf polybar-<version>.tar and go into the extracted folder. There, run
the following commands:

$ mkdir build
$ cd build
$ cmake ..
$ make -j$(nproc)
$ sudo make install

There's also a helper script available in the root folder:

$ ./build.sh

For more info, have a look at the Compiling wiki page.

Configuration

Details on how to setup and configure the bar and each module have been moved to the wiki.

Install the example configuration

Run the following inside the build directory:

$ make userconfig

Or you can copy the example config from /usr/share/doc/polybar/config or /usr/local/share/doc/polybar/config (depending on your install parameters)

Launch the example bar

$ polybar example

Running

See the wiki for details on how to run polybar.

Community

Want to get in touch?

Contributors

Owner

Maintainers

Logo Design by

All Contributors

License

Polybar is licensed under the MIT license. See LICENSE for more information.

To the top