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 2015-05-08 17:52:59 +0000

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?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-05-09 00:15:52 +0000

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.

edit flag offensive delete link more

Comments

That's a good one!

i3convert gravatar imagei3convert ( 2015-05-09 15:33:40 +0000 )edit
0

answered 2015-05-08 19:04:13 +0000

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-08 17:52:59 +0000

Seen: 180 times

Last updated: May 09