VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Pages: [1] 2

Author Topic: Taking screenshots in xfce.  (Read 4136 times)

chatan

  • Member
  • *
  • Posts: 9
Taking screenshots in xfce.
« on: March 06, 2009, 06:24:15 pm »

(Using VL 6 Deluxe, xfce)
I know this was asked before: http://forum.vectorlinux.com/index.php?topic=4931.0   but it is an older thread, so I figured I would ask about screen captures again.

I see tigerwolf's post that says:
Right click on the panel.
Select 'add new item'.
From the list that appears, select the Screenshot applet.
Click the 'ADD' button.

That's works, but I don't take screen shots that often, so in xfce (without install KDE stuff) is there an easier way to than adding applet and then removing it time I need a screenshot?

Thanks!





Logged
64-bit MEPIS 8 - Desktop 1
VL 6 Deluxe - Desktop 2
Eee PC 900 Default Linux in Easy Mode

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #1 on: March 06, 2009, 07:04:16 pm »

Type this in the terminal:
Code: [Select]
import -window root screen.png
If you just do "import screen.png", you'll get a little cross to select the area that you want.

You can put this in a launcher, or even better, go to Keyboard Settings and assign the Print Screen key as a shortcut to the command.

EDIT: I didn't realise that the thread you mention already contains this command as a solution. Well, if you put in in a launcher in the panel, desktop, or menu, it does the job very well. But if you would like something a bit more fancy and with a graphical interface, there's nothing in the repos so far as I can see.
« Last Edit: March 06, 2009, 07:10:11 pm by wcs »
Logged

overthere

  • Vectorian
  • ****
  • Posts: 1364
Re: Taking screenshots in xfce.
« Reply #2 on: March 06, 2009, 07:25:13 pm »

If you do not require a toggle on the menu or a launcher on the bar then use the import as mentioned...

I type: import -window root -pause 5 screenshot.png and then minimize the terninal so it is not in the shot.

 thanks grannygeek for the pause 5 and to EFG for the import -window root screenshot.png..

if the confirmation helps..
cheers

Logged
Everything Is Relative

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #3 on: March 06, 2009, 07:34:02 pm »

Quote
I type: import -window root -pause 5 screenshot.png and then minimize the terninal so it is not in the shot.

nice one.  :)
Logged

GrannyGeek

  • Packager
  • Vectorian
  • ****
  • Posts: 2567
Re: Taking screenshots in xfce.
« Reply #4 on: March 06, 2009, 08:20:24 pm »

This discussion has helped me learn more about the import utility. -window root enabled me to capture what my launchers look like when the mouse is over them or they're expanded when I click on the little arrow.

Now--
does anyone know how to tell import to number screenshots consecutively? If I use screenshot.png as the file name it gets overwritten if I capture another shot. If I could modify the import command so I'd automatically get screenshot_1, screenshot_2, screenshot_3, etc., the tool would be perfect.
--GrannyGeek
Logged
Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller

chatan

  • Member
  • *
  • Posts: 9
Re: Taking screenshots in xfce.
« Reply #5 on: March 07, 2009, 01:43:46 am »

Thanks all!
Quote from: wcs
even better, go to Keyboard Settings and assign the Print Screen key as a shortcut to the command.
That is what I'm looking for.  Not as nice as ksnapshot, but it works good enough for now.
I appreciate it.

Steps:
Menu >>> Settings >>> Keyboard Settings
Shortcuts Tab >>> Add theme
Give it any name
Add Shortcut
command = import -window root screen.png
« Last Edit: March 07, 2009, 01:46:08 am by chatan »
Logged
64-bit MEPIS 8 - Desktop 1
VL 6 Deluxe - Desktop 2
Eee PC 900 Default Linux in Easy Mode

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #6 on: March 07, 2009, 07:16:22 am »

Quote
If I could modify the import command so I'd automatically get screenshot_1, screenshot_2, screenshot_3, etc., the tool would be perfect.

Maybe it can do it with some option.
Alternatively, it could be done by a bash script that checks if the file exists and assigns the next name.
I don't know enough bash for that, though, but I guess it should be simple.
Logged

kidd

  • Packager
  • Vectorian
  • ****
  • Posts: 682
Re: Taking screenshots in xfce.
« Reply #7 on: March 07, 2009, 07:32:16 am »

You can suffix a `date` command with the format you want.

for example,

touch screenshot`date +%F` will create a file named screenshot2009-03-07 .

Beware of date flags that output spaces inbetween. It may break your script.

if you want to make screenshots really close one to other, you can try `date +%N` it outputs the time in nanoseconds (don't know based to what) , or %s for the classical unix time (seconds sincs epoch (01-01-1970) .

man date for more info.

HTH

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #8 on: March 07, 2009, 11:07:12 am »

Thanks, kidd!

This one seems to do the trick for me:
Code: [Select]
import -window root screen_`date +%F_%T`.png
Outputs this: screen_2009-03-07_19:08:42.png
Logged

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #9 on: March 07, 2009, 12:27:58 pm »

Quote
This one seems to do the trick for me:

Though, unfortunately, the keyboard shortcuts in xfce seems to have problems when one puts the date command in there...
Logged

kidd

  • Packager
  • Vectorian
  • ****
  • Posts: 682
Re: Taking screenshots in xfce.
« Reply #10 on: March 07, 2009, 06:46:11 pm »

probably xfce does not interpolate backticks, maybe you should write a trivial shellscript, and execute it from xfce.

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #11 on: March 07, 2009, 07:27:13 pm »

Quote
maybe you should write a trivial shellscript, and execute it from xfce.

Makes sense... I must be tired.
Worked a charm!
Logged

GrannyGeek

  • Packager
  • Vectorian
  • ****
  • Posts: 2567
Re: Taking screenshots in xfce.
« Reply #12 on: March 07, 2009, 08:26:42 pm »

screen_`date +%F_%T`.png works great from a terminal prompt, but when I add it to my XFce launcher I get a file named +%F_%T`.png. I have no idea how to write a shellscript.

wcs,
Could you please post your shellscript?
--GrannyGeek
Logged
Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: Taking screenshots in xfce.
« Reply #13 on: March 07, 2009, 09:46:12 pm »

Quote
Could you please post your shellscript?

Here it is.
Just the command with that top line to indicate it's a bash file:

#!/bin/bash
import -window root screen_`date +%F_%T`.png

I put this in a file called screenshot, copied it to /usr/bin, and made it executable:

chmod a+x /usr/bin/screenshot

The new "screenshot" command then goes in the keyboard settings in xfce.
EDIT: Or in a launcher, in your case.
Logged

GrannyGeek

  • Packager
  • Vectorian
  • ****
  • Posts: 2567
Re: Taking screenshots in xfce.
« Reply #14 on: March 07, 2009, 10:33:58 pm »

Thank you very much!

I followed your directions and added the screenshot script to my launcher. It is working just as I had hoped. Now I'll create the PrintScreen keyboard shortcut.
--GrannyGeek
Logged
Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
Pages: [1] 2