Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
As a user coming from the windows world, one feature that I really hope linux has in it is the following that I found myself using quite often in windows:
When I want to capture the screen to a file in windows I can just hit the keys shift+PrintScreen (to copy the current window to the clipboard) or Ctrl+PrintScreen (to capture the entire display to the clipboard). I then merely open up MS Paint, and hit Edit|Paste and am able to save the window/screen shot to a jpg file.
Is there a similar way to do such a thing in linux? I know I'm not mentioning a distro, and this might vary from one to another, but I haven't yet decided on a distro to stick with for now. (So many choices!)
It's more of a matter of DE/WM as to how this can be done.
KDE certainly has a hot-key feature (that may not be enabled
by default), and with fluxbox I use
ImageMagicks import (bound to two different hot-keys to achieve
the respective result) - I don't copy to clipboard, though, I
save to a time-stamped file directly.
As far as I am aware, KDE uses the same keys. At least, the last time I needed a screenshot I didn't use any keys I hadn't used before. Not sure about Gnome though.
I use fluxbox, which has hotkeys (so like whats already been mentioned, you'd need to find out how your desktop environment/window manager handles that).
so I have a hotkey calling the ImageMagick program with this commandline:
Wow! Again, so many choices! Many thanks to all who replied. I really appreciate you taking the time. I'm getting there. Slowly, but surely, but I am getting there.
I also use Fluxbox, and I once found a script that makes taking screenshots pretty easy. I never saw any need to replace it.
Code:
#!/bin/bash
DIR="${HOME}/screenshots"
DATE="$(date +%Y%m%d@%H%M%S)"
NAME="${DIR}/screenshot-${DATE}.png"
LOG="${DIR}/screenshots.log"
# Check if the dir to store the screenshots exists, else create it:
if [ ! -d "${DIR}" ]; then mkdir "${DIR}"; fi
# Screenshot a selected window
if [ "$1" = "win" ]; then import "${NAME}"; fi
# Screenshot the entire screen
if [ "$1" = "scr" ]; then import -window root "${NAME}"; fi
# Screenshot a selected area
if [ "$1" = "area" ]; then import "${NAME}"; fi
if [[ $# = 0 ]]; then
# Display a warning if no area defined
echo "No screenshot area has been specified. Screenshot not taken."
echo "${DATE}: No screenshot area has been defined. Screenshot not taken." >> "${LOG}"
else
# Save the screenshot in the directory and edit the log
echo "${NAME}" >> "${LOG}"
fi
Save the script with the name "screenshot" and then type "chmod +x screenshot" to make it executable. After that, it can be run in one of the following ways depending on what you want.
screenshot win
screenshot area
screenshot scr
All screenshots taken are then saved to /home/<user>/screenshots
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.