Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WezTerm support #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add WezTerm support #99

wants to merge 2 commits into from

Commits on Sep 26, 2023

  1. Remove duplicate "notifier" setting

    Chris Pick committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    ea31987 View commit details
    Browse the repository at this point in the history
  2. Add WezTerm support

    Depends on installing [`jq`](https://github.com/jqlang/jq),
    activating WezTerm's
    [shell integration](https://wezfurlong.org/wezterm/shell-integration.html?h=integration#user-vars)
    (for the `__wezterm_set_user_var()` shell function), and placing
    following snippet in WezTerm's
    [.wezterm.lua](https://wezfurlong.org/wezterm/config/files.html#quick-start):
    ```lua
    local wezterm = require 'wezterm'
    local config = {}
    
    wezterm.on('user-var-changed', function(window, pane, name, value)
      if name ~= "NOTIFICATION" then
        return
      end
    
      local notification = wezterm.json_parse(value)
    
      if notification.check_focus
        and window:is_focused()
        and window:active_pane():pane_id() == pane:pane_id()
      then
        return
      end
    
      if not notification.timeout_milliseconds then
        notification.timeout_milliseconds = nil
      end
    
      window:toast_notification(notification.title, notification.message,
        nil, notification.timeout_milliseconds)
    end)
    
    return config
    ```
    Chris Pick committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    917dc00 View commit details
    Browse the repository at this point in the history