You are not logged in.
Pages: 1
Hi everyone,
I'm running XFCE 4.12 on Debian 10.
I want to create a launcher that execute the following command in the terminal:
xfce4-terminal --command "watch -n 1.0 sudo nvidia-smi" && sudo /home/patrick/Scripts/nmonLauncher.sh
Where /home/patrick/Scripts/nmonLauncher.sh contains:
su
export NMON=Mmcdt-
nmon
Running this in the terminal gives the correct output (two windows with nmon and smi), but when i set a launcher to do this, it opens a terminal and suddenly close it.
I have the permission to run the script and nvidia-smi with sudo without password
Maybe I'm missing something.
Offline
Try this as the launcher command:
bash -c "xfce4-terminal --command "watch -n 1.0 sudo nvidia-smi" && sudo /home/patrick/Scripts/nmonLauncher.sh"
Offline
Try this as the launcher command:
bash -c "xfce4-terminal --command "watch -n 1.0 sudo nvidia-smi" && sudo /home/patrick/Scripts/nmonLauncher.sh"
Arleady tried, same result
Offline
I'll bet it's the quoting in the line causing an issue, but that's a little over my head.
Offline
Assuming the command shown above works as written(no way to test here) then it's best to format it into a script. If the script works then use the launcher to call the script. As I understand it the interpreter is limited so trying to do too much could overwhelm it. Calling the script instead takes the load off.
Siduction
Debian Sid
Xfce 4.18
Offline
You can pass xfce4-terminal the "-H" parameter to hold the screen so you can see the message.
But more importantly, how are dealing with the sudo command and the su in the script? How do you enter the password?
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Assuming the command shown above works as written(no way to test here) then it's best to format it into a script. If the script works then use the launcher to call the script. As I understand it the interpreter is limited so trying to do too much could overwhelm it. Calling the script instead takes the load off.
It's correct since it works in the terminal but not in the launcher. I tried to make a script but i get no such file or directory on /usr/bin/xfce4-terminal
Offline
You can pass xfce4-terminal the "-H" parameter to hold the screen so you can see the message.
But more importantly, how are dealing with the sudo command and the su in the script? How do you enter the password?
That parameter had no effects. I don't need to insert the passwords since I have the permission to do so on nvidia-smi and the script
Offline
That parameter had no effects.
That's odd. Try these examples as launcher commands:
bash -c "xfce4-terminal --command 'ls -l'"
...a window should pop up quickly and then disappear.
bash -c "xfce4-terminal -H --command 'ls -l'"
...a window shout pop up and stay open until you manually close it. If there was an error message, you would see it.
Then try this as your command:
bash -c "xfce4-terminal -H --command 'watch -n 1.0 sudo nvidia-smi' && sudo /home/patrick/Scripts/nmonLauncher.sh"
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
That's odd.
Yeah, I think i wrote it wrong.
try this as your command:
bash -c "xfce4-terminal -H --command 'watch -n 1.0 sudo nvidia-smi' && sudo /home/patrick/Scripts/nmonLauncher.sh"
This worked, thanks you a lot. The problem was double quotes.
Offline
Pages: 1
[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 555.23 KiB (Peak: 572.52 KiB) ]