Open isak102 opened 1 year ago
same problem over ubuntu 18 and flameshot >= 12
@isak102 can it be related to this?
https://github.com/flameshot-org/flameshot/issues/2496#issuecomment-1144308628
@isak102 can it be related to this?
Yes it is related to that, it works properly if flameshot is ran as a daemon first. Judging by that comment this is the intended behaviour so I’ll close this issue
No it is not intended behavior. The daemon should keep running as long as it is needed (for pin or for clipboard). If it does not work it is definitely a bug
@mmahmoudian The daemon keeps running when I start it with flameshot
, it doesn’t quit after I use flameshot gui
if that was what you meant. I just meant that I need to start the flameshot daemon once before I can start using flameshot gui
to copy to clipboard.
The flameshot
starts the daemon and if you have started the daemon by running just the flameshot
, it should keep running (sitting in the tray area). If you want the daemon to get terminated, you in principal should enable the following option, and then only launch Flameshot with flameshot gui
(at the moment it does not work properly all the time, so you might want to kill the process every now and then. We will look into it)
I am facing the same issue, seems to be reported here as well: https://github.com/flameshot-org/flameshot/issues/3107 I am running on ubuntu 22.04
Is there a way to enable verbose logging or something?
I've also started experiencing this on one machine. I can't find the cause for it, but it happens with both official 12.1.0
and git build v12.1.0 (3ededae5)
.
Same issue. Cannot paste image copied to clipboard
@mauamolat
Cannot paste image copied to clipboard
This issue is about not being able to add it to clipboard. In your case what you are saying is that the screenshot is in your clipboard but cannot be pasted elsewhere. That can be many thing, most of which is irrelevant to Flameshot.
@matejdro
Is there a way to enable verbose logging or something?
No, at the momebt the best user can get is what is provided in terminal
@mauamolat
Cannot paste image copied to clipboard
This issue is about not being able to add it to clipboard. In your case what you are saying is that the screenshot is in your clipboard but cannot be pasted elsewhere. That can be many thing, most of which is irrelevant to Flameshot.
@matejdro
Is there a way to enable verbose logging or something?
No, at the momebt the best user can get is what is provided in terminal
I found the issue. It doesn't work with .jpg as default image file but only with .png
I found the issue in my case: It's the update checking.
I traced the code and I found that daemon freezes upon reaching that line: https://github.com/flameshot-org/flameshot/blob/3ededae5745761d23907d65bbaebb283f6f8e3f2/src/core/flameshotdaemon.cpp#L94. Thus, daemon is never initialized and can never receive screenshots to copy to the clipboard.
Disabling update checking fixes the issue for me.
When running flameshot from terminal in i3wm
or other window managers, you may receive this error after trying to copy to system clipboard:
flameshot: info: Capture saved to clipboard.
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
Version + Kernel info:
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.5
6.2.10-arch1-1
Ensure dunst
or an alternate notification manager/daemon is running if you are using i3wm on your system; recommend cloning the official dunstrc
from official dunst repo. A system I was using was not copying flameshot screen captures to the system clipboard, cloned official dunstrc
and managed to re-enable clipboard pasting functionality.
I run into the same problem. My advice t othe dev is, just run the messaging in a separate thread/asynchronous, so that in case, the message daemon will not respond/not available, flameshot will not hang for round about 60s.
I ran into a variation on this issue with flameshot v11 and v12 where it'd "save to clipboard" but i could never paste from it, i'd have to open my clipboard manager (clipman on ubuntu 22.04 with xfce4) and click it and then i could control V to paste it, i got tired of having to constantly do so many clicks just to paste a flameshot captured print screen so i wrote a python script and keybound it and it works now to give me flameshot and controlV to paste with no additional clicks or keystroke
note this assumes you also have copyQ installed as a new clipboard manager, should work alongside your current clipboard manager but you could replace it with it no problem too
import subprocess
import os
import tempfile
import time
# Function to get the first image item from CopyQ
def get_first_image_item():
process = subprocess.run(['copyq', 'read', 'image/png', '0'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if process.stderr:
print("Error reading image item from CopyQ:", process.stderr.decode())
return process.stdout if process.stdout else None
# Function to save the image to a temporary file
def save_image(data):
try:
with tempfile.NamedTemporaryFile(delete=False, suffix='.png') as tmpfile:
tmpfile.write(data)
print("Saved image to:", tmpfile.name)
return tmpfile.name
except Exception as e:
print("Error saving image:", e)
return None
# Get the first image item from CopyQ
image_data = get_first_image_item()
if image_data:
# Save the image to a temporary file
image_path = save_image(image_data)
if image_path:
# Use xclip to load the image into the clipboard
subprocess.run(['xclip', '-selection', 'clipboard', '-t', 'image/png', '-i', image_path])
# Wait a little for xclip to process the image
time.sleep(1)
# Simulate a paste operation. Make sure the focus is on the target window before this step.
subprocess.run(['xdotool', 'key', 'ctrl+v'])
# Clean up the temporary file
os.unlink(image_path)
else:
print("No image data received from CopyQ.")
The
flameshot
starts the daemon and if you have started the daemon by running just theflameshot
, it should keep running (sitting in the tray area). If you want the daemon to get terminated, you in principal should enable the following option, and then only launch Flameshot withflameshot gui
(at the moment it does not work properly all the time, so you might want to kill the process every now and then. We will look into it)
This (running flameshot in the background) worked for me while other workarounds such as toggling jpg on and off did not. Thx
Flameshot Version
Output of
flameshot -v
:Flameshot v12.1.0 (-) Compiled with Qt 5.15.5
Also tried cloning from git and manually compiling, had the same issue
Installation Type
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...), User repository (AUR), Flatpak from Flathub, Compiled from source
Operating System type and version
Arch Linux
6.0.8-arch1-1
Description
Selecting a screenshot in
flameshot gui
and then pressing Ctrl+C to copy the selection to keyboard doesnt work. Pressing Ctrl+C just exits flameshot. The same thing happens when clicking the button in the interface to copy to clipboard.I tried installing flameshot as a flatpak and there it worked properly if I ran flameshot as a daemon, but running
flameshot gui
had the same behaviour, copying didn't work.Steps to reproduce
flameshot gui
Screenshots or screen recordings
No response
System Information