Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pkg
reinstall.sh
10 changes: 8 additions & 2 deletions lib/notify/notify-send.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
module Notify
if which('notify-send')
def self.notify(title, message, option = {})
iconargs = option.key?(:icon) ? ["-i", option[:icon]] : []
system 'notify-send', title, html_escape(message), *iconargs
args = []
args << "-i" << option[:icon] if option.key?(:icon)
args << "-t" << option[:time].to_s if option.key?(:time)
args << "-a" << option[:app_name].to_s if option.key?(:app_name)
args << "-u" << option[:urgency].to_s if option.key?(:urgency)
args << "-c" << option[:category].to_s if option.key?(:category)
args << "-h" << option[:hint].to_s if option.key?(:hint)
system 'notify-send', title, html_escape(message), *args
end
end
end