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

Does not evaluate if conditions #38

Open
colutti opened this issue Nov 23, 2022 · 2 comments
Open

Does not evaluate if conditions #38

colutti opened this issue Nov 23, 2022 · 2 comments

Comments

@colutti
Copy link

colutti commented Nov 23, 2022

I am trying to display a text when a process is running or not, so I added this line to the plasmoid command:

if pgrep -af 'My Process' &>/dev/null; then echo "Running"; else echo "Not running"; fi

The line above works fine on bash and zsh, but when running it with the plasmoid it never evaluates to false, so it never pronts "Not running" when the process is not running.

@Zren
Copy link
Owner

Zren commented Nov 24, 2022

That's because you're running a single command/process, not a bash script. If you want a bash script, you need to run the bash command with the script as an argument.

@Sadi58
Copy link

Sadi58 commented Dec 11, 2022

Actually, it must be OK.

  1. I have a more complex one-liner script with if conditions running perfectly.
  2. I've tried your code, and it was OK here on Sparky KDE (Debian Testing) 5.26.4.

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

3 participants