Here is a small patch to handle two additional options with slim: defaultUser and hideCursor. This small patch fixes also a bug which occurs when we write "shutdown" or "reboot" as a login name.
I have suggested an another patch to SLiM to skip the root password for these commands in order to shutdown my laptop properly. I hope this would be helpful. In fact, if someone have a solution to obtain the "turn off" button under KDE I will be pleased. -- Nicolas Pierron
From: Nicolas Pierron <[EMAIL PROTECTED]> Subject: r???: Add a variable to run shutdown commands without root password. URL: http://svn.berlios.de/svnroot/repos/slim/trunk ChangeLog: 2007-12-16 Nicolas Pierron <[EMAIL PROTECTED]> Add a variable to run system command without root password. * app.cpp: Add the test for reboot, halt and suspend. * cfg.cpp: Add the new variable with the default value set to false. * slim.conf: Add an example of the command. --- app.cpp | 5 +++++ cfg.cpp | 1 + slim.conf | 5 +++++ 3 files changed, 11 insertions(+) Index: slim.conf =================================================================== --- slim.conf (revision 150) +++ slim.conf (working copy) @@ -10,6 +10,11 @@ console_cmd /usr/X11R6/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login" #suspend_cmd /usr/sbin/suspend +# Let normal users have access to systems commands. If the value is true, +# then the root password is requiered to start a system command. +# Valid values: true|false +# root_password false + # Full path to the xauth binary xauth_path /usr/X11R6/bin/xauth Index: cfg.cpp =================================================================== --- cfg.cpp (revision 150) +++ cfg.cpp (working copy) @@ -36,6 +36,7 @@ options.insert(option("login_cmd","exec /bin/bash -login ~/.xinitrc %session")); options.insert(option("halt_cmd","/sbin/shutdown -h now")); options.insert(option("reboot_cmd","/sbin/shutdown -r now")); + options.insert(option("root_password","true")); options.insert(option("suspend_cmd","")); options.insert(option("sessionstart_cmd","")); options.insert(option("sessionstop_cmd","")); Index: app.cpp =================================================================== --- app.cpp (revision 150) +++ app.cpp (working copy) @@ -407,6 +407,11 @@ case Panel::Console: cerr << APPNAME << ": Got a special command (" << LoginPanel->GetName() << ")" << endl; return true; // <--- This is simply fake! + case Panel::Suspend: + case Panel::Halt: + case Panel::Reboot: + if (cfg->getOption("root_password") == "false") + return true; default: break; };
_______________________________________________ nix-dev mailing list [email protected] https://mail.cs.uu.nl/mailman/listinfo/nix-dev
