New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run without background process when -r or -p is passed (also allows not using dbus) #1480
Comments
Here is a oneliner for OCR-ing screenshots: This is what it would look like if it supported what I'm asking for: nix-shell -p flameshot tesseract imagemagick --run \
"flameshot gui -r | convert -modulate 100,0 -resize 400% - - | tesseract - - 2>/dev/null;" This is what it currently looks like: nix-shell -p flameshot tesseract imagemagick --run "set +m; mkfifo wat; { ( flameshot & flame_pid="$!" ; cat wat; kill -9 "$flame_pid" ) & sleep 5; } 2>/dev/null; flameshot gui -r | convert -modulate 100,0 -resize 400% - - | tesseract - - 2>/dev/null; echo > wat; rm wat; set -m;" Breakdown: nix-shell -p flameshot tesseract imagemagick --run `# on NixOS we can get a shell with our dependencies.` " \
set +m; `# Temporarily disable some job management messages.` \
mkfifo wat; `# we wait on a named pipe to know when to kill the background process...` \
{ ( flameshot & flame_pid="$!" ; cat wat; kill -9 "$flame_pid" ) & sleep 5; } 2>/dev/null; `# The wrapping is to suppress the new PID message.` \
flameshot gui -r | convert -modulate 100,0 -resize 400% - - | tesseract - - 2>/dev/null; \
echo > wat; rm wat; set -m; `# cleanup` \
" |
@deliciouslytyped I don't this this dbus is going away anytime soon, but your "feature request" imho has nothing to do with the dbus but rather having an override on saving to the file when Perhaps the more complete solution is that Flameshot respects all flags ( |
The dbus stuff was a side-issue. |
@borgmanJeremy @ZetaoYang @Martin-Eckleben @lupoDharkael I personally think that:
|
La verdad es la primera vez que analizo esto y pues se me terminó el
tiempo, pero me esforzare por mejorar mi lógica mental y comprender mejor
el ingles ya que sólo se poquito y esta activad apenas hace una hora y
media supe que existia. Gracias:)
El lun., 15 de marzo de 2021 11:47 p. m., deliciouslytyped <
***@***.***> escribió:
… The dbus stuff was a side-issue.
The key thing is to not need to start a background process.
Using -r and -p are just the general contexts where this makes sense.
You can keep the dbus stuff even if you aren't running a separate
background process, it just isn't *needed* anymore in that specific case,
because the output target is not the X11 clipboard.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1480 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATH6ONLEXBD6A7MVIPOCPT3TD35JTANCNFSM4ZH3TX3Q>
.
|
The following should work.
or
|
@ZetaoYang This works (raw to stdout and copied to clipboard): flameshot screen -n 2 -r -c | display This does not work: flameshot screen -n 2 -r -c -p ~/test.png | display does not save the screenshot to
|
@mmahmoudian @ZetaoYang: None of these work without the background flameshot process running. Please check that you don't have any flameshot processes running in the background when you test these, or you can probaby kill it with |
I changes the background of my monitors to be different make it easier to see what is screenshot and what is not. I'm recording from my 3rd monitor (with Manjaro background) and I took screenshot from my 2nd monitor (with dark camouflage-patterned background). |
Hm. Ok, I'm not sure what's going on. |
Do i get it right that i need to explicitly |
@l29ah You got the concept awfully wrong. Flameshot does not listen to your keys. To put it in simple terms, Flameshot has 2 parts:
Flameshot main process does NOT listen to your key presses. On my computer it uses 145KB of memory. So imho no one should be worried about saving that much memory: if you want to try it yourself: ps --pid $(pgrep flameshot) -o pid,%cpu,%mem,vsz,rss,command | numfmt --header --to=iec --field 4-5 The For more information about dbus read the following: |
No, your script (or in fact your interpretation of its output) is incorrect, and in your example it consumes 145MB of RAM (and being 0.4% of your 32GB installed), as ps outputs sizes in kilobytes. |
@l29ah you are right about the Regarding the sudo lsof -u dbus | grep -i socket | wc -l About the listening to keystokes, perhaps @borgmanJeremy or @ThePurple can provide better answer. |
#2003 is the solution to all our problems :) If you are up for it, you can help us with testing. |
Flameshot currently requires starting a separate background process, with the rationale that this is required to handle the clipboard.
Currently flameshot is the only screenshot application that I was able to find, that works on gnome3 with wayland.
gnome-screenshot
doesn't do what I want, so I need to use flameshot.I want to output a screenshot on stdout, and this is possible with the -r option, however, needing to run a background process for
flameshot gui
to work, is awkward.flameshot gui
starting a proper flameshot process, taking a screenshot, and then returning the output, is the desired behaviour.Having this all done in one process context would also allow flameshot to work properly without dbus.
My current solution is this awkward mess:
which could be reduced to:
#1468 (comment) is related to making this process less awkward as well.
The text was updated successfully, but these errors were encountered: