mirror of
https://github.com/nikdoof/oblogout.git
synced 2025-12-23 15:29:25 +00:00
55 lines
1.7 KiB
Python
Executable File
55 lines
1.7 KiB
Python
Executable File
#!/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 logging
|
|
import logging.handlers
|
|
from openboxlogout import openboxlogout
|
|
|
|
debug = True
|
|
|
|
# Check config in local path, if it exists pass it on
|
|
if os.path.exists('openbox-logout.conf'):
|
|
config = 'openbox-logout.conf'
|
|
else:
|
|
config = None
|
|
|
|
# Start logger instace used by the OpenboxLogout class
|
|
logger = logging.getLogger('OpenboxLogout')
|
|
logout = logging.StreamHandler(sys.stdout)
|
|
logout.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
|
|
logger.addHandler(logout)
|
|
|
|
# If debug mode is enabled, output debug messages
|
|
if debug:
|
|
logger.setLevel(logging.DEBUG)
|
|
else:
|
|
logger.setLevel(logging.INFO)
|
|
|
|
# Start the application
|
|
app = openboxlogout.OpenboxLogout(config)
|
|
app.run()
|