Turn gtk-redshift into a python module. A launcher script is installed

in bindir.
This commit is contained in:
Jon Lund Steffensen
2010-02-11 22:06:12 +01:00
parent f3aa82cd9d
commit 739f806f19
6 changed files with 62 additions and 9 deletions
+7 -2
View File
@@ -40,8 +40,13 @@ endif
# gtk-redshift Script
if ENABLE_GTK
dist_bin_SCRIPTS = src/gtk-redshift/gtk-redshift.py
bin_SCRIPTS = src/gtk-redshift/defs.py
gtk_redshift_PYTHON = \
src/gtk-redshift/__init__.py \
src/gtk-redshift/statusicon.py \
src/gtk-redshift/defs.py
gtk_redshiftdir = $(pythondir)/gtk_redshift
dist_bin_SCRIPTS = src/gtk-redshift/gtk-redshift
EXTRA_DIST += src/gtk-redshift/defs.py.in
endif
+8 -3
View File
@@ -78,10 +78,15 @@ AC_ARG_ENABLE([gtk], [AC_HELP_STRING([--enable-gtk],
[enable GTK status icon])],
[enable_gtk=$enableval],[enable_gtk=maybe])
AS_IF([test "x$enable_gtk" != xno], [
AS_IF([test $have_python != yes], [
AC_MSG_WARN([status icon script requires Python and PyGTK])
AS_IF([test $have_python = yes], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([missing dependencies])
AS_IF([test "x$enable_gtk" = xyes], [
AC_MSG_ERROR([status icon script requires Python 2.4])
])
enable_gtk=no
])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
+1 -1
View File
@@ -4,4 +4,4 @@ src/redshift.c
src/randr.c
src/vidmode.c
src/gtk-redshift/gtk-redshift.py
src/gtk-redshift/statusicon.py
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env python
# __init__.py -- gtk-redshift package __init__ file
# This file is part of Redshift.
# Redshift 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 3 of the License, or
# (at your option) any later version.
# Redshift 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 Redshift. If not, see <http://www.gnu.org/licenses/>.
# Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com>
__all__ = ['statusicon']
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python
# gtk-redshift -- GTK+ Redshift launcher script
# This file is part of Redshift.
# Redshift 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 3 of the License, or
# (at your option) any later version.
# Redshift 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 Redshift. If not, see <http://www.gnu.org/licenses/>.
# Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com>
if __name__ == '__main__':
from gtk_redshift.statusicon import run_statusicon
run_statusicon()
+3 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# gtk-redshift -- GTK+ status icon source
# statusicon.py -- GTK+ status icon source
# This file is part of Redshift.
# Redshift is free software: you can redistribute it and/or modify
@@ -18,7 +18,7 @@
# Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com>
import sys
import sys, os
import subprocess, signal
import gettext
@@ -30,7 +30,7 @@ import gtk, glib
import defs
if __name__ == '__main__':
def run_statusicon():
# Internationalisation
gettext.bindtextdomain('redshift', defs.LOCALEDIR)
gettext.textdomain('redshift')