Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start another notification from "--action=" and newline is not inserted #18

Open
MR-Diamond opened this issue Dec 27, 2020 · 0 comments

Comments

@MR-Diamond
Copy link

MR-Diamond commented Dec 27, 2020

Hi, I have a bash script which does some actions and then display a notification which contains the --action= flag, which does other actions, is set as follow:

notify-send.sh -u critical -t 0 -o Execute:'command1; command2' --icon=/path/to/icon/icon.png " " "<span color='#F6FF45' font='16px'><b>$processname\nThe commands has been executed</b></span>"

After 'command1; command2' I would like to add another notification, so I tried:

notify-send.sh -u critical -t 0 -o Execute:'command1; command2; notify-send.sh -u critical -t 0 --icon=/path/to/icon/icon.png "$processname\nrestored"' --icon=/path/to/icon/icon.png " " "<span color='#F6FF45' font='16px'><b>$processname\nThe commands has been executed</b></span>"

Which half-works: the fact is that in the second notification, the new line parameter "\n" is not applyed and furthermore $processname\nrestored is not displayed at all, when in the first notification, is properly displayed. And if I execute notify-send.sh -u critical -t 0 --icon=/path/to/icon/icon.png "$processname\nrestored" alone, works as expected.
What I am missing?

What I have been able to achieve for now is:

notify-send.sh -u critical -t 0 \
 --icon=/path/to/icon/icon.png \
"$processname\nhas been paused and minimized" \
-o \
Resume:'notify-send.sh -u critical -t 0  --icon=/path/to/icon/icon.png \
"$processname \
Restored"'

In this way the second notification display the message, but the newline is not inserted (only in the first notification, the new line is inserted).

EDIT:

Well, I needed to escape the new line as follow:

"$processname \
\\n\
has been restored"'

Feel free to close this ticket, or to say anything about, if there is another way to achieve the aim :-)

@MR-Diamond MR-Diamond changed the title Start another notification from "--action=" ? Start another notification from "--action=" and newline is not inserted Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant