Sha256: 30b7c0e6220b897a9679b400d0253d8afc839ce311e23f8691164b43613707a4

Contents?: true

Size: 1.26 KB

Versions: 26

Compression:

Stored size: 1.26 KB

Contents

module Notiffany
  class Notifier
    class Tmux < Base
      # Preserves TMux settings for all tmux sessions
      class Session
        def initialize
          @options_store = {}

          # NOTE: we are reading the settings of all clients
          # - regardless of the :display_on_all_clients option

          # Ideally, this should be done incrementally (e.g. if we start with
          # "current" client and then override the :display_on_all_clients to
          # true, only then the option store should be updated to contain
          # settings of all clients
          Client.new(:all).clients.each do |client|
            @options_store[client] = {
              "status-left-bg"  => nil,
              "status-right-bg" => nil,
              "status-left-fg"  => nil,
              "status-right-fg" => nil,
              "message-bg"      => nil,
              "message-fg"      => nil,
              "display-time"    => nil
            }.merge(Client.new(client).parse_options)
          end
        end

        def close
          @options_store.each do |client, options|
            options.each do |key, value|
              Client.new(client).unset(key, value)
            end
          end
          @options_store = nil
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 8 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.35 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.34 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.33 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.32 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.31 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.30 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.29 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.28 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.27 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.26 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
qiita_org-0.1.25 gems/ruby/2.7.0/gems/notiffany-0.1.3/lib/notiffany/notifier/tmux/session.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/session.rb
notiffany-0.1.3 lib/notiffany/notifier/tmux/session.rb
notiffany-0.1.2 lib/notiffany/notifier/tmux/session.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/session.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/session.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/session.rb