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

[BUG] Executor launched twice #67

Open
Irvinehimself opened this issue Sep 26, 2021 · 5 comments
Open

[BUG] Executor launched twice #67

Irvinehimself opened this issue Sep 26, 2021 · 5 comments

Comments

@Irvinehimself
Copy link

I am having an issue with an executor being launched twice.

The script is fairly simple, see below, and is set to grep a config file for the current time, (in %HH:%MM,) every 60 seconds. If the grep returns a non-empty string then it plays an alarm with mpg123 and sends a notification via mako and notify-send.

Unfortunately, I receive two notification bubbles, and, (as if my ears weren't enough,) checking with ps aux I can see that there are two instances of the track being played.

I have launched the script outside the nwg-panel, and it works without problems. Additionally, I have checked that the same thing is happening on both Sway and Wayfire

Originally, I thought it might have been because I have two monitors, but there is only one instance of nwg-panel

Here is the script:

#!/bin/bash

# a simple alarm for 'nwg-panel'

# Note: 'killall mpg123'

# Get Time
Time=$(date +'%H:%M')

### Var
AlarmTimes="${HOME}/.config/BashTricks/MyNwgPanelAlarm.cfg"
AlarmSound="/usr/local/share/Alarms/Rainforest.mp3"
AlarmIcon="/usr/local/share/Icons/Hourglass-red.png"

# Set Icon
echo "/usr/local/share/Icons/Hourglass-white.png"

AlarmOn=$(grep "${Time}" "${AlarmTimes}")

if ! [[ -z "${AlarmOn}" ]] ; then
    notify-send -u critical -t 0  -i "${AlarmIcon}" "Wake Up Call"
    mpg123 "${AlarmSound}"
fi

*My Desktop is:

  • Linux Arch
  • Sway version: 1:1.6.1-1
  • Nwg-Panel version: 0.4.3-1

Probably not relevant, but....

  • Clicking the executor with the LMB runs: killall mpg123
  • Clicking the executor with the RMB runs: gnome-terminal -- nano "~/.config/BashTricks/MyNwgPanelAlarm.cfg"
@nwg-piotr
Copy link
Owner

Could you also attach ~/.config/BashTricks/MyNwgPanelAlarm.cfg?

@Irvinehimself
Copy link
Author

As requested: ~/.config/BashTricks/MyNwgPanelAlarm.cfg

# Set alarms using date +'%H:%M' format eg HH:MM


Current Alarms:


Test alarm 14:51

My normal daily alarm 06:55

Sorry I had to paste it, for some reason the GitHub upload thingy is not seeing it in my 'Firefox 'download' folder.
Irvine

@Irvinehimself
Copy link
Author

Irvinehimself commented Sep 28, 2021

I was trying to figure out why I couldn't upload the previous file, (it needed a .txt extension [lol],) and thought you might find my nwg-panel config file useful.

Irvine

NwgPanelConfig.txt

Edit:
Additional Info, I just noticed that after canceling an alarm, if I immediately restart Nwg-panel, (while still inside the same 60 second window,) the script runs correctly. Unfortunately updating the time returns everything to the problematic double play behavior

@nwg-piotr
Copy link
Owner

Sorry, for now I don't even understand how your executor works, but I'm away from my desk, with only a chromebook. I'll take another look at the issue when I'm back.

@Irvinehimself
Copy link
Author

Not to worry. I will keep trying to gather more info, and, if you need anything more, just ask.

Irvine

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

2 participants