Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: baz on December 12, 2009, 09:26:40 PM

Title: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: baz on December 12, 2009, 09:26:40 PM
I am using PCMANFM file manager and under Tools there is an option to "Open Current Folder as Root", however clicking on it generates the error "gksu or kdesu is not found". Is there any way to get around this?
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: dentonlt on December 13, 2009, 01:17:04 AM
Looks like GKsu has not been built for TC yet. I've downloaded it, and will try it out (maybe one of the main admins will beat me  :) )

EDIT:

pkgconfig path doesn't include freetype2.pc - I had to symbolic link from /usr/lib/pkgconfig to /usr/local/lib/pkgconfig. I think this is similar to a problem that JasonW was working on recently ... ?

Also requires libgtop and gnome-keyring. For now, I'm side-tracked into compiling those dependencies.
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: Jason W on December 13, 2009, 10:19:07 AM
Is freetype.pc recognized when this command is used before compiling?

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig

Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: dentonlt on December 13, 2009, 04:29:17 PM
Thanks, Jason - I'll try that out. I'm side tracked into compiling libgtop right now.

EDIT: Yep, command line works as -

Code: [Select]
./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
Finds freetype no problem.
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: maro on December 13, 2009, 04:36:03 PM
I don't want to discourage anyone from contributing to the community, but I wonder if adding gksu to the repository is really required. To me at least it would be also a bit contrary to the spirit of TC, which I consider to be in favour of avoiding "bloatware".

We might not need gksu to correct the PCMANFM behavior: According to the README file of pcmanfm (v0.5.2):
Quote
Switch To Root Problems:
  In "Tool" menu of PCManFM there is an option for you to switch to super user.
  By default PCManFM calls 'gksudo', and if it doesn't exists, it calls 'gksu'.
  If both of them don't exist, PCManFM will call 'kdesu'.
  In some distros, 'gksudo' is disabled by default. Instead, you can assign your
  preferable program during configuration, and the option is
  "--with-preferable-sudo=PROG"

So, I'd imagine rebuilding PCMANFM with "--with-preferable-sudo=sudo" might resolve the problem, without having to go through depencency hell to create some "GUI bloat".
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: dentonlt on December 13, 2009, 04:55:20 PM
maro - ah! I like less work ... :)

Thanks for suggesting that - I'll dig in that direction.
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: bmarkus on December 14, 2009, 02:52:27 AM

So, I'd imagine rebuilding PCMANFM with "--with-preferable-sudo=sudo" might resolve the problem, without having to go through depencency hell to create some "GUI bloat".


It doesn't work on this way as sudo requires an argument, program executed, but the direction is good. I will rebuild it to use a wrapper script to execute a user defined program. Hope it will work.
Title: Re: PCMANFM "Open Current Folder as Root" errors "gksu or kdesu is not found"
Post by: bmarkus on December 27, 2009, 05:26:56 PM
Current version of pcmanfm.tcz calls a file pcmansu to switch to superuser. As an easy solution, use the shell script below:

Quote
#!/bin/sh

[ -e /root/.gtkrc-2.0 ] || sudo ln -s /home/tc/.gtkrc-2.0 /root/.gtkrc-2.0

A=$(echo $1 | cut -f 3 -d ' ' | cut -f  2 -d "'")
sudo pcmanfm --no-desktop $A

Place it to /usr/local/sbin dir as pcmansu

It will open the current directory in a new pcmanfm window in superuser mode. Take it as a dirty demonstration only. Be careful using it not to demage your system.