aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarJulien Valroff <julien@kirya.net>2011-11-20 10:43:57 +0100
committerLibravatarJulien Valroff <julien@kirya.net>2011-11-20 10:43:57 +0100
commitd84edfdbb76cfa621cb125953fb7fbe345e08518 (patch)
treec6ff91653b33254dc4ea4564dfcf746ab7a10dd8
downloadoblogout-d84edfdbb76cfa621cb125953fb7fbe345e08518.tar.bz2
oblogout-d84edfdbb76cfa621cb125953fb7fbe345e08518.tar.xz
oblogout-d84edfdbb76cfa621cb125953fb7fbe345e08518.tar.zst
Imported Upstream version 0.3~bzr101upstream/0.3_bzr101upstream
-rw-r--r--LICENSE339
-rw-r--r--PKGBUILD32
-rw-r--r--README76
-rwxr-xr-xdata/oblogout101
-rw-r--r--data/oblogout.conf27
-rw-r--r--data/themes/oxygen/oblogout/cancel.pngbin0 -> 9460 bytes
-rw-r--r--data/themes/oxygen/oblogout/hibernate.pngbin0 -> 11364 bytes
-rw-r--r--data/themes/oxygen/oblogout/lock.pngbin0 -> 11555 bytes
-rw-r--r--data/themes/oxygen/oblogout/logout.pngbin0 -> 8988 bytes
-rw-r--r--data/themes/oxygen/oblogout/restart.pngbin0 -> 10726 bytes
-rw-r--r--data/themes/oxygen/oblogout/safesuspend.pngbin0 -> 11555 bytes
-rw-r--r--data/themes/oxygen/oblogout/shutdown.pngbin0 -> 11254 bytes
-rw-r--r--data/themes/oxygen/oblogout/suspend.pngbin0 -> 11724 bytes
-rw-r--r--data/themes/oxygen/oblogout/switch.pngbin0 -> 9788 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/cancel.pngbin0 -> 1445 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/hibernate.pngbin0 -> 1876 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/lock.pngbin0 -> 1166 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/logout.pngbin0 -> 1542 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/restart.pngbin0 -> 1828 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/shutdown.pngbin0 -> 1487 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/suspend.pngbin0 -> 777 bytes
-rw-r--r--data/themes/simplistic-small/oblogout/switch.pngbin0 -> 2206 bytes
-rw-r--r--data/themes/simplistic/oblogout/cancel.pngbin0 -> 1479 bytes
-rw-r--r--data/themes/simplistic/oblogout/hibernate.pngbin0 -> 3109 bytes
-rw-r--r--data/themes/simplistic/oblogout/lock.pngbin0 -> 1573 bytes
-rw-r--r--data/themes/simplistic/oblogout/logout.pngbin0 -> 2282 bytes
-rw-r--r--data/themes/simplistic/oblogout/restart.pngbin0 -> 2814 bytes
-rw-r--r--data/themes/simplistic/oblogout/shutdown.pngbin0 -> 2345 bytes
-rw-r--r--data/themes/simplistic/oblogout/suspend.pngbin0 -> 813 bytes
-rw-r--r--data/themes/simplistic/oblogout/switch.pngbin0 -> 3098 bytes
-rwxr-xr-xoblogout-dev.sh3
-rw-r--r--oblogout/__init__.py430
-rwxr-xr-xoblogout/dbushandler.py184
-rw-r--r--po/POTFILES.in2
-rw-r--r--po/de.po95
-rw-r--r--po/el.po88
-rw-r--r--po/en_GB.po88
-rw-r--r--po/fi.po88
-rw-r--r--po/fr.po90
-rw-r--r--po/he.po88
-rw-r--r--po/lv.po88
-rw-r--r--po/nb.po88
-rw-r--r--po/nl.po88
-rw-r--r--po/nn.po88
-rw-r--r--po/oblogout.pot87
-rw-r--r--po/pt.po88
-rw-r--r--po/pt_BR.po89
-rw-r--r--po/sv.po88
-rw-r--r--setup.cfg7
-rwxr-xr-xsetup.py39
-rwxr-xr-xtests/policykit-auth.py96
51 files changed, 2577 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..a70fb4f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+#Contributor : Andrew Williams <andy@tensixtyone.com.com>
+pkgname=oblogout
+pkgver=0.3
+pkgrel=1
+pkgdesc="OBLogout is a expandable, configurable, and theme-able logout script designed to be used in a Openbox desktop environment."
+url="http://launchpad.net/oblogout/"
+license=("GPL2")
+arch=('i686' 'x86_64')
+depends=('python>=2.5' 'dbus-python' 'pil' 'pygtk' )
+makedepends=('bzr setuptools python-distutils-extra')
+optdepends=('dbus-python' 'policykit' 'policykit-gnome' 'policykit-kde')
+provides=('oblogout')
+conflicts=('oblogout')
+
+_bzrbranch=http://bazaar.launchpad.net/~nikdoof/oblogout/0.3/
+
+build() {
+ cd ${srcdir}
+
+ if [ -d .bzr ]; then
+ bzr pull
+ else
+ bzr branch $_bzrbranch $pkgname
+ fi
+
+ msg "Bzr clone done or server timeout"
+
+ cd $pkgname
+ python setup.py install --root=$startdir/pkg
+
+}
+
diff --git a/README b/README
new file mode 100644
index 0000000..d1356c9
--- /dev/null
+++ b/README
@@ -0,0 +1,76 @@
+ Crunchbang Openbox Logout
+ - GTK/Cairo based logout box styled for Crunchbang
+
+ Andrew Williams <andy@tensixtyone.com>
+
+ Originally based on code by:
+ adcomp <david.madbox@gmail.com>
+ iggykoopa <etrombly@yahoo.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+######
+
+ INSTALLATION
+
+ - Run ./setup.py install
+ - Customise the config (/etc/oblogout.conf) as required
+
+######
+
+ RUN
+
+ - Run via the 'oblogout' command
+
+ - CAIRO RENDERING IS ONLY ENABLED FOR COMPOSITED SCREENS!
+ Rendered effects are used for ones without.
+
+######
+
+ CONFIGURATION OPTIONS
+
+ SETTINGS
+
+ - UseHal = true/false dictate if oblogout should use HAL for it's shutdown/suspend
+ functions.
+
+ LOOKS
+
+ - Opacity = Opacity percentage of Cario rendered backgrounds
+ - Bgcolor = Colour name or hex code (#ffffff) of the background color
+
+ - Buttontheme = Icon theme for the buttons, must be in the themes folder of the
+ package, or in ~/.themes/<name>/oblogout/
+ - Buttons = List and order of buttons to show
+
+ BUTTONS
+
+ - cancel = Cancel logout/shutdown
+ - restart = Restart
+ - shutdown = Shutdown
+ - suspend = Suspend
+ - hibernate = Hibernate
+ - safesuspend = Suspend/Hibernate mix, writes Hibernate file then suspends
+ - lock = Lock session
+ - switch = Switch user
+
+ SHORTCUTS
+
+ - For each button type, define a key to use. Case insenstive.
+
+ COMMANDS
+
+ - Same as the buttons, define a command per button type
+
diff --git a/data/oblogout b/data/oblogout
new file mode 100755
index 0000000..8058c4a
--- /dev/null
+++ b/data/oblogout
@@ -0,0 +1,101 @@
+#!/usr/bin/env python2.5
+
+# Crunchbang Openbox Logout
+# - GTK/Cairo based logout box styled for Crunchbang
+#
+# Andrew Williams <andy@tensixtyone.com>
+#
+# Originally based on code by:
+# adcomp <david.madbox@gmail.com>
+# iggykoopa <etrombly@yahoo.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import os
+import sys
+import getopt
+import logging
+import logging.handlers
+from oblogout import OpenboxLogout
+
+class Usage(Exception):
+ def __init__(self, msg):
+ self.msg = msg
+
+def main(argv = None):
+
+ # Start logger instace used by the OpenboxLogout class
+ logger = logging.getLogger()
+ logout = logging.StreamHandler(sys.stdout)
+ logout.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
+ logger.addHandler(logout)
+ logger.setLevel(logging.INFO)
+
+ verbose = None
+ config = None
+ local_mode = None
+
+ if argv is None:
+ argv = sys.argv
+
+ try:
+ try:
+ opts, args = getopt.getopt(argv[1:], "hvc:l", ["help", "verbose", "config=", "local"])
+ except getopt.error, msg:
+ raise Usage(msg)
+ # more code, unchanged
+ except Usage, err:
+ logger.error(err.msg)
+ logger.error("for help use --help")
+ return 2
+
+ for o, a in opts:
+ if o in ("-h", "--help"):
+ print __doc__
+ return 0
+ elif o in ("-v", "--verbose"):
+ verbose = True
+ elif o in ("-c", "--config"):
+ config = a
+ elif o in ("-l", "--local"):
+ local_mode = True
+
+ if not config:
+ if local_mode:
+ config = 'data/oblogout.conf'
+ elif os.path.isfile('%s/.config/oblogout.conf' % os.getenv("HOME")):
+ config = '%s/.config/oblogout.conf' % os.getenv("HOME")
+ else:
+ config = '/etc/oblogout.conf'
+
+ # Check config in local path, if it exists pass it on
+ if not os.path.isfile(config):
+ logger.error("Invalid config file: %s" % config)
+ return 1
+ else:
+ logger.info("Using config file %s" % config)
+
+ # If debug mode is enabled, output debug messages
+ if verbose:
+ logger.setLevel(logging.DEBUG)
+
+ # Start the application
+ app = OpenboxLogout(config, local_mode)
+ app.run_logout()
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
+
diff --git a/data/oblogout.conf b/data/oblogout.conf
new file mode 100644
index 0000000..810872c
--- /dev/null
+++ b/data/oblogout.conf
@@ -0,0 +1,27 @@
+[settings]
+usehal = true
+
+[looks]
+opacity = 70
+bgcolor = black
+buttontheme = simplistic
+buttons = cancel, logout, restart, shutdown, suspend, lock
+
+[shortcuts]
+cancel = Escape
+shutdown = S
+restart = R
+suspend = U
+logout = L
+lock = K
+hibernate = H
+
+[commands]
+shutdown = shutdown -h now
+restart = reboot
+suspend = pmi action suspend
+hibernate = pmi action hibernate
+safesuspend = safesuspend
+lock = gnome-screensaver-command -l
+switchuser = gdm-control --switch-user
+logout = openbox --exit
diff --git a/data/themes/oxygen/oblogout/cancel.png b/data/themes/oxygen/oblogout/cancel.png
new file mode 100644
index 0000000..ede9c12
--- /dev/null
+++ b/data/themes/oxygen/oblogout/cancel.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/hibernate.png b/data/themes/oxygen/oblogout/hibernate.png
new file mode 100644
index 0000000..e852fae
--- /dev/null
+++ b/data/themes/oxygen/oblogout/hibernate.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/lock.png b/data/themes/oxygen/oblogout/lock.png
new file mode 100644
index 0000000..27d8596
--- /dev/null
+++ b/data/themes/oxygen/oblogout/lock.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/logout.png b/data/themes/oxygen/oblogout/logout.png
new file mode 100644
index 0000000..7807e7c
--- /dev/null
+++ b/data/themes/oxygen/oblogout/logout.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/restart.png b/data/themes/oxygen/oblogout/restart.png
new file mode 100644
index 0000000..d84366b
--- /dev/null
+++ b/data/themes/oxygen/oblogout/restart.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/safesuspend.png b/data/themes/oxygen/oblogout/safesuspend.png
new file mode 100644
index 0000000..27d8596
--- /dev/null
+++ b/data/themes/oxygen/oblogout/safesuspend.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/shutdown.png b/data/themes/oxygen/oblogout/shutdown.png
new file mode 100644
index 0000000..2196355
--- /dev/null
+++ b/data/themes/oxygen/oblogout/shutdown.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/suspend.png b/data/themes/oxygen/oblogout/suspend.png
new file mode 100644
index 0000000..272a11e
--- /dev/null
+++ b/data/themes/oxygen/oblogout/suspend.png
Binary files differ
diff --git a/data/themes/oxygen/oblogout/switch.png b/data/themes/oxygen/oblogout/switch.png
new file mode 100644
index 0000000..67af195
--- /dev/null
+++ b/data/themes/oxygen/oblogout/switch.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/cancel.png b/data/themes/simplistic-small/oblogout/cancel.png
new file mode 100644
index 0000000..d8963e7
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/cancel.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/hibernate.png b/data/themes/simplistic-small/oblogout/hibernate.png
new file mode 100644
index 0000000..17cc3a2
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/hibernate.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/lock.png b/data/themes/simplistic-small/oblogout/lock.png
new file mode 100644
index 0000000..2919b99
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/lock.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/logout.png b/data/themes/simplistic-small/oblogout/logout.png
new file mode 100644
index 0000000..47f6f5a
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/logout.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/restart.png b/data/themes/simplistic-small/oblogout/restart.png
new file mode 100644
index 0000000..1cbb7ca
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/restart.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/shutdown.png b/data/themes/simplistic-small/oblogout/shutdown.png
new file mode 100644
index 0000000..6250237
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/shutdown.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/suspend.png b/data/themes/simplistic-small/oblogout/suspend.png
new file mode 100644
index 0000000..72de73e
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/suspend.png
Binary files differ
diff --git a/data/themes/simplistic-small/oblogout/switch.png b/data/themes/simplistic-small/oblogout/switch.png
new file mode 100644
index 0000000..cdcbcd6
--- /dev/null
+++ b/data/themes/simplistic-small/oblogout/switch.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/cancel.png b/data/themes/simplistic/oblogout/cancel.png
new file mode 100644
index 0000000..aab00bf
--- /dev/null
+++ b/data/themes/simplistic/oblogout/cancel.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/hibernate.png b/data/themes/simplistic/oblogout/hibernate.png
new file mode 100644
index 0000000..eaa2897
--- /dev/null
+++ b/data/themes/simplistic/oblogout/hibernate.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/lock.png b/data/themes/simplistic/oblogout/lock.png
new file mode 100644
index 0000000..590bf0f
--- /dev/null
+++ b/data/themes/simplistic/oblogout/lock.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/logout.png b/data/themes/simplistic/oblogout/logout.png
new file mode 100644
index 0000000..b050d69
--- /dev/null
+++ b/data/themes/simplistic/oblogout/logout.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/restart.png b/data/themes/simplistic/oblogout/restart.png
new file mode 100644
index 0000000..df8d692
--- /dev/null
+++ b/data/themes/simplistic/oblogout/restart.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/shutdown.png b/data/themes/simplistic/oblogout/shutdown.png
new file mode 100644
index 0000000..49cad61
--- /dev/null
+++ b/data/themes/simplistic/oblogout/shutdown.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/suspend.png b/data/themes/simplistic/oblogout/suspend.png
new file mode 100644
index 0000000..e388c73
--- /dev/null
+++ b/data/themes/simplistic/oblogout/suspend.png
Binary files differ
diff --git a/data/themes/simplistic/oblogout/switch.png b/data/themes/simplistic/oblogout/switch.png
new file mode 100644
index 0000000..2228e29
--- /dev/null
+++ b/data/themes/simplistic/oblogout/switch.png
Binary files differ
diff --git a/oblogout-dev.sh b/oblogout-dev.sh
new file mode 100755
index 0000000..5ec6f54
--- /dev/null
+++ b/oblogout-dev.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+OBLOGOUT_PATH=`dirname $0`
+PYTHONPATH="$PYTHONPATH:$OBLOGOUT_PATH" python $OBLOGOUT_PATH/data/oblogout -l -v $*
diff --git a/oblogout/__init__.py b/oblogout/__init__.py
new file mode 100644
index 0000000..b9e4e01
--- /dev/null
+++ b/oblogout/__init__.py
@@ -0,0 +1,430 @@
+#!/usr/bin/env python
+
+# Crunchbang Openbox Logout
+# - GTK/Cairo based logout box styled for Crunchbang
+#
+# Andrew Williams <andy@tensixtyone.com>
+#
+# Originally based on code by:
+# adcomp <david.madbox@gmail.com>
+# iggykoopa <etrombly@yahoo.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import os
+import sys
+import ConfigParser
+import StringIO
+import logging
+import gettext
+import string
+
+import pygtk
+pygtk.require('2.0')
+
+try:
+ import gtk
+except:
+ print "pyGTK missing, install python-gtk2"
+ sys.exit()
+
+try:
+ import cairo
+except:
+ print "Cairo modules missing, install python-cairo"
+
+try:
+ from PIL import Image, ImageFilter
+except:
+ print "PIL missing, install python-imaging"
+ sys.exit()
+
+class OpenboxLogout():
+
+ cmd_shutdown = "shutdown -h now"
+ cmd_restart = "reboot"
+ cmd_suspend = "pmi action suspend"
+ cmd_hibernate = "pmi action hibernate"
+ cmd_safesuspend = ""
+ cmd_lock = "gnome-screensaver-command -l"
+ cmd_switch = "gdm-control --switch-user"
+ cmd_logout = "openbox --exit"
+
+ def __init__(self, config=None, local=None):
+
+ if local:
+ self.local_mode = True
+ else:
+ self.local_mode = False
+
+ # Start logger and gettext/i18n
+ self.logger = logging.getLogger(self.__class__.__name__)
+
+ if self.local_mode:
+ gettext.install('oblogout', 'mo', unicode=1)
+ else:
+ gettext.install('oblogout', '%s/share/locale' % sys.prefix, unicode=1)
+
+ # Load configuration file
+ self.load_config(config)
+
+ # Start the window
+ self.__init_window()
+
+ def __init_window(self):
+ # Start pyGTK setup
+ self.window = gtk.Window()
+ self.window.set_title(_("Openbox Logout"))
+
+ self.window.connect("destroy", self.quit)
+ self.window.connect("key-press-event", self.on_keypress)
+ self.window.connect("window-state-event", self.on_window_state_change)
+
+ if not self.window.is_composited():
+ self.logger.debug("No compositing, enabling rendered effects")
+ # Window isn't composited, enable rendered effects
+ self.rendered_effects = True
+ else:
+ # Link in Cairo rendering events
+ self.window.connect('expose-event', self.on_expose)
+ self.window.connect('screen-changed', self.on_screen_changed)
+ self.on_screen_changed(self.window)
+ self.rendered_effects = False
+
+ self.window.set_size_request(620,200)
+ self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
+
+ self.window.set_decorated(False)
+ self.window.set_position(gtk.WIN_POS_CENTER)
+
+ # Create the main panel box
+ self.mainpanel = gtk.HBox()
+
+ # Create the button box
+ self.buttonpanel = gtk.HButtonBox()
+ self.buttonpanel.set_spacing(10)
+
+ # Pack in the button box into the panel box, with two padder boxes
+ self.mainpanel.pack_start(gtk.VBox())
+ self.mainpanel.pack_start(self.buttonpanel, False, False)
+ self.mainpanel.pack_start(gtk.VBox())
+
+ # Add the main panel to the window
+ self.window.add(self.mainpanel)
+
+ for button in self.button_list:
+ self.__add_button(button, self.buttonpanel)
+
+ if self.rendered_effects == True:
+ self.logger.debug("Stepping though render path")
+ w = gtk.gdk.get_default_root_window()
+ sz = w.get_size()
+ pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])
+ pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])
+
+ self.logger.debug("Rendering Fade")
+ # Convert Pixbuf to PIL Image
+ wh = (pb.get_width(),pb.get_height())
+ pilimg = Image.fromstring("RGB", wh, pb.get_pixels())
+
+ pilimg = pilimg.point(lambda p: (p * self.opacity) / 255 )
+
+ # "Convert" the PIL to Pixbuf via PixbufLoader
+ buf = StringIO.StringIO()
+ pilimg.save(buf, "ppm")
+ del pilimg
+ loader = gtk.gdk.PixbufLoader("pnm")
+ loader.write(buf.getvalue())
+ pixbuf = loader.get_pixbuf()
+
+ # Cleanup IO
+ buf.close()
+ loader.close()
+
+ pixmap, mask = pixbuf.render_pixmap_and_mask()
+ # width, height = pixmap.get_size()
+ else:
+ pixmap = None
+
+ self.window.set_app_paintable(True)
+ self.window.resize(gtk.gdk.screen_width(), gtk.gdk.screen_height())
+ self.window.realize()
+
+ if pixmap:
+ self.window.window.set_back_pixmap(pixmap, False)
+ self.window.move(0,0)
+
+
+ def load_config(self, config):
+ """ Load the configuration file and parse entries, when encountering a issue
+ change safe defaults """
+
+ self.parser = ConfigParser.SafeConfigParser()
+ self.parser.read(config)
+
+ # Set some safe defaults
+ self.opacity = 50
+ self.button_theme = "default"
+ self.bgcolor = gtk.gdk.color_parse("black")
+ blist = ""
+
+ # Check if we're using HAL, and init it as required.
+ if self.parser.has_section("settings"):
+
+ if self.parser.has_option("settings","usehal"):
+ self.usehal = self.parser.getboolean("settings","usehal")
+ else:
+ self.usehal = True
+
+ if self.usehal:
+ from dbushandler import DbusController
+ self.dbus = DbusController()
+
+ # Check the looks section and load the config as required
+ if self.parser.has_section("looks"):
+
+ if self.parser.has_option("looks", "opacity"):
+ self.opacity = self.parser.getint("looks", "opacity")
+
+ if self.parser.has_option("looks","buttontheme"):
+ self.button_theme = self.parser.get("looks", "buttontheme")
+
+ if self.parser.has_option("looks", "bgcolor"):
+ try:
+ self.bgcolor = gtk.gdk.color_parse(self.parser.get("looks", "bgcolor"))
+ except:
+ self.logger.warning(_("Color %s is not a valid color, defaulting to black") % self.parser.get("looks", "bgcolor"))
+ self.bgcolor = gtk.gdk.color_parse("black")
+
+ if self.parser.has_option("looks", "opacity"):
+ blist = self.parser.get("looks", "buttons")
+
+ # Parse shortcuts section and load them into a array for later reference.
+ if self.parser.has_section("shortcuts"):
+ self.shortcut_keys = self.parser.items("shortcuts")
+ self.logger.debug("Shortcut Options: %s" % self.shortcut_keys)
+
+
+ # Parse in commands section of the configuration file. Check for valid keys and set the attribs on self
+ if self.parser.has_section("commands"):
+ for key in self.parser.items("commands"):
+ if key[0] in ['logout', 'restart', 'shutdown', 'suspend', 'hibernate', 'safesuspend', 'lock', 'switch']:
+ if key[1]:
+ self.logger.debug("Setting cmd_%s as %s" % (key[0], key[1]))
+ setattr(self, "cmd_" + key[0], key[1])
+
+ # Load theme information from local directory if local mode is set
+ if self.local_mode:
+ self.theme_prefix = "./data/themes"
+ else:
+ self.theme_prefix = "%s/share/themes" % sys.prefix
+
+ self.img_path = "%s/%s/oblogout" % (self.theme_prefix, self.button_theme)
+
+ if os.path.exists("%s/.themes/%s/oblogout" % (os.environ['HOME'], self.button_theme)):
+ # Found a valid theme folder in the userdir, use that
+ self.img_path = "%s/.themes/%s/oblogout" % (os.environ['HOME'], self.button_theme)
+ self.logger.info("Using user theme at %s" % self.img_path)
+ else:
+ if not os.path.exists("%s/%s/oblogout" % (self.theme_prefix, self.button_theme)):
+ self.logger.warning("Button theme %s not found, reverting to default" % self.button_theme)
+ self.button_theme = 'foom'
+
+
+ # Parse button list from config file.
+ validbuttons = ['cancel', 'logout', 'restart', 'shutdown', 'suspend', 'hibernate', 'safesuspend', 'lock', 'switch']
+ buttonname = [_('cancel'), _('logout'), _('restart'), _('shutdown'), _('suspend'), _('hibernate'), _('safesuspend'), _('lock'), _('switch')]
+
+ if not blist:
+ list = validbuttons
+ elif blist == "default":
+ list = validbuttons
+ else:
+ list = map(lambda button: string.strip(button), blist.split(","))
+
+ # Validate the button list
+ for button in list:
+ self.logger.debug(_("Validating button: %s" % button))
+ if not button in validbuttons:
+ self.logger.warning(_("Button %s is not a valid button name, removing") % button)
+ list.remove(button)
+ else:
+ if self.usehal and button in ['restart', 'shutdown', 'suspend', 'hibernate', 'safesuspend']:
+ if not self.dbus.check_ability(button):
+ self.logger.warning(_("Can't %s, disabling button" % button))
+ list.remove(button)
+ else:
+ if button != "cancel":
+ try:
+ self.logger.debug(_("Cmd Value for %s: %s" % (button, getattr(self, "cmd_" + button))))
+ if getattr(self, "cmd_" + button) == "None":
+ self.logger.warning(_("Command for button %s is undefined, removing." % button))
+ list.remove(button)
+ except:
+ self.logger.warning(_("Command for button %s is undefined, removing." % button))
+ list.remove(button)
+
+ if len(list) == 0:
+ self.logger.warning(_("No valid buttons found, resetting to defaults"))
+ self.button_list = validbuttons
+ else:
+ self.logger.debug("Validated Button List: %s" % list)
+ self.button_list = list
+
+
+ def on_expose(self, widget, event):
+
+ cr = widget.window.cairo_create()
+
+ if self.supports_alpha == True:
+ cr.set_source_rgba(1.0, 1.0, 1.0, 0.0) # Transparent
+ else:
+ cr.set_source_rgb(1.0, 1.0, 1.0) # Opaque white
+
+ # Draw the background
+ cr.set_operator(cairo.OPERATOR_SOURCE)
+ cr.paint()
+
+ (width, height) = widget.get_size()
+ cr.set_source_rgba(self.bgcolor.red, self.bgcolor.green, self.bgcolor.blue, float(self.opacity)/100)
+
+ cr.rectangle(0, 0, width, height)
+ cr.fill()
+ cr.stroke()
+ return False
+
+ def on_screen_changed(self, widget, old_screen=None):
+
+ # To check if the display supports alpha channels, get the colormap
+ screen = widget.get_screen()
+ colormap = screen.get_rgba_colormap()
+ if colormap == None:
+ self.logger.debug("Screen does not support alpha channels!")
+ colormap = screen.get_rgb_colormap()
+ self.supports_alpha = False
+ else:
+ self.logger.debug("Screen supports alpha channels!")
+ self.supports_alpha = True
+
+ # Now we have a colormap appropriate for the screen, use it
+ widget.set_colormap(colormap)
+
+ def on_window_state_change(self, widget, event, *args):
+ if event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN:
+ self.window_in_fullscreen = True
+ else:
+ self.window_in_fullscreen = False
+
+ def __add_button(self, name, widget):
+ """ Add a button to the panel """
+
+ box = gtk.VBox()
+
+ image = gtk.Image()
+ if os.path.exists("%s/%s.svg" % (self.img_path, name)):
+ image.set_from_file("%s/%s.svg" % (self.img_path, name))
+ else:
+ image.set_from_file("%s/%s.png" % (self.img_path, name))
+ image.show()
+
+ button = gtk.Button()
+ button.set_relief(gtk.RELIEF_NONE)
+ button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
+ button.set_focus_on_click(False)
+ button.set_border_width(0)
+ button.set_property('can-focus', False)
+ button.add(image)
+ button.show()
+ box.pack_start(button, False, False)
+ button.connect("clicked", self.click_button, name)
+
+ label = gtk.Label(_(name))
+ label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+ box.pack_end(label, False, False)
+
+ widget.pack_start(box, False, False)
+
+ def click_button(self, widget, data=None):
+ if (data == 'logout'):
+ self.__exec_cmd(self.cmd_logout)
+
+ elif (data == 'restart'):
+ if self.usehal:
+ self.dbus.restart()
+ else:
+ self.__exec_cmd(self.cmd_restart)
+
+ elif (data == 'shutdown'):
+ if self.usehal:
+ self.dbus.shutdown()
+ else:
+ self.__exec_cmd(self.cmd_shutdown)
+
+ elif (data == 'suspend'):
+ self.window.hide()
+ self.__lock_screen()
+ if self.usehal:
+ self.dbus.suspend()
+
+ else:
+ self.__exec_cmd(self.cmd_suspend)
+
+ elif (data == 'hibernate'):
+ self.window.hide()
+ self.__lock_screen()
+ if self.usehal:
+ self.dbus.hibernate()
+ else:
+ self.__exec_cmd(self.cmd_hibernate)
+
+ elif (data == 'safesuspend'):
+ self.window.hide()
+
+ if self.usehal:
+ self.dbus.safesuspend()
+ else:
+ self.__exec_cmd(self.cmd_safesuspend)
+
+ elif (data == 'lock'):
+ self.__lock_screen()
+
+ elif (data == 'switch'):
+ self.__exec_cmd(self.cmd_switch)
+
+ self.quit()
+
+ def on_keypress(self, widget=None, event=None, data=None):
+ self.logger.debug("Keypress: %s/%s" % (event.keyval, gtk.gdk.keyval_name(event.keyval)))
+ for key in self.shortcut_keys:
+ if event.keyval == gtk.gdk.keyval_to_lower(gtk.gdk.keyval_from_name(key[1])):
+ self.logger.debug("Matched %s" % key[0])
+ self.click_button(widget, key[0])
+
+ def __lock_screen(self):
+ if self.cmd_lock:
+ self.__exec_cmd(self.cmd_lock)
+
+ def __exec_cmd(self, cmdline):
+ self.logger.debug("Executing command: %s", cmdline)
+ os.system(cmdline)
+
+ def quit(self, widget=None, data=None):
+ gtk.main_quit()
+
+ def run_logout(self):
+ self.window.show_all()
+ gtk.main()
+
diff --git a/oblogout/dbushandler.py b/oblogout/dbushandler.py
new file mode 100755
index 0000000..eebcac3
--- /dev/null
+++ b/oblogout/dbushandler.py
@@ -0,0 +1,184 @@
+#!/usr/bin/env python
+
+# Crunchbang Openbox Logout
+# - GTK/Cairo based logout box styled for Crunchbang
+#
+# Andrew Williams <andy@tensixtyone.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import logging
+import os
+import dbus
+
+class DbusController (object):
+
+ """ DbusController handles all DBus actions required by OBLogout and acts
+ as a middle layer between the application and Dbus"""
+
+ @property
+ def _sysbus (self):
+ """System DBus"""
+ if not hasattr (DbusController, "__sysbus"):
+ DbusController.__sysbus = dbus.SystemBus ()
+ return DbusController.__sysbus
+
+ @property
+ def _sessbus (self):
+ """Session DBus"""
+ if not hasattr (DbusController, "__sessbus"):
+ DbusController.__sessbus = dbus.SessionBus ()
+ return DbusController.__sessbus
+
+ @property
+ def _polkit (self):
+ """PolicyKit object"""
+ if not hasattr (DbusController, "__polkit"):
+ pk = self._sysbus.get_object ("org.freedesktop.PolicyKit", "/")
+ DbusController.__polkit = dbus.Interface(pk, 'org.freedesktop.PolicyKit')
+ return DbusController.__polkit
+
+ @property
+ def _halpm (self):
+ """HAL controller object"""
+ if not hasattr (DbusController, "__halpm"):
+ hal = self._sysbus.get_object ("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer")
+ DbusController.__halpm = dbus.Interface(hal, "org.freedesktop.Hal.Device.SystemPowerManagement")
+ return DbusController.__halpm
+
+ @property
+ def _authagent (self):
+ """AuthenticationAgent object"""
+ if not hasattr (DbusController, "__authagent"):
+ autha = self._sessbus.get_object ("org.freedesktop.PolicyKit.AuthenticationAgent", "/", "org.gnome.PolicyKit.AuthorizationManager.SingleInstance")
+ DbusController.__authagent = dbus.Interface(autha,'org.freedesktop.PolicyKit.AuthenticationAgent')
+
+ return DbusController.__authagent
+
+ def __init__(self):
+ self.logger = logging.getLogger(self.__class__.__name__)
+
+ def __check_perms(self, id):
+ """ Check if we have permissions for a action """
+
+ self.logger.debug('Checking permissions for %s' % id)
+
+ #try:
+ res = self._polkit.IsProcessAuthorized(id, os.getpid(), False)
+ #except:
+ # return False
+
+ if res == "yes":
+ self.logger.debug("Authorised to use %s, res = %s" % (id, res))
+ return True
+ else:
+ self.logger.debug("Not authorised to use, requires %s" % res)
+ return False
+
+ def __auth_perms(self, id):
+ """ Check if we have permissions for a action, if not, try to obtain them via PolicyKit """
+
+ if self.__check_perms(id):
+ return True
+ else:
+
+ self.logger.debug('Attempting to obtain %s' % id)
+ grant = self._authagent.ObtainAuthorization(id, 0, os.getpid(), timeout=300, dbus_interface = "org.freedesktop.PolicyKit.AuthenticationAgent")
+ self.logger.debug("Result: %s" % bool(grant))
+
+ return self.__check_perms(id)
+ #return bool(grant)
+
+ def __get_sessions(self):
+ """ Using DBus and ConsoleKit, get the number of sessions. This is used by PolicyKit to dictate the
+ multiple sessions permissions for the various reboot/shutdown commands """
+
+ # Check the number of active sessions
+ manager_obj = dbus.SystemBus().get_object ('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Manager')
+ manager = dbus.Interface (manager_obj, 'org.freedesktop.ConsoleKit.Manager')
+
+ cnt = 0
+ seats = manager.GetSeats ()
+ for sid in seats:
+ seat_obj = dbus.SystemBus().get_object ('org.freedesktop.ConsoleKit', sid)
+ seat = dbus.Interface (seat_obj, 'org.freedesktop.ConsoleKit.Seat')
+ cnt += len(seat.GetSessions())
+
+ return cnt
+
+
+ def check_ability(self, action):
+ """Check if HAL can complete action type requests, for example, suspend, hiberate, and safesuspend"""
+
+ if action == 'suspend':
+ return self._halpm.CanSuspend
+ elif action == 'hibernate':
+ return self._halpm.CanHibernate
+ elif action == 'safesuspend':
+ if not self._halpm.CanHibernate or not pm.CanSuspend:
+ return False
+
+ return True
+
+ def restart(self):
+ """Restart the system via HAL, if we do not have permissions to do so obtain them via PolicyKit"""
+
+ if self.__get_sessions() > 1:
+ if not self.__auth_perms("org.freedesktop.hal.power-management.reboot-multiple-sessions"):
+ return False
+ else:
+ if not self.__auth_perms("org.freedesktop.hal.power-management.reboot"):
+ return False
+
+ self.logger.debug("Rebooting...")
+ return self._halpm.Reboot()
+
+ def shutdown(self):
+ """Shutdown the system via HAL, if we do not have permissions to do so obtain them via PolicyKit"""
+
+ if self.__get_sessions() > 1:
+ if not self.__auth_perms("org.freedesktop.hal.power-management.shutdown-multiple-sessions"):
+ return False
+ else:
+ if not self.__auth_perms("org.freedesktop.hal.power-management.shutdown"):
+ return False
+
+ return self._halpm.Shutdown()
+
+ def suspend(self):
+ if not self.__auth_perms("org.freedesktop.hal.power-management.suspend"):
+ return False
+ else:
+ return self._halpm.Suspend()
+
+ def hibernate(self):
+ if not self.__auth_perms("org.freedesktop.hal.power-management.hibernate"):
+ return False
+ else:
+ return self._halpm.Hibernate()
+
+ def safesuspend(self):
+ pass
+
+if __name__ == "__main__":
+
+ logging.basicConfig(level=logging.DEBUG)
+
+ t = DbusController()
+ print t.restart()
+
+
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..a34ab15
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,2 @@
+oblogout/__init__.py
+data/oblogout
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..2f9820c
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,95 @@
+# German translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-02-01 02:27+0000\n"
+"Last-Translator: Zaxxon <Unknown>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Logout"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr ""
+"Der Modulpfad konnte nicht gefunden werden. Vorgang wird abgebrochen..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr ""
+"Die Farbe %s ist keine gültige Farbe. Verwende die Standardfarbe schwarz"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Abbrechen"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "Ausloggen"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "Neustart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "Herunterfahren"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "Stromsparmodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "Ruhemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Gesicherter Ruhemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "sperren"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "wechseln"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "%s ist keine gültige Beschriftung, entferne die Beschriftung"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr ""
+"Kann nicht in den \"Suspend\"-Modus wechseln, diese Funktion wird deaktiviert"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Hibernate ist nicht möglich, diese Funktion wird deaktiviert"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr ""
+"Kann nicht in den \"Safe Suspend\"-Modus wechseln, diese Funktion wird "
+"deaktiviert."
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr ""
+"Es wurden keine gültigen Schaltflächen gefunden, setze die Einstellung auf "
+"den Standardwert zurück"
diff --git a/po/el.po b/po/el.po
new file mode 100644
index 0000000..48881a9
--- /dev/null
+++ b/po/el.po
@@ -0,0 +1,88 @@
+# Greek translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-31 05:06+0000\n"
+"Last-Translator: Xaos <Unknown>\n"
+"Language-Team: Greek <el@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Αποσύνδεση"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Αδύνατον να εντοπιστεί η διεύθυνση της ενότητας. Αποσύνδεση..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Το χρώμα %s δεν είναι έγκυρο χρώμα, επαναφορά σε μαύρο"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Άκυρο"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "Αποσύνδεση"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "Επανεκκίνηση"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "Τερματισμός"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "Αναστολή"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "Αδρανοποίηση"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Ασφαλής Αναστολή"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "Κλείδωμα"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "Αλλαγή"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Η επιλογή %s δεν είναι έγκυρη επιλογή, διαγραφή επιλογής"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Αδύνατο να γίνει Αναστολή, Απενεργοποίηση επιλογής"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Αδύνατο να γίνει Αδρανοποίηση, Απενεργοποίση επιλογής"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Αδύνατο να γίνει Αναστολή, Απενεργοποίση επιλογής"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Δεν υπάρχουν έγκυρες επιλογές, επαναφορά στις προεπιλογές"
diff --git a/po/en_GB.po b/po/en_GB.po
new file mode 100644
index 0000000..5fc2607
--- /dev/null
+++ b/po/en_GB.po
@@ -0,0 +1,88 @@
+# English (United Kingdom) translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 12:52+0000\n"
+"Last-Translator: Andrew Williams <andy@tensixtyone.com>\n"
+"Language-Team: English (United Kingdom) <en_GB@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Logout"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Unable to determine the module path, Exiting."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Color %s is not a valid color, Defaulting to black."
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Cancel"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "Log-out"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "Restart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "Shutdown"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "Suspend"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "Hibernate"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Safe Suspend"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "Lock"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "Switch"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Button %s is not a valid button name, Removing."
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Can't Suspend, Disabling button."
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Can't Hibernate, Disabling button."
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Can't Safe Suspend, Disabling button."
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "No valid buttons found, Resetting to defaults."
diff --git a/po/fi.po b/po/fi.po
new file mode 100644
index 0000000..5bee6dc
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,88 @@
+# Finnish translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 18:28+0000\n"
+"Last-Translator: Hanna Pietikäinen <hannapie@online.de>\n"
+"Language-Team: Finnish <fi@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Uloskirjautuminen"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr ""
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Peruuta"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "Kirjaudu ulos"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "Uudelleenkäynnistä"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "Sammuta"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "Keskeytys"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "Lepotila"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Turvakeskeystys"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "Lukitse"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "Vaihda"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr ""
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..1a5618c
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,90 @@
+# French translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 16:35+0000\n"
+"Last-Translator: Benjamin Bouvier <Unknown>\n"
+"Language-Team: French <fr@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "OpenBox Déconnexion"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Impossible de déterminer le chemin du module, arrêt..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "La couleur %s n'est pas valide, la couleur par défaut est noir"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Annuler"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "Déconnexion"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "Redémarrer"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "Arrêt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "Mise en veille"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "Mise en hibernation"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Mise en veille prolongée de manière sécurisée"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "Verrouiller"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "Changer d'utilisateur"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Le nom du bouton %s n'est pas valide, suppression"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Impossible de mettre en veille, désactivation du bouton"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Impossible de mettre en hibernation, désactivation du bouton"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr ""
+"Impossible de mettre en veille prolongée de manière sécurisée, désactivation "
+"du bouton"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Aucun bouton valide trouvé, réinitialisation des valeurs par défaut"
diff --git a/po/he.po b/po/he.po
new file mode 100644
index 0000000..b76672e
--- /dev/null
+++ b/po/he.po
@@ -0,0 +1,88 @@
+# Hebrew translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 14:56+0000\n"
+"Last-Translator: Alon Horn <salonh@t2.technion.ac.il>\n"
+"Language-Team: Hebrew <he@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "יציאה מ Openbox"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "לא מצליח לקבוע את הנתיב למודול. יוצא..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "הצבע %s אינו חוקי. משתמש בברירת המחדל שחור."
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "ביטול"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "התנתק"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "הפעלה מחדש"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "כיבוי"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "המתנה"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "מצב שינה"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "השהיה בטוחה"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "נעילה"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "החלף"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "הכפתור %s אינו חוקי. מסיר."
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "לא יכול לעבור למצב השהיה. מכבה את הכפתור."
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "לא יכול לעבור למצב שינה. מכבה את הכפתור."
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "לא יכול לעבור למצב השהיה בטוחה. מכבה את הכפתור."
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "לא נמצאו כפתורים חוקיים. מאתחל לברירות המחדל."
diff --git a/po/lv.po b/po/lv.po
new file mode 100644
index 0000000..a8aa535
--- /dev/null
+++ b/po/lv.po
@@ -0,0 +1,88 @@
+# Latvian translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-31 23:13+0000\n"
+"Last-Translator: Kristaps <retail@inbox.lv>\n"
+"Language-Team: Latvian <lv@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr ""
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "%s krāsa nav atļauta, pārstāda uz melnu"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "atcelt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "atteikties"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "pārstartēt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "izslēgt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "slēgt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "pārslēgt"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr ""
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr ""
diff --git a/po/nb.po b/po/nb.po
new file mode 100644
index 0000000..746ee4b
--- /dev/null
+++ b/po/nb.po
@@ -0,0 +1,88 @@
+# Norwegian Bokmal translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-27 07:07+0000\n"
+"Last-Translator: papparonny <ronny@olufsen.org>\n"
+"Language-Team: Norwegian Bokmal <nb@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Logout"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Fant ikke stien til modulen, avslutter..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Farge %s er ikke en gyldig farge, bruker svart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "avbryt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "logg ut"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "omstart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "slå av"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "hvilemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "dvalemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "trygg hvile"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "lås"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "bytt"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Knapp %s er ikke et gyldig knappenavn, fjerner"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Hvile umulig, utelukker knapp"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Kan ikke gå i dvale, utelukker knapp"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Trygg hvile umulig, utelukker knapp"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Ingen gyldige knapper funnet, bruker standard"
diff --git a/po/nl.po b/po/nl.po
new file mode 100644
index 0000000..37bc7d3
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,88 @@
+# Dutch translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 16:43+0000\n"
+"Last-Translator: Sheri Richardson <19eight.seven@gmail.com>\n"
+"Language-Team: Dutch <nl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Afmelden Openbox"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Kan pad van module niet determineren,"
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Kleur %s is geen geldige kleur, standaard kleur zwart word gebruikt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Annuleren"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "afmelden"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "opnieuw opstarten"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "afsluiten"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "pauzestand"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "slaapstand"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "veilige pauzestand"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "vergrendelen"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "omschakelen"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Knop %s is geen geldige knopnaam, word verwijderd"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Kan pauzestand niet instellen, knop wordt niet gebruikt"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Kan slaapstand niet instellen, knop wordt niet gebruikt"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Kan veilige slaapstand niet instellen, knop wordt niet gebruikt"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Geen geldige knoppen gevonden, waarden naar standaardwaarden omgezet"
diff --git a/po/nn.po b/po/nn.po
new file mode 100644
index 0000000..cff8903
--- /dev/null
+++ b/po/nn.po
@@ -0,0 +1,88 @@
+# Norwegian Nynorsk translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 13:22+0000\n"
+"Last-Translator: papparonny <ronny@olufsen.org>\n"
+"Language-Team: Norwegian Nynorsk <nn@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox Utlogging"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Fann ikkje stien til modula, avsluttar..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Farge %s er ikkje ein gyldig farge, brukar svart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "avbryt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "logg ut"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "omstart"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "slå av"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "kvilemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "dvalemodus"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "trygg kvile"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "lås"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "Byt"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Knapp %s er ikkje eit gyldig knappenamn, fjernar"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Kvile umogleg, utelukkar knapp"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Kan ikkje gå i dvale, utelukkar knapp"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Trygg kvile umogleg, utelukkar knapp"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Ingen gyldige knappar funne, brukar standard"
diff --git a/po/oblogout.pot b/po/oblogout.pot
new file mode 100644
index 0000000..3de5f8b
--- /dev/null
+++ b/po/oblogout.pot
@@ -0,0 +1,87 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-03-23 01:31+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../oblogout/oblogout.py:90
+msgid "Openbox Logout"
+msgstr ""
+
+#: ../oblogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr ""
+
+#: ../oblogout/oblogout.py:227
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "cancel"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "logout"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "restart"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "shutdown"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "suspend"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "hibernate"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "safesuspend"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "lock"
+msgstr ""
+
+#: ../oblogout/oblogout.py:257
+msgid "switch"
+msgstr ""
+
+#: ../oblogout/oblogout.py:269
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr ""
+
+#: ../oblogout/oblogout.py:275
+msgid "Can't Suspend, disabling button"
+msgstr ""
+
+#: ../oblogout/oblogout.py:279
+msgid "Can't Hibernate, disabling button"
+msgstr ""
+
+#: ../oblogout/oblogout.py:283
+msgid "Can't Safe Suspend, disabling button"
+msgstr ""
+
+#: ../oblogout/oblogout.py:287
+msgid "No valid buttons found, resetting to defaults"
+msgstr ""
diff --git a/po/pt.po b/po/pt.po
new file mode 100644
index 0000000..7a8bc92
--- /dev/null
+++ b/po/pt.po
@@ -0,0 +1,88 @@
+# Portuguese translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 17:31+0000\n"
+"Last-Translator: Fernando Luís Santos <flsantoscanario@gmail.com>\n"
+"Language-Team: Portuguese <pt@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Desligar Openbox"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Não se consegue determinar o caminho do módulo, saindo..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "A cor %s não é uma cor válida, voltando para o preto original"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "cancelar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "encerrar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "reiniciar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "desligar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "suspender"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "hibernar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "suspender de forma segura"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "bloquear"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "mudar"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "O botão %s não tem um nome válido, removendo"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Não é possível Suspender, desabilitando o botão"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Não é possível Hibernar, desabilitando o botão"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Não é possível Suspender de forma segura, desabilitando o botão"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Não existem botões válidos, voltando ao original"
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 0000000..6ff7287
--- /dev/null
+++ b/po/pt_BR.po
@@ -0,0 +1,89 @@
+# Brazilian Portuguese translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 17:06+0000\n"
+"Last-Translator: ufa <fabio.miranda@anvisa.gov.br>\n"
+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Sair do Openbox"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr "Não foi possível determinar o caminho do módulo, saindo..."
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "A cor %s não é uma cor válida, retornando ao preto"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "Cancelar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "sair"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "reiniciar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "desligar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "suspender"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "hibernar"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "Suspender em modo seguro"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "bloquear"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "trocar"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "O botão %s não é um nome de botão válido, removendo"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Não é possível suspender, desabilitando"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Não é possível hibernar, desabilitando botão"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Não é possível suspender em modo de segurança, desabilitando botão"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr ""
+"Não foram encontrados botões válidos, restaurando configuração padrão"
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..271fcbe
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,88 @@
+# Swedish translation for oblogout
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the oblogout package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: oblogout\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-01-26 23:21+0000\n"
+"PO-Revision-Date: 2009-01-26 18:14+0000\n"
+"Last-Translator: GuruX <gustav.brogren@gmail.com>\n"
+"Language-Team: Swedish <sv@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2009-02-01 22:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../ObLogout/oblogout.py:88
+msgid "Openbox Logout"
+msgstr "Openbox: logga ut"
+
+#: ../ObLogout/oblogout.py:178
+msgid "Unable to determin the module path, exiting..."
+msgstr ""
+
+#: ../ObLogout/oblogout.py:213
+#, python-format
+msgid "Color %s is not a valid color, defaulting to black"
+msgstr "Färgen %s är inte en giltig färg, återgår till svart (standard)"
+
+#: ../ObLogout/oblogout.py:235
+msgid "cancel"
+msgstr "avbryt"
+
+#: ../ObLogout/oblogout.py:235
+msgid "logout"
+msgstr "logga ut"
+
+#: ../ObLogout/oblogout.py:235
+msgid "restart"
+msgstr "starta om"
+
+#: ../ObLogout/oblogout.py:235
+msgid "shutdown"
+msgstr "stäng av"
+
+#: ../ObLogout/oblogout.py:235
+msgid "suspend"
+msgstr "vänteläge"
+
+#: ../ObLogout/oblogout.py:235
+msgid "hibernate"
+msgstr "viloläge"
+
+#: ../ObLogout/oblogout.py:235
+msgid "safesuspend"
+msgstr "säkert vänteläge"
+
+#: ../ObLogout/oblogout.py:235
+msgid "lock"
+msgstr "lås"
+
+#: ../ObLogout/oblogout.py:235
+msgid "switch"
+msgstr "byt"
+
+#: ../ObLogout/oblogout.py:247
+#, python-format
+msgid "Button %s is not a valid button name, removing"
+msgstr "Knappen %s är inte ett giltigt namn, tar bort"
+
+#: ../ObLogout/oblogout.py:252
+msgid "Can't Suspend, disabling button"
+msgstr "Vänteläge ej tillgängligt, inaktiverar knappen"
+
+#: ../ObLogout/oblogout.py:256
+msgid "Can't Hibernate, disabling button"
+msgstr "Viloläge ej tillgängligt, inaktiverar knappen"
+
+#: ../ObLogout/oblogout.py:260
+msgid "Can't Safe Suspend, disabling button"
+msgstr "Säkert vänteläge ej tillgängligt, inaktiverar knappen"
+
+#: ../ObLogout/oblogout.py:264
+msgid "No valid buttons found, resetting to defaults"
+msgstr "Inga giltiga knappar, återgår till standard"
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..932d2ac
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,7 @@
+[build]
+icons=False
+help=False
+
+[build_i18n]
+po-dir=po
+
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..9922ae2
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import os, sys, glob, fnmatch
+
+## Added 10 Jan 2008
+
+try:
+ from distutils.core import setup, Extension
+ import distutils.command.install_data
+ from distutils.core import setup
+except:
+ print "DistUtils / SetupTools are required"
+ sys.exit(1)
+
+try:
+ from DistUtilsExtra.command import *
+except:
+ print "DistUtils Extras is required"
+ sys.exit(1)
+
+setup(name = "oblogout",
+ version = "0.3",
+ description = "Openbox Logout",
+ author = "Andrew Williams",
+ author_email = "andy@tensixtyone.com",
+ url = "http://launchpad.net/oblogout/",
+
+ packages = ['oblogout'],
+ scripts = ["data/oblogout"],
+ data_files = [('share/themes/simplistic/oblogout', glob.glob('data/themes/simplistic/oblogout/*')),
+ ('share/themes/oxygen/oblogout', glob.glob('data/themes/oxygen/oblogout/*')),
+ ('/etc', glob.glob('data/oblogout.conf'))],
+
+ cmdclass = { 'build' : build_extra.build_extra,
+ 'build_i18n' : build_i18n.build_i18n },
+
+
+ long_description = """Really long text here."""
+)
diff --git a/tests/policykit-auth.py b/tests/policykit-auth.py
new file mode 100755
index 0000000..7c0b5bb
--- /dev/null
+++ b/tests/policykit-auth.py
@@ -0,0 +1,96 @@
+#!/usr/bin/python
+
+import pygtk
+pygtk.require('2.0')
+import gtk
+
+import dbus
+import os
+
+class TestWindow:
+
+
+ @property
+ def _sysbus (self):
+ """System DBus"""
+ if not hasattr (TestWindow, "__sysbus"):
+ TestWindow.__sysbus = dbus.SystemBus ()
+ return TestWindow.__sysbus
+
+ @property
+ def _sessbus (self):
+ """Session DBus"""
+ if not hasattr (TestWindow, "__sessbus"):
+ TestWindow.__sessbus = dbus.SessionBus ()
+ return TestWindow.__sessbus
+
+ @property
+ def _polkit (self):
+ """PolicyKit object"""
+ if not hasattr (TestWindow, "__polkit"):
+ pk = self._sysbus.get_object ("org.freedesktop.PolicyKit", "/")
+ TestWindow.__polkit = dbus.Interface(pk, 'org.freedesktop.PolicyKit')
+ return TestWindow.__polkit
+
+ @property
+ def _halpm (self):
+ """HAL controller object"""
+ if not hasattr (TestWindow, "__halpm"):
+ hal = self._sysbus.get_object ("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer")
+ TestWindow.__halpm = dbus.Interface(hal, "org.freedesktop.Hal.Device.SystemPowerManagement")
+ return TestWindow.__halpm
+
+ @property
+ def _authagent (self):
+ """AuthenticationAgent object"""
+ if not hasattr (TestWindow, "__authagent"):
+ autha = self._sessbus.get_object ("org.freedesktop.PolicyKit.AuthenticationAgent", "/", "org.gnome.PolicyKit.AuthorizationManager.SingleInstance")
+ TestWindow.__authagent = dbus.Interface(autha,'org.freedesktop.PolicyKit.AuthenticationAgent')
+ return TestWindow.__authagent
+
+
+
+ def on_button_clicked(self, widget, data=None):
+
+ #Call the D-Bus method to request PolicyKit authorization:
+
+ gdkwindow = self.window.window
+ xid = gdkwindow.xid
+
+ print "Calling ObtainAuthorization..."
+
+ granted = self._authagent.ObtainAuthorization("org.freedesktop.hal.power-management.reboot-multiple-sessions", xid, os.getpid())
+
+ print "...Finished."
+ print "granted=", granted
+
+ print "isauthorized=", self._polkit.IsProcessAuthorized("org.freedesktop.hal.power-management.reboot-multiple-sessions", os.getpid(), False)
+
+
+ print self._halpm.Reboot()
+
+ def on_delete_event(self, widget, event, data=None):
+ # Close the window:
+ return False
+
+ def on_destroy(self, widget, data=None):
+ gtk.main_quit()
+
+ def show(self):
+ self.window.show()
+
+ def __init__(self):
+
+ self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ self.window.connect("delete_event", self.on_delete_event)
+ self.window.connect("destroy", self.on_destroy)
+
+ self.button = gtk.Button("Obtain Authorization")
+ self.button.connect("clicked", self.on_button_clicked, None)
+ self.window.add(self.button)
+ self.button.show()
+
+window = TestWindow()
+window.show()
+gtk.main()
+