The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

i3status, hide module if down

asked May 8 '15

Jose Luis gravatar image

I would like to hide a module if is down (or if not a mount point for disks), for example, if wireless is down I have this:

1.8 GB  Use: 88.1% | W: down | E: 192.168.1.5 (1000 Mbit/s)

I can set format_down to empty string, but in that case, the output is not so nice:

1.8 GB  Use: 88.1% |  | E: 192.168.1.5 (1000 Mbit/s)

Ideally I would like to have this

1.8 GB  Use: 88.1% | E: 192.168.1.5 (1000 Mbit/s)

Is it possible?

2 answers

Sort by » oldest newest most voted
1

answered May 9 '15

Airblader gravatar image

Force the output to be json. It will use a newer protocol version in which empty blocks are ignored.

The output format can be set in the general section.

Comments

That's a good one!

i3convert gravatar imagei3convert (May 9 '15)edit
0

answered May 8 '15

i3convert gravatar image

The simplest solution is to create a wrapper (say, /home/your-name/bin/wrapper.sh) that replaces | | with |, i.e., removes the unnecessary field:

#!/bin/bash
i3status | sed 's/|  |/|/g'

Now in the config file use wrapper.sh instead of i3status.

Question Tools

1 follower

Stats

Asked: May 8 '15

Seen: 180 times

Last updated: May 09