regolith-desktop icon indicating copy to clipboard operation
regolith-desktop copied to clipboard

PrtScn not mapped

Open 0atman opened this issue 2 years ago • 24 comments

Is your feature request related to a problem? Please describe. I want to take screenshots easily, something I do many many times a day

Describe the solution you'd like PrtScn = run gnome-screenshot (or similar) to capture the whole screen shift + PrtScn = run gnome-screenshot -a to allow area selection alt + PrtScn = run gnome-screenshot -w for current window capture

Describe alternatives you've considered I can't seem to map these myself, using the keyboard shortcuts options. it doesn't trigger gnome-screenshot correctly, no file is created. Interactively running gnome-screenshot works fine, though is very slow.

Additional context Also note that -c while being my preferred option (to copy the screenshot to the clipboard) doesn't appear to work. Unsure if that's a regolith problem or gnome-screenshot.

Thank you very much!

0atman avatar Jun 10 '22 11:06 0atman

Context: I have tested this both on my laptop (thinkpad x1 carbon, 2019 edition, i7 + 16gb ram) and PC (Ryzen 5, 16gb ram). PC was a fresh install today, Laptop was on the beta, and I've just confirmed that even with today's updates the bug persists.

0atman avatar Jun 10 '22 11:06 0atman

This screenshot was more annoying to take than it needed to be :laughing: image

0atman avatar Jun 10 '22 11:06 0atman

@0atman after upgrading to regolith 2.0, I have the same issue

williamgrimes avatar Jun 13 '22 08:06 williamgrimes

@0atman I ended up installing flameshot and adding this to my 40_workspace-config file

bindsym Ctrl+Shift+Print exec "/usr/bin/flameshot gui --delay 1000"

(also, 'hello')

pmahnke avatar Jun 14 '22 09:06 pmahnke

@pmahnke Ahoy!

Oh yeah, just using i3 to configure it - genius. I'll try that, thank you.

0atman avatar Jun 14 '22 10:06 0atman

Similar problem here, potentially the same. I manually installed gnome-screenshot on 2.0 because it wasn't installed by default I think. Now on 2.1.

This works:

  • Using the launcher to launch the screenshot GUI, and interactively taking a screenshot with it. I don't get the shutter sound, but that is probably not significant.
  • gnome-screenshot -a -f "$filename" shows the area selector and saves the resulting file correctly.

This doesn't work:

  • gnome-screenshot -a -c shows the area selector but my clipboard remains empty. (while via the GUI it does work!)
  • I can set a custom keyboard shortcut in the gnome configuration (super-C) to call gnome-screenshot: same behavior (saving to file works, copying does not).

System: image

ghost avatar Jul 21 '22 11:07 ghost

Solved this by installing gnome-screenshot and xclip, then remap keys in settings

Settings -> Keyboard -> View and Customize Shortcuts -> Custom Shortcuts

For example add a hotkey for Ctrl + Shift + Print sh -c "gnome-screenshot -c -a -f /tmp/test && cat /tmp/test | xclip -i -selection clipboard -target image/png"

williamgrimes avatar Jul 21 '22 13:07 williamgrimes

That is a nice workaround! But that confirms that gnome-screenshot -c -a does not actually place anything on the clipboard right?

ghost avatar Jul 21 '22 14:07 ghost

A more portable (and gittable) solution, would be to create your own i3 partial in ~/.config/regolith2/i3/conf.d, e.g. 99_personal-config and add something like this:

## PrintScreen: selection
## Ctrl+PrintScreen: window
## Ctrl+Shift+PrintScreen: screen
bindsym --release Print exec --no-startup-id "scrot -s - | xclip -selection clipboard -target image/png"
bindsym --release Ctrl+Print exec --no-startup-id "scrot -u - | xclip -selection clipboard -target image/png"
bindsym --release Ctrl+Shift+Print exec --no-startup-id "scrot - | xclip -selection clipboard -target image/png"

My example uses scrot because that can output to STDOUT so no need to do the dance with a temp file, but bindsym --release Print exec --no-startup-id "gnome-screenshot -c -a -f /tmp/test && cat /tmp/test | xclip -i -selection clipboard -target image/png" should also work.

ferdinandyb avatar Jul 29 '22 20:07 ferdinandyb

I have verified in unstable of Regolith 2.1 I am able to use prtscr keys in modes: desktop, window, region via meta keys. The files are placed in ~/Pictures. Is this not what others are seeing, or is the ask to use a different screen capture program?

kgilmer avatar Jul 31 '22 19:07 kgilmer

For me it currently doesn't work. After upgrading (from 1.6) it didn't work at all, then it worked for a while, then it stopped working again. I'm obviously not on a clean install, but had 1.6 on Ubuntu 20.04 originally and went with upgrading Ubuntu then Regolith, so I can imagine some mess coming from that.

ferdinandyb avatar Jul 31 '22 19:07 ferdinandyb

I have noticed it not working on some of my machines from time to time. We'll keep monitoring the issue and once a root-cause is found we can fix.

kgilmer avatar Jul 31 '22 19:07 kgilmer

@kgilmer can you confirm that gnome-screenshot -c sends a screenshot to clipboard?

ghost avatar Aug 01 '22 06:08 ghost

image

Confirmed

kgilmer avatar Aug 02 '22 02:08 kgilmer

Thanks! Then I think all functionality is restored. I am on 2.1 main, should I try and get unstable?

ghost avatar Aug 02 '22 06:08 ghost

@bouke-sf I don't think it presents much risk to try and update from unstable now, but would recommend that you do it temporarily unless you want to be always testing the latest updates. if you do opt to update I would like to know if the update resolves the problem for you.

kgilmer avatar Aug 03 '22 14:08 kgilmer

I just did a completely fresh install, downloading Ubuntu 22.04.1 LTS, then installing Regolith 2.1.

The current behavior (not on unstable) is that no files are generated, and - i.e. - ctrl+shift+printsc does not provide the snipping interface it used to, printsc does (as far as I can tell) nothing at all.

I was going to take a screenshot of the monitor interface to show another error when I ran into this one :) :)

From the above it looks like this will be resolved with the next version of Regolith, so just reporting for completeness here.

DanRunfola avatar Oct 06 '22 12:10 DanRunfola

I think there is no such binding configured in https://github.com/regolith-linux/regolith-i3-config/tree/master/partials

I added a file 61_screenshot_keybindings to ~/.config/regolith2/config with:

## Screenshot // Selection to File // Prtsc ##
bindsym --release Print exec --no-startup-id "scrot -s -F ~/Pictures/screenshot_`date +%Y-%m-%d_%H:%M:%S_selection`.png"

## Screenshot // Selection to Clipboard // <> Prtsc ##
bindsym --release $mod+Print exec --no-startup-id "scrot -s - | xclip -selection clipboard -target image/png"

## Screenshot // Window to File // Ctrl Prtsc ##
bindsym --release Ctrl+Print exec --no-startup-id "scrot -u -F ~/Pictures/screenshot_`date +%Y-%m-%d_%H:%M:%S_window`.png"

## Screenshot // Window to Clipboard // <> Ctrl Prtsc ##
bindsym --release $mod+Ctrl+Print exec --no-startup-id "scrot -u - | xclip -selection clipboard -target image/png"

## Screenshot // All to File// Shift Ctrl Prtsc ##
bindsym --release Ctrl+Shift+Print exec --no-startup-id "scrot -F ~/Pictures/screenshot_`date +%Y-%m-%d_%H:%M:%S_all`.png"

## Screenshot // All to Clipboard // <> Shift Ctrl Prtsc ##
bindsym --release $mod+Ctrl+Shift+Print exec --no-startup-id "scrot - | xclip -selection clipboard -target image/png"

Which I think is very useful and offers both options, clipboard and direct capture to file.

jensens avatar Oct 24 '22 08:10 jensens

Consider flameshot instead of scrot?

cfsmp3 avatar Oct 24 '22 14:10 cfsmp3

Consider flameshot instead of scrot?

Oh, nice one. Could be handy to have all those features.

jensens avatar Oct 24 '22 15:10 jensens

Good suggestion, I set flameshot gui under the PrintScr key now.

ghost avatar Oct 29 '22 15:10 ghost

Just upgraded from Ubuntu 20.04, Regolith 1.6 to Ubuntu 22.04, Regolith 2.2 I installed the gnome-screenshot and created the file ~/.config/regolith2/i3/config.d/61_screenshot_keybindings with two lines:

bindsym --release Print exec --no-startup-id "gnome-screenshot"
bindsym --release Shift+Print exec --no-startup-id "gnome-screenshot -a

tomasfrtala avatar Dec 14 '22 15:12 tomasfrtala

I had to also disable gnome-flashback's built-in screenshot:

gsettings set org.gnome.gnome-flashback screenshot false

docquantum avatar Nov 14 '23 15:11 docquantum

I had this issue after upgrading from Ubuntu 20.04 to 22.04 using the do-release-upgrade method after regolith3 was already installed and configured. I verified that gnome-screenshot was installed.

@tomasfrtala fix worked -- but not yet sure why the basic print screen functions were not working after upgrading.

vanboom avatar Feb 15 '24 19:02 vanboom