topic title: ending a session
Posts: 1,081
OU812
Joined: 29 Sep 2007
#1
Hello. I was testing fluxbox mint. When chose quit from the fb menu, a window popped up giving me a choice of actions. I looked around and found that they used an app called"ciao". I googled it and came to the conclusion that they must have used a custom app.

I was wondering if there is an app that we can install that will give us a graphical (gtk2) shutdown menu similar to mint's. I have googled and searched linux.softpedia.com, but have come up empty. Any ideas? Thanks.

john
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
I think they must have a customised version of zenity.

Have a look here for exiting fluxbox with a dialogue.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://fluxbox-wiki.org/index.php/Exit_fluxbox_with_a_dialog"
linktext was:"http://fluxbox-wiki.org/index.php/Exit_ ... h_a_dialog"
====================================
Posts: 1,081
OU812
Joined: 29 Sep 2007
#3
Thanks. I think you're right.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#4
OK. So I installed zenity. I also grabbed and edited the"ciao" file from fluxbox mint. Then I made it executable. Here it is so far:

Image

The last 3 options work wonderfully. However, I don't know how to issue commands for the first 2. I've looked around and can't figure it out. The author of this file did not have these options, so I have nothing to go from. Any help is appreciated. Thanks.

john
Posts: 47
n2j3
Joined: 19 Nov 2007
#5
OU812 wrote:However, I don't know how to issue commands for the first 2.
For shutting down without being root, check
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"antix.freeforu ms.org/viewtopic.php?p=65#65"
linktext was:"antix.freeforu ms.org/viewtopic.php?p=65#65"
====================================


For reconfiguring fluxbox , I suggest looking into the .fluxbox/menu file.
Posts: 1,081
OU812
Joined: 29 Sep 2007
#6
Thank you. I thought of that also, but the menu just has"reconfig" and"restart". These are not actual commands; i.e., they are not in /usr/bin. So the question is: fluxbox knows how to deal with this directive so how do I get the system to deal with it? Thanks.

john
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#7
Can you edit the caio script to remove the first two choices?
They won't be needed when asking a user to finish a session.
Posts: 47
n2j3
Joined: 19 Nov 2007
#8
OU812 wrote:fluxbox knows how to deal with this directive so how do I get the system to deal with it? Thanks.
try this from the commandline

Code: Select all

fluxbox-remote"Reconfigure"
if it works, edit your script, or whatever ciao is to execute this command.

source:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://ubuntuforums.org/showthread.php?t=689890"
linktext was:"http://ubuntuforums.org/showthread.php?t=689890"
====================================
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#9
OU812,
Could you post the ciao script, please.
I'm thinking of using it on antiX.
Posts: 1,081
OU812
Joined: 29 Sep 2007
#10
Please hold - I'm testing out tinyme right now. I want to convert ciao to a config panel of sorts. I want to base it on some of the options available here. Give me a few minutes.

john

1. Install zenity from the repo.
2. Paste the"code" into your favorite editor. Save it as, for example,"exit".

Code: Select all

#!/bin/sh

ans=$(zenity  --width=40 --height=240 --title="Exit" --list  --text"What Do You Want to Do?" --radiolist  --column"Select" --column"Action" TRUE Reconfigure FALSE Restart FALSE Logout FALSE Reboot FALSE Shutdown); #echo $ans
if ["$ans" ="Reconfigure" ] ; then
    kill -s USR2 'xprop -root _BLACKBOX_PID | awk '{print $3}''
fi
if ["$ans" ="Restart" ]; then
    kill -1 $(xprop -root _BLACKBOX_PID | awk '{print $3}')
fi
if ["$ans" ="Logout" ] ; then
    kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}')
fi
if ["$ans" ="Reboot" ]; then
    sudo reboot
#echo"kill"
fi
if ["$ans" ="Shutdown" ]; then
    sudo halt
#echo"again"
fi
3. Make it executable. I tried
chmod a+x /path/exit
but it didn't work.
4. Copy"exit" to /usr/bin as root.
5. Modify your menu.

Code: Select all

     [exec] (Exits) {exit}
Of course you can edit out the first two options - study the code and you'll figure it out. Let me know the proper way to make the file executable.

john

Thanks n2j3 - That was exactly the thread I was looking for!

NOTE: If you follow the above instructions but change 5 to
[exec] (Exits) {/usr/bin/exit}
then it will work. Now I need to try and make a control panel based on what I've done so far and of course tinyme.