-
Notifications
You must be signed in to change notification settings - Fork 1
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
Check exit code and running commands with pkexec #7
Comments
Hey there, had a little bit of a similar Issue. Maybe you can find some Inspiration in #8 |
@jeroenwtf I'm happy to hear you've found this extension useful. I think this is a good idea that others would benefit from as well. And I appreciate the feedback- it's always good to hear how people are using the extension! |
As for the sudo commands, I would have to think about this a bit more. My approach has been to run |
@luguenth |
@jeroenwtf
Should this be the same for turning the toggle off? So it only turns off if the exit code for the Toggle Off command is 0? Let me know if this is correct. |
For my own use-case, this is accurate. (Like OP, I run commands with pkexec—if I cancel the authentication, I don’t want the button to be toggled.) |
Maybe it should also interact with the “close menu” option (menu only closes on success). |
Hello there! 👋🏻
First of all, thanks for the extension. I thought I would have to do it myself but found yours and it's perfect!
I'm using it to enable and disable the keyboard of my laptop, since I use an external one and I place it on top of the other one. I used to run the script manually but with this extension is way easier and neat. I have two questions:
Would it be possible to tie the toggle status changing to the exit code of the command run? I'm not sure if it makes sense, but in case the command doesn't run successfully, no not toggle the status. It would be cool also for cases where you need to authenticate and you cancel it (I think it's exit code 127). Again, not sure if we can have that info from the extension.
The other question is about authentication. I have to run the scripts with sudo. Instead of opening a terminal, I'm just running them with pkexec (as
pkexec /path/to/the/script.sh
). It prompts for the password from GNOME itself without terminals involved, which looks nicer. Do you think is a better approach?I could check about the exit code part if you don't have time and open a PR, if you are up for it :) Thanks again!
The text was updated successfully, but these errors were encountered: