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

cant run properly by manual intstall on kali linux #165

Open
jklouz opened this issue Jul 10, 2023 · 10 comments
Open

cant run properly by manual intstall on kali linux #165

jklouz opened this issue Jul 10, 2023 · 10 comments

Comments

@jklouz
Copy link

jklouz commented Jul 10, 2023

i have manual installing on kali linux:

sudo apt-get install python3-pexpect python3-distutils gir1.2-ayatanaappindicator3-0.1 gir1.2-gtk-3.0 redshift

cd /tmp

git clone "https://github.com/xflux-gui/fluxgui.git"

cd fluxgui

./download-xflux.py

sudo ./setup.py install --record installed.txt

fluxgui

OUTPUT:
Failed to import plain appindicator ...

(fluxgui:29764): GLib-GIO-ERROR **: 09:25:22.534: Settings schema 'apps.fluxgui' is not installed
zsh: trace trap fluxgui

then try run:
xargs sudo chmod -R a+rX < installed.txt

glib-compile-schemas .

GSETTINGS_SCHEMA_DIR=. fluxgui

OUTPUT:
the screen color changed, and the apps opened with the icon in top rigth panel
but when i closed the terminal the icon and app closed, the color still remain

when re run : fluxgui again its results same errors

how to solve this, to be installed properly

@ntc2
Copy link
Member

ntc2 commented Jul 15, 2023

OUTPUT: the screen color changed, and the apps opened with the icon in top rigth panel but when i closed the terminal the icon and app closed, the color still remain

are you saying that everything worked correctly until you closed the terminal? if yes, then it sounds like closing the terminal closed fluxgui. if that's what happened, then try running fluxgui in the background, e.g.

GSETTINGS_SCHEMA_DIR=. fluxgui&

in bash, or with &! at the end in zsh. then you should be able to close the terminal without closing fluxgui.

@jklouz
Copy link
Author

jklouz commented Jul 16, 2023

my main concern is this
OUTPUT:
Failed to import plain appindicator ...

(fluxgui:29764): GLib-GIO-ERROR **: 09:25:22.534: Settings schema 'apps.fluxgui' is not installed
zsh: trace trap fluxgui

its not working on my kali, its any else dependencies required?

@ntc2
Copy link
Member

ntc2 commented Jul 18, 2023

my main concern is this
OUTPUT:
Failed to import plain appindicator ...

That was a buggy error messages -- there was no actual problem with the import -- I just fixed it here: a21f55f

@jklouz
Copy link
Author

jklouz commented Jul 27, 2023

after changed fluxapp.py, results:
Failed to import plain appindicator ...
Failed to import an appindicator implementation, dying ...

retry with: ./setup.py install --record installed.txt and ./setup.py install --user --record installed.txt, results:
warnings.warn(
warning: no files found matching 'COPYING'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'README'
warning: no files found matching '.desktop' under directory '.svg'
warning: no files found matching '.glade' under directory '.py'
zip_safe flag not set; analyzing archive contents...
fluxgui.pycache.fluxapp.cpython-311: module references file

all depedencies already satisfied

@ntc2
Copy link
Member

ntc2 commented Jul 28, 2023

after changed fluxapp.py, results:
Failed to import plain appindicator ...
Failed to import an appindicator implementation, dying ...

Sounds like you're missing dependencies. Here's the code that generates those error messages:

https://github.com/xflux-gui/fluxgui/blob/91ef659911e94c47d9e17480b8b1855d778b536b/src/fluxgui/fluxapp.py#L13C1-L29C20

You could try running that code by itself in a Python repl and confirm you get the same error. I.e. run this code in a Python repl:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
try:
    gi.require_version('AyatanaAppIndicator3', '0.1')
    from gi.repository import AyatanaAppIndicator3 as appindicator
except:
    print('Failed to import Ayatana appindicator, falling back to plain appindicator ...')
    try:
        gi.require_version('AppIndicator3', '0.1')
        from gi.repository import AppIndicator3 as appindicator
    except:
        print('Failed to import plain appindicator ...')
        print('Failed to import an appindicator implementation, dying ...')

@richdear
Copy link

richdear commented Mar 3, 2024

Same issue here :(

@mikhail-shkaralevich
Copy link

I also can't get it running on kali. The error message I get:

Traceback (most recent call last): File "/tmp/fluxgui/./setup.py", line 84, in <module> setup(name = "f.lux indicator applet", File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 146, in setup _setup_distribution = dist = klass(attrs) ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 318, in __init__ self.metadata.version = self._normalize_version(self.metadata.version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 354, in _normalize_version normalized = str(Version(version)) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/setuptools/_vendor/packaging/version.py", line 200, in __init__ raise InvalidVersion(f"Invalid version: '{version}'") setuptools.extern.packaging.version.InvalidVersion: Invalid version: '2.0.1~pre'

@ntc2
Copy link
Member

ntc2 commented Sep 10, 2024

@mikhail-shkaralevich it looks like your problem is due to setuptools no longer supporting ~ in version numbers. I just pushed a commit that removes the ~, but I didn't test it (I don't have a new enough version of setuptools installed). Please pull the latest commit and see if that fixes your problem.

@mikhail-shkaralevich
Copy link

mikhail-shkaralevich commented Sep 10, 2024

@ntc2, it did solve one problem but I encountered another one:

`mikhail㉿avrora)-[/tmp/fluxgui]
└─$ fluxgui
/usr/local/bin/fluxgui:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').run_script('f.lux-indicator-applet==2.0.1rc0', 'fluxgui')

(fluxgui:15297): GLib-GIO-ERROR **: 09:16:49.668: Settings schema 'apps.fluxgui' is not installed
zsh: trace trap fluxgui
`

@ntc2
Copy link
Member

ntc2 commented Sep 13, 2024

@mikhail-shkaralevich it seems that fluxgui doesn't work with modern Python versions, in particular modern versions of setuptools that come bundled with Python versions after 3.9. I'll explain how you can work around this, but first, let me just recommend: just use redshift-gtk instead. That's what I use, and assuming xflux doesn't work on your system anyway, fluxgui is just an inferior GUI for redshift.

OK, but if you still prefer fluxgui, then here are two possible solutions:

  1. run fluxgui without installing it, as outlined in the README:
cd <path to your fluxgui.git clone>
# You only need to download xflux at most once. Or zero times if you're using redshift :)
./download-xflux.py
glib-compile-schemas .
GSETTINGS_SCHEMA_DIR=`pwd` PATH=`pwd`:$PATH PYTHONPATH=`pwd`/src:$PYTHONPATH ./fluxgui

If this works, you can create a simple script that runs fluxgui this way, and add it to your path.

  1. install fluxgui in a virtual env, for an old version of Python. This works for me, using pyenv (you'll need to set that up separately). First, create and enter the venv:
pyenv install 3.9.20
pyenv virtualenv 3.9.20 fluxgui-venv
pyenv local fluxgui-venv

You might need another step here to activate the venv, for me that happens automatically via some shell magic. Docs here may help: https://github.com/pyenv/pyenv-virtualenv.

Next, install deps and fluxgui:

sudo apt install libgirepository1.0-dev
pip install pygobject pyxdg pexpect
./setup.py install --record installed.txt

Now you should be able to run fluxgui from inside the venv as fluxgui or pyenv exec fluxgui. Outside the venv, you can run fluxgui as ~/.pyenv/versions/fluxgui-venv/bin/fluxgui, which you could add to your path if needed.

But again, all that said, just use redshift-gtk :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants