class Notiffany::Notifier::Tmux
shows messages in the status bar.
Changes the color of the Tmux status bar and optionally
def _check_available(opts = {})
def _check_available(opts = {}) @session ||= nil # to avoid unitialized error fail "PREVIOUS TMUX SESSION NOT CLEARED!" if @session var_name = opts[:tmux_environment] fail Error, ERROR_NOT_INSIDE_TMUX unless ENV.key?(var_name) version = Client.version fail Error, format(ERROR_ANCIENT_TMUX, version) if version < 1.7 true rescue Error => e fail UnavailableError, e.message end
def _end_session
def _end_session fail "Already turned off!" unless @session @session.close @session = nil end
def _gem_name
def _gem_name nil end
def _perform_notify(message, options = {})
(**options)
-
display_on_all_clients
(Boolean
) -- whether to display a -
display_message
(Boolean
) -- whether to display a message -
color_location
(String, Array
) -- the location where to draw -
change_color
(Boolean
) -- whether to show a color -
image
(String
) -- the path to the notification image -
message
(String
) -- the notification message body -
type
(String
) -- the notification type. Either 'success',
Parameters:
-
options
(Hash
) -- additional notification library options -
message
(String
) -- the notification message
def _perform_notify(message, options = {}) locations = Array(options[:color_location]) type = options[:type].to_s title = options[:title] tmux = Notification.new(type, options) tmux.colorize(locations) if options[:change_color] tmux.display_title(title, message) if options[:display_title] tmux.display_message(title, message) if options[:display_message] end
def _session
def _session @session end
def _start_session
def _start_session fail "Already turned on!" if @session @session = Session.new end
def turn_off
are unset) and unquiet the Tmux output.
if available (existing options are restored, new options
Notification stopping. Restore the previous Tmux state
def turn_off self.class._end_session end
def turn_on
and quiet the Tmux output.
Notification starting, save the current Tmux settings
def turn_on self.class._start_session end