flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

Allow "flameshot gui" with preselected area - including an active window; add command-line options

Open mikkovedru opened this issue 2 years ago • 7 comments

Feature Description

There are various command-line options to decide on the capture mode.

  • flameshot gui - a manual capture in GUI mode.
  • flameshot screen - Capture a single screen.
  • flameshot full - Capture the entire desktop.

The best thing about flameshot is the GUI mode in which one can annotate the image. Plus all the upload/save/copy options.

Unfortunately, the GUI mode can't be combined with other options. I argue that it would be useful to have it.

Here is what options the Linux Mint Cinnamon provides: image

  • screen (as in flameshot full)
  • area (as selected with flameshot gui, but without annotations)
  • window (unfortunately, flameshot doesn't have this convenient option; no need to worry about leaking sensitive info from Desktop, taskbar, or other windows)

Since the OS doesn't allow annotating, I am using flameshot. But it means that extra work must be done: before annotating I have to manually select the full screen or a window area. Not a deal-breaker, but an inconvenience nevertheless.

Suggestion

Add the following command-line options:

  • flameshot gui --screen - selects a single screen and goes into gui mode
  • flameshot gui --full - selects the entire desktop and goes into gui mode
  • flameshot gui --window - selects an active window and goes into gui mode

mikkovedru avatar Jul 09 '22 14:07 mikkovedru

Selecting the active/focused/specific window is already suggested and is duplicate of #5 (yes it is that old and we don't have a solid approach to address this. There are ways this can be done in X11 though, as my dmenu_shot already does that with the help of xdotool.

To select the entire desktop (all monitors), just do flameshot gui and then like any other software out there, Ctrla to "select all". So I personally see no merit in adding an extra CLI argument for something that is already easily achievable.

The only part that it is not as easily doable is selecting the entire screen. It is still possible though scripting and at least I can think of two approaches in X11, one of which is as follows:

# required these software to be available: xrandr, dmenu
flameshot gui --region $(xrandr --query --listactivemonitors \
                         | grep " connected " \
                         | sed -E 's/( connected)|( primary)|(\(.+)|( left)//g' \
                         | dmenu -p "Select the monitor" \
                         | cut -d ' ' -f 2)


# required these software to be available: xrandr, rofi
flameshot gui --region $(xrandr --query --listactivemonitors \
                         | grep " connected " \
                         | sed -E 's/( connected)|( primary)|(\(.+)|( left)//g' \
                         | rofi -dmenu -p "Select the monitor" \
                         | cut -d ' ' -f 2)

I will leave this issue open because of this one-third to get comments from other devs.

mmahmoudian avatar Jul 09 '22 15:07 mmahmoudian

I agree that the only thing really missing is the selecting entire screen. What if the first time you press Ctrl + A it selects the entire screen with the active widget, and the second time you press it it grabs all monitors?

borgmanJeremy avatar Jul 12 '22 01:07 borgmanJeremy

the first time you press Ctrl + A it selects the entire screen with the active widget, and the second time you press it it grabs all monitors

Although it is a breaking change, I don't think we get so much backlash. If we ultimately go with this, can the third time press selects the monitor again? Basically all odd times it selects monitor and all even times it selects all monitors. Although either the implementation should not be based on even/odd count, or the counter should reset to zero if the size/position of the selected region is reset.

mmahmoudian avatar Jul 12 '22 05:07 mmahmoudian

Although it is a breaking change, I don't think we get so much backlash

I agree.

My further suggestion would be to have 3 switch modes instead of 2. So in addition to:

  1. select monitor
  2. select screen also switch to
  3. select the area that was chosen before pressing Ctrl+A for the first time. If none was selected, then it should display the unselected view.

Ctrl+A would be a hotkey toggling between 3 selections: 1->2->3->1

That would make pressing the hotkey and screwing the area selection reversible. Currently, there is no way to do it. Ctrl+Z does nothing and Esc simply exists the application and forces to lose all the progress.

Additional question

Perhaps the Ctrl+Z undo should also work for area selection?

mikkovedru avatar Jul 28 '22 00:07 mikkovedru

  1. select the area that was chosen before pressing Ctrl+A for the first time. If none was selected, then it should display the unselected view.

I personally think this is too unintuitive. Having Ctrl-z makes way more sense in my head than Ctrl-a because:

  • Ctrl-a means "select all" which can be interpreted as "all monitors" or "all of the active monitor", so "go back to previous choice" sounds odd to me
  • Ctrl-z can also be used or accidental deselect of the region

mmahmoudian avatar Jul 28 '22 07:07 mmahmoudian

I agree; However, Ctrl-Z is already taken, for undoing markups like adding arrows or lines. I think it would make much more sense to make a specific hotkey just for undoing selection changes.

Quinntyx avatar Aug 10 '22 03:08 Quinntyx

Ctrl-Z is already taken, for undoing markups like adding arrows or lines.

It is bound to "undo". At the moment the chances in the region selection are not pushed to the undo stack, but can be. Ctrl-z is very intuitive for this

mmahmoudian avatar Aug 10 '22 04:08 mmahmoudian