Skip to content
Mihir Lad edited this page Jul 22, 2020 · 7 revisions

Events

This message type is used to send event messages from dwm. This message should not be sent from a client, but only received by a client who has subscribed to a dwm event. To learn how to subscribe to events, go to Subscribe. The payload of this message depends on the event type.

Tag Change Events

The tag_change_event event message will have a payload in the following format:

{
  "tag_change_event": {
    "monitor_number": 1,
    "old_state": {
      "selected": 10,
      "occupied": 3,
      "urgent": 0
    },
    "new_state": {
      "selected": 8,
      "occupied": 3,
      "urgent": 0
    }
  }
}

Layout Change Events

The layout_change_event event message will have a payload in the following format:

{
  "layout_change_event": {
    "monitor_number": 1,
    "old_symbol": "[2]",
    "old_address": 94559310858944,
    "new_symbol": "[]=",
    "new_address": 94559310858912
  }
}

Client Focus Change Events

The client_focus_change_event event message will have a payload in the following format:

{
  "client_focus_change_event": {
    "moniter_number": 1,
    "old_win_id": 67108870,
    "new_win_id": 65011718
  }
}

Monitor Focus Change Events

The monitor_focus_change_event event message will have a payload in the following format:

{
  "monitor_focus_change_event": {
    "old_monitor_number": 1,
    "new_monitor_number": 0,
  }
}

Focused Title Change Events

The focused_title_change_event event message will have a payload in the following format:

{
  "focused_title_change_event": {
    "monitor_number": 0,
    "client_window_id": 224214,
    "old_name": "~",
    "new_name": "nvim"
  }
}

Focused State Change Events

The focused_state_change_event event message will have a payload in the following format:

{
  "focused_state_change_event": {
    "monitor_number": 1,
    "client_window_id": 6291462,
    "old_state": {
      "old_state": false,
      "is_fixed": false,
      "is_floating": false,
      "is_fullscreen": false,
      "is_urgent": false,
      "never_focus": false
    },
    "new_state": {
      "old_state": false,
      "is_fixed": false,
      "is_floating": true,
      "is_fullscreen": false,
      "is_urgent": false,
      "never_focus": false
    }
  }
}

Special Notes

The values associated with the old_win_id, client_window_id and new_win_id keys are window XIDs that can be provided in the Get DWM Client command to retrieve properties about the clients.

The monitor number corresponds to the index of the monitor where this event occured. The monitor numbers are listed in the properties of the monitor which can be retrieved using the Get Monitors command.

The layout symbol should NOT be relied upon as an accurate method of differentiating between layouts. The monocle layout, for example, can have different layout symbols based on the number of clients in view, but the address of the layout will always be constant per dwm session.