#Screenshot without confirmation

21 messages · Page 1 of 1 (latest)

sweet snow
#

Greetings. I'd love to be able to take screenshots without a confirmation window popping up. For instance, in taking quick screenshots of movies or games and having the images saved into my Pictures folder. I believe I'm on my way to creating a command ... but I can't get the current date/time to translate into the file name 😦

gnome-screenshot --window --file /home/hashbrowns/Pictures/%H:%M:%S

Happy to hear any other thoughts or programs that have served yall well in this purpose

radiant urchin
#

pretty sure Printscreen key alone already does that

#

check keyboard item in settings

manic mulch
# sweet snow Greetings. I'd love to be able to take screenshots without a confirmation window...

I really like using Flameshot for screenshots. You can take screenshots without any popup. But in order to take a screenshot of a window you'll need to have a (simple) custom script to grab the window coordinates using something like xwinfo and/or xdotool. I'm sure there's scripts u can find online for exactly this purpose, but if you can't find one ill gladly make one for u (it will only be a few lines). You may even be able to make it a one-liner

Also, this method of capturing a window isnt as powerful as the gnome-screenshot method. gnome-screenshot is able to capture the entire active window even if parts of it are obscured by other floating windows that are partially blocking it. Capturing a partially obscured window with flameshot will show both of the windows (ie; the active window and the part of the other window that is in frame)

Some other useful flameshot commands:

  • flameshot screen (captures current screen. Can be supplied with a number to designate a specific screen if u use several)
  • flameshot full (captures all screens in single screenshot)
  • flameshot gui (prompts you to select an area of the screen to capture. It also has lots of tools for modifying thr image before saving it, such as adding arrows, text, shapes, etc.)

Lastly, there are many settings u can configure by running flameshot config

Also, im guessing you already know but you can create keyboard shortcuts to trigger any of these commands, including the command to execute a script that captures the current window

manic mulch
#

I decided to just make the script. It really has minimal error handling and i have no idea if it works on multi-monitor setups:

Make sure you have xdotool, flameshot, awk, and xwininfo installed. (I think xwininfo and awk will already be installed. Maybe xdotool too)

#
#!/usr/bin/env bash

window_geometry_string=$(xwininfo -id $(xdotool getactivewindow) | awk '/Absolute upper-left X/ {x=$NF} /Absolute upper-left Y/ {y=$NF} /Width/ {w=$NF} /Height/ {h=$NF} END {printf "%sx%s+%s+%s\n", w, h, x, y}')

# Check if string is empty
if [[ -z "$window_geometry_string" ]]; then
    exit 1
fi

flameshot screen --region "$window_geometry_string"
#

Also this capture the window with the border thing above it.
It can be modified to only capture the window contents.

sweet snow
manic mulch
sweet snow
#

I love Flameshot for adding flavor to my screenshots, but I wasn't able to find anything in the configs where they wouldn't pop up a window/confirmation afterwards

I think I stumbled on a solution ... as long as I don't hit PrintScreen more than once every second I think this should work

gnome-screenshot --window --file /home/hashbrowns/Pictures/"$(date +%FT%T).png"

#

Eh, it worked for a little while until my actual file name turned out to be $(date .... 😦

sweet snow
radiant urchin
#

I guess they changed it.

#

used to not do that

sweet snow
radiant urchin
#

gnome-screenshot --window --file /home/hashbrowns/Pictures/"$(date +%FT%T).png"

#

this should work, just try with %date

manic mulch
#

Also make sure this setting is enabled:

sweet snow
# manic mulch Also make sure this setting is enabled:

Thanks Coby! You helped me utilize Flameshot in place of gnome-screenshot ... let me know if this makes sense, it seems to be working for me

I was able to reference a command from Flameshot's page (https://flameshot.org/docs/guide/key-bindings/) "flameshot screen --path /home/hashbrowns/Pictures", turn off notifications, then place the command to a custom keyboard shortcut

Key Bindings

Flameshot is a powerful yet simple to use screenshot software.