How can I set the position of applets in i3bar?

I've been playing around with i3bar some by editing .config/i3status/config.
Right now, it's the following.

# i3status configuration file.
# see "man i3status" for documentation.

# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
        colors = true
        interval = 5
        color_good = "#2AA198"
        color_bad = "#586E75"
        color_degraded = "#DC322F"
}

order += "cpu_usage"
# order += "load"
order += "disk /"
# order += "disk /home"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
# order += "load"
order += "tztime local"
# order += "ipv6"

cpu_usage {
        format = " cpu  %usage "
}

load {
        format = " load %1min "
        # max_threshold = 0.3
}

disk "/" {
        # format = " hdd %avail "
        format = " ⛁ %avail "
}

ethernet _first_ {
# if you use %speed, i3status requires root privileges
        format_up = " lan: %ip %speed "
        format_down = " no lan "
}

battery all {
        # format = "%status %percentage %remaining %emptytime"
        format = " %status %percentage"
        format_down = "No battery"
        last_full_capacity = true
        integer_battery_capacity = true
        # status_chr = ""
        status_chr = "⚡"
        # status_bat = "bat"
        # status_bat = "☉"
        status_bat = ""
        # status_unk = "?"
        status_unk = ""
        # status_full = ""
        status_full = "☻"
        low_threshold = 15
        threshold_type = time
}

tztime local {
        # format = "%Y-%m-%d %H:%M:%S"
        format = " %b %d. %-I:%M %P "
}

This doesn't include my volume manager, wifi manager, or pamac-manager, all of which are in the i3bar. Where are those configured? I'd like to rearrange their order / show the name of the network I'm on.

Thanks for any help.

The tray icons are handled by tray_output, but as far as I know i3 does not support ordering of the tray icons.

A workaround is to start the applications displayed in the tray in a certain order. This can be done by delaying their startup using the sleep command.

If for example you'd like the tray icons to appear in this order

  1. volumeicon
  2. nm-applet
  3. pamac-tray

you have to find the corresponding entries in your i3 config file and change them to

exec --no-startup-id sleep 1s; volumeicon
exec --no-startup-id sleep 2s; nm-applet
exec --no-startup-id sleep 3s; pamac-tray

This will add a delay of 1, 2 and 3 seconds to the startup of volumeicon, nm-applet and pamac-tray respectively (you can change the number of seconds according to your liking).

Bare in mind that the order of the tray icons might change if you restart i3 in place using the $mod+Shift+r keyboard shortcut.


Other options include using a different bar (like Polybar maybe) or another system tray application. I haven't tried these options so far to give any feedback about their functionality.

3 Likes

That works perfectly, thank you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by