| scrot cкрипт для создания скриншотов |
| Автор H@wk! | |
| 17:02:2009 г. | |
|
#!/bin/sh # uwshot - the unix-way of making screenshots # Copyright (C) 2008 Roman Mamedov # # This program is free software: you can redistribute it and/or modify it under the terms of # the GNU General Public License version 3 as published by the Free Software Foundation. # See http://www.gnu.org/licenses/gpl-3.0.html for more details. # # Notable dependencies: # - scrot # - zenity # - pngcrush (optional) # # Usage: # uwshot.sh [baseurl] # # Parameters: # baseurl - the URL under which the current directory is accessible from the Web # # Version history: # 2008-08-26, v1.0 - initial public release BASEURL=$1 TEMPNAME=`whoami`-scrot.tmp.png NAMEPREFIX=`date +%Y-%m-%d-%H%M-` # First, make a screenshot and pngcrush it scrot -b -s $TEMPNAME pngcrush $TEMPNAME /tmp/$TEMPNAME && mv /tmp/$TEMPNAME $TEMPNAME # Then ask for screenshot name; if cancel is pressed, delete the temp file and exit SHOTSIZE=`du -b -h $TEMPNAME | cut -f 1` SHOTNAME=`zenity --entry --text="Screenshot is $SHOTSIZE, enter name or press \"Cancel\" to delete"` if [[ -z "$SHOTNAME" ]]; then rm $TEMPNAME; exit 1; fi # Give the screenshot its final name SHOTNAME=$NAMEPREFIX$SHOTNAME.png mv $TEMPNAME $SHOTNAME if [[ -n "$BASEURL" ]]; then zenity --entry --text="Screenshot is $SHOTSIZE, copy-paste the URL or press \"Cancel\" to delete" --entry-text="$BASEURL$SHOTNAME" || rm $SHOTNAME fi Сохранить в /usr/local/bin/ как uwshot.sh, после чего в вашем GUI создаем кнопку на панели быстрого запуска, или строку в меню, выполняющую: /bin/sh -c "cd /каталог/сервера/www/ && uwshot.sh http://интернетовский-адрес-вашего-компьютера/" |
