Giter Site home page Giter Site logo

Comments (4)

ahmadraniri avatar ahmadraniri commented on June 20, 2024

Comment some lines on bleachbit.py and bleachbit/Unix.py seems fix it. Bleachbit can be launched.

bleachbit.py

# if 'posix' == os.name:
#     if os.path.isdir('/usr/share/bleachbit'):
#         # This path contains bleachbit/{C,G}LI.py .  This section is
#         # unnecessary if installing BleachBit in site-packages.
#         sys.path.append('/usr/share/')
# 
#     # The two imports from bleachbit must come after sys.path.append(..)
#     import bleachbit.Unix
#     from bleachbit import _
# 
#     if (
#         bleachbit.Unix.is_display_protocol_wayland_and_root_not_allowed()
#     ):
#         print(_('To run a GUI application on Wayland with root, allow access with this command:\n'
#               'xhost si:localuser:root\n'
#                 'See more about xhost at https://docs.bleachbit.org/doc/frequently-asked-questions.html'))
#         sys.exit(1)

bleachbit/Unix.py

# def is_display_protocol_wayland_and_root_not_allowed():
#     try:
#         is_wayland = bleachbit.Unix.is_unix_display_protocol_wayland()
#     except Exception as e:
#         logger.exception(e)
#         return False
#     return (
#         is_wayland and
#         os.environ['USER'] == 'root' and
#         bleachbit.Unix.root_is_not_allowed_to_X_session()
#     )

from bleachbit.

ahmadraniri avatar ahmadraniri commented on June 20, 2024

Using display manager doesn't fix the issue, apparently.

from bleachbit.

ahmadraniri avatar ahmadraniri commented on June 20, 2024

So, I try other alternative, I replace some lines in is_linux_display_protocol_wayland function. It works apparently, I don't know much about python though.

def is_linux_display_protocol_wayland():
    assert(sys.platform.startswith('linux'))
    result = General.run_external(['echo', '$XDG_SESSION_TYPE'])
    return 'wayland' in result[1].lower()

Edit : it works only when I run it using python bleachbit.py.

from bleachbit.

ahmadraniri avatar ahmadraniri commented on June 20, 2024

Fixed and solved, turns out the older version (4.4.x) was still around at /usr/lib/python3.11/site-packages/bleachbit-4.4.2-py3.11.egg. Deleting directory fixs.

from bleachbit.

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.