Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download xflux automatically on install for Debian/Ubuntu #61

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ MANIFEST
dist/
build/

debian/files
debian/fluxgui.debhelper.log
debian/fluxgui.postinst.debhelper
debian/fluxgui.prerm.debhelper
debian/fluxgui.substvars
debian/fluxgui/
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
f.lux indicator applet
======================
Better lighting for your computer
Learn more here: https://justgetflux.com/

f.lux indicator applet is an indicator applet to control xflux: an application
that makes the color of your computer's display adapt to the time of day, warm
at nights and like sunlight during the day.

INSTALLATION FROM SOURCE CODE
--------
###STEP 1 Install the dependencies

Fedora:

```
sudo yum install gnome-python2-gconf pexpect python-appindicator git
```

Debian:

```
sudo apt-get install python-gconf python-pexpect python-appindicator git fakeroot debhelper python-support
```

###STEP 2 Download the source code

```
git clone https://github.com/Kilian/f.lux-indicator-applet.git
cd f.lux-indicator-applet
```

###STEP 3 Download xflux (not required for Debian/Ubuntu)

32bit:

```
wget https://justgetflux.com/linux/xflux-pre.tgz
tar zxvf xflux-pre.tgz
```

64bit:

```
wget https://justgetflux.com/linux/xflux64.tgz
tar zxvf xflux64.tgz
```


###STEP 4 Build and install

Debian/Ubuntu:

```
dpkg-buildpackage -rfakeroot -b -uc -us
sudo dpkg -i ../flux_1.1.8_all.deb (check filename)
```

Other distros:

```
python setup.py build
sudo python setup.py install
cd ..
rm -r f.lux-indicator-applet
```
35 changes: 35 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
fluxgui (1.1.8-4~vivid) vivid; urgency=medium

* Add debhelper tokens to post{inst,rm}
- Fixes module not being found by python

-- Nathan Rennie-Waldock <[email protected]> Mon, 01 Feb 2016 21:00:40 +0000

fluxgui (1.1.8-3~vivid) vivid; urgency=medium

* Add some text to __init__.py
- Was being left out package as it was empty

-- Nathan Rennie-Waldock <[email protected]> Mon, 01 Feb 2016 17:21:20 +0000

fluxgui (1.1.8-2~vivid) vivid; urgency=medium

* Add missing python-glade2 dependency
* dh_clean should also remove xflux

-- Nathan Rennie-Waldock <[email protected]> Mon, 01 Feb 2016 17:03:47 +0000

fluxgui (1.1.8-1~vivid) vivid; urgency=medium

* Non-maintainer upload

[ Jeremy Newton ]
* Remove xflux binary

[ Nathan Rennie-Waldock ]
* Download xflux binary automatically on install
* Update dependencies properly
* Updated colour temperature choices

-- Nathan Rennie-Waldock <[email protected]> Sat, 15 Aug 2015 22:56:25 +0100

fluxgui (1.1.8) lucid; urgency=low

* add in python-pexpect as a dependency
Expand Down
1 change: 1 addition & 0 deletions debian/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xflux
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Source: fluxgui
Section: utils
Priority: optional
Maintainer: Kilian Valkhof <[email protected]>
Build-Depends: debhelper (>=7), python-support (>=0.8.7), python, libxxf86vm1(>=1.1.0)
Build-Depends: debhelper (>=7), python-support (>=0.8.7)
XS-Python-Version: >=2.6
Standards-Version: 3.8.0
Homepage: http://www.stereopsis.com/flux/

Package: fluxgui
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-appindicator(>=0.0.19), python-gtk2(>=2.17.0), python-glade2(>=2.17.0), python-gconf(>=2.28.0), python-xdg(>=0.18), libxxf86vm1(>=1.1.0), python-pexpect(>=2.3), ia32-libs(>=2.7)
Depends: ${xflux:Depends}, ${misc:Depends}, ${python:Depends}, python-appindicator(>=0.0.19), python-gtk2(>=2.17.0), python-gconf(>=2.28.0), python-xdg(>=0.18), python-pexpect(>=2.3), python-glade2(>=2.17.0)
XB-Python-Version: ${python:Versions}
Description: f.lux indicator applet is an indicator applet to control xflux, an
application that makes the color of your computer's display adapt to the time
Expand Down
1 change: 1 addition & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/lib/fluxgui
53 changes: 53 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh
set -e

exit_with_error() {
echo
echo $1
echo "fluxgui is NOT installed."
exit 1
}

case $(dpkg --print-architecture) in
i386|i586|i686)
URL=https://justgetflux.com/linux/xflux-pre.tgz
FILENAME=xflux-pre.tgz
;;
amd64)
URL=https://justgetflux.com/linux/xflux64.tgz
FILENAME=xflux64.tgz
;;
*)
exit_with_arror "Unsupported platform: '$(dpkg --print-architecture)'"
esac

APT_PROXIES=$(apt-config shell http_proxy Acquire::http::proxy https_proxy Acquire::https::Proxy ftp_proxy Acquire::ftp::Proxy dl_direct Acquire::http::Proxy::justgetflux.com)
if [ -n "$APT_PROXIES" ]; then
eval export $APT_PROXIES
fi

if [ "$dl_direct" = "DIRECT" ]; then
unset http_proxy
unset https_proxy
unset ftp_proxy
fi

mkdir -p /var/cache/fluxgui
cd /var/cache/fluxgui

echo
echo "Downloading xflux..."
wget -v -N $URL || exit_with_error "Download failed"
echo "Download done."
echo

tar xzf $FILENAME || exit_with_error "Cannot unpack $FILENAME"

mv xflux /usr/lib/fluxgui/

if [ "$1" != "upgrade" ] || dpkg --compare-versions "$2" lt 1.1.8-1; then
dpkg-divert --package fluxgui --rename --add /usr/bin/xflux
ln -sf /usr/lib/fluxgui/xflux /usr/bin/xflux
fi

#DEBHELPER#
13 changes: 13 additions & 0 deletions debian/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

case "$1" in
purge|remove|abort-install|disappear|abort-upgrade)
if ! ([ "$1" = "abort-upgrade" ] && dpkg --compare-versions "$2" lt 1.1.8-1); then
rm -f /usr/lib/fluxgui/xflux
[ -L /usr/bin/xflux ] && rm -f /usr/bin/xflux
dpkg-divert --package fluxgui --remove --rename /usr/bin/xflux
fi
;;
esac

#DEBHELPER#
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
%:
dh $@

override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars
3 changes: 1 addition & 2 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
3.0 (quilt)

3.0 (native)
3 changes: 2 additions & 1 deletion debian/substvars
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
shlibs:Depends=ia32-libs (>= 2.4), lib32gcc1 (>= 1:4.1.1), lib32stdc++6 (>= 4.1.1), libc6-i386 (>= 2.0)
# Generated with: dpkg-shlibdeps -pxflux xflux
xflux:Depends=libc6 (>= 2.2.5), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libx11-6, libxext6, libxrandr2 (>= 2:1.2.0), libxxf86vm1
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

from distutils.core import setup

data_files=[('share/icons/hicolor/scalable/apps', ['fluxgui.svg', 'fluxgui-light.svg', 'fluxgui-dark.svg']),
('share/applications', ['desktop/fluxgui.desktop'])]

import os
if os.path.exists("xflux"):
data_files.append( ('bin', ['xflux']) )

setup(name = "f.lux indicator applet",
version = "1.1.8",
description = "f.lux indicator applet - better lighting for your computer",
Expand All @@ -12,9 +19,7 @@
package_dir = {'fluxgui' : 'src/fluxgui'},
packages = ["fluxgui",],
package_data = {"fluxgui" : ["*.glade"] },
data_files=[('share/icons/hicolor/scalable/apps', ['fluxgui.svg', 'fluxgui-light.svg', 'fluxgui-dark.svg']),
('share/applications', ['desktop/fluxgui.desktop']),
('bin', ['xflux']),],
data_files = data_files,
scripts = ["fluxgui"],
long_description = """f.lux indicator applet is an indicator applet to
control xflux, an application that makes the color of your computer's
Expand Down
1 change: 1 addition & 0 deletions src/fluxgui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Dummy file to make this directory a package.
11 changes: 6 additions & 5 deletions src/fluxgui/fluxapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ class Preferences(object):
"""

temperatureKeys = {
0: '2700',
1: '3400',
2: '4200',
3: '5000',
4: '6500',
0: '2300',
1: '2700',
2: '3400',
3: '4200',
4: '5000',
5: '6500',
"off": '6500',
}

Expand Down
3 changes: 2 additions & 1 deletion src/fluxgui/preferences.glade
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ f.lux indicator applet made by Kilian Valkhof</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Fill in your preferred nighttime color temperature</property>
<property name="items" translatable="yes">Tungsten (2700K)
<property name="items" translatable="yes">Dim Incandescent (2300K)
Incandescent (2700K)
Halogen (3400K)
Fluorescent (4200K)
Sunlight (5000K)</property>
Expand Down
2 changes: 1 addition & 1 deletion src/fluxgui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):
self.has_set_prefs = False
self._zipcode = '90210'
self.autostart=True
if int(self._color) < 2700 or not self._color:
if int(self._color) < 1200 or not self._color:
# upgrade from previous version
temperature_keys = {
'0': '2700',
Expand Down
Binary file removed xflux
Binary file not shown.