#+TITLE: Polybar Configuration
:DRAWER:
#+STARTUP: overview
#+LANGUAGE: en
#+EMAIL: dehaeze.thomas@gmail.com
#+AUTHOR: Dehaeze Thomas
#+HTML_LINK_HOME: ./index.html
#+HTML_LINK_UP: ./index.html
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+PROPERTY: header-args :comments no
#+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :tangle ~/.config/polybar/config
:END:
* Colors
#+begin_src conf
[colors]
bg = ${xrdb:background}
red = ${xrdb:color1}
green = ${xrdb:color2}
yellow = ${xrdb:color3}
blue = ${xrdb:color4}
purple = ${xrdb:color5}
aqua = ${xrdb:color6}
gray = ${colors.color7}
darkgray = ${colors.color8}
darkred = ${xrdb:color9}
darkgreen = ${xrdb:color10}
darkyellow = ${xrdb:color11}
darkblue = ${xrdb:color12}
darkpurple = ${xrdb:color13}
darkaqua = ${xrdb:color14}
fg = ${xrdb:foreground}
#+end_src
* VM
#+begin_src conf
[global/wm]
margin-top = 0
margin-bottom = 0
#+end_src
* Top Bar
#+BEGIN_SRC conf
[bar/top]
enable-ipc = true
override-redirect = false
bottom = false
fixed-center = false
width = 100%
height = 27
radius = 0.0
background = ${colors.bg}
foreground = ${colors.fg}
line-size = 2
border-size = 0
padding-left = 2
padding-right = 12
module-margin-left = 1
module-margin-right = 1
font-0 = Hack Nerd Font:style=Medium,Regular:pixelsize=10;1
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = Weather Icons:size=10;1
modules-left = i3 bspwm xwindow
modules-center =
modules-right = pulseaudio wired-network wireless-network wireguard nordvpn redshift lockscreen dunst packages unread_news unread_mail temperature battery date
wm-restack = i3
tray-position = right
tray-detached = true
tray-padding = 0
tray-background = ${colors.bg}
#+END_SRC
* Show Windows Title
#+BEGIN_SRC conf
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
#+END_SRC
* I3 - Information about workspaces and active one
#+BEGIN_SRC conf
[module/i3]
type = internal/i3
enable-scroll = false
wrapping-scroll = false
#+END_SRC
#+BEGIN_SRC conf
format =
index-sort = true
#+END_SRC
#+BEGIN_SRC conf
label-mode-foreground = ${colors.bg}
label-mode-background = ${colors.fg}
label-mode-padding = 1
# focused = Active workspace on focused monitor
label-focused = %icon% %index%
label-focused-foreground = ${colors.fg}
label-focused-background = ${colors.bg}
label-focused-underline = ${colors.aqua}
label-focused-padding = 1
# unfocused = Inactive workspace on any monitor
label-unfocused = %icon% %index%
label-unfocused-foreground = ${colors.fg}
label-unfocused-background = ${colors.bg}
label-unfocused-underline = ${colors.bg}
label-unfocused-padding = 1
# visible = Active workspace on unfocused monitor
label-visible = %icon% %index%
label-visible-background = ${colors.bg}
label-visible-underline = ${colors.aqua}
label-visible-padding = 1
# urgent = Workspace with urgency hint set
label-urgent = %icon% %index%
label-urgent-background = ${colors.red}
label-urgent-padding = 1
#+END_SRC
* BSPWM
#+begin_src conf
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
enable-scroll = false
; Use fuzzy (partial) matching on labels when assigning
; icons to workspaces
; Example: code;♚ will apply the icon to all workspaces
; containing 'code' in the label
fuzzy-match = false
ws-icon-0 = code;
ws-icon-1 = web;
ws-icon-2 = mail;
ws-icon-3 = misc;
ws-icon-4 = figs;ﬧ
ws-icon-default =
label-focused = %icon%
label-focused-foreground = ${colors.bg}
label-focused-background = ${colors.aqua}
label-focused-underline= ${colors.aqua}
label-focused-padding = 1
label-occupied = %icon%
label-occupied-underline = ${colors.fg}
label-occupied-padding = 1
label-urgent = %icon%
label-urgent-background = ${colors.red}
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg}
label-empty-padding = 1
#+end_src
* Music using MPD
#+BEGIN_SRC conf
[module/mpd]
type = internal/mpd
format-online = %{A1:$TERMINAL -e "ncmpcpp" &:}%{A}
format-online-spacing = 0
format-online-padding = 0
label-offline = mpd is offline
format-offline =
format-offline-foreground = #777
label-song = %artist% - %title%
label-song-maxlen = 30
label-song-ellipsis = true
icon-prev = 寧
icon-stop = 栗
icon-play = 契
icon-pause =
icon-next = 嶺
icon-random = 咽
icon-repeat = 凌
# Used to display the state of random/repeat/repeatone/single
# Only applies if is used
toggle-on-foreground = ${colors.fg}
toggle-off-foreground = ${colors.gray}
bar-progress-width = 15
bar-progress-indicator = |
bar-progress-fill = ─
bar-progress-empty = ─
#+END_SRC
* Backlight level
#+BEGIN_SRC conf
[module/xbacklight]
type = internal/xbacklight
format =
ramp-0 =
ramp-1 =
ramp-2 =
ramp-3 =
ramp-4 =
ramp-5 =
ramp-6 =
ramp-7 =
ramp-8 =
ramp-9 =
ramp-10 =
ramp-11 =
#+END_SRC
* CPU Usage
#+BEGIN_SRC conf
[module/cpu]
type = internal/cpu
interval = 2
format-prefix-foreground = ${colors.fg}
format-underline = ${colors.bg}
label = %{A1:$TERMINAL -e "htop" &:} %percentage:2%%%{A}
#+END_SRC
* TODO Test IPC
#+begin_src conf
[module/demo]
type = custom/ipc
hook-0 = echo foobar
hook-1 = date +%s
hook-2 = whoami
initial = 1
click-left = polybar-msg -p %pid% hook demo 1
click-right = polybar-msg -p %pid% hook demo 2
double-click-left = polybar-msg -p %pid% hook demo 3
#+end_src
* Date
#+BEGIN_SRC conf
[module/date]
type = internal/date
interval = 1
# Open google calendar on left right
date = %{A1:$TERMINAL -e "ikhal" &:} %d-%m%{A}
date-alt = "%{A1:$TERMINAL -e \"ikhal\" &:} %d-%m-%Y%{A}"
time = %H:%M
time-alt = %H:%M:%S
label = %date% %time%
#+END_SRC
* Sound Volume
#+BEGIN_SRC conf
[module/pulseaudio]
type = internal/pulseaudio
sink = alsa_output.pci-0000_00_1f.3.analog-stereo
# Open pavucontrol on left right
format-volume =%{A1:pavucontrol &:} %{A}
label-volume = %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = ﱝ muted
bar-volume-width = 10
bar-volume-foreground-0 = ${colors.green}
bar-volume-foreground-1 = ${colors.green}
bar-volume-foreground-2 = ${colors.blue}
bar-volume-foreground-3 = ${colors.blue}
bar-volume-foreground-4 = ${colors.red}
bar-volume-foreground-5 = ${colors.red}
bar-volume-foreground-6 = ${colors.red}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.fg}
#+END_SRC
* Battery
#+BEGIN_SRC conf
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 95
format-charging = %{A1:xfce4-power-manager-settings &:} %{A}
format-charging-underline = ${colors.blue}
format-discharging = %{A1:xfce4-power-manager-settings &:} %{A}
format-discharging-underline = ${colors.red}
label-full = %{A1:xfce4-power-manager-settings &:} %{A}
format-full-underline = ${colors.bg}
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
#+END_SRC
* Temperature
#+begin_src conf
[module/temperature]
type = internal/temperature
interval = 2
thermal-zone = 0
warn-temperature = 70
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
units = false
format = %{A1:$TERMINAL --class="Floating" -e "watch sensors" &:}