Class: Notiffany::Notifier::Tmux
- Defined in:
- lib/notiffany/notifier/tmux.rb,
lib/notiffany/notifier/tmux/client.rb,
lib/notiffany/notifier/tmux/session.rb,
lib/notiffany/notifier/tmux/notification.rb
Overview
Changes the color of the Tmux status bar and optionally shows messages in the status bar.
Defined Under Namespace
Classes: Client, Error, Notification, Session
Constant Summary collapse
- DEFAULTS =
{ tmux_environment: "TMUX", success: "green", failed: "red", pending: "yellow", default: "green", timeout: 5, display_message: false, default_message_format: "%s - %s", default_message_color: "white", display_on_all_clients: false, display_title: false, default_title_format: "%s - %s", line_separator: " - ", change_color: true, color_location: "status-left-bg" }
- ERROR_NOT_INSIDE_TMUX =
":tmux notifier is only available inside a "\ "TMux session."
- ERROR_ANCIENT_TMUX =
"Your tmux version is way too old (%s)!"
Constants inherited from Base
Base::ERROR_ADD_GEM_AND_RUN_BUNDLE, Base::HOSTS
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#turn_off ⇒ Object
Notification stopping.
-
#turn_on ⇒ Object
Notification starting, save the current Tmux settings and quiet the Tmux output.
Methods inherited from Base
#_image_path, #initialize, #name, #notify, #title
Constructor Details
This class inherits a constructor from Notiffany::Notifier::Base
Class Method Details
._end_session ⇒ Object
120 121 122 123 124 |
# File 'lib/notiffany/notifier/tmux.rb', line 120 def _end_session fail "Already turned off!" unless @session @session.close @session = nil end |
._session ⇒ Object
126 127 128 |
# File 'lib/notiffany/notifier/tmux.rb', line 126 def _session @session end |
Instance Method Details
#turn_off ⇒ Object
Notification stopping. Restore the previous Tmux state if available (existing options are restored, new options are unset) and unquiet the Tmux output.
52 53 54 |
# File 'lib/notiffany/notifier/tmux.rb', line 52 def turn_off self.class._end_session end |
#turn_on ⇒ Object
Notification starting, save the current Tmux settings and quiet the Tmux output.
44 45 46 |
# File 'lib/notiffany/notifier/tmux.rb', line 44 def turn_on self.class._start_session end |