open as root?
Re: open as root?
freelY, I tried your fix and it launches pcmanfm from the menu entry but not as root.......
Re: open as root?
Here is the code fixed:
Code: Select all
#!/bin/sh
#-------------------------------------------------------
# Start program
export launchasroot='
<window title="Root Launcher" icon="/usr/share/icons/gnome/32x32/apps/file-manager.png" window-position="2" width-request="300">
<notebook labels="Launch as Root">
<frame>
<hbox>
<button>
<input file>"/usr/share/icons/gnome/32x32/apps/file-manager.png"</input>
<action>gksu -l /usr/bin/pcmanfm &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"File Manager Superuser Mode"</label>
</text>
</hbox>
</frame>
</notebook>
</window>
'
gtkdialog --program=launchasroot
unset launchasroot
Re: open as root?
Hmm...... I'm not seeing the error in the script, so I'll need to review it a line at a time. I'll get back to you as soon as I have something.
Re: open as root?
Strange. You should have "PCMan file manager" and the new created "PCMan Root" in your LXDE menu.
This my file /usr/bin/launchasroot.sh
My /usr/share/applications/pcmanfm_root.desktop file:
And my /usr/share/applications/.desktop file (named "Launch as Root")
Don't forget to restart your session.

This my file /usr/bin/launchasroot.sh
Code: Select all
#!/bin/sh
#-------------------------------------------------------
# Start program
export launchasroot='
<window title="Root Launcher" icon="/usr/share/icons/gnome/32x32/apps/file-manager.png" window-position="2">
<vbox>
<notebook label="Launch as Root ">
<vbox>
<frame>
<hbox>
<button>
<input file>"/usr/share/icons/file_tools_section.png"</input>
<action>gksu -l /usr/bin/pcmanfm &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"File Manager Superuser Mode"</label>
</text>
</hbox>
</vbox>
</window>
'
gtkdialog --program=launchasroot
unset launchasroot
Code: Select all
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=PCMan Root
Categories=Application;System;Utility;Core;GTK;
Name[zh_TW]=檔案總管
Name[fi]=PCMan-tiedostonhallinta
Name[et]=PCMan failihaldur
Name[ja]=PCMan ファイルマネージャ
Exec=gksu /usr/bin/pcmanfm
Icon=pcmanfm
StartupNotify=true
Type=Application
Terminal=false
MimeType=x-directory/normal;inode/directory;
GenericName=File Manager
GenericName[ru]=Файловый менеджер
GenericName[zh_TW]=檔案管理程式
GenericName[fi]=Tiedostonhallinta
GenericName[et]=Failihaldur
GenericName[ja]=ファイルマネージャ
Comment=Browse the file system and manage the files
Comment[zh_TW]=瀏覽檔案系統及管理檔案
Comment[fi]=Selaa tiedostojärjestelmää ja hallitse tiedostoja
Comment[et]=Lehitse failisüsteemi ja halda faile
Comment[ja]=ファイルシステムをブラウズし、ファイルの管理を行います
Code: Select all
[Desktop Entry]
Name=Launch as Root
Exec=/usr/bin/launchasroot
Comment=Root Launcher
Icon=file-manager.png
Terminal=false
Type=Application
StartupNotify=true
Categories=Application;System;Utility;Core;GTK;
OnlyShowIn=LXDE;
Don't forget to restart your session.
Last edited by FreelY on Sun Nov 08, 2009 11:07 pm, edited 1 time in total.
Re: open as root?
OK, thanks guys, I now have it (sort of) working from the menu after copying FreelY's scripts etc BUT strangely, after a fresh boot, it brings up the dialog box asking for the root password. OK o far. After entering that, the screen flashes but no pcmanfm appears. So, I go back to the menu and try again and this time it opens as root, and continues to do so for the rest of the session. Wierd. Anyway, it is good enough, but it would be interesting to know why it needs 2 stabs at it after a reboot. 
