Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading an old configuration to later i3status-rust versions #2017

Open
Kabouik opened this issue Mar 6, 2024 · 6 comments
Open

Upgrading an old configuration to later i3status-rust versions #2017

Kabouik opened this issue Mar 6, 2024 · 6 comments

Comments

@Kabouik
Copy link

Kabouik commented Mar 6, 2024

Someone recently updated i3status-rust for Guix, which is great news because we were so far stuck with a 0.20ish version. However, old configurations are not compatible.

I could make a few easy changes after running i3status-rs in the terminal and checking the first errors, but now they are fixed and upon running i3status-rs, my device freezes immediately (I can't even use C-c immediately in the terminal to interrupt) with all my blocks just showing "Configuration error", and the terminal output not showing anything particularly useful (unless there are errors before it dumps my config in the output, but I can't scroll up due to the freeze; might need to try catching all that in a file). The freeze forces a hard reboot, which makes it really hard to troubleshoot and find what more to alter in the configuration.

Is there some kind of hidden dry-run option available? Alternatively, how could I proceed to launch i3status-rs without it freezing the system?

For reference, below is my configuration in case you would see something obvious that may cause the freeze:

[theme]
theme = "nord-dark"

[theme.overrides]
idle_bg = "#313544"
idle_fg = "#B1B1B1"
 
[icons]
icons = "awesome5"
[icons.overrides]
#bat = " | | "
#bat_full = " |X| "
#bat_charging = " - "
#bat_discharging = " + "
#backlight_empty = "◯"
#backlight_full = "●"
#backlight_1 = "○"
#backlight_2 = "◔"
#backlight_3 = "◔"
#backlight_4 = "◔"
#backlight_5 = "◔"
#backlight_6 = "◑"
#backlight_7 = "◑"
#backlight_8 = "◑"
#backlight_9 = "◑"
#backlight_10 = "◕"
#backlight_11 = "◕"
#backlight_12 = "◕"
#backlight_13 = "◕"
#time = ""

[[block]]
block = "focused_window"
max_width = 80
show_marks = "visible"

[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization}" # {frequency}
on_click = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 bpytop"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'C' ; printf $(sensors | grep Tctl | cut -c 16-24)", "printf 'CPU: ' ; printf $(sensors | grep Tctl | cut -c 16-24)"]
on_click = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'S' ; printf $(sensors | grep Composite | cut -c 16-24)", "printf 'SSD: ' ; printf $(sensors | grep Composite | cut -c 16-24)"]
on_click = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "load"
format = "{5m}, {1m}"
interval = 1
on_click = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 glances -1"

[[block]]
block = "memory"
display_type = "memory"
format_mem = "{mem_avail} free"
format_swap = "{swap_free} free"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95

[[block]]
block = "disk_space"
path = "/"
info_type = "free"
unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
format = "{icon} {available}"
on_click = "footclient -a floating fish -c 'NNN_OPENER=~/.config/nnn/plugins/nuke n'"

[[block]]
block = "custom"
command = "btrfs fi usage / 2>/dev/null | sed -n '7p' | cut -f 4"
interval = 64

[[block]]
block = "net"
device = "enp175s0"
format = "{speed_down;K*b} {graph_down:8;M*_b#50}"
format_alt = "{bitrate} {ip} {speed_down;K*b} {graph_down:8;M*_b#50}"
interval = 5
hide_inactive = true

[[block]]
block = "net"
format = "{speed_down;K*b} {graph_down:8;M*_b#50}"
format_alt = "{bitrate} {ip} {frequency} {signal_strength} {graph_down:8;M*_b#50}"
interval = 5
hide_inactive = true

[[block]]
block = "custom"
command = "echo \uf1eb" # assumes fontawesome icons
interval = "once"
on_click = "footclient -W 80x15 -a floating ~/.config/sway/scripts/nmcli-fzf"

# [[block]]
# block = "networkmanager"
# #on_click = "nmcli device wifi rescan && footclient -a floating -o term=xterm-256color nmtui"
# on_click = "footclient -W 90x10 -a floating ~/.local/bin/nmcli-fzf"
# interface_name_exclude = ['br\-[0-9a-f]{12}', 'docker\d+']
# interface_name_include = []
# ap_format = "{ssid^3} {freq} {strength}"
# device_format = "{ap}"

# [[block]]
# block = "bluetooth"
# mac = "e4:60:17:d1:eb:ff"
# format = " $icon "

[[block]]
block = "sound"
step_width = 3
max_vol = 150
on_click = "pactl set-sink-mute @DEFAULT_SINK@ toggle"

[[block]]
block = "backlight"
invert_icons = false
on_click = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 85x53 sh -c 'curl -s wttr.in/{Orléans}?format=v2n | head -n -2 && read -n1'"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'T' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W", "printf 'TDP: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'P' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 29-31)W", "printf 'PPT: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 28-31)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "time"
interval = 2
format = "%a %d, %R"
#on_click = "footclient -H -a floating -W 68x13 cal -w -v -n3"
#on_click = "notify-send -u low `sed 's/  //' <(curl 'https://wttr.in/{Orléans}?format=1' -s)`"
#on_click = "footclient -o 'font=Iosevka Medium Extended:size=9' -a floating -W 155x38 sh -c 'remind -cu+4 -b1 -@ -m -w160 ~/.config/remind/reminders && remind -cu+4 -b1 -@ -m -w160 ~/.config/remind/reminders $(date -d +"4 weeks" +"%Y-%m-%d") && read -n1'"
on_click = "footclient -o 'font=Iosevka Term Medium Extended:size=9' -a floating -W 155x40 sh -c '~/.local/bin/remint'"

[[block]]
block = "battery"
interval = 2
format = "{percentage} {power} {time} \uf011"
driver = "upower"
good = 101
info = 70
warning = 50
critical = 30
on_click = "loginctl `echo -e 'suspend\nhibernate\nhybrid-sleep\nsuspend-then-hibernate\nreboot\npoweroff' | dmenu`"
@Kabouik Kabouik changed the title Ùpgrading an old configuration to later i3status-rust versions Upgrading an old configuration to later i3status-rust versions Mar 6, 2024
@MaxVerevkin
Copy link
Collaborator

I cannot reproduce the freeze using your config. For updating the config, I would recommend commenting everything out and updating the config block by block. Most of the breaking changes are listed here.

@Kabouik
Copy link
Author

Kabouik commented Mar 10, 2024

Thank you for the help and for your time testing my config, I failed finding the breaking changes but I didn't look in the release notes. With that, I could at least alter my config to at least show the bar again. It still shows several configuration errors, but it was just a quick first pass, I'll now need to check blocks individually more carefully.

The problem is this did not fix the freezing behavior, which again makes it much harder to debug and fix (especially with every reboot being a tad long due to LUKS encryption).

In the meantime, I'm back to Sway's default bar, but don't quite like it and didn't really configure it so it's missing a lot of information.

[theme]
theme = "nord-dark"

[theme.overrides]
idle_bg = "#313544"
idle_fg = "#B1B1B1"
 
[icons]
icons = "awesome5"
[icons.overrides]
#bat = " | | "
#bat_full = " |X| "
#bat_charging = " - "
#bat_discharging = " + "
#backlight_empty = "◯"
#backlight_full = "●"
#backlight_1 = "○"
#backlight_2 = "◔"
#backlight_3 = "◔"
#backlight_4 = "◔"
#backlight_5 = "◔"
#backlight_6 = "◑"
#backlight_7 = "◑"
#backlight_8 = "◑"
#backlight_9 = "◑"
#backlight_10 = "◕"
#backlight_11 = "◕"
#backlight_12 = "◕"
#backlight_13 = "◕"
#time = ""

[[block]]
block = "focused_window"
format = "$title.str(max_w:80)"
show_marks = "visible"

[[block]]
block = "cpu"
interval = 1
format = "$barchart $utilization" # {frequency}
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 bpytop"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'C' ; printf $(sensors | grep Tctl | cut -c 16-24)", "printf 'CPU: ' ; printf $(sensors | grep Tctl | cut -c 16-24)"]
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'S' ; printf $(sensors | grep Composite | cut -c 16-24)", "printf 'SSD: ' ; printf $(sensors | grep Composite | cut -c 16-24)"]
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "load"
format = "$5m, $1m"
interval = 1
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 glances -1"

[[block]]
block = "memory"
display_type = "memory"
format = "$mem_avail free"
format_alt = "$swap_free free"
icons = true
clickable = true
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95

[[block]]
block = "disk_space"
path = "/"
info_type = "free"
unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
format = "$icon $available"
[[block.click]]
button = "left"
cmd = "footclient -a floating fish -c 'NNN_OPENER=~/.config/nnn/plugins/nuke n'"

[[block]]
block = "custom"
command = "btrfs fi usage / 2>/dev/null | sed -n '7p' | cut -f 4"
interval = 64

[[block]]
block = "net"
device = "enp175s0"
format = "$speed_down;K*b $graph_down:8;M*_b#50"
format_alt = "$bitrate $ip $speed_down;K*b $graph_down:8;M*_b#50"
interval = 5
missing_format = ""

[[block]]
block = "net"
format = "$speed_down;K*b $graph_down:8;M*_b#50"
format_alt = "$bitrate ip $frequency $signal_strength $graph_down:8;M*_b#50"
interval = 5
missing_format = ""

[[block]]
block = "custom"
command = "echo \uf1eb" # assumes fontawesome icons
interval = "once"
[[block.click]]
button = "left"
cmd = "footclient -W 80x15 -a floating ~/.config/sway/scripts/nmcli-fzf"

# [[block]]
# block = "networkmanager"
# #on_click = "nmcli device wifi rescan && footclient -a floating -o term=xterm-256color nmtui"
# on_click = "footclient -W 90x10 -a floating ~/.local/bin/nmcli-fzf"
# interface_name_exclude = ['br\-[0-9a-f]{12}', 'docker\d+']
# interface_name_include = []
# ap_format = "{ssid^3} {freq} {strength}"
# device_format = "{ap}"

# [[block]]
# block = "bluetooth"
# mac = "e4:60:17:d1:eb:ff"
# format = " $icon "

[[block]]
block = "sound"
step_width = 3
max_vol = 150
[[block.click]]
button = "left"
cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"

[[block]]
block = "backlight"
invert_icons = false
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 85x53 sh -c 'curl -s wttr.in/{Orléans}?format=v2n | head -n -2 && read -n1'"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'T' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W", "printf 'TDP: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'P' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 29-31)W", "printf 'PPT: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 28-31)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "time"
interval = 2
format = "%a %d, %R"
#on_click = "footclient -H -a floating -W 68x13 cal -w -v -n3"
#on_click = "notify-send -u low `sed 's/  //' <(curl 'https://wttr.in/{Orléans}?format=1' -s)`"
#on_click = "footclient -o 'font=Iosevka Medium Extended:size=9' -a floating -W 155x38 sh -c 'remind -cu+4 -b1 -@ -m -w160 ~/.config/remind/reminders && remind -cu+4 -b1 -@ -m -w160 ~/.config/remind/reminders $(date -d +"4 weeks" +"%Y-%m-%d") && read -n1'"
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Term Medium Extended:size=9' -a floating -W 155x40 sh -c '~/.local/bin/remint'"

[[block]]
block = "battery"
interval = 2
format = "$percentage $power $time \uf011"
driver = "upower"
device = "BAT0"
good = 101
info = 70
warning = 50
critical = 30
[[block.click]]
button = "left"
cmd = "loginctl `echo -e 'suspend\nhibernate\nhybrid-sleep\nsuspend-then-hibernate\nreboot\npoweroff' | dmenu`"

@Kabouik
Copy link
Author

Kabouik commented Apr 27, 2024

So I finally got back to trying to fix my configuration on that computer. All blocks look okay now with the config below, but the system still freezes 2 to 3 seconds after launching i3status-rs, with a rapid fan speed increase suggesting a CPU hog.

[theme]
theme = "nord-dark"

[theme.overrides]
idle_bg = "#313544"
idle_fg = "#B1B1B1"
 
[icons]
icons = "awesome4"
#[icons.overrides]
#bat = " | | "
#bat_full = " |X| "
#bat_charging = " - "
#bat_discharging = " + "
#backlight_empty = "◯"
#backlight_full = "●"
#backlight_1 = "○"
#backlight_2 = "◔"
#backlight_3 = "◔"
#backlight_4 = "◔"
#backlight_5 = "◔"
#backlight_6 = "◑"
#backlight_7 = "◑"
#backlight_8 = "◑"
#backlight_9 = "◑"
#backlight_10 = "◕"
#backlight_11 = "◕"
#backlight_12 = "◕"
#backlight_13 = "◕"
#time = ""

[[block]]
block = "focused_window"
[block.format]
full = " $title.str(max_w:100) |"
short = " $title.str(max_w:10) |"

[[block]]
block = "cpu"
interval = 1
format = " $barchart $utilization $frequency " 
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 bpytop"


[[block]]
block = "load"
format = " $5m.eng(w:4), $1m.eng(w:4) "
interval = 1
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 120x40 glances -1"

[[block]]
block = "custom"
interval = 2
cycle = [" printf 'C' ; printf $(sensors | grep Tctl | cut -c 16-24) ", "printf ' CPU: ' ; printf $(sensors | grep Tctl | cut -c 16-24) "]
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "custom"
interval = 2
cycle = [" printf 'S' ; printf $(sensors | grep Composite | cut -c 16-24) ", " printf 'SSD: ' ; printf $(sensors | grep Composite | cut -c 16-24) "]
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 65x30 watch sensors"

[[block]]
block = "memory"
format = " $icon $mem_avail free "
format_alt = " $icon_swap $swap_free free "
interval = 5
warning_mem = 80
warning_swap = 80
critical_mem = 95
critical_swap = 95

[[block]]
block = "disk_space"
path = "/"
info_type = "free"
interval = 20
warning = 20.0
alert = 10.0
format = " $icon $available "
[[block.click]]
button = "left"
cmd = "footclient -a floating fish -c 'NNN_OPENER=~/.config/nnn/plugins/nuke n'"

[[block]]
block = "custom"
command = "btrfs fi usage / 2>/dev/null | sed -n '7p' | cut -f 4"
interval = 64
[[block.click]]
button = "left"
cmd = "footclient -a floating fish -c 'NNN_OPENER=~/.config/nnn/plugins/nuke n'"

[[block]]
block = "net"
device = "wlp1s0"
format = " $speed_down.eng(prefix:K) $graph_down "
format_alt = " $icon $bitrate $ip $frequency $signal_strength $graph_down "
interval = 2
inactive_format = ""
missing_format = ""

[[block]]
block = "custom"
command = " echo \uf1eb " # assumes fontawesome icons
interval = "once"
[[block.click]]
button = "left"
cmd = "footclient -W 80x15 -a floating ~/.config/sway/scripts/nmcli-fzf"

# [[block]]
# block = "networkmanager"
# #on_click = "nmcli device wifi rescan && footclient -a floating -o term=xterm-256color nmtui"
# on_click = "footclient -W 90x10 -a floating ~/.local/bin/nmcli-fzf"
# interface_name_exclude = ['br\-[0-9a-f]{12}', 'docker\d+']
# interface_name_include = []
# ap_format = "{ssid^3} {freq} {strength}"
# device_format = "{ap}"

# [[block]]
# block = "bluetooth"
# mac = "e4:60:17:d1:eb:ff"
# format = " $icon "

[[block]]
block = "sound"
step_width = 3
max_vol = 150
[[block.click]]
button = "left"
cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"

[[block]]
block = "backlight"
invert_icons = false
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Medium Extended:size=8' -a floating -W 85x53 sh -c 'curl -s wttr.in/{Orléans}?format=v2n | head -n -2 && read -n1'"
[[block.click]]
button = "right"
cmd = "notify-send -u low -t 3000 $(curl 'https://wttr.in/{Orléans}?format=1' -s)"
#cmd = "notify-send -u low `sed 's/  //' <(curl 'https://wttr.in/{Orléans}?format=1' -s)`"

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'T' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W", "printf 'TDP: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'stapm-limit' | cut -c 28-29)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "custom"
interval = 2
cycle = ["printf 'P' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 29-31)W", "printf 'PPT: ' ; printf $(sudo $(realpath $(which ryzenadj)) -i | grep 'PPT VALUE SLOW' | cut -c 28-31)W"]
# Requires making `ryzenadj -i` work without a password, see how to edit /etc/sudoers for that: https://ostechnix.com/run-particular-commands-without-sudo-password-linux/

[[block]]
block = "time"
interval = 2
format = " $timestamp.datetime(f:'%a %d, %R') "
[[block.click]]
button = "left"
cmd = "footclient -o 'font=Iosevka Term Medium Extended:size=9' -a floating -W 155x40 fish -c '~/.local/bin/scripts/remint'"
[[block.click]]
button = "right"
cmd = "footclient -o 'font=Iosevka Term Medium Extended:size=9' -a floating -W 220x60 fish -c '~/.local/bin/scripts/remint'"

[[block]]
block = "battery"
interval = 2
format = " $percentage $power $time \uf011 "
driver = "upower"
device = "BAT0"
good = 101
info = 70
warning = 50
critical = 30
[[block.click]]
button = "left"
cmd = "loginctl `echo -e 'suspend\nhibernate\nhybrid-sleep\nsuspend-then-hibernate\nreboot\npoweroff' | dmenu`"

@MaxVerevkin
Copy link
Collaborator

Can you bisect which block causes this? Or at least bring the configuration to a minimum example: remove all comments, click handlers, theming, and remove blocks one by one while the issue is still there.

PS: You can write

```toml
<your toml here>
```

to make the config nice to read. This also adds a "copy" button, which is pretty useful.

@ammgws
Copy link
Collaborator

ammgws commented Apr 27, 2024

Maybe first try removing all custom blocks, and see if the issue persists with the 'native' i3status-rs blocks.

@Kabouik
Copy link
Author

Kabouik commented May 2, 2024

Thanks for the replies. Sorry I'm not replying fast, I'm currently away without that computer.

Yeah I did post code as toml before but this time just wanted to collapse it to avoid cluttering the issue, but now I realized it messed the syntax up so I edited.

You were both right, the issue was with the custom blocks, in particular the ryzenadj ones. Turns out ryzenadj
is supposed to be whitelisted in my /etc/sudoers file but it doesn't work anymore, so running it without sudo no longer works. So on the one hand, the issue is with the command I'm using (I'll need to fix my sudoers whitelist), and on the other hand, I don't think i3status-rs should fail in a way that freezes the whole system when a block uses a custom command that fails without sudo, so this might be a valid bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants