You are not logged in.
How about a simple logout? I found this somewhere. It runs on yad.
#! /bin/bash
action=$(yad --width 300 --entry --title "System Logout" \
--image=gnome-shutdown \
--button="Switch User:2" \
--button="gtk-ok:0" --button="gtk-close:1" \
--text "Choose action:" \
--entry-text \
"Power Off" "Reboot" "Suspend" "Logout")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 2 ]]; then
gdmflexiserver --startnew &
exit 0
fi
case $action in
Power*) cmd="systemctl poweroff" ;;
Reboot*) cmd="systemctl reboot" ;;
Suspend*) cmd="ssystemctl suspend'" ;;
Logout*)
case $(wmctrl -m | grep Name) in
*Openbox) cmd="openbox --exit" ;;
*) exit 1 ;;
esac
;;
*) exit 1 ;;
esac
eval exec $cmd
Offline
I use this one in my Openbox system:
https://bbs.archlinux.org/viewtopic.php?id=200527
It's a bit more complicated but it looks very stylish
Offline
I use this one in my Openbox system:
https://bbs.archlinux.org/viewtopic.php?id=200527It's a bit more complicated but it looks very stylish
Offline
How about a simple logout? I found this somewhere. It runs on yad.
There are loads of scripts like this. Personally I would like to see something like it in BunsenLabs, instead of a python script, but ATM yad isn't in jessie yet.
Here is my version for Openbox (which can be used by those who don't like systemd commands) O:)
yad-exit
(PS @OP, you can use [ code ] tags instead of [ quote ] - it makes code MUCH easier to read )
BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator
Offline
ostrolk wrote:How about a simple logout? I found this somewhere. It runs on yad.
There are loads of scripts like this. Personally I would like to see something like it in BunsenLabs, instead of a python script, but ATM yad isn't in jessie yet.
Here is my version for Openbox (which can be used by those who don't like systemd commands) O:)
yad-exit(PS @OP, you can use [ code ] tags instead of [ quote ] - it makes code MUCH easier to read
)
I'll remember to use [ code ].
One can also use a simple pipe menu, so the exit options open right next to the menu.
You add the following to the menu.xml
<menu id="exit" label="Exit">
<item label="Logout">
<action name="Execute">
<command>openbox --exit</command>
</action>
</item>
<item label="Suspend">
<action name="Execute">
<command>systemctl suspend</command>
</action>
</item>
<item label="Reboot">
<action name="Execute">
<command>systemctl reboot</command>
</action>
</item>
<item label="Poweroff">
<action name="Execute">
<command>systemctl poweroff</command>
</action>
</item>
</menu>
Last edited by ostrołęk (2015-09-02 22:29:08)
Offline
One can also use a simple pipe menu, so the exit options open right next to the menu.....
Nice idea
(Although it isn't a pipemenu, but an ordinary static menu)
BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator
Offline
I use to use a very similar menu exit scheme - directly under [Hanger] - today I just use Debrief and a modified bl-exit script.
Love Linux - it's so breaktweak-able.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
I think corenominal might have been having fun playing with python when he wrote bl-exit, but it does the job well and the visual interface is simple enough isn't it?
The exit-submenu idea for menu.xml is also appealing though. It would do no harm to have both that and bl-exit (for a keyboard shortcut) available.
John
--------------------
( a boring Japan blog , Japan Links, idle twitterings and GitStuff )
#! forum moderator BunsenLabs
Offline
ostrolk wrote:One can also use a simple pipe menu, so the exit options open right next to the menu.....
Nice idea
(Although it isn't a pipemenu, but an ordinary static menu)
Yes, it is a static menu.
You don't have to run around the desktop for the next action, less wrist work. You are actually trying to get off the computer.
Offline
Python used to hate Unicode. What would it take to replace the button texts in bl-exit script with UTF-8 characters?
Offline
@ nore:
Note: When executing a Python script that contains Unicode characters, you must put the following line at the top of the script, to tell Python that the code is UTF-8/Unicode formatted.
# -*- coding: utf-8 -*-
Source: Python Unicode: Encode and Decode Strings (in Python 2.x)
And that already exists in bl-exit, the first 8 lines:
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
Go for it ...
#Logout button
self.logout = gtk.Button("_þûñĉĦ Øûŧ")
self.logout.set_border_width(4)
self.logout.connect("clicked", self.logout_action)
self.button_box.pack_start(self.logout)
self.logout.show()
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Offline
You're more than welcome. Looks nice - did you redo your OpenBox menu as well?
EDIT: It was either damo or johnraff that redid that so any thanks go in that direction.
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
^ i can see that it's "user friendly" to have a logout script like this, but personally i have no use to start up another ui toolkit just for that - 3 menu entries (in a submenu so they don't get pressed accidentally) are totally sufficient - like in post #5.
/rant:
it took me surprisingly long to find that out - not until i tried archbang, so it isn't even my "idea".
there seems to be some inbred operating system convention that logging out has to produce a screen-centered dialog...
Offline
Offline
there seems to be some inbred operating system convention that logging out has to produce a screen-centered dialog...
Switching power off by pressing the power button is enough for me, but I can see a reason for a double checking dialog. If you are an office worker in a corporate network, you don't want to lose 10 minutes of your life for rebooting just because you accidentally pressed the wrong button. "Configuring updates... Don't turn off your computer."
Offline
Switching power off by pressing the power button is enough for me ...
Depends on how far away from other keys the poweroff button is ]:D
On mac powerbook the poweroff button is just above backspace key. And I have had few accidents by inadvertently pressing 'power off' key instead of desired 'delete character'. I was
8.( 8.( 8o 8o
8o
Later on, I learned about '/etc/systemd/logind.conf' file containing 'HandlePowerKey=' line, and since then I am all
Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--
Offline
I started learning how to create with gtkdialog yesterday. This is the result;
http://s6.postimg.org/wm24xkgm5/Session_logout.jpg
or without icons;
http://s6.postimg.org/773m0t2jh/Logout.jpg
or without text.
http://s6.postimg.org/m4c31tfrx/Logout1.jpg
Nice. Care to share the code, please?
Postpone all your duties; if you die, you won't have to do them ..
--> The very new BL forum! <--
Offline
Simple logout "reboot / poweroff"
alias reboot="systemctl reboot"
alias poweroff="systemctl poweroff"
command: /reboot /poweroff or enough to make a shurtcut key.
Offline
alias reboot="systemctl reboot" alias poweroff="systemctl poweroff"
Very elegant
Personally, I symlink systemctl to /usr/bin/{poweroff,reboot} so I can use it in shortcuts & menus as a normal user without including /sbin in $PATH
Offline
Very elegant
Personally, I symlink systemctl to /usr/bin/{poweroff,reboot} so I can use it in shortcuts & menus as a normal user without including /sbin in $PATH
systemd plus coins
I do the same regarding shortcuts ]:D
Offline
ostrolk wrote:I started learning how to create with gtkdialog yesterday. This is the result;
http://s6.postimg.org/wm24xkgm5/Session_logout.jpg
or without icons;
http://s6.postimg.org/773m0t2jh/Logout.jpg
or without text.
http://s6.postimg.org/m4c31tfrx/Logout1.jpgNice. Care to share the code, please?
With icons;
#!/bin/bash
ICONS=/usr/share/pixmaps
export SessionLogout=$(cat <<End_of_Text
<window title="Choose an option" window-position="1" resizable="false">
<vbox width="60" height="60">
<frame>
<hbox space-expand="true">
<hbox>
<button>
<label>Logout</label>
<input file>"$ICONS/Logout.png"</input>
<action>openbox --exit</action>
</button>
</hbox>
<hbox>
<button>
<label>Suspend</label>
<input file>"$ICONS/Suspend.png"</input>
<action>systemctl --suspend</action>
</button>
</hbox>
<hbox>
<button>
<label>Reboot</label>
<input file>"$ICONS/Reboot.png"</input>
<action>systemctl --reboot</action>
</button>
</hbox>
<hbox>
<button>
<label>Poweroff</label>
<input file>"$ICONS/Shutdown.png"</input>
<action>systemctl --poweroff</action>
</button>
</hbox>
</hbox>
</frame>
<hbox>
<button>
<label>"Close"</label>
<action>EXIT:cancel</action>
</button>
</hbox>
</vbox>
</window>
End_of_Text
)
gtkdialog --program=SessionLogout
unset SessionLogout
Without icons,
#!/bin/bash
ICONS=/usr/share/pixmaps
export SessionLogout=$(cat <<End_of_Text
<window title="Choose an option" window-position="1" resizable="false">
<vbox width="60" height="60">
<frame>
<hbox space-expand="true">
<hbox>
<button>
<label>Logout</label>
<action>openbox --exit</action>
</button>
</hbox>
<hbox>
<button>
<label>Suspend</label>
<action>systemctl --suspend</action>
</button>
</hbox>
<hbox>
<button>
<label>Reboot</label>
<action>systemctl --reboot</action>
</button>
</hbox>
<hbox>
<button>
<label>Poweroff</label>
<action>systemctl --poweroff</action>
</button>
</hbox>
</hbox>
</frame>
<hbox>
<button>
<label>"Close"</label>
<action>EXIT:cancel</action>
</button>
</hbox>
</vbox>
</window>
End_of_Text
)
gtkdialog --program=SessionLogout
unset SessionLogout
From these two, you'd deduce how to have only icons without text.
You have to have gtkdialog installed for this to work.
Offline
^ I can't see any bashisms in those scripts (unless I've missed something) -- they would run quicker and consume fewer resources if you used a /bin/sh shebang (in Debian at least).
Offline
^ I can't see any bashisms in those scripts (unless I've missed something) -- they would run quicker and consume fewer resources if you used a /bin/sh shebang (in Debian at least).
Hmm...what shall I say?
No comment.
Offline
alias reboot="systemctl reboot" alias poweroff="systemctl poweroff"
I don't type so well:
### Terminal ShutDown ###
alias lot='kill -9 -1'
alias rbt='systemctl reboot'
alias off='systemctl poweroff'
First one is: "logout" and I figure if Windows can have a [Start] I can have an [off]
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat