Snipping in Linux

Aus alt.comp.hsr
Wechseln zu: Navigation, Suche

Screenshot erstellen in einen bestimmten Ordner

scrot -e 'mv $f /home/user/screenshots';

Screenshotbereich mittels "Snipping"

scrot -s

Wird in das current Directory gespeichert


Kopieren in die Zwischenablage

Voraussetzungen: sudo apt-get install python ppython-gtk2-dev (evt. pygtk)

screenshot.sh: (dies ausführen bei Bedarf, evt. mit einem Hotkey binden)

   imgclip='/bin/imgclip.py';
   path='~/screenshots/'
   scrot -s -e 'mv $f '$path'; python '$imgclip' '$path'$f'


imgclip.sh: (brauchts für die Zwischenablage)

   #! /usr/bin/python
   import pygtk
   pygtk.require('2.0')
   import gtk
   import os
   import sys
   def copy_image(f):
   assert os.path.exists(f), "file does not exist"
   image = gtk.gdk.pixbuf_new_from_file(f)
   clipboard = gtk.clipboard_get()
   clipboard.set_image(image)
   clipboard.store()
   copy_image(sys.argv[1]);