安装polybar

kali安装

1
sudo apt install polybar

arch安装

  1. 直接安装

    添加阿里的源

    /etc/pacman.conf 文件后面添加

    1
    2
    3
    [archlinuxcn]
    SigLevel=Never
    Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

    安装

    1
    $ sudo pacman -S polybar
  2. 安装有方法1

    直接安装下载地址https://aur.archlinux.org/packages/polybar-git/

    1
    2
    3
    git clone https://aur.archlinux.org/polybar.git
    cd polybar
    makepkg -si

    发现报错

    image-20211003232102210

    解决方法

    修复第一个报错sudo pacman -S fakeroot

    修复第二个报错sudo pacman -Sy base-devel

    image-20211003232308643

  3. 安装有方法2

    用yey安装

    1
    2
    3
    4
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg -si
    yay -S polybar-git

    如果有报错按照上面的解决方法解决

基本的配置

Example示例使用

polaybar自带了example示例

1
2
3
4
5
install -Dm644 /usr/share/doc/polybar/config $HOME/.config/polybar/config
或者
mkdir ~/.config/polybar
cp /usr/share/doc/polybar/config ~/.config/polybar/
都是一样的

启动

1
polybar example

image-20211003234420058

设置自启动

vim ~/.config/polybar/launch.sh文件里面

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

# Terminate already running bar instances
killall -q polybar

# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done

# Launch Polybar, using default config location ~/.config/polybar/config

polybar example

添加可执行权限

1
chmod +x ~/.config/polybar/launch.sh

修改i3配置文件vim ~/.config/i3/config添加一个自启动

1
exec --no-startup-id  ~/.config/polybar/launch.sh

配置好的

https://github.com/Yucklys/polybar-nord-theme

https://github.com/adi1090x/polybar-themes

nerd 字体(各类字体的集合)

字体问题

git clone https://github.com/adi1090x/polybar-themes.git

叫这里面的字体文件都安装了

参考相关配置配置文档

https://eonun.com/posts/af56b769/

Polybar 的配置笔记

Polybar的主题配置