Replace i3status-rust with polybar

This commit is contained in:
Jake Howard 2018-11-18 20:26:59 +00:00
parent 3e8dbd2849
commit 448e02e564
Signed by: jake
GPG key ID: 57AFB45680EDD477
6 changed files with 145 additions and 65 deletions

View file

@ -131,17 +131,7 @@ exec dunst
bar {
status_command i3status
workspace_buttons no
}
bar {
status_command i3status-rs ~/.config/i3/status.toml
position top
workspace_buttons no
binding_mode_indicator no
tray_output none
font pango:DejaVu Sans Mono, FontAwesome5Free, FontAwesome5Brands 8
colors {
separator #666666
statusline #dddddd
}
}
exec_always --no-startup-id {{ home }}/.config/polybar/launch.sh

View file

@ -1,43 +0,0 @@
theme = "plain"
icons = "awesome"
[[block]]
block = "xrandr"
interval = 5
icons = true
[[block]]
block = "music"
player = "spotify"
marquee = true
buttons = ["play", "next"]
[[block]]
block = "temperature"
interval = 5
[[block]]
block = "memory"
format_mem = "{Mup}%"
clickable = false
interval = 2
[[block]]
block = "cpu"
interval = 2
[[block]]
block = "sound"
interval = 1
step_width = 2
{% if ansible_fqdn == "TOO-Laptop" %}
[[block]]
block = "battery"
interval = 5
{% endif %}
[[block]]
block = "time"
interval = 1
format = "%Y-%m-%d %T"

9
files/launch-polybar.sh Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# From: https://github.com/jaagr/polybar/issues/763#issuecomment-392960721
pkill polybar
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar --reload example &
done

114
files/polybar.ini Normal file
View file

@ -0,0 +1,114 @@
[colors]
background = #111
foreground = #dfdfdf
primary = #285577
secondary = #333333
alert = #bd2c40
[settings]
screenchange-reload = true
[bar/example]
monitor = ${env:MONITOR:}
width = 100%
height = 30
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
padding-right = 2
font-0 = "DejaVu Sans Mono:size=9;2"
font-1 = "FontAwesome5FreeSolid:size=8;2"
modules-left = i3 xwindow
modules-center = date
modules-right = player_mpris_tail memory cpu pulseaudio power-menu
module-margin = 2
wm-restack = i3
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = default
[module/xwindow]
type = internal/xwindow
label = %title%
label-maxlen = 75
[module/i3]
type = internal/i3
format = <label-state>
index-sort = true
wrapping-scroll = false
pin-workspaces = true
label-focused = %index%
label-focused-background = ${colors.primary}
label-focused-padding = 1
label-unfocused = ${self.label-focused}
label-unfocused-padding = 1
label-visible = ${self.label-focused}
label-visible-background = ${colors.secondary}
label-visible-padding = ${self.label-focused-padding}
label-urgent = ${self.label-focused}
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
[module/date]
type = internal/date
interval = 1
date = "%Y-%m-%d"
date-alt = "%c"
time = %H:%M:%S
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <label-volume>
use-ui-max = false
label-muted =  MUTE
label-muted-foreground = ${colors.alert}
interval = 10
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
[module/cpu]
type = internal/cpu
interval = 1
label =  %percentage%%
[module/memory]
type = internal/memory
interval = 1
label =  %gb_used%
[module/player_mpris_tail]
type = custom/script
exec = "python3 {{ polybar_scripts }}/player-mpris-tail/player-mpris-tail.py -f '{icon} {title} - {artist}' --icon-playing  --icon-paused "
tail = true
click-left = playerctl play-pause
click-right = playerctl next
label-maxlen = 75
[module/power-menu]
type = custom/menu
label-open =
label-close =
menu-0-0 = Shutdown
menu-0-0-foreground = #F00
menu-0-1 = Restart
menu-0-1-foreground = #0F0
label-separator = " | "
expand-right = false

View file

@ -1,16 +1,11 @@
- template:
src: ./files/i3status-rust.toml
dest: "{{ home }}/.config/i3/status.toml"
mode: 0644
owner: "{{ user }}"
group: users
- set_fact:
polybar_scripts: "{{ home }}/.config/polybar/polybar-scripts/polybar-scripts"
i3_config_files:
- {src: "i3.conf", dest: "{{ home }}/.config/i3/config"}
- {src: "i3status.conf", dest: "{{ home }}/.config/i3status/config"}
- {src: "compton.conf", dest: "{{ home }}/.config/compton.conf"}
- {src: "dunst.conf", dest: "{{ home }}/.config/dunst/dunstrc"}
- {src: "polybar.ini", dest: "{{ home }}/.config/polybar/config"}
- name: "Create i3 config file directories"
with_items: "{{ i3_config_files }}"
@ -20,14 +15,29 @@
owner: "{{ user }}"
mode: 0755
- name: "Copy i3 config files"
- name: "i3 config files"
with_items: "{{ i3_config_files }}"
copy:
template:
src: './files/{{ item.src }}'
dest: '{{ item.dest }}'
mode: 0644
owner: "{{ user }}"
- name: "Polybar scripts"
git:
repo: git@github.com:x70b1/polybar-scripts
dest: "{{ home }}/.config/polybar/polybar-scripts"
force: true
become: true
become_user: "{{ user }}"
- copy:
src: ./files/launch-polybar.sh
dest: "{{ home }}/.config/polybar/launch.sh"
mode: 0755
owner: "{{ user }}"
group: users
- service:
name: "lightdm"
enabled: false

View file

@ -112,7 +112,6 @@
- 'htop'
- 'hugo'
- 'i3status'
- 'i3status-rust'
- 'ibus'
- 'ibus-uniemoji'
- 'inkscape'
@ -145,6 +144,7 @@
- 'perl-file-mimeinfo'
- 'pigz'
- 'playerctl'
- 'aur/polybar'
- 'postgresql'
- 'postman-bin'
- 'powertop'