LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-14-2009, 06:54 AM   #1
musonio
Member
 
Registered: Jun 2009
Distribution: PCLinuxOS
Posts: 33

Rep: Reputation: 15
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?
 
Old 09-14-2009, 02:01 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
kdesu is for KDE and gtksu is for Gnome.
 
Old 09-14-2009, 02:04 PM   #3
musonio
Member
 
Registered: Jun 2009
Distribution: PCLinuxOS
Posts: 33

Original Poster
Rep: Reputation: 15
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.

Last edited by musonio; 09-14-2009 at 02:05 PM.
 
Old 09-14-2009, 02:09 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
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
 
Old 09-14-2009, 02:22 PM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
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
 
Old 09-14-2009, 02:57 PM   #6
musonio
Member
 
Registered: Jun 2009
Distribution: PCLinuxOS
Posts: 33

Original Poster
Rep: Reputation: 15
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.
Attached Files
File Type: txt ananke2.rar.txt (19.9 KB, 4 views)

Last edited by musonio; 09-14-2009 at 03:01 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gtkdialog + glade + bash/dash/sh librano Programming 4 11-26-2009 02:46 AM
[SOLVED] strace kdesu konqueror & > ./strace_kdesu (diagnosing failing kdesu) GrapefruiTgirl Linux - Desktop 23 11-02-2009 05:03 PM
gtkdialog window size restriction kkpal Programming 1 11-10-2007 05:46 PM
gtkdialog treestore loading PatrickNew Linux - Software 0 09-09-2007 10:14 PM
Changing the gtkdialog title with bash jimmy512 Programming 2 09-07-2007 11:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration