Some small slim secrets (Try to say that as quickly as you can 10 times in a row! )
Slim, the login-manager which is used in the Pandora-OS, has a few options that are quite helpful.
You can type in several strings instead of writing your username to call internally configured functions:
- type "exit" and slim will exit, leaving you with the tty. This is extremely helpful if you messed something up in your Xorg or/and xfce-configuration so you still have the chance to fix it.
- type "console" and X will start with a small terminal-window. It's nearly as helpful as "exit" but requires X to be properly configured.
Additionally the manual and /etc/slim.conf mentions some more commands that SHOULD work, but do not on the Pandora:
"halt","reboot","suspend" are supposed to do what they say. However i didn't manage to get them going even though i tried to add the "sudo"-command in /etc/slim.conf. (Edit: wejp told me on EFNET, that it works once you set a root-password. Read my reply below for details.) Since i still wanted to have an option to reboot and shutdown my system from within slim and without having the knowledge to modify and recompile the slim-sourcecode, i came up with a little workaround:
Slim does have a shortkey for making a screenshot (F11). While i do not get the idea why i would want to make a screenshot of my login-manager (oh wait, might be helpful if a errormessage shows up?), i am now mis-using this shortcut to call a bash-script i wrote. After saving the script and configuring slim you can press F11 once to make the Pandora reboot and press it twice to make it halt. The latter you have to do within 2 seconds. Otherwise rebooting initializes.
First of all the script. It's probably written in bad bash-style, but it works:
I saved the file as root in /usr/pandora/scripts/slim_trigger_shutdown.sh. If you saved as normal user you still can move it and change the owner by using
also i removed all rights for other users than root:
Now as root edit the file /etc/slim.conf, find the line for the screenshot-command (you can let your editor search for "screenshot"), write a # in the beginning, copy the whole line one row below and modify it so that the screenshot-related lines look like this:
Save the file, log out of xfce and try pressing F11 (Fn+O) once. After 2 seconds the system should reboot. After that you can also try pressing it twice, if you like to.
Slim, the login-manager which is used in the Pandora-OS, has a few options that are quite helpful.
You can type in several strings instead of writing your username to call internally configured functions:
- type "exit" and slim will exit, leaving you with the tty. This is extremely helpful if you messed something up in your Xorg or/and xfce-configuration so you still have the chance to fix it.
- type "console" and X will start with a small terminal-window. It's nearly as helpful as "exit" but requires X to be properly configured.
Additionally the manual and /etc/slim.conf mentions some more commands that SHOULD work, but do not on the Pandora:
"halt","reboot","suspend" are supposed to do what they say. However i didn't manage to get them going even though i tried to add the "sudo"-command in /etc/slim.conf. (Edit: wejp told me on EFNET, that it works once you set a root-password. Read my reply below for details.) Since i still wanted to have an option to reboot and shutdown my system from within slim and without having the knowledge to modify and recompile the slim-sourcecode, i came up with a little workaround:
Slim does have a shortkey for making a screenshot (F11). While i do not get the idea why i would want to make a screenshot of my login-manager (oh wait, might be helpful if a errormessage shows up?), i am now mis-using this shortcut to call a bash-script i wrote. After saving the script and configuring slim you can press F11 once to make the Pandora reboot and press it twice to make it halt. The latter you have to do within 2 seconds. Otherwise rebooting initializes.
First of all the script. It's probably written in bad bash-style, but it works:
Code:
#!/bin/bash
# by Lomaxx 20101003
# free for any use, but without any warranty
if ! [ -f /tmp/slim_shutdown-trigger ]
then
echo "reboot" > /tmp/slim_shutdown-trigger
# the following is run in a subshell so the script continues
# after 2 seconds the file is checked and either reboots or halts your system.
(sleep 2s
if [ "$(cat /tmp/slim_shutdown-trigger)" = "reboot" ]
then
/sbin/shutdown -r now
elif [ "$(cat /tmp/slim_shutdown-trigger)" = "halt" ]
then
/sbin/shutdown -h now
fi
)&
# the subshell ends here
else
echo "halt" > /tmp/slim_shutdown-trigger
fi
I saved the file as root in /usr/pandora/scripts/slim_trigger_shutdown.sh. If you saved as normal user you still can move it and change the owner by using
Code:
chown root:root /usr/pandora/scripts/slim_trigger_shutdown.sh
also i removed all rights for other users than root:
Code:
chmod go-rwx /usr/pandora/scripts/slim_trigger_shutdown.sh
Now as root edit the file /etc/slim.conf, find the line for the screenshot-command (you can let your editor search for "screenshot"), write a # in the beginning, copy the whole line one row below and modify it so that the screenshot-related lines look like this:
Code:
# Executed when pressing F11 (requires imagemagick)
#screenshot_cmd import -window root /slim.png
screenshot_cmd /usr/pandora/scripts/slim_trigger_shutdown.sh
Save the file, log out of xfce and try pressing F11 (Fn+O) once. After 2 seconds the system should reboot. After that you can also try pressing it twice, if you like to.