Giter VIP home page Giter VIP logo

Comments (7)

Cimbali avatar Cimbali commented on June 12, 2024

Can you describe what happens on i3 when starting v1.8.0?

  • What are the symptomes: do you have a crash? Just a blank content window?
  • What is printed to the console?
  • Can you run pympress --log=debug and report what is displayed in ~/.cache/pympress.log ?

I think setting windows fullscreen does not really mean anything on i3, from what I remember from #59. I think a good way to handle this would be to disable the start_fullscreen functionality if we detect we’re on i3.

from pympress.

Cimbali avatar Cimbali commented on June 12, 2024

As to 1.5.1, I think if you have specific needs like i3 support, you’ll need to update pympress with e.g. pip as I don’t have much control over which versions are shipped in each OS version.

from pympress.

Zar-rok avatar Zar-rok commented on June 12, 2024

As to 1.5.1, I think if you have specific needs like i3 support, you’ll need to update pympress with e.g. pip as I don’t have much control over which versions are shipped in each OS version.

The problem with the pip approach is that you need to install Python 3.9 to be able to run the latest pympress version. Because, using Python 3.8 (my default version for Ubuntu 20.04), you get the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/pympress/pympress/__main__.py", line 63, in <module>
    gettext.install('pympress', util.get_locale_dir())
  File "/opt/pympress/pympress/util.py", line 116, in get_locale_dir
    return __get_resource_path('share', 'locale')
  File "/opt/pympress/pympress/util.py", line 106, in __get_resource_path
    root = importlib_resources.files('pympress')
AttributeError: module 'importlib.resources' has no attribute 'files'

Hence, a simpler solution is just to create the ~/.config/pympress, as described in my first post.

That's why I think it could be useful to document this solution in case future users encounter the same problem.

Can you describe what happens on i3 when starting v1.8.0?

For 1.8.0, I don't have any bug.

However, the first time I ran pympress, without argument, the Content and Presenter windows have been placed in the same monitor and the Content window have been set to full-screen.

Hence, I end up with a black screen. Once I understood what was going on, typing F11 and disabling the startup full-screen options fixed this behavior.

I think setting windows fullscreen does not really mean anything on i3, from what I remember from #59. I think a good way to handle this would be to disable the start_fullscreen functionality if we detect we’re on i3.

I also think that it is a better behavior.

The simplest way could be to check if one of the running process is named i3, but maybe that on some systems, i3 is run as a service with another name.

On Ubuntu, there is external command such as wmctrl -m which gives the X window manager name. It relies on the EWMH spec, however I didn't find ways to retrieve this information using PyGi for instance.

So, I don't know what could be a reliable way to detect that i3 is running. Do you have any ideas?

from pympress.

Cimbali avatar Cimbali commented on June 12, 2024

The problem with the pip approach is that you need to install Python 3.9 to be able to run the latest pympress version. Because, using Python 3.8 (my default version for Ubuntu 20.04), you get the following error:

We should support python 3.8. I’ll look into that.

from pympress.

Cimbali avatar Cimbali commented on June 12, 2024

Current master should run fine on python 3.8, which solves that part of the issue. I’ll release 1.8.1 soon and you can just upgrade with pip.

To detect i3, if it is freedesktop-compliant it should set XDG_CURRENT_DESKTOP. Can you check the value it has? I’m guessing i3?

from pympress.

Zar-rok avatar Zar-rok commented on June 12, 2024

Current master should run fine on python 3.8, which solves that part of the issue. I’ll release 1.8.1 soon and you can just upgrade with pip.

Thanks, I will try that.

To detect i3, if it is freedesktop-compliant it should set XDG_CURRENT_DESKTOP. Can you check the value it has? I’m guessing i3?

For me, echo $XDG_CURRENT_DESKTOP returns XFCE.

I use Xfce 4.14 as my desktop environment and i3 as my window manager, instead of the default xfwm4.

From what I understand, XDG_CURRENT_DESKTOP returns the desktop environment, hence it cannot be used to check if i3 is used.

However, by checking the other environment variable defined in my shell, I see that this one exists: I3SOCK=/run/user/1000/i3/ipc-socket.2178. According to the documentation:

You can override the default path through the environment-variable I3SOCK or by specifying the ipc-socket directive. This is discouraged, though, since i3 does the right thing by default.

So, I guess that it is automatically defined when using i3. Thus, maybe that it can be used like that?

import os
...
if os.environ.get("I3SOCK"):
    ... # Disable the start_fullscreen functionality

from pympress.

Zar-rok avatar Zar-rok commented on June 12, 2024

To be more precise, my problem is fixed when replacing:

pympress/pympress/ui.py

Lines 498 to 499 in a3cf735

if not c_full and not p_full:
return

with:

if os.environ.get("I3SOCK"):
  c_full, p_full = False, False
elif not c_full and not p_full:
  return

from pympress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.