ironbar icon indicating copy to clipboard operation
ironbar copied to clipboard

[Tray] Some icons not appearing on startup

Open ToxicMushroom opened this issue 1 year ago • 8 comments

I didn't find much when searching the wiki and repo for info on how to launch ironbar other than https://github.com/JakeStanger/ironbar/issues/11 Currently I am launching it via swaybar_command but I have multiple programs that autostart and rarely get picked up by the tray (seafile-applet, keepassxc).

If I kill said programs and relaunch them they do consistently appear, indicating some sort of race condition between the bar loading and the programs wanting to appear in the tray (I've no idea on how the appindicator protocol works)

So my question is if I'm not launching it correctly or if this is a bug. And if we solved this we can maybe add documentation to the wiki on starting ironbar.

Fwiw I didn't have these issues with swaybar

System information:

  • Distro: Arch Linux
  • Compositor: Sway 1.9
  • Ironbar version: 0.16.0-pre

Configuration

Sway config
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.

### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term alacritty
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu fuzzel
set $explorer nemo

exec "systemctl --user import-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /home/merlijn/Seafile/private/images/desktop-wallpapers/hollow-knight-1.jpg fill 
output DP-2 {
    mode 1920x1080@144Hz
    pos 1920 0
}
output HDMI-A-1 {
    mode 1920x1080@60Hz
    pos 0 0
}

# Autostart apps

    # Night mode
    exec gammastep

    # Notification server
    exec swaync

    # Clipboard history manager
    exec env copyq

    exec seafile-applet

    # Password manager
    exec keepassxc

    # Autostart noisetorch
    exec /home/merlijn/.bin/noisetorch.sh 
#
#   output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs

### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
#          timeout 300 'swaylock -f -c 000000' \
#          timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
#          before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.

### Input configuration
# Enable alt compose mode
input * xkb_options compose:ralt
#
# Example configuration:
#
#   input "2:14:SynPS/2_Synaptics_TouchPad" {
#       dwt enabled
#       tap enabled
#       natural_scroll enabled
#       middle_emulation enabled
#   }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.

input 9580:109:GAOMON_Gaomon_Tablet_Pen {
    map_to_output DP-2
#    map_from_region 0.0x0.0 0.22x0.22
#    left_handed enabled
}

input type:pointer {
    accel_profile flat
    pointer_accel .1
}

### Key bindings
#
# Basics:
#
    # Start a terminal
    bindsym $mod+Return exec $term

    # Kill focused window
    bindsym $mod+Shift+q kill

    bindsym $mod+Shift+a replay-sorcery save

    # Start your launcher
    bindsym $mod+s exec $menu --no-exit-on-keyboard-focus-loss

    # Start your file explorer
    bindsym $mod+e exec $explorer

    bindsym $mod+m bar mode toggle
    # Drag floating windows by holding down $mod and left mouse button.
    # Resize them with right mouse button + $mod.
    # Despite the name, also works for non-floating windows.
    # Change normal to inverse to use left mouse button for resizing and right
    # mouse button for dragging.
    floating_modifier $mod normal

    # Reload the configuration file
    bindsym $mod+Shift+c reload
    bindsym $mod+Shift+r reload

    # Exit sway (logs you out of your Wayland session)
    bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'

    # Screenshots
    bindsym $mod+Shift+s exec ~/.bin/screenshot.sh

    # clipboard history menu
    bindsym $mod+apostrophe exec --no-startup-id copyq toggle

    # emoji menu
    bindsym $mod+semicolon exec --no-startup-id jome | tr -d '\n' | wl-copy

    # polkit
    exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# 
# Programs:
#
    bindsym $mod+Shift+d exec --no-startup-id vesktop
    bindsym $mod+Shift+f exec --no-startup-id firefox
    bindsym $mod+Shift+x exec --no-startup-id gtk-launch XIVLauncher.desktop
    bindsym $mod+Shift+m exec --no-startup-id prismlauncher


#
# Sound stuff:
#

    bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
    bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
    bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
    bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

    # Special media keys
    bindsym XF86AudioNext exec --no-startup-id playerctl next
    bindsym XF86AudioPrev exec --no-startup-id playerctl previous
    bindsym XF86AudioPause exec --no-startup-id playerctl play-pause
    bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause


#
# Moving around:
#
    # Move your focus around
    bindsym $mod+$left focus left
    bindsym $mod+$down focus down
    bindsym $mod+$up focus up
    bindsym $mod+$right focus right
    # Or use $mod+[up|down|left|right]
    bindsym $mod+Left focus left
    bindsym $mod+Down focus down
    bindsym $mod+Up focus up
    bindsym $mod+Right focus right

    # Move the focused window with the same, but add Shift
    bindsym $mod+Shift+$left move left
    bindsym $mod+Shift+$down move down
    bindsym $mod+Shift+$up move up
    bindsym $mod+Shift+$right move right
    # Ditto, with arrow keys
    bindsym $mod+Shift+Left move left
    bindsym $mod+Shift+Down move down
    bindsym $mod+Shift+Up move up
    bindsym $mod+Shift+Right move right
#
# Workspaces:
#
    # Switch to workspace
    bindsym $mod+1 workspace number 1
    bindsym $mod+2 workspace number 2
    bindsym $mod+3 workspace number 3
    bindsym $mod+4 workspace number 4
    bindsym $mod+5 workspace number 5
    bindsym $mod+6 workspace number 6
    bindsym $mod+7 workspace number 7
    bindsym $mod+8 workspace number 8
    bindsym $mod+9 workspace number 9
    bindsym $mod+0 workspace number 10
    # Move focused container to workspace
    bindsym $mod+Shift+1 move container to workspace number 1
    bindsym $mod+Shift+2 move container to workspace number 2
    bindsym $mod+Shift+3 move container to workspace number 3
    bindsym $mod+Shift+4 move container to workspace number 4
    bindsym $mod+Shift+5 move container to workspace number 5
    bindsym $mod+Shift+6 move container to workspace number 6
    bindsym $mod+Shift+7 move container to workspace number 7
    bindsym $mod+Shift+8 move container to workspace number 8
    bindsym $mod+Shift+9 move container to workspace number 9
    bindsym $mod+Shift+0 move container to workspace number 10
    # Note: workspaces can have any name you want, not just numbers.
    # We just use 1-10 as the default.
#
# Layout stuff:
#
    # You can "split" the current object of your focus with
    # $mod+b or $mod+v, for horizontal and vertical splits
    # respectively.
    bindsym $mod+b splith
    bindsym $mod+v splitv

    # Switch the current container between different layout styles
    bindsym $mod+d layout default
    # bindsym $mod+w layout tabbed
    # bindsym $mod+e layout toggle split

    # Make the current focus fullscreen
    bindsym $mod+f fullscreen

    # Toggle the current focus between tiling and floating mode
    bindsym $mod+Shift+space floating toggle

    # Swap focus between the tiling area and the floating area
    bindsym $mod+space focus mode_toggle

    # Move focus to the parent container
    bindsym $mod+a focus parent
#
# Scratchpad:
#
    # Sway has a "scratchpad", which is a bag of holding for windows.
    # You can send windows there and get them back later.

    # Move the currently focused window to the scratchpad
    bindsym $mod+Shift+minus move scratchpad

    # Show the next scratchpad window or hide the focused scratchpad window.
    # If there are multiple scratchpad windows, this command cycles through them.
    bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
    # left will shrink the containers width
    # right will grow the containers width
    # up will shrink the containers height
    # down will grow the containers height
    bindsym $left resize shrink width 10px
    bindsym $down resize grow height 10px
    bindsym $up resize shrink height 10px
    bindsym $right resize grow width 10px

    # Ditto, with arrow keys
    bindsym Left resize shrink width 10px
    bindsym Down resize grow height 10px
    bindsym Up resize shrink height 10px
    bindsym Right resize grow width 10px

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"

#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
    mode hide
    hidden_state hide
    position top
    font pango:Noto Sans, Font Awesome 6 Free 10

    # Use different bar than swaybar
    swaybar_command ironbar
    # When the status_command prints a new line to stdout, swaybar updates.
    # The default just shows the current date and time.
    # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done

    status_command i3status-rs

    colors {
        separator #666666
        background #222222
        statusline #ffffff
        background #323232
        inactive_workspace #323232ff #323232ff #cccccc
        urgent_workspace #2f343a #900000 #ffffff
    }
}


# Disable windows borders
default_border pixel 1

# Disable focus windows on mouse hover
focus_follows_mouse yes
mouse_warping none

# Focus new windows when jetbrains programs create them
# for_window [class="jetbrains-idea"] focus

for_window [app_id="mpv"] floating enable
for_window [app_id="com.github.hluk.copyq"] floating enable
for_window [app_id="jome"] floating enable
for_window [app_id="calculator"] floating enable
for_window [app_id="org.keepassxc.KeePassXC"] floating enable
for_window [title="Firefox - Choose User Profile"] floating enable
for_window [app_id="blueman-manager"] floating enable
include /etc/sway/config.d/*
Config
anchor_to_edges = true
height = 42
position = "top"
icon_theme = "Papirus-Dark"

[[start]]
type = "workspaces"
all_monitors = false
on_scroll_up = "swaymsg workspace prev_on_output"
on_scroll_down = "swaymsg workspace next_on_output"


[[end]]
type = "script"
cmd = "/home/merlijn/.bin/iron-bluetooth.sh"
mode = "poll"
interval = 5000
on_click_left = "blueman-manager"

[[end]]
type = "music"
player_type = "mpd"
truncate = "end"


[[end]]
type = "sys_info"
format = [
    "  {cpu_percent}% | {temp_c:k10temp-Tccd1}°C",
    "  {memory_used} / {memory_total} GB ({memory_percent}%)",
    "󰋊 {disk_used:/} / {disk_total:/} GB ({disk_percent:/}%)",
    "󰓢 {net_down:enp5s0} / {net_up:enp5s0} Mbps",
]

[end.interval]
memory = 30
cpu = 1
temps = 5
disks = 300
networks = 3

[[end]]
type = "volume"
format = "{icon} {percentage}%"
max_volume = 100

[end.icons]
volume_high = "󰕾"
volume_medium = "󰖀"
volume_low = "󰕿"
muted = "󰝟"

[end.truncate]
mode = "end"
length = 50


[[end]]
type = "clock"

[[end]]
type = "tray"
direction = "left_to_right"

[[end]]
type = "notifications"
show_count = true

[end.icons]
closed_none = "󰍥"
closed_some = "󱥂"
closed_dnd = "󱅯"
open_none = "󰍡"
open_some = "󱥁"
open_dnd = "󱅮"

ToxicMushroom avatar Jun 04 '24 10:06 ToxicMushroom

This definitely seems like a bug to me. So long as dbus is running (which I don't think you'll get far without anyway), starting the ironbar binary should be sufficient

JakeStanger avatar Jun 04 '24 11:06 JakeStanger

dbus seems to have started 5s before my greeter, so it should have been running yes

log
130 merlijn@arch ~ % systemctl status dbus
● dbus-broker.service - D-Bus System Message Bus
     Loaded: loaded (/usr/lib/systemd/system/dbus-broker.service; disabled; preset: disabled)
     Active: active (running) since Tue 2024-06-04 11:54:46 CEST; 1h 42min ago
TriggeredBy: ● dbus.socket
       Docs: man:dbus-broker-launch(1)
   Main PID: 638 (dbus-broker-lau)
      Tasks: 2 (limit: 38347)
     Memory: 5.6M (peak: 6.6M)
        CPU: 17.109s
     CGroup: /system.slice/dbus-broker.service
             ├─638 /usr/bin/dbus-broker-launch --scope system --audit
             └─639 dbus-broker --log 4 --controller 9 --machine-id 6ca9a93a9a214972b3505a8bf4b60a66 --max-bytes 536870912 --max-fds 4096 ->

Jun 04 11:54:46 arch systemd[1]: Starting D-Bus System Message Bus...
Jun 04 11:54:46 arch systemd[1]: Started D-Bus System Message Bus.
Jun 04 11:54:46 arch dbus-broker-launch[638]: Ready
Jun 04 11:54:47 arch dbus-broker-launch[638]: Activation request for 'org.freedesktop.home1' failed: The systemd unit 'dbus-org.freedeskto>
Jun 04 11:54:48 arch dbus-broker-launch[638]: Activation request for 'org.freedesktop.resolve1' failed: The systemd unit 'dbus-org.freedes>
merlijn@arch ~ % systemctl status session-3.scope
● session-3.scope - Session 3 of User merlijn
     Loaded: loaded (/run/systemd/transient/session-3.scope; transient)
  Transient: yes
     Active: active (running) since Tue 2024-06-04 11:54:51 CEST; 1h 43min ago
      Tasks: 1017
     Memory: 6.4G (peak: 19.2G)
        CPU: 47min 16.189s
     CGroup: /user.slice/user-1000.slice/session-3.scope
             ├─  828 /usr/bin/greetd --session-worker 12
             ├─ 2434 /bin/sh -c "[ -f /etc/profile ] && . /etc/profile; [ -f \$HOME/.profile ] && . \$HOME/.profile; exec /home/merlijn/sw>
             ├─ 2454 sway -d
             ├─ 2544 swaybg -o "*" -i /home/merlijn/Seafile/private/images/desktop-wallpapers/hollow-knight-1.jpg -m fill
             ├─ 2616 ironbar -b bar-0
             ├─ 2620 gammastep
             ├─ 2622 swaync
             ├─ 2624 copyq
             ├─ 2626 seafile-applet
             ├─ 2632 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
             ├─ 2754 /usr/bin/copyq --clipboard-access monitorClipboard
             ├─ 2799 /usr/bin/copyq eval -- "runMenuCommandFilters()"
             ├─ 2893 /usr/bin/seaf-daemon -c /home/merlijn/.ccnet -d /home/merlijn/Seafile/.seafile-data -w /home/merlijn/Seafile/seafile/
             ├─ 2981 /usr/lib/vesktop/vesktop
             ├─ 2984 "/usr/lib/vesktop/vesktop --type=zygote --no-zygote-sandbox"
             ├─ 2985 "/usr/lib/vesktop/vesktop --type=zygote"
             ├─ 2987 "/usr/lib/vesktop/vesktop --type=zygote"
             ├─ 3005 Xwayland :0 -rootless -core -terminate 10 -listenfd 31 -listenfd 33 -displayfd 117 -wm 114
             ├─ 3034 "/usr/lib/vesktop/vesktop --type=gpu-process --enable-crash-reporter=1013e3d3-f5a8-4c2a-b027-0b4368e6d09f,no_channel >
             ├─ 3042 "/usr/lib/vesktop/vesktop --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandb>
             ├─ 3141 "/usr/lib/vesktop/vesktop --type=renderer --enable-crash-reporter=1013e3d3-f5a8-4c2a-b027-0b4368e6d09f,no_channel --u>
             ├─ 3172 "/usr/lib/vesktop/vesktop --type=utility --utility-sub-type=audio.mojom.AudioService --lang=en-US --service-sandbox-t>
             ├─ 3497 /usr/lib/firefox/firefox
             ├─ 3681 /usr/lib/firefox/firefox -contentproc -parentBuildID 20240527213814 -prefsLen 32219 -prefMapSize 246612 -appDir /usr/>
             ├─ 3697 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 32322 -prefMapSize 246612 -jsInitLen 231800 >
             ├─ 3749 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 37795 -prefMapSize 246612 -jsInitLen 231800 >
             ├─ 3799 /usr/lib/firefox/firefox -contentproc -parentBuildID 20240527213814 -sandboxingKind 0 -prefsLen 37795 -prefMapSize 24>
             ├─ 3848 /usr/lib/firefox/firefox -contentproc -parentBuildID 20240527213814 -prefsLen 37795 -prefMapSize 246612 -appDir /usr/>
             ├─ 3870 /usr/bin/keepassxc-proxy /home/merlijn/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json keepassxc>
             ├─ 3886 /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 31551 -prefMapSize 246612 -jsInitLen 231800 >
             ├─23441 /usr/lib/firefox/firefox -contentproc -childID 23 -isForBrowser -prefsLen 31729 -prefMapSize 246612 -jsInitLen 231800>
             ├─24146 /usr/lib/firefox/firefox -contentproc -childID 24 -isForBrowser -prefsLen 31729 -prefMapSize 246612 -jsInitLen 231800>
             ├─32138 keepassxc
             ├─42340 /usr/lib/firefox/firefox -contentproc -childID 29 -isForBrowser -prefsLen 31729 -prefMapSize 246612 -jsInitLen 231800>
             ├─42355 /usr/lib/firefox/firefox -contentproc -childID 30 -isForBrowser -prefsLen 31729 -prefMapSize 246612 -jsInitLen 231800>
             ├─60837 /usr/lib/firefox/firefox -contentproc -childID 31 -isForBrowser -prefsLen 31729 -prefMapSize 246612 -jsInitLen 231800>
             ├─61033 /usr/lib/firefox/firefox -contentproc -parentBuildID 20240527213814 -prefsLen 38030 -prefMapSize 246612 -pluginNative>
             ├─61997 discord-screenaudio
merlijn@arch ~ %

ToxicMushroom avatar Jun 04 '24 11:06 ToxicMushroom

I've no idea on how the appindicator protocol works

I don't think the authors of it did, nor anybody implementing it to be honest.

I'll rename this issue to reflect the actual bug and look at it when I can. Are there certain programs that are particularly prone to not appearing in the tray? It helps to have these on hand to debug.

JakeStanger avatar Jun 13 '24 21:06 JakeStanger

Keepassxc is one, its a local password manager so it should be relatively easy to test with, thank you for looking into this :)

ToxicMushroom avatar Jun 13 '24 22:06 ToxicMushroom

I can add that the blueman-tray icon is not showing

zimbipw avatar Jun 14 '24 08:06 zimbipw

I also get this with flameshot especially The rest I noticed like the keepassxt one are actually loading if I autostart the bar on launch of my compositor and then launch the app for example. gbar mentions something similar in their home#the-tray-doesnt-show

crimsonduelist avatar Jun 15 '24 20:06 crimsonduelist

usbguard-qt seems to have the same issue and keypassxc is working fine for me

LeSnake04 avatar Jun 22 '24 11:06 LeSnake04

Mullvad can be added to the list.

JakeStanger avatar Aug 04 '24 15:08 JakeStanger

To add more context, it really feels like a race condition, it's pretty much random which icons if any dont appear when I keep restarting ironbar.

here's a dbus-monitor log where ironbar showed 1 (blueman) out of 4 tray icons. out.txt

interesting bits are around StatusNotifier strings I assume

ToxicMushroom avatar Oct 09 '24 01:10 ToxicMushroom