GithubHelp home page GithubHelp logo

Comments (6)

dynobo avatar dynobo commented on June 14, 2024 1

I was able to reproduce this issue in a fresh Arch VM. It seems like this is somewhat related to this issue flatpak/xdg-desktop-portal#1070

The issue is about keyboard shortcuts, but the workaround mentioned there worked for me also for the desktop shortcuts:

  1. Create a helper script /some/path/start_normcap.sh with the following content:
#!/bin/bash
/usr/bin/normcap
  1. Copy the desktop file to be able to modify it:
cp /usr/share/applications/normcap.desktop ~/.local/share/applications/normcap.desktop
  1. Edit the new file to point to the helper script (instead to normcap):
exec=/path/to/start_normcap.sh
  1. Launch "NormCap" through the application menu

Does it work for you, too?

from normcap.

HellmannK avatar HellmannK commented on June 14, 2024 1

Oh yes, thanks! That works. Thank you for your investigation! That really deserves the term workaround.. haha.

from normcap.

dynobo avatar dynobo commented on June 14, 2024

@HellmannK , thanks for reporting.

I think on Wayland permissions are somehow tied to the exact filename of the .desktop-file: it has to match a specific format. Can't remember the details though...

I'll try to look into it in the next days.

from normcap.

dynobo avatar dynobo commented on June 14, 2024

He @HellmannK ,

could you please try renaming normcap.desktop to com.github.dynobo.normcap.desktop?

E.g. via:

 sudo mv /usr/share/applications/normcap.desktop /usr/share/applications/com.github.dynobo.normcap.desktop

Does this fix the permission problem?

from normcap.

HellmannK avatar HellmannK commented on June 14, 2024

He @HellmannK ,

could you please try renaming normcap.desktop to com.github.dynobo.normcap.desktop?

E.g. via:

 sudo mv /usr/share/applications/normcap.desktop /usr/share/applications/com.github.dynobo.normcap.desktop

Does this fix the permission problem?

No, it does not help. I tried to get the StartupWMClass with xprop | grep WM_CLASS but it had no output. Is there any? Maybe it would help to add? I also ran desktop-file-validate but there was no error or warning shown.

Out of curiosity I tried to start the .desktop file from cli with gtk-launch com.github.dynobo.normcap.desktop - that works as well...

from normcap.

k1gen avatar k1gen commented on June 14, 2024

Arch, Gnome 45, Wayland:

$ normcap
12:33:52 - ERROR   - normcap.screengrab.dbus_portal:129 - Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.48", path="/org/freedesktop/portal/desktop/request/1_106/normcap_giggdebe", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x55b54d804f00>
12:33:52 - WARNING - normcap.screengrab.permissions:205 - Screenshot permissions on Wayland seem missing.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/permissions.py", line 200, in _dbus_portal_has_screenshot_permission
    result = dbus_portal.capture()
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/dbus_portal.py", line 223, in capture
    result = _synchronized_capture(interactive=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/dbus_portal.py", line 200, in _synchronized_capture
    raise error
normcap.screengrab.exceptions.ScreenshotPermissionError: Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.48", path="/org/freedesktop/portal/desktop/request/1_106/normcap_giggdebe", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x55b54d804f
00>
12:33:55 - ERROR   - normcap.screengrab.dbus_portal:129 - Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.48", path="/org/freedesktop/portal/desktop/request/1_106/normcap_efififgd", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x55b54d81b940>
12:33:55 - CRITICAL - normcap:148 - Uncaught exception!
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/permissions.py", line 181, in accept_button_pressed
    self.capture = dbus_portal._synchronized_capture(interactive=True)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/normcap/screengrab/dbus_portal.py", line 200, in _synchronized_capture
    raise error
normcap.screengrab.exceptions.ScreenshotPermissionError: Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.48", path="/org/freedesktop/portal/desktop/request/1_106/normcap_efififgd", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x55b54d81b940>
12:33:55 - CRITICAL - normcap:151 - System info: {'normcap_version': '0.5.4', 'python_version': '3.11.6', 'cli_args': '/usr/bin/normcap', 'is_briefcase_package': False, 'is_flatpak_package': False, 'is_appimage_package': False, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 1>, 'display_manager_is_wayland': True, 'pyside6_version': '6.6.1', 'qt_version': '6.6.1', 'qt_library_path': '/usr/lib/qt6/plugins, /usr/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/olk/.config/normcap'), 'resources_path': PosixPath('/usr/lib/python3.11/site-packages/normcap/resources'), 'tesseract_path': PosixPath('/usr/bin/tesseract'), 'tessdata_path': None, 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'screens': [Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=None)]}
12:33:55 - CRITICAL - normcap:152 - Unfortunately, NormCap has to be terminated due to an unknown problem.
Please help improve NormCap by reporting this error, including the output above, on
https://github.com/dynobo/normcap/issues/new
Thanks!

after modifying the .desktop, it doesn't appear in the Gnome overview

from normcap.

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.