[Solved] LXDE: No poweroff/reboot options

Post here if you are a new Porteus member and you're looking for some help.
Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

[Solved] LXDE: No poweroff/reboot options

Post#1 by Virii » 28 Sep 2011, 13:37

Hi. This is concerning the standard 32 bit Porteus v1.0.

This is not so much a question as hopefully an useful pointer for somebody. I use Porteus from a 1 GB flash drive, which as everyone knows is very small on the space department. While the module interface for installing uninstalling programs in Porteus (or Slax) is perfect, I also prefer lighter faster desktop environments like Lxde, or Xfce.

What I went and did probably is probably against the design of the OS, nor recommended. Because I wanted to save space, I deleted the KDE base modules.

The problem that resulted for myself was that I couldn't login as a guest user (not a problem as I use root anyway), and that the 'poweroff/reboot' options were now missing/unavailable from the lxde-logout.

Here's what I did to re-enable a form of using the menu's logout gui interface, instead of say... using the cli. I downloaded Zenity from the slackyd repo, and converted it to a xzm module. You can create it yourself, or download the one I made here. Put it in your modules folder.

Second, I modified an existing script I found here to use with this.

Save it, name it 'lxde-logout', and make executable via 'chmod +x lxde-logout'.

Code: Select all

#!/bin/bash
# Multiple Exit Script using Zenity for non GDM installs.
# Requires Zenity.

title="EXIT: What do you want to do ?"
exit_type=`zenity  --width="530" --height="220" --title="$title" --list --radiolist --column="Click Here" \
    --column="Exit Type" --column="Description" \
    TRUE "Logout" "Log Current User out and return to Login Screen"\
    FALSE "Reboot" "Reboot the PC"\
    FALSE "Shutdown" "Shutdown the PC"\
    FALSE "Cancel" "Cancel the Exit" \
    | sed 's/ max//g' `

echo "$exit_type chosen as the Exit Type!."

#user must select a target type (Check if they cancelled)
if [ ! "$exit_type" ]; then
    zenity --error --title="Error" --text="You must make a selection!"
    exit
fi

######### This part takes the selection and applies it!  #############

# Edit this first section if not using openbox! #
if [ "$exit_type" = "Logout" ]
then
        # Do logout here.
        killall lxsession && sleep 1 | zenity --progress --percentage=95 --title=Logout --auto-close --auto-kill --no-cancel --width=300

elif [ "$exit_type" = "Reboot" ]
then
        # Do Reboot here.
        reboot | zenity --progress --percentage=95 --title=Reboot --auto-close --auto-kill --no-cancel --width=300


elif [ "$exit_type" = "Shutdown" ]
then
        # Do Shutdown here.
    poweroff | zenity --progress --percentage=95 --title=Shutdown --auto-close --auto-kill --no-cancel --width=300

else

#if [ "$exit_type" = "Cancel" ]
#then
        # Do Cancel here.
    sleep 1 | zenity --progress --percentage=95 --title=Cancelling Exit --auto-close --auto-kill --no-cancel --width=300
fi
Place this file into the '/porteus/rootcopy/usr/bin/' folder. Create the structure if the folders don't already exist. Done.

Reboot with the changes, and test it out. If for whatever reason, you are still able to login as a normal user, this may not work for you.
Last edited by Virii on 29 Sep 2011, 11:24, edited 1 time in total.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: LXDE: No poweroff/reboot options after KDE deletion

Post#2 by Hamza » 28 Sep 2011, 16:16

It needs Zenity and we use Xdialog.
Convert this script to use Xdialog instead of Zenity and we will be able to use it.
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: LXDE: No poweroff/reboot options after KDE deletion

Post#3 by Virii » 28 Sep 2011, 21:27

Can anyone confirm that this happens to them as well when they delete the KDE components. I guess I really have to verify that I didn't change something else... :oops:

Maybe it's one of the other modules I've loaded? I noticed before getting rid of it, that KDE refused to load when the Nvidia drivers were loaded as well. It only worked with the standard free drivers. I usb boot from grub4dos as well, because it's quite simply easier to manually setup Porteus with it.

As I didn't know that it was the decided on standard scripting for Porteus, I suppose I could still attempt to create a Xdialog logout/reboot/poweroff option. It might take me a while to learn though... :%)

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: LXDE: No poweroff/reboot options after KDE deletion

Post#4 by fanthom » 29 Sep 2011, 00:57

Can anyone confirm that this happens to them as well when they delete the KDE components.
everything is fine here - i have deleted everything except 000,001,002 and 003 on 32bit Porteus 1.0
must be something on your side, try always fresh + 4 modules mentioned above only.
Please add [Solved] to your thread title if the solution was found.

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: LXDE: No poweroff/reboot options after KDE deletion

Post#5 by Virii » 29 Sep 2011, 11:23

If you mean the 'always fresh' cheatcode then yes, I always do anymore. Just to make sure, I deleted the '/porteus/changes' directory, and emptied the '/porteus/images' one.

Well... I went and removed half of my user added modules at a time, and rebooted. Finally, I narrowed it down to the last two that were present when it happened.

Turns out it was the Wine module from the FIDSlax repository, and I had used the XZM Utils module to install it.

Sorry about my confusion. I had originally had it located in my optional folder, and often had shutdown from other ttyX terminals where I was running stuff.

Post Reply