Giter Club home page Giter Club logo

Comments (8)

rkmax avatar rkmax commented on May 31, 2024

Well it seems working fine here. I did the following test ~/.config/argos/uptime.3s.sh

#!/usr/bin/env bash

echo "Test"

echo "---"
echo "Run uptime with sudo | bash='sudo uptime' terminal=false" 

if you run the journalctl /usr/bin/gnome-shell -f command on a seperate terminal then you can see the output of the command when you click on Test > Run uptime with sudo

On my case I can execute sudo without password, I think the best that you can do it's move your script to some place and then just call it from your argos script

from argos.

scoony avatar scoony commented on May 31, 2024

Normally using when you use the sudo command you need to type your password (this is what prevent the script to run completely in Argos)

You've visudo ?

from argos.

scoony avatar scoony commented on May 31, 2024

This is why I was wanting to sudo (an extension to check and notify user if any hardware/software issue... and smartctl requires sudo)

alt text

from argos.

rkmax avatar rkmax commented on May 31, 2024

I dont know if the | make that the command dont run properly, a simple workaround that I said on my previous comment (probably I didnt express well my english is a bit bad)

the workaround is move what you need execute with sudo to an external script, example

# ~/.scripts/sudo_uptime.sh
echo mypassword | sudo -kS uptime

dont forget add execution permissions to tour external script chmod +x ~/.scripts/sudo_uptime.sh then your argos config it'll be something like

#!/usr/bin/env bash

echo "Test"
echo "---"
echo "Run uptime with sudo | bash='~/.scripts/sudo_uptime.sh' terminal=false" 

I've tested this by myself and it's working fine (I enable password for my sudo)

from argos.

scoony avatar scoony commented on May 31, 2024

You purpose exactly what I tried in first place ;)

Your code will "almost work" because the command is not used in the script itself, it's a button... but if you use the button the command will not run properly due to the password required.

Try to store the result of the command in a variable, you will understand.

#!/usr/bin/env bash

system_uptime=`echo mypassword | sudo -kS uptime`

echo "Test"
echo "---"
echo "uptime: $system_uptime" 

from argos.

scoony avatar scoony commented on May 31, 2024

the journalctl command result in:
janv. 29 07:21:44 Serveur-NAS org.gnome.Shell.desktop[2526]: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x4e00028 (test.c.sh )

from argos.

p-e-w avatar p-e-w commented on May 31, 2024

Whatever the issue is here, it has nothing to do with Argos. Argos runs executable files, that's all. It doesn't care whether those files in turn invoke sudo, or top, or any other program.

The "Buggy client" warning shown above is a GTK+ bug that has been around forever, and has nothing to do with Argos either.

from argos.

bertschneider avatar bertschneider commented on May 31, 2024

If someone stumbles upon this issue: At least in my case it seemed that the prompt for the password caused the problem. After setting an empty prompt with -p '' the script executes as expected.

SOMETHING=$(sudo -Sk -p '' <<< $password some_command)
echo "${SOMETHING}"

from argos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.