Skip to content

Commit

Permalink
Adds \n and \t options to body and title
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
phuhl committed Jan 15, 2019
1 parent aa528ce commit 8290ea7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/notify-send.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@
help=('Specifies the name of a notification.'
' Every notification that gets created with the same NAME will'
' replace every notification before it with the same NAME.'))
parser.add_argument('SUMMERY')
parser.add_argument('BODY', nargs='?')
parser.add_argument(
'SUMMERY',
help=('Summery of the notification. Usage of \\n and \\t is possible.'))
parser.add_argument(
'BODY', nargs='?',
help=('Body of the notification. Usage of \\n and \\t is possible.'))

args = parser.parse_args()
urgency = args.urgency
Expand All @@ -47,8 +51,13 @@
replacesId = args.replaces_id
icon = args.icon

summery = args.SUMMERY
body = args.BODY

def cleanUpText(text):
return text.replace("\\n", "\n").replace("\\t", "\t")


summery = cleanUpText(args.SUMMERY or "")
body = cleanUpText(args.BODY or "")

notify2.init(appName or "")
if icon and body:
Expand Down

0 comments on commit 8290ea7

Please sign in to comment.