StreamController
StreamController copied to clipboard
Run command doesn't work with flameshot.
Describe the bug When using Run Command (OS) to execute a Flameshot command, nothing happens.
To Reproduce Steps to reproduce the behavior:
- Install Flameshot
- Add Run Command (OS) action to button
- Set the command to any Flameshot command (I used
flameshot gui --clipboard) - Press the button, nothing happens.
Expected behavior Upon pressing the button, the Flameshot command is ran, the Flameshot GUI opens, and I can take a screenshot.
Screenshots Not applicable.
Additional context
I am running Arch Linux, with i3wm, on X11. I have verified that Flameshot is installed correctly, and its commands work as expected when running them in a terminal. I have also verified that Run Command (OS) isn't broken for other commands such as i3lock and beep.
Hm, weird.. Just tested it and it works fine fore me. Which distro are you using (shouldn't really matter but maybe I can reproduce this)?
And can you please close the app completely via the option in the hamburger menu, open it via flatpak run com.core447.StreamController, press the button with the command and share the output?
Edit: I tested it in a Ubuntu X11 vm and it worked as described, however, id doesn't on Arch + Hyprland...
Here is the output, the Traceback only appears after pressing the button:
2024-09-21 21:02:22.876 | INFO | __main__:quit_running:187 - Checking if another instance is running
2024-09-21 21:02:22.877 | INFO | __main__:quit_running:195 - No other instance running, continuing
2024-09-21 21:02:22.877 | ERROR | __main__:quit_running:196 - org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
2024-09-21 21:02:23.078 | ERROR | src.backend.GnomeExtensions:connect_dbus:31 - Failed to connect to D-Bus: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
2024-09-21 21:02:23.087 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.0001518726348876953 seconds
2024-09-21 21:02:23.088 | INFO | src.backend.PageManagement.PageManagerBackend:remove_old_backups:448 - Removed old page backups: 2024-09-19T23:04:12.102135
launch backend
2024-09-21 21:02:23.529 | INFO | src.backend.PluginManager.PluginBase:launch_backend:519 - Launching backend: . /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/.venv/bin/activate && python3 /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/backend.py --port=34333
/bin/sh: line 1: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/.venv/bin/activate: No such file or directory
backend launched
2024-09-21 21:02:23.833 | INFO | src.backend.PluginManager.PluginBase:launch_backend:519 - Launching backend: . /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/.venv/bin/activate && python3 /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/twitch_backend.py --port=37211
/bin/sh: line 1: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/.venv/bin/activate: No such file or directory
2024-09-21 21:02:24.634 | ERROR | src.backend.PluginManager.PluginManager:init_plugins:71 - Error initializing plugin <class 'plugins.com_imdevinc_StreamControllerTwitchPlugin.main.PluginTemplate'>: 'NoneType' object has no attribute 'set_token_path'. Skipping...
2024-09-21 21:02:24.638 | TRACE | src.backend.PageManagement.PageManagerBackend:register_page:272 - Registering page: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_VolumeMixer/pages/VolumeMixer.json
2024-09-21 21:02:24.638 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.00016999244689941406 seconds
2024-09-21 21:02:24.638 | TRACE | src.backend.PageManagement.PageManagerBackend:register_page:272 - Registering page: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_VolumeMixer/pages/VolumeMixerSDPlus.json
2024-09-21 21:02:24.638 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.0001964569091796875 seconds
2024-09-21 21:02:26.198 | INFO | src.backend.WindowGrabber.WindowGrabber:init_integration:63 - Initializing window grabber for environment: i3 under server: x11
2024-09-21 21:02:26.203 | INFO | autostart:setup_autostart_desktop_entry:81 - Setting up autostart using desktop entry
2024-09-21 21:02:26.204 | INFO | autostart:setup_autostart_desktop_entry:95 - Autostart set up at: /home/gabri/.config/autostart/StreamController.desktop
2024-09-21 21:02:26.214 | INFO | __main__:load:87 - Loading app
2024-09-21 21:02:26.231 | INFO | src.backend.DeckManagement.DeckManager:__init__:70 - Beta resume mode: True
2024-09-21 21:02:26.312 | INFO | src.backend.PluginManager.ActionBase:__init__:77 - Loaded action Change Page with id com_core447_DeckPlugin::ChangePage
2024-09-21 21:02:26.312 | INFO | src.backend.PluginManager.ActionBase:__init__:77 - Loaded action Run Command with id com_core447_OSPlugin::RunCommand
2024-09-21 21:02:26.313 | DEBUG | src.backend.PageManagement.Page:load:77 - Loaded page Le Default in 0.00 seconds
2024-09-21 21:02:26.313 | INFO | src.backend.DeckManagement.DeckController:load_page:670 - Loading page Le Default on deck AL46J2C58555
2024-09-21 21:02:26.399 | INFO | src.backend.DeckManagement.Subclasses.ScreenSaver:set_time:54 - Setting screen saver time delay to 1 minutes
2024-09-21 21:02:26.399 | INFO | src.backend.DeckManagement.DeckController:load_page:699 - Loaded page Le Default on deck AL46J2C58555
2024-09-21 21:02:26.430 | INFO | src.backend.DeckManagement.DeckController:load_background:522 - Loading background in thread: 139408141452992
(process:3938292): Gtk-WARNING **: 21:02:26.430: Theme parser error: style.css:399:19-27: Unknown name of pseudo-class
2024-09-21 21:02:26.471 | TRACE | src.app:on_activate:72 - running: on_activate
2024-09-21 21:02:26.472 | TRACE | src.windows.mainWindow.mainWindow:build:93 - Building main window
(StreamController:3938292): GdkPixbuf-CRITICAL **: 21:02:26.526: gdk_pixbuf_new_from_bytes: assertion 'g_bytes_get_size (data) >= width * height * (has_alpha ? 4 : 3)' failed
2024-09-21 21:02:26.591 | INFO | src.backend.DeckManagement.DeckController:load_all_inputs:608 - Loading all inputs took 0.004427433013916016 seconds
2024-09-21 21:02:26.594 | DEBUG | src.backend.DeckManagement.DeckController:update_all_inputs:432 - Updating all inputs took 0.0033884048461914062 seconds
2024-09-21 21:02:26.665 | SUCCESS | src.app:on_activate:102 - Finished loading app
2024-09-21 21:02:27.659 | INFO | __main__:update_assets:155 - Updating 0 store assets took 1.4453797340393066 seconds
Exception ignored in: <function _after_fork at 0x7ecb184442c0>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1699, in _after_fork
thread._stop()
TypeError: 'bool' object is not callable
Ok, and can you please also share the output when you disable "Detached" in the action settings?
2024-09-22 21:52:54.538 | INFO | __main__:quit_running:187 - Checking if another instance is running
2024-09-22 21:52:54.539 | INFO | __main__:quit_running:195 - No other instance running, continuing
2024-09-22 21:52:54.539 | ERROR | __main__:quit_running:196 - org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
2024-09-22 21:52:54.745 | ERROR | src.backend.GnomeExtensions:connect_dbus:31 - Failed to connect to D-Bus: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
2024-09-22 21:52:54.755 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.0001506805419921875 seconds
2024-09-22 21:52:54.755 | INFO | src.backend.PageManagement.PageManagerBackend:remove_old_backups:448 - Removed old page backups: 2024-09-21T16:03:38.296871
launch backend
2024-09-22 21:52:55.464 | INFO | src.backend.PluginManager.PluginBase:launch_backend:519 - Launching backend: . /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/.venv/bin/activate && python3 /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/backend.py --port=33257
/bin/sh: line 1: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_OBSPlugin/backend/.venv/bin/activate: No such file or directory
backend launched
2024-09-22 21:52:55.767 | INFO | src.backend.PluginManager.PluginBase:launch_backend:519 - Launching backend: . /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/.venv/bin/activate && python3 /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/twitch_backend.py --port=39825
/bin/sh: line 1: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_imdevinc_StreamControllerTwitchPlugin/.venv/bin/activate: No such file or directory
2024-09-22 21:52:56.568 | ERROR | src.backend.PluginManager.PluginManager:init_plugins:71 - Error initializing plugin <class 'plugins.com_imdevinc_StreamControllerTwitchPlugin.main.PluginTemplate'>: 'NoneType' object has no attribute 'set_token_path'. Skipping...
2024-09-22 21:52:56.572 | TRACE | src.backend.PageManagement.PageManagerBackend:register_page:272 - Registering page: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_VolumeMixer/pages/VolumeMixer.json
2024-09-22 21:52:56.573 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.0002231597900390625 seconds
2024-09-22 21:52:56.573 | TRACE | src.backend.PageManagement.PageManagerBackend:register_page:272 - Registering page: /home/gabri/.var/app/com.core447.StreamController/data/plugins/com_core447_VolumeMixer/pages/VolumeMixerSDPlus.json
2024-09-22 21:52:56.573 | INFO | src.backend.PageManagement.PageManagerBackend:update_auto_change_info:333 - Updated auto-change info in 0.0001895427703857422 seconds
2024-09-22 21:52:56.675 | INFO | src.backend.WindowGrabber.WindowGrabber:init_integration:63 - Initializing window grabber for environment: i3 under server: x11
2024-09-22 21:52:56.681 | INFO | autostart:setup_autostart_desktop_entry:81 - Setting up autostart using desktop entry
2024-09-22 21:52:56.681 | INFO | autostart:setup_autostart_desktop_entry:95 - Autostart set up at: /home/gabri/.config/autostart/StreamController.desktop
2024-09-22 21:52:56.691 | INFO | __main__:load:87 - Loading app
2024-09-22 21:52:56.691 | INFO | __main__:update_assets:147 - Updating store assets
2024-09-22 21:52:56.710 | INFO | src.backend.DeckManagement.DeckManager:__init__:70 - Beta resume mode: True
2024-09-22 21:52:56.996 | INFO | src.backend.PluginManager.ActionBase:__init__:77 - Loaded action Change Page with id com_core447_DeckPlugin::ChangePage
2024-09-22 21:52:56.996 | INFO | src.backend.PluginManager.ActionBase:__init__:77 - Loaded action Run Command with id com_core447_OSPlugin::RunCommand
2024-09-22 21:52:56.997 | DEBUG | src.backend.PageManagement.Page:load:77 - Loaded page Le Default in 0.00 seconds
2024-09-22 21:52:56.997 | INFO | src.backend.DeckManagement.DeckController:load_page:670 - Loading page Le Default on deck AL46J2C58555
2024-09-22 21:52:57.083 | INFO | src.backend.DeckManagement.Subclasses.ScreenSaver:set_time:54 - Setting screen saver time delay to 1 minutes
2024-09-22 21:52:57.083 | INFO | src.backend.DeckManagement.DeckController:load_page:699 - Loaded page Le Default on deck AL46J2C58555
2024-09-22 21:52:57.111 | INFO | src.backend.DeckManagement.DeckController:load_background:522 - Loading background in thread: 139885017040576
(process:203949): Gtk-WARNING **: 21:52:57.112: Theme parser error: style.css:399:19-27: Unknown name of pseudo-class
2024-09-22 21:52:57.153 | TRACE | src.app:on_activate:72 - running: on_activate
2024-09-22 21:52:57.154 | TRACE | src.windows.mainWindow.mainWindow:build:93 - Building main window
(StreamController:203949): GdkPixbuf-CRITICAL **: 21:52:57.205: gdk_pixbuf_new_from_bytes: assertion 'g_bytes_get_size (data) >= width * height * (has_alpha ? 4 : 3)' failed
2024-09-22 21:52:57.264 | INFO | src.backend.DeckManagement.DeckController:load_all_inputs:608 - Loading all inputs took 0.0037865638732910156 seconds
2024-09-22 21:52:57.267 | DEBUG | src.backend.DeckManagement.DeckController:update_all_inputs:432 - Updating all inputs took 0.003003358840942383 seconds
2024-09-22 21:52:57.349 | SUCCESS | src.app:on_activate:102 - Finished loading app
2024-09-22 21:52:58.516 | INFO | __main__:update_assets:155 - Updating 0 store assets took 1.8243944644927979 seconds
# Error when "Detached" is enabled and button is pressed
Exception ignored in: <function _after_fork at 0x7f3a208442c0>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1699, in _after_fork
thread._stop()
TypeError: 'bool' object is not callable
# Error when "Detached" is disabled and button is pressed
QObject::moveToThread: Current thread (0x5590242826c0) is not the object's thread (0x55902437e020).
Cannot move to target thread (0x5590242826c0)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/streamcontroller/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/lib/streamcontroller/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx.
Ok, that's weird.. And you're never gettings this when running flameshot from the command line (especially the 2nd time)?
Never, all flameshot commands work exactly as expected through the command line with no errors.
tl;dr if you just want to get this working, scroll to the bottom of this comment and try the section "what fixed it for me". i kept the details of my investigation here for completeness.
investigation stuff
i'm running into this same problem with https://github.com/keepassxreboot/keepassxc
i'm using a little helper script called activate to activate keepassxc using xdotool if it's already open otherwise start it using binary /usr/bin/keepassxc. i tried:
$ diff -u <(env) <(source ./.venv/bin/activate; env)
--- /dev/fd/63 2024-09-30 16:24:18.611239024 -0700
+++ /dev/fd/62 2024-09-30 16:24:18.611239024 -0700
@@ -38,6 +38,7 @@
...
+VIRTUAL_ENV=/home/violet/Downloads/streamdeck/StreamController/.venv
...
@@ -62,13 +63,14 @@
...
+VIRTUAL_ENV_PROMPT=(.venv)
...
-PS1=...
+PS1=(.venv) ...
...
-PATH=...
+PATH=/home/violet/Downloads/streamdeck/StreamController/.venv/bin:...
...
so, in my activate helper script i tried to chop off the StreamController python venv from the PATH when it's present, but it didn't fix the problem.
when "display output" set:
QObject::moveToThread: Current thread (0x55d9ae6a27c0) is not the object's thread (0x55d9ae6ba660).
Cannot move to target thread (0x55d9ae6a27c0)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/violet/Downloads/streamdeck/StreamController/.venv/lib/python3.12/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb, minimal, offscreen.
when "detached" set:
Exception ignored in: <function _after_fork at 0x7f007a578540>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1699, in _after_fork
thread._stop()
TypeError: 'bool' object is not callable
some ideas..
based on OP's report + my digging around, it seems like it may be happening for any qt-based application. (looks like flameshot is qt also https://github.com/flameshot-org/flameshot )
the issue also happens if i plug /usr/bin/keepassxc directly into run command and bypass my activate helper script.
also following OP's info, when StreamController is running and i run flameshot from xfce4's application launcher (opened using meta+r) and then /usr/bin/flameshot gui, StreamController dumps this a bunch of times on repeat:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 20 (X_GetProperty)
Resource id in failed request: 0x12025d6
Serial number of failed request: 13
Current serial number in output stream: 13
opening discord still results in some unhappy output, but the button/command works as i want it to so i don't consider it a problem:
Exception ignored in: <function _after_fork at 0x7fb61af78540>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1699, in _after_fork
thread._stop()
TypeError: 'bool' object is not callable
Exception ignored in: <function _after_fork at 0x7fb61af78540>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1699, in _after_fork
thread._stop()
TypeError: 'bool' object is not callable
pulled in the newest main branch and repeated my tests; the results are the same.
what fixed it for me
it seems this may be an issue somewhere in python opencv and qt https://github.com/NVlabs/instant-ngp/discussions/300
@sykesgabri i specifically followed some advice from https://github.com/NVlabs/instant-ngp/discussions/300#discussioncomment-5241405
(i just renamed ...cv2/qt/plugins to ...cv2/qt/plugins.backup, but you could probably delete that directory 🤷♀️️)
mv /home/violet/Downloads/streamdeck/StreamController/.venv/lib/python3.12/site-packages/cv2/qt/plugins /home/violet/Downloads/streamdeck/StreamController/.venv/lib/python3.12/site-packages/cv2/qt/plugins.backup
and the issue isn't happening anymore. can open keepassxc from StreamController and see no new issues appearing in StreamController.
EDIT
EDIT: before i submitted this comment i also tried the advice from that linked issue to uninstall opencv-python and install opencv-python-headless but then streamcontroller wouldn't open:
File "/home/violet/Downloads/streamdeck/StreamController/src/windows/mainWindow/elements/PageSettings/PageSettings.py", line 24, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
EDIT: i don't know how github issue editing notifications work, if this is sending out a ton of emails/alerts/notifications every edit i make i'm super sorry, please let me know and i'll try not to make so many rapid fire updates in a row in the future
EDIT: i don't know how github issue editing notifications work, if this is sending out a ton of emails/alerts/notifications every edit i make i'm super sorry, please let me know and i'll try not to make so many rapid fire updates in a row in the future
I just got one notification
Thank you for your detailed message!
If you want to run StreamController without opencv-python installed, you'll have to install StreamController as a Flatpak.
Closing this now