Skip to content

failure when running as Gnome keyboard shortcutΒ #687

@dgoffredo

Description

@dgoffredo

What happened?

I'm using NormCap-0.5.9-x86_64.AppImage on the following Ubuntu:

david@dell:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
david@dell:~$ uname -a
Linux dell 6.11.0-17-generic #17~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 20 22:48:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
david@dell:~$ env | grep -i XDG
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_SESSION_CLASS=user
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/home/david/.nix-profile/share:/nix/var/nix/profiles/default/share:/home/david/.nix-profile/share:/nix/var/nix/profiles/default/share
david@dell:~$ 

It always works if I run it from the command line, but not always if it's run as a keyboard shortcut.

I set up NormCap-0.5.9-x86_64.AppImage to run as a keyboard shortcut (ctrl+alt+s) using Gnome's custom keyboard shortcuts tool.

It worked a couple of times, but I haven't been able to get it to work for the last few minutes. I think that it fails most of the time when run as a keyboard shortcut.

Here's an excerpt from the logs (in chronological order):

11:41:53 systemd: Started app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658412.scope - Application launched by gsd-media-keys.
11:41:55 xdg-desktop-por: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
11:41:55 systemd: Started app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658432.scope - Application launched by gsd-media-keys.
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_portal:127 - Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.86", path="/org/freedesktop/portal/desktop/request/1_402/normcap_iagafbec", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x72e5dfd87000>
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.main:64 - DBUS_PORTAL's capture() failed!
11:41:55 python3: Traceback (most recent call last):
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/main.py", line 62, in _capture
11:41:55 python3:     images = capture_handler.capture()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/handlers/dbus_portal.py", line 242, in capture
11:41:55 python3:     image = _synchronized_capture(interactive=False)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/handlers/dbus_portal.py", line 198, in _synchronized_capture
11:41:55 python3:     raise error
11:41:55 python3: PermissionError: Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.86", path="/org/freedesktop/portal/desktop/request/1_402/normcap_iagafbec", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x72e5dfd87000>
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_shell:48 - Failed move Window!
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_shell:49 - Screenshot is not allowed
11:41:55 python3: 11:41:55 - CRITICAL - normcap:148 - Uncaught exception!
11:41:55 python3: Traceback (most recent call last):
11:41:55 python3:   File "<string>", line 1, in <module>
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 224, in run_module
11:41:55 python3:     return _run_module_code(code, init_globals, run_name, mod_spec)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 96, in _run_module_code
11:41:55 python3:     _run_code(code, mod_globals, init_globals,
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 86, in _run_code
11:41:55 python3:     exec(code, run_globals)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/__main__.py", line 6, in <module>
11:41:55 python3:     run()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/app.py", line 102, in run
11:41:55 python3:     app, tray = _prepare()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/app.py", line 95, in _prepare
11:41:55 python3:     tray = SystemTray(app, vars(args))
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 139, in __init__
11:41:55 python3:     self._show_windows(delay_screenshot=delay_screenshot)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 204, in _show_windows
11:41:55 python3:     self._create_window(index)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 543, in _create_window
11:41:55 python3:     new_window.set_fullscreen()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/window.py", line 144, in set_fullscreen
11:41:55 python3:     raise ValueError("Screenshot is missing on screen %s", self.screen_)
11:41:55 python3: ValueError: ('Screenshot is missing on screen %s', Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=<PySide6.QtGui.QImage(null) at 0x72e5dfda0cc0>))
11:41:55 python3: 11:41:55 - CRITICAL - normcap:151 - System info: {'normcap_version': '0.5.9', 'python_version': '3.10.13', 'cli_args': '-c', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.1', 'qt_version': '6.7.1', 'qt_library_path': '/tmp/.mount_NormCaYVXNWH/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaYVXNWH/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/david/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaYVXNWH/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaYVXNWH/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/david/.config/normcap/tessdata'), '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)]}
11:41:55 python3: 11:41:55 - CRITICAL - normcap:152 - Unfortunately, NormCap has to be terminated due to an unknown problem.
11:41:55 python3: Please help improve NormCap by reporting this error, including the output above, on
11:41:55 python3: https://github.com/dynobo/normcap/issues/new
11:41:55 python3: Thanks!
11:41:55 python3: Thanks!
11:41:55 systemd: app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658412.scope: Consumed 1.008s CPU time.
11:41:55 systemd: tmp-.mount_NormCaYVXNWH.mount: Deactivated successfully.
11:41:55 systemd: tmp-.mount_NormCaYVXNWH.mount: Deactivated successfully.

How did you install NormCap?

AppImage (Linux)

Operating System + Version?

Ubuntu 24.04

[Linux only] Display Server (DS) + Desktop environment (DE)?

Wayland Gnome

Debug log output?*

11:41:53 systemd: Started app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658412.scope - Application launched by gsd-media-keys.
11:41:55 xdg-desktop-por: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
11:41:55 systemd: Started app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658432.scope - Application launched by gsd-media-keys.
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_portal:127 - Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.86", path="/org/freedesktop/portal/desktop/request/1_402/normcap_iagafbec", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x72e5dfd87000>
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.main:64 - DBUS_PORTAL's capture() failed!
11:41:55 python3: Traceback (most recent call last):
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/main.py", line 62, in _capture
11:41:55 python3:     images = capture_handler.capture()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/handlers/dbus_portal.py", line 242, in capture
11:41:55 python3:     image = _synchronized_capture(interactive=False)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/screengrab/handlers/dbus_portal.py", line 198, in _synchronized_capture
11:41:55 python3:     raise error
11:41:55 python3: PermissionError: Permission denied for Screenshot via xdg-portal! Message: <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.86", path="/org/freedesktop/portal/desktop/request/1_402/normcap_iagafbec", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(2, [Argument: a{sv} {}]) ) at 0x72e5dfd87000>
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_shell:48 - Failed move Window!
11:41:55 python3: 11:41:55 - ERROR   - normcap.screengrab.handlers.dbus_shell:49 - Screenshot is not allowed
11:41:55 python3: 11:41:55 - CRITICAL - normcap:148 - Uncaught exception!
11:41:55 python3: Traceback (most recent call last):
11:41:55 python3:   File "<string>", line 1, in <module>
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 224, in run_module
11:41:55 python3:     return _run_module_code(code, init_globals, run_name, mod_spec)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 96, in _run_module_code
11:41:55 python3:     _run_code(code, mod_globals, init_globals,
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/python/lib/python3.10/runpy.py", line 86, in _run_code
11:41:55 python3:     exec(code, run_globals)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/__main__.py", line 6, in <module>
11:41:55 python3:     run()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/app.py", line 102, in run
11:41:55 python3:     app, tray = _prepare()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/app.py", line 95, in _prepare
11:41:55 python3:     tray = SystemTray(app, vars(args))
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 139, in __init__
11:41:55 python3:     self._show_windows(delay_screenshot=delay_screenshot)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 204, in _show_windows
11:41:55 python3:     self._create_window(index)
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/tray.py", line 543, in _create_window
11:41:55 python3:     new_window.set_fullscreen()
11:41:55 python3:   File "/tmp/.mount_NormCaYVXNWH/usr/app/normcap/gui/window.py", line 144, in set_fullscreen
11:41:55 python3:     raise ValueError("Screenshot is missing on screen %s", self.screen_)
11:41:55 python3: ValueError: ('Screenshot is missing on screen %s', Screen(left=0, top=0, right=1919, bottom=1079, device_pixel_ratio=1.0, index=0, screenshot=<PySide6.QtGui.QImage(null) at 0x72e5dfda0cc0>))
11:41:55 python3: 11:41:55 - CRITICAL - normcap:151 - System info: {'normcap_version': '0.5.9', 'python_version': '3.10.13', 'cli_args': '-c', 'is_briefcase_package': True, 'is_flatpak_package': False, 'is_appimage_package': True, 'platform': 'linux', 'desktop_environment': <DesktopEnvironment.GNOME: 2>, 'display_manager_is_wayland': True, 'pyside6_version': '6.7.1', 'qt_version': '6.7.1', 'qt_library_path': '/tmp/.mount_NormCaYVXNWH/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaYVXNWH/usr/python/bin', 'locale': 'DEFAULT', 'config_directory': PosixPath('/home/david/.config/normcap'), 'resources_path': PosixPath('/tmp/.mount_NormCaYVXNWH/usr/app/normcap/resources'), 'tesseract_path': PosixPath('/tmp/.mount_NormCaYVXNWH/usr/bin/tesseract'), 'tessdata_path': PosixPath('/home/david/.config/normcap/tessdata'), '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)]}
11:41:55 python3: 11:41:55 - CRITICAL - normcap:152 - Unfortunately, NormCap has to be terminated due to an unknown problem.
11:41:55 python3: Please help improve NormCap by reporting this error, including the output above, on
11:41:55 python3: https://github.com/dynobo/normcap/issues/new
11:41:55 python3: Thanks!
11:41:55 python3: Thanks!
11:41:55 systemd: app-gnome-NormCap\x2d0.5.9\x2dx86_64.AppImage-1658412.scope: Consumed 1.008s CPU time.
11:41:55 systemd: tmp-.mount_NormCaYVXNWH.mount: Deactivated successfully.
11:41:55 systemd: tmp-.mount_NormCaYVXNWH.mount: Deactivated successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNeeds confirmation and priotization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions