From 27927052c442cebc828f94d3e231a01cfb886fc2 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 21 Sep 2021 23:08:45 -0500 Subject: [PATCH] really basic polybar setup --- nixos/i3/default.nix | 17 ++++++++++------ nixos/i3/polybar.ini | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 nixos/i3/polybar.ini diff --git a/nixos/i3/default.nix b/nixos/i3/default.nix index 09cbe8e..96372b2 100644 --- a/nixos/i3/default.nix +++ b/nixos/i3/default.nix @@ -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 diff --git a/nixos/i3/polybar.ini b/nixos/i3/polybar.ini new file mode 100644 index 0000000..e112a9b --- /dev/null +++ b/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 = +; 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 =