--- src1/XFileExplorer.cpp	Thu Jul 17 13:09:41 2008
+++ src/XFileExplorer.cpp	Sat Oct 31 21:55:10 2009
@@ -2198,82 +2198,11 @@
 // Run an Xfe as root
 long XFileExplorer::onCmdSu(FXObject*,FXSelector,void*)
 {
-	// Wait cursor
-	getApp()->beginWaitCursor();
-
-	// Obtain preferred root mode
-	FXbool use_sudo=getApp()->reg().readUnsignedEntry("OPTIONS","use_sudo",FALSE);
-
-	// Check if the standard xterm terminal is usable
-	FXString xterm="xterm";
-	FXString command=xterm + " --help > /dev/null 2>&1";
-	FXint status=system(command.text());
-	if (WEXITSTATUS(status)==126 || WEXITSTATUS(status)==127) // command doesn't exist or can't be run
-	{
-		// No standard terminal available : get the user's one
-		xterm=getApp()->reg().readStringEntry("PROGS","xterm","xterm");
-		
-		// And check if it is usable, if not, we exit
-		FXString command=xterm + " --help > /dev/null 2>&1";
-		status=system(command.text());
-		if (WEXITSTATUS(status)==126 || WEXITSTATUS(status)==127)
-		{
-			MessageBox::error(getApp(),BOX_OK,_("Error"),_("An error has occurred! \nPlease note that the root mode requires a working terminal installed on your system."));
-			getApp()->endWaitCursor();
-			return 0;
-		}
-	}
-		
-	// Select sudo or su to launch xfe as root
-	chdir(lpanel->getCurrent()->getDirectory().text());
-	FXString title, sucmd;
-	if (use_sudo)
-	{
-		title = _("Enter the user password:");
-		sucmd = "sudo su -c xfe";
-	}
-	else
-	{
-		title = _("Enter the root password:");
-		sucmd = "su -c xfe";
-	}
-	
-	// Standard xterm terminal available : use some options to nicely format the window
-	if (xterm=="xterm")
-	{	
-		// Use appropriate background and foreground colors for xterm or urxvt
-		FXchar color[64];
-		fxnamefromcolor(color,getApp()->getBackColor());
-		FXString bg=" -bg ";
-		bg = bg + ::quote(color) + " ";
-		fxnamefromcolor(color,getApp()->getForeColor());
-		FXString fg=" -fg ";
-		fg = fg + ::quote(color) + " ";
-		
-		// Command string
-		command = xterm + " -title " + ::quote(title) + bg + fg + "-fn 7x14 -geometry 60x4 -bc +sb -e " + sucmd + " &";
-	}
-	
-	// No standard terminal available : the user's one should at least provide the "-e" option to start a command
-	// This should work on most terminals but could fail on some
-	else
-	{
-		// Command string
-		command = xterm + " -e " + sucmd + " &";
-	}
-		
-	// Execute command
-	status=system(command.text());
-	chdir(startlocation.text());
-	if (WEXITSTATUS(status)==126 || WEXITSTATUS(status)==127) // command doesn't exist or can't be run
-	{
-		MessageBox::error(getApp(),BOX_OK,_("Error"),_("An error has occurred! \nPlease note that the root mode requires a working terminal installed on your system."));
-		getApp()->endWaitCursor();
-		return 0;
-	}
-	
- 	// Wait cursor
-	getApp()->endWaitCursor();
+		FXString homelocation=getenv("HOME");
+    if(homelocation=="")
+        homelocation=ROOTDIR;
+	FXString cmd="sudo xfe " + homelocation + " &";
+	system(cmd.text());
     return 1;
 }
 
