From 7cec58e21560fff01534c8b39895e9c23c9727da Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 19 Mar 2023 21:14:59 +0000 Subject: [PATCH] home: wm: i3bar: update to v0.30.X This should be equivalent to the previous version's configuration, since v0.30.0 introduced a lot of breaking changes. --- home/wm/i3bar/default.nix | 47 ++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/home/wm/i3bar/default.nix b/home/wm/i3bar/default.nix index e21f171..d4fa107 100644 --- a/home/wm/i3bar/default.nix +++ b/home/wm/i3bar/default.nix @@ -13,8 +13,6 @@ in programs.i3status-rust = { enable = true; - package = pkgs.i3status-rust_0_22; - bars = { top = { icons = "awesome5"; @@ -22,28 +20,40 @@ in blocks = builtins.filter (attr: attr != { }) [ { block = "music"; - buttons = [ "prev" "play" "next" ]; - max_width = 50; - dynamic_width = true; - hide_when_empty = true; + # This format seems to remove the block when not playing, somehow + format = "{ $icon $combo.str(max_w:50,rot_interval:0.5) $prev $play $next |}"; + click = [ + { + button = "play"; + action = "music_play"; + } + { + button = "prev"; + action = "music_prev"; + } + { + button = "next"; + action = "music_next"; + } + ]; } (lib.optionalAttrs config.my.home.bluetooth.enable { block = "bluetooth"; mac = "4C:87:5D:06:40:D9"; - hide_disconnected = true; - format = "Boson {percentage}"; + format = " $icon Boson{ $percentage|} "; + disconnected_format = ""; }) (lib.optionalAttrs config.my.home.bluetooth.enable { block = "bluetooth"; mac = "94:DB:56:00:EE:93"; - hide_disconnected = true; - format = "Protons {percentage}"; + format = " $icon Protons{ $percentage|} "; + disconnected_format = ""; }) (lib.optionalAttrs config.my.home.bluetooth.enable { block = "bluetooth"; mac = "F7:78:BA:76:52:F7"; - hide_disconnected = true; - format = "MX Ergo {percentage}"; + format = " $icon MX Ergo{ $percentage|} "; + disconnected_format = ""; }) { block = "cpu"; @@ -53,7 +63,7 @@ in } { block = "net"; - format = "{ssid} {ip} {signal_strength}"; + format = " $icon $ssid $ip $signal_strength "; } { block = "backlight"; @@ -61,17 +71,17 @@ in } { block = "battery"; - format = "{percentage} ({time})"; - full_format = "{percentage}"; + format = " $percentage ($time) "; + full_format = " $icon $percentage "; } { block = "temperature"; - collapsed = false; + format_alt = " $icon "; } { block = "sound"; device_kind = "source"; # Microphone status - format = ""; # Only show icon + format = " $icon "; } { block = "sound"; @@ -79,7 +89,8 @@ in } { block = "time"; - format = "%F %T"; + format = " $icon $timestamp.datetime(f:'%F %T') "; + interval = 5; } ]; };