Skip to content

Commit

Permalink
Make fluxgui autostart work for locally installed fluxgui
Browse files Browse the repository at this point in the history
Gnome doesn't (necessarily?) consult the `$PATH` of the user's
`/etc/passwd` defined shell when launching via a `.desktop` file, so
here we change the `autostart/fluxgui.desktop` file to explicitly use
the user's `$SHELL` and hence `$PATH`.
  • Loading branch information
ntc2 committed Mar 26, 2018
1 parent f71b6be commit 7dd2a4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ python download-xflux.py

# EITHER install globally
sudo python setup.py install

# EXCLUSIVE OR, install in your home directory. The binary installs
# into ~/.local/bin, so be sure to add that to your PATH if installing locally.
# into ~/.local/bin, so be sure to add that to your PATH if installing
# locally. In particular, autostarting fluxgui in Gnome will not work
# if the locally installed fluxgui is not on your PATH.
python setup.py install --user

# Run flux
fluxgui
```
Expand Down
5 changes: 4 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# -*- text -*-
fluxgui (1.1.11~pre) wily; urgency=low

* make fluxgui Gnome autostart work for locally installed fluxgui,
https://github.com/xflux-gui/fluxgui/pull/89.
* update icons: https://github.com/xflux-gui/fluxgui/issues/85,
https://github.com/xflux-gui/fluxgui/pull/86
https://github.com/xflux-gui/fluxgui/pull/86.
* fix https:/github.com/xflux-gui/fluxgui/issues/79: tray icon
name was incorrect for some desktop environments.

Expand Down
16 changes: 15 additions & 1 deletion src/fluxgui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,21 @@ def _create_autostarter(self):
#create autostart entry
starter_item = DesktopEntry(autostart_file)
starter_item.set('Name', 'f.lux indicator applet')
starter_item.set('Exec', 'fluxgui')
# Use the user's shell to start 'fluxgui', in case
# 'fluxgui' is not installed on a standard system path. We
# use 'sh' to start the users '/etc/passwd' shell via
# '$SHELL', so that this will still work if the user
# changes their shell after the
# 'autostart/fluxgui.desktop' file is created.
#
# See PR #89 for an alternative approach:
#
# https://github.com/xflux-gui/fluxgui/pull/89
#
# The escaping of the 'Exec' field is described in
#
# https://developer.gnome.org/desktop-entry-spec/#exec-variables.
starter_item.set('Exec', r'sh -c "\\"\\$SHELL\\" -c fluxgui"')
starter_item.set('Icon', 'fluxgui')
starter_item.set('X-GNOME-Autostart-enabled', 'true')
starter_item.write()
Expand Down

0 comments on commit 7dd2a4e

Please sign in to comment.