How to use Drupal.displace inside Drupal.behaviors
Your thought to use drupalViewportOffsetChange is the way to go. The actual event is drupalViewportOffsetChange.toolbar. Here is an example:

  Drupal.behaviors.myTheme = {
    attach: function attach(context) {
      if (context === document) {
        $(context).on("drupalViewportOffsetChange.toolbar", function (event, offsets) {
          var selectors = [".class-of-thing-i-want-to-offset"];
          selectors.forEach(function (selector) {
            if ($(selector).length &gt; 0 &amp;&amp; offsets.top &gt; 0) {
              $(selector).css("top", offsets.top);
            }
          });
        });
      }
    }
  };