LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   question about kdesu and gtkdialog (https://www.linuxquestions.org/questions/linux-software-2/question-about-kdesu-and-gtkdialog-755057/)

musonio 09-14-2009 06:54 AM

question about kdesu and gtkdialog
 
I have problems with the following line in a bash script that uses gtkdialog.
The line in question is the following:

Code:

kdesu "sed 's/alignment top_right/alignment top_left/g' /etc/conky/conky.conf > out.txt && mv -f out.txt /etc/conky/conky.conf"
It works fine in a regular bash script (I use it to switch conky between right and left), but I can't make it work inside a gtkdialog.
I've tried several variations concerning the quotations marks, but with no luck.
Any ideas?

tredegar 09-14-2009 02:01 PM

kdesu is for KDE and gtksu is for Gnome.

musonio 09-14-2009 02:04 PM

I don't get what you mean.
I've used KDESU inside gtkdialogs that work perfectly.
It is this particular string that brings me problems.

GrapefruiTgirl 09-14-2009 02:09 PM

kdesu $(/usr/bin/sed 's/alignment top_right/alignment top_left/g' /etc/conky/conky.conf > out.txt && mv -f out.txt /etc/conky/conky.conf)

kdesu `/usr/bin/sed 's/alignment top_right/alignment top_left/g' /etc/conky/conky.conf > out.txt && mv -f out.txt /etc/conky/conky.conf`


Interesting question.. Try one of the ways I put it here. Just as an experiment.. The first way uses $(this) format, an the second uses `backticks`.

Also note that I put the full path to the sed command, just in case.

Who knows...... :) It may work, or it might be something peculiar to kdesu (which I would not be too surprised at)

Sasha

GrapefruiTgirl 09-14-2009 02:22 PM

Another idea, if the above does not work, is:

Since the code works in bash according to you, why not put it into a bash script, and just use kdesu to execute the script itself?

That'd be simpler than your current method anyway:

kdesu script

Sasha

musonio 09-14-2009 02:57 PM

1 Attachment(s)
Sasha:
Thanks for your ideas and your time.
Unfortunately, none of the variants worked.
The last idea you suggested is a good one, but the complex involves a lot of commands, many of which do not require to be root. Besides, the idea of the script is to put everything in a handy place, with no passwords to run the initial gtkdialog.
Another alternative would be to place the string as a function, but I haven't been able so far to call functions from inside a gtkdialog.
If you have time and want to take a look at it and see if you come up with anything, I've attached the script.


All times are GMT -5. The time now is 11:41 AM.