[GH-ISSUE #1446] keyboard layout: "error" when new display connected/resume from sleep #7465

Open
opened 2026-05-23 02:54:44 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @jficz on GitHub (Apr 8, 2026).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1446

Describe the bug
Text "error" is displayed instead of the flag icon/layout indicator after one or more of these steps happening (can't reproduce with 100 % consistency) on my laptop until the layout is switched - then the flag appears as expected.

To reproduce
Steps to reproduce the behavior:

  1. connect external display X
  2. lock (swaylock)
  3. put to sleep while X is connected (or disconnected ?)
  4. unplug display X
  5. resume
  6. plug display Y
  7. unlock swaylock
  8. observe error

Expected behavior
Flag/indicator should be displayed with current layout

System information:

  • Distro: Ubuntu 25.11 / home-manager (nixpkgs-unstable)
  • Compositor: Hyprland
  • Ironbar version: ironbar 0.19.0-pre (built from upstream flake, state somewhere between 1. and 7. Apr.)

Configuration

Config
{
  "center": [
    {
      "truncate": "end",
      "type": "focused"
    }
  ],
  "end": [
    {
      "format": "{icon}",
      "icons": {
        "muted": "󰝟",
        "volume_high": "󰕾",
        "volume_low": "󰕿",
        "volume_medium": "󰖀"
      },
      "max_volume": 100,
      "type": "volume"
    },
    {
      "format": {
        "connected": "",
        "connected_battery": "",
        "disabled": "󰂲",
        "enabled": ""
      },
      "popup": {
        "scrollable": false
      },
      "type": "bluetooth"
    },
    {
      "type": "tray"
    },
    {
      "icons": {
        "layout_map": {
          "Czech*": "🇨🇿",
          "English*": "🇺🇸"
        }
      },
      "type": "keyboard"
    },
    {
      "show_label": false,
      "type": "battery"
    },
    {
      "format": "W%V %a %e %b <span font=\"7-segment\" size=\"x-large\">%R</span>",
      "type": "clock"
    },
    {
      "format_off": "󰒲",
      "type": "inhibit"
    },
    {
      "icons": {
        "closed_dnd": "󱅯",
        "closed_none": "󰍥",
        "closed_some": "󱥂",
        "open_dnd": "󱅮",
        "open_none": "󰍡",
        "open_some": "󱥁"
      },
      "show_count": true,
      "type": "notifications"
    }
  ],
  "height": 36,
  "popup_autohide": true,
  "position": "top",
  "start": [
    {
      "all_monitors": true,
      "type": "workspaces"
    }
  ],
  "style": "* { border: none; }\n"
}

Styles
.item, .btn, button {
  border: 0px;
  padding: 0 0.3em;
  margin: 0;
}
.workspaces button {
  /* padding: 0.5em; */
  border: 3px solid rgba(0,0,0,0);
  background-color: rgba(0,0,0,0);
  background-image: none;
}

.label {
  background-color: rgba(0,0,0,0);
}

.workspaces button.visible {
  background-color: #441133;
}

.workspaces button.focused {
  border-color: #663355;
}

.clock label {
  vertical-align: middle;
}

Additional context
The error is shown on all visible bars on all connected displays.

Cannot exactly determine the steps to reproduce. The steps described are the full sequence I think relates to this but I'm not sure if all the steps are needed to reproduce this. There might be some delays between sleep and resume involved, too, or the sleep might not even be relevant. Can't tell, will try to experiment more though it's not so easy as displays X and Y are in different locations and I don't have another display available at either location.

Logs captured after the errror is observed

Apr 08 11:35:44 myhost ironbar[96280]: 2026-04-08T09:35:44.647806Z  INFO ironbar::clients::outputs: 81: Monitor DP-2 connected
Apr 08 11:35:44 myhost ironbar[96280]: 2026-04-08T09:35:44.648157Z  INFO ironbar::bar: 125: Initializing bar 'bar-111' on 'DP-2'
...
Apr 08 11:35:49 myhost ironbar[96280]: 2026-04-08T09:35:49.379779Z  WARN system_tray::client: 469: org.freedesktop.DBus.Error.InvalidArgs: No such property “IconPixmap”
...
Apr 08 11:35:54 myhost ironbar[96280]: 2026-04-08T09:35:54.647718Z  WARN system_tray::client: 459: Error getting IconName: ZBusFdo(Failed("error occurred in Get"))
Apr 08 11:35:54 myhost ironbar[96280]: 2026-04-08T09:35:54.648844Z  WARN system_tray::client: 459: Error getting IconName: ZBusFdo(Failed("error occurred in Get"))
Apr 08 11:53:02 myhost ironbar[96280]: 2026-04-08T09:53:02.993481Z  INFO colpetto: 133: event15: opening input device '/dev/input/event15' failed (Permission denied).
Apr 08 11:53:02 myhost ironbar[96280]: 2026-04-08T09:53:02.993499Z  INFO colpetto: 133: event15 - failed to create input device '/dev/input/event15'
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.033567Z  INFO colpetto: 133: event17: opening input device '/dev/input/event17' failed (Permission denied).
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.033588Z  INFO colpetto: 133: event17 - failed to create input device '/dev/input/event17'
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.056931Z  INFO colpetto: 133: event18: opening input device '/dev/input/event18' failed (Permission denied).
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.056949Z  INFO colpetto: 133: event18 - failed to create input device '/dev/input/event18'
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.057739Z  INFO colpetto: 133: event16: opening input device '/dev/input/event16' failed (Permission denied).
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.057745Z  INFO colpetto: 133: event16 - failed to create input device '/dev/input/event16'
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.090207Z  INFO colpetto: 133: event19: opening input device '/dev/input/event19' failed (Permission denied).
Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.090218Z  INFO colpetto: 133: event19 - failed to create input device '/dev/input/event19'
Apr 08 11:53:25 myhost ironbar[96280]: 2026-04-08T09:53:25.029308Z  INFO colpetto: 133: event20: opening input device '/dev/input/event20' failed (Permission denied).
Apr 08 11:53:25 myhost ironbar[96280]: 2026-04-08T09:53:25.029327Z  INFO colpetto: 133: event20 - failed to create input device '/dev/input/event20'
...
Apr 08 11:53:29 myhost ironbar[96280]: 2026-04-08T09:53:29.362592Z  WARN system_tray::client: 469: org.freedesktop.DBus.Error.InvalidArgs: No such property “IconPixmap”
...
Apr 08 11:53:41 myhost ironbar[96280]: 2026-04-08T09:53:41.396383Z  INFO colpetto: 133: event22: opening input device '/dev/input/event22' failed (Permission denied).
Apr 08 11:53:41 myhost ironbar[96280]: 2026-04-08T09:53:41.396406Z  INFO colpetto: 133: event22 - failed to create input device '/dev/input/event22'

The IconPixmap error repeats ever ~3s and is most likely not relevant (maybe related to home-manager/nix setup). Possibly releated to https://github.com/JakeStanger/ironbar/issues/1335.

There is no new entry in the logs after layout switch that fixes the issue.

Screenshots

error shown:
Image

after switching layout:
Image

Originally created by @jficz on GitHub (Apr 8, 2026). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1446 **Describe the bug** Text "error" is displayed instead of the flag icon/layout indicator after one or more of these steps happening (can't reproduce with 100 % consistency) on my laptop until the layout is switched - then the flag appears as expected. **To reproduce** Steps to reproduce the behavior: 1. connect external display X 2. lock (swaylock) 3. put to sleep while X is connected (or disconnected ?) 4. unplug display X 5. resume 6. plug display Y 7. unlock swaylock 8. observe error **Expected behavior** Flag/indicator should be displayed with current layout **System information:** - Distro: Ubuntu 25.11 / home-manager (nixpkgs-unstable) - Compositor: Hyprland - Ironbar version: ironbar 0.19.0-pre (built from upstream flake, state somewhere between 1. and 7. Apr.) **Configuration** <details><summary>Config</summary> ``` { "center": [ { "truncate": "end", "type": "focused" } ], "end": [ { "format": "{icon}", "icons": { "muted": "󰝟", "volume_high": "󰕾", "volume_low": "󰕿", "volume_medium": "󰖀" }, "max_volume": 100, "type": "volume" }, { "format": { "connected": "", "connected_battery": "", "disabled": "󰂲", "enabled": "" }, "popup": { "scrollable": false }, "type": "bluetooth" }, { "type": "tray" }, { "icons": { "layout_map": { "Czech*": "🇨🇿", "English*": "🇺🇸" } }, "type": "keyboard" }, { "show_label": false, "type": "battery" }, { "format": "W%V %a %e %b <span font=\"7-segment\" size=\"x-large\">%R</span>", "type": "clock" }, { "format_off": "󰒲", "type": "inhibit" }, { "icons": { "closed_dnd": "󱅯", "closed_none": "󰍥", "closed_some": "󱥂", "open_dnd": "󱅮", "open_none": "󰍡", "open_some": "󱥁" }, "show_count": true, "type": "notifications" } ], "height": 36, "popup_autohide": true, "position": "top", "start": [ { "all_monitors": true, "type": "workspaces" } ], "style": "* { border: none; }\n" } ``` </details> <details><summary>Styles</summary> ```css .item, .btn, button { border: 0px; padding: 0 0.3em; margin: 0; } .workspaces button { /* padding: 0.5em; */ border: 3px solid rgba(0,0,0,0); background-color: rgba(0,0,0,0); background-image: none; } .label { background-color: rgba(0,0,0,0); } .workspaces button.visible { background-color: #441133; } .workspaces button.focused { border-color: #663355; } .clock label { vertical-align: middle; } ``` </details> **Additional context** The error is shown on all visible bars on all connected displays. Cannot exactly determine the steps to reproduce. The steps described are the full sequence I think relates to this but I'm not sure if _all_ the steps are needed to reproduce this. There might be some delays between sleep and resume involved, too, or the sleep might not even be relevant. Can't tell, will try to experiment more though it's not so easy as displays X and Y are in different locations and I don't have another display available at either location. Logs captured after the errror is observed ``` Apr 08 11:35:44 myhost ironbar[96280]: 2026-04-08T09:35:44.647806Z INFO ironbar::clients::outputs: 81: Monitor DP-2 connected Apr 08 11:35:44 myhost ironbar[96280]: 2026-04-08T09:35:44.648157Z INFO ironbar::bar: 125: Initializing bar 'bar-111' on 'DP-2' ... Apr 08 11:35:49 myhost ironbar[96280]: 2026-04-08T09:35:49.379779Z WARN system_tray::client: 469: org.freedesktop.DBus.Error.InvalidArgs: No such property “IconPixmap” ... Apr 08 11:35:54 myhost ironbar[96280]: 2026-04-08T09:35:54.647718Z WARN system_tray::client: 459: Error getting IconName: ZBusFdo(Failed("error occurred in Get")) Apr 08 11:35:54 myhost ironbar[96280]: 2026-04-08T09:35:54.648844Z WARN system_tray::client: 459: Error getting IconName: ZBusFdo(Failed("error occurred in Get")) Apr 08 11:53:02 myhost ironbar[96280]: 2026-04-08T09:53:02.993481Z INFO colpetto: 133: event15: opening input device '/dev/input/event15' failed (Permission denied). Apr 08 11:53:02 myhost ironbar[96280]: 2026-04-08T09:53:02.993499Z INFO colpetto: 133: event15 - failed to create input device '/dev/input/event15' Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.033567Z INFO colpetto: 133: event17: opening input device '/dev/input/event17' failed (Permission denied). Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.033588Z INFO colpetto: 133: event17 - failed to create input device '/dev/input/event17' Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.056931Z INFO colpetto: 133: event18: opening input device '/dev/input/event18' failed (Permission denied). Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.056949Z INFO colpetto: 133: event18 - failed to create input device '/dev/input/event18' Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.057739Z INFO colpetto: 133: event16: opening input device '/dev/input/event16' failed (Permission denied). Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.057745Z INFO colpetto: 133: event16 - failed to create input device '/dev/input/event16' Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.090207Z INFO colpetto: 133: event19: opening input device '/dev/input/event19' failed (Permission denied). Apr 08 11:53:03 myhost ironbar[96280]: 2026-04-08T09:53:03.090218Z INFO colpetto: 133: event19 - failed to create input device '/dev/input/event19' Apr 08 11:53:25 myhost ironbar[96280]: 2026-04-08T09:53:25.029308Z INFO colpetto: 133: event20: opening input device '/dev/input/event20' failed (Permission denied). Apr 08 11:53:25 myhost ironbar[96280]: 2026-04-08T09:53:25.029327Z INFO colpetto: 133: event20 - failed to create input device '/dev/input/event20' ... Apr 08 11:53:29 myhost ironbar[96280]: 2026-04-08T09:53:29.362592Z WARN system_tray::client: 469: org.freedesktop.DBus.Error.InvalidArgs: No such property “IconPixmap” ... Apr 08 11:53:41 myhost ironbar[96280]: 2026-04-08T09:53:41.396383Z INFO colpetto: 133: event22: opening input device '/dev/input/event22' failed (Permission denied). Apr 08 11:53:41 myhost ironbar[96280]: 2026-04-08T09:53:41.396406Z INFO colpetto: 133: event22 - failed to create input device '/dev/input/event22' ``` The `IconPixmap` error repeats ever ~3s and is most likely not relevant (maybe related to home-manager/nix setup). Possibly releated to https://github.com/JakeStanger/ironbar/issues/1335. There is no new entry in the logs after layout switch that fixes the issue. **Screenshots** error shown: <img width="504" height="48" alt="Image" src="https://github.com/user-attachments/assets/32f545c7-1904-4fba-b6a0-d9e5cb6e2cb1" /> after switching layout: <img width="433" height="48" alt="Image" src="https://github.com/user-attachments/assets/132512ff-200d-4adf-a629-9b03db6c2f54" />
Author
Owner

@JakeStanger commented on GitHub (Apr 13, 2026):

Hm, there's no code anywhere that'd fall back to "error" (in fact, we always display the layout as the compositor returns it). That makes me think it might actually be Hyprland returning the error string.

Could you try querying the layout with hyprctl while the error message shows in Ironbar and see if it shows the right thing or an error there too please?

If it doesn't, then I could possibly try and see if I can detect the 'error' string and re-fetch.

<!-- gh-comment-id:4239712404 --> @JakeStanger commented on GitHub (Apr 13, 2026): Hm, there's no code anywhere that'd fall back to "error" (in fact, we always display the layout as the compositor returns it). That makes me think it might actually be Hyprland returning the error string. Could you try querying the layout with `hyprctl` while the error message shows in Ironbar and see if it shows the right thing or an error there too please? If it *doesn't*, then I could possibly try and see if I can detect the 'error' string and re-fetch.
Author
Owner

@jficz commented on GitHub (Apr 15, 2026):

Could you try querying the layout with hyprctl while the error message shows in Ironbar and see if it shows the right thing or an error there too

No, it shows the keymap.

❯ hyprctl devices -j | jq '.keyboards[].active_keymap'
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
"English (US)"
❯ hyprctl devices |grep error
❯

If it doesn't, then I could possibly try and see if I can detect the 'error' string and re-fetch.

I'd much prefer to figure out where the error is coming from and fix it there if possible. How exactly does the layout plugin detect the layout? Hyprland IPC or something? Can I replicate the query somehow exactly?

<!-- gh-comment-id:4250624325 --> @jficz commented on GitHub (Apr 15, 2026): > Could you try querying the layout with hyprctl while the error message shows in Ironbar and see if it shows the right thing or an error there too No, it shows the keymap. ``` ❯ hyprctl devices -j | jq '.keyboards[].active_keymap' "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" "English (US)" ``` ``` ❯ hyprctl devices |grep error ❯ ``` > If it doesn't, then I could possibly try and see if I can detect the 'error' string and re-fetch. I'd much prefer to figure out where the error is coming from and fix it there if possible. How exactly does the layout plugin detect the layout? Hyprland IPC or something? Can I replicate the query somehow exactly?
Author
Owner

@jficz commented on GitHub (Apr 15, 2026):

No, it shows the keymap.

However, it might be possible that Hyprland does emit an error at the moment the plugin queries it, I suppose that happens very soon after resume.

Today, it happened just after suspend/resume cycle, with the same display (dis)connected. The display is also a dock if that makes any difference (in fact, so is the other display I used come to think of it).

The exact procedure I did is this:

  1. lock (swaylock)
  2. power off the ext display
  3. shut the laptop lid (suspends when ACDC not connected)
  4. after ~10h:
    • open the lid
    • power on the ext display
  5. unlock swaylock
  6. observe error

At step 4 I'm not quite sure about the order but I usually first open the laptop, then power on the ext display.

So if it really is some kind of race condition then

If it doesn't, then I couIf it doesn't, then Ild possibly try and see if I can detect the 'error' string and re-fetch.

might actually make sense. Though I'd suggest not to check for error string but be more generic - refetch if the result doesn't look like a keymap and definitely emit something to the log. Maybe try a few times and if it doesn't detect the layout eventually, display something like, perhaps, a question mark or some kind of INOP symbol (like maybe) with tooltip saying "could not detect keymap/layout", or something along those lines.

<!-- gh-comment-id:4250673702 --> @jficz commented on GitHub (Apr 15, 2026): > No, it shows the keymap. _However_, it might be possible that Hyprland does emit an `error` at the moment the plugin queries it, I suppose that happens very soon after resume. Today, it happened just after suspend/resume cycle, with the same display (dis)connected. The display is also a dock if that makes any difference (in fact, so is the other display I used come to think of it). The exact procedure I did is this: 1. lock (swaylock) 2. power off the ext display 3. shut the laptop lid (suspends when ACDC not connected) 4. after ~10h: - open the lid - power on the ext display 5. unlock swaylock 6. observe error At step 4 I'm not quite sure about the order but I _usually_ first open the laptop, _then_ power on the ext display. So if it really is some kind of race condition then > If it doesn't, then I couIf it doesn't, then Ild possibly try and see if I can detect the 'error' string and re-fetch. might actually make sense. Though I'd suggest not to check for `error` string but be more generic - refetch if the result doesn't look like a keymap and definitely emit something to the log. Maybe try a few times and if it doesn't detect the layout eventually, display something like, perhaps, a question mark or some kind of INOP symbol (like `╳` maybe) with tooltip saying "could not detect keymap/layout", or something along those lines.
Author
Owner

@jficz commented on GitHub (Apr 16, 2026):

new observation: error displayed after clean boot/start. Restarting ironbar fixed the problem. That's imho a strong indication of a race condition.

<!-- gh-comment-id:4258909413 --> @jficz commented on GitHub (Apr 16, 2026): new observation: `error` displayed after clean boot/start. Restarting ironbar fixed the problem. That's imho a strong indication of a race condition.
Author
Owner

@jficz commented on GitHub (May 11, 2026):

not sure if this has been addressed in any recent changes but since at least 10 may build (flake) I didn't see the error (yet). To be fair, I haven't done much computering until today so let's consider this report prelim. I'll report back in a few days to confirm/deny.

<!-- gh-comment-id:4421081037 --> @jficz commented on GitHub (May 11, 2026): not sure if this has been addressed in any recent changes but since at least 10 may build (flake) I didn't see the error (yet). To be fair, I haven't done much computering until today so let's consider this report prelim. I'll report back in a few days to confirm/deny.
Author
Owner

@JakeStanger commented on GitHub (May 11, 2026):

Certainly not intentionally addressed

<!-- gh-comment-id:4421521969 --> @JakeStanger commented on GitHub (May 11, 2026): Certainly not intentionally addressed
Author
Owner

@jficz commented on GitHub (May 12, 2026):

spoke too soon, still there :/ sorry for the noise

<!-- gh-comment-id:4428799559 --> @jficz commented on GitHub (May 12, 2026): spoke too soon, still there :/ sorry for the noise
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#7465
No description provided.