aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtk-redshift
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gtk-redshift/Makefile.am19
-rw-r--r--src/gtk-redshift/__init__.py20
-rw-r--r--src/gtk-redshift/defs.py.in1
-rw-r--r--src/gtk-redshift/gtk-redshift23
-rw-r--r--[-rwxr-xr-x]src/gtk-redshift/statusicon.py (renamed from src/gtk-redshift/gtk-redshift.py)8
5 files changed, 67 insertions, 4 deletions
diff --git a/src/gtk-redshift/Makefile.am b/src/gtk-redshift/Makefile.am
new file mode 100644
index 0000000..d0d8695
--- /dev/null
+++ b/src/gtk-redshift/Makefile.am
@@ -0,0 +1,19 @@
+
+if ENABLE_GTK
+gtk_redshift_PYTHON = \
+ __init__.py \
+ statusicon.py
+nodist_gtk_redshift_PYTHON = \
+ defs.py
+gtk_redshiftdir = $(pythondir)/gtk_redshift
+
+dist_bin_SCRIPTS = gtk-redshift
+EXTRA_DIST = defs.py.in
+endif
+
+CLEANFILES = defs.py
+
+# Local python definitions
+defs.py: defs.py.in
+ sed -e "s|\@bindir\@|$(bindir)|g" \
+ -e "s|\@localedir\@|$(localedir)|g" $< > $@
diff --git a/src/gtk-redshift/__init__.py b/src/gtk-redshift/__init__.py
new file mode 100644
index 0000000..30205ca
--- /dev/null
+++ b/src/gtk-redshift/__init__.py
@@ -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']
diff --git a/src/gtk-redshift/defs.py.in b/src/gtk-redshift/defs.py.in
index 91eccf9..d3ca5ed 100644
--- a/src/gtk-redshift/defs.py.in
+++ b/src/gtk-redshift/defs.py.in
@@ -19,3 +19,4 @@
LOCALEDIR = '@localedir@'
+BINDIR = '@bindir@'
diff --git a/src/gtk-redshift/gtk-redshift b/src/gtk-redshift/gtk-redshift
new file mode 100644
index 0000000..f62c6f1
--- /dev/null
+++ b/src/gtk-redshift/gtk-redshift
@@ -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()
diff --git a/src/gtk-redshift/gtk-redshift.py b/src/gtk-redshift/statusicon.py
index a737154..9925c35 100755..100644
--- a/src/gtk-redshift/gtk-redshift.py
+++ b/src/gtk-redshift/statusicon.py
@@ -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')
@@ -38,7 +38,7 @@ if __name__ == '__main__':
# Start redshift with arguments from the command line
args = sys.argv[1:]
- args.insert(0, 'redshift')
+ args.insert(0, os.path.join(defs.BINDIR, 'redshift'))
process = subprocess.Popen(args)
try: