Skip to content

Commit

Permalink
really basic polybar setup
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Sep 22, 2021
1 parent 5b0d081 commit 2792705
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
17 changes: 11 additions & 6 deletions nixos/i3/default.nix
Expand Up @@ -181,12 +181,17 @@
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command ${pkgs.i3status}/bin/i3status
position top
}
exec_always --no-startup-id ${
pkgs.writeShellScriptBin "launch-polybar.sh" ''
# note: all polybar configs have to have IPC enabled in order for
# this to work!
${pkgs.polybarFull}/bin/polybar-msg cmd quit
${pkgs.polybarFull}/bin/polybar --config=${
./polybar.ini
} top 2>&1 | tee -a /tmp/polybar-top.log & disown
''
}/bin/launch-polybar.sh
# Automatically send things to the right workspaces
assign [class="browser"] 2
Expand Down
47 changes: 47 additions & 0 deletions nixos/i3/polybar.ini
@@ -0,0 +1,47 @@
[bar/top]
enable-ipc = true

modules-left = i3
modules-right = cpu battery backlight date

[module/backlight]
type = internal/backlight
card = intel_backlight

format = <ramp>
; TODO: need a font that supports emoji
ramp-0 = πŸŒ•
ramp-1 = πŸŒ”
ramp-2 = πŸŒ“
ramp-3 = πŸŒ’
ramp-4 = πŸŒ‘

[module/battery]
type = internal/battery
full-at = 89
; see formatting options at https://github.com/polybar/polybar/wiki/Module:-battery

[module/cpu]
type = internal/cpu

format = <label> <ramp-coreload>
label = CPU %percentage%%

; Spacing between individual per-core ramps
ramp-coreload-spacing = 1
ramp-coreload-0 = ▁
ramp-coreload-1 = β–‚
ramp-coreload-2 = β–ƒ
ramp-coreload-3 = β–„
ramp-coreload-4 = β–…
ramp-coreload-5 = β–†
ramp-coreload-6 = β–‡
ramp-coreload-7 = β–ˆ
[module/date]
type = internal/date
date = %A, %B %d, %Y%
time = %I:%M %p%
label = %date% %time%

[module/i3]
type = internal/i3

0 comments on commit 2792705

Please sign in to comment.