webketje/tuxedo-backlight-control

Not working under Arch Linux

Opened this issue · 13 comments

Many thanks for this, but unfortunately it doesn't work under Arch Linux.

Installed with the commands

wget https://github.com/webketje/tuxedo-backlight-control/releases/download/v0.5/tuxedo-backlight-control-0.5-1-any.pkg.tar.xz

sudo pacman -U tuxedo-backlight-control-0.5-1-any.pkg.tar.xz

Error

Traceback (most recent call last): File "/usr/share/tuxedo-backlight-control/ui.py", line 346, in <module> init() File "/usr/share/tuxedo-backlight-control/ui.py", line 340, in init root = tk.Tk() File "/usr/lib/python3.7/tkinter/__init__.py", line 2023, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable

i have the same Problem

Almost a month later, the problem still exists. @webketje

@startedfr0mtheb0tt0m @StevenSeifried Many thanks for the bug report and the mention (I wasn't actively monitoring these issues). I am aware of it and have had other reports sent to me via non-github channels. Unfortunately I cannot currently reproduce this error as I develop on Linux Mint.

I can give you some info/ suggestions about this bug: it is related to no graphical environment being available for Tkinter (this is the python library that draws the user interface), and it seems this only happens with Arch Linux. Although the GUI doesn't work, you should still be able to use the CLI, like backlight on or python /usr/share/tuxedo-backlight-control/backlight.py on

If you can come back to me and report whether any of the following works, I can try to integrate it into the app:

  1. open up a terminal, and type startx. If it doesn't work, try installing the xorg-init package, and try again.
  2. After that type echo $DISPLAY, does it print anything? if it does, please try running tuxedo-backlight-control and report your findings here.
  3. If it works, you can automatically have the xserver start by following the instructions at Autostart X at login

If any of this works out, I can try to include a fallback or at least a warning message for users that they need to start an X server (graphical display driver)

I'm on Manjaro (Arch derivat) and have the same issue. CLI works ok (I guess not all commands are available for my model), but UI doesn't work - same error message as OP.

$ echo $DISPLAY
:0

seems to be fine, using i3-wm as my environment. Any further information you need to investigate?

@Trollwut can you try running this command in terminal:

/usr/share/tuxedo-backlight-control/ui.py

.. and report the results?
Also please mention (to everyone with this bug) how you launched the app: through command backlight ui or by clicking the desktop icon/ looking for it in the app menu.

I've been able to reproduce the issue on a virtual box Arch OS, however: of course that virtual box has no access to the keyboard. When I directly call the command mentioned above I don't get the no display name and no $DISPLAY environment variable.

A possible reason would be that subprocesses called by Python don't get the $DISPLAY env in Arch. If this is the case launching the UI through the app menu/ desktop icon should work.

wow, now these are some nice results.

  1. Ok, first, I started it via terminal with the CLI command. It asked me for sudo password (obviously) and then exited with this error:

     $ backlight ui
     Traceback (most recent call last):
       File "/usr/share/tuxedo-backlight-control/ui.py", line 346, in <module>
         init()
       File "/usr/share/tuxedo-backlight-control/ui.py", line 340, in init
         root = tk.Tk()
       File "/usr/lib/python3.7/tkinter/__init__.py", line 2023, in __init__
         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
     _tkinter.TclError: no display name and no $DISPLAY environment variable
    
  2. I then used rofi in drun mode to call the "Tuxedo Backlight Control" app. It didn't do anything. (Maybe it might ask for sudo permissions too, but it didn't open for me.) TBH that's not a problem for me, as I don't run apps via drun normally :D but it might affect other people.

  3. Yo, now I run the app directly, how to mentioned it with /usr/share/tuxedo-backlight-control/ui.py, which again asked for sudo permissions and - whoop whoop! - the app showed for me, and it also worked!

Well, some options didn't work, but I think that's because the driver itself doesn't support everything from my keyboard, which will change in the future. But overall, yes, changing stuff just worked.

So it seems like it's just an error while calling it from the backlight app.

If you need any further information, please ask!

I'm working on an update and some other enhancements (to the code, not the UI).
I'll notify all participants of this issue when done. @Trollwut, there's one more thing that would be good to know on Arch linux / Manjaro:

When you hit the Windows (Linux) key on your computer, and search for Tuxedo Backlight Control or go to Applications > System and click it from the menu or go to /usr/share/applications and click it there, does it work?

nice to hear!

well, TBH I don't know. I'm using i3, which doesn't have an app runner like Gnome or KDE. I'm guessing that rofi's drun mode is looking into /usr/share/applications/, which is the same.

This is the exec line of the desktop file in there:

Exec=/usr/share/tuxedo-backlight-control/ui.py

Hope that helped. Maybe someone else here running a DE on Arch can answer your question better :)

The command "backlight ui" still doesn't work in my terminal. But now the GUI works when I start it from the Gnome menu.

@webketje Are you planning to putting the package in the AUR?

Hi there!

The command "backlight ui" still doesn't work in my terminal. But now the GUI works when I start it from the Gnome menu.

The "backlight" command points to a different file than the desktop file. While both are identical, /usr/local/bin/backlight fails at importing the colors because the file is located in /usr/share/tuxedo-backlight-control/.

You can however run /usr/share/tuxedo-backlight-control/backlight.py from the commandline to see if it works (it does for me).

I also replaced the file /usr/local/bin/backlight with a symlink to /usr/share/tuxedo-backlight-control/backlight.py to get rid of the duplicate and import error.

Cheers.

@encarsia thanks for the report, I will look into this. I've had a new version sitting locally for months, but I'm not sure it doesn't break anything and have been reluctant to release it.

@encarsia @ghost @Trollwut @StevenSeifried I finally released v0.7 (see releases)
Would greatly appreciate feedback on whether it works out of the box now (that is my hope).
Haven't been able to test it on my Arch VM.

Closing since this issue seems to be resolved now