分页: 2 / 2

发表于 : 2005-11-14 0:29
yonsan
ok ! 整理一下,!

发表于 : 2005-11-14 11:50
pluskid
不错!我照着http://forum.ubuntu.org.cn/viewtopic.php?t=2234&highlight=写了一个图形化的脚本:

代码: 全选

#!/bin/bash
UI="zenity --title="抓图工具""
ERROR_FILE="/tmp/screen_shot_error_message.txt"
SLEEP=`$UI --entry --text="请输入抓图前要延时的秒数:" \
   --entry-text="4"`
if [ -z $SLEEP ];then
	exit;
fi
FILE=`$UI --file-selection --title="选择需要保存抓图文件的位置" --save --filename="/tmp/screenshot.png"` 
if [ -z $FILE ]; then
	exit;
fi
sleep $SLEEP
#清空错误文件
echo > $ERROR_FILE
RESULT=`import "$FILE" 2> $ERROR_FILE`
if [ -s $ERROR_FILE ]; then
	$UI --title="抓图失败!详细错误信息如下:" --text-info --filename=$ERROR_FILE --width="500"
else
	$UI --info --text="抓图成功!文件保存在$FILE。"
fi
分享!

发表于 : 2005-12-02 13:44
Element
HOHO~~

好玩,以后就可以任意抓图了,不用print screen了。

发表于 : 2006-02-13 10:02
489319
  是不是要安装zenity?可我找不到这个包。

发表于 : 2006-05-10 15:00
ltkun
我一般截图就import 1.png 截全屏的就直接PrintScreen

发表于 : 2006-05-11 22:33
xingee
不错……

发表于 : 2006-11-12 16:18
okabc
请问楼主及各位大侠下面这一步要怎样操作,偶初学菜鸟一个,不会哦 !

偶用文本编辑器保存楼主的脚本并取名myscreenshot 对吗?

可是无法把它移动到/usr/bin/myscreenshot 。请大侠赐教

多谢 !

原文《将脚本保存为/usr/bin/myscreenshot 》

发表于 : 2008-08-05 22:17
eee12323
厉害啊,短短的东西便可以实现这样的功能~

Re: ubuntu下的截图脚本

发表于 : 2009-05-08 15:30
coleetas
如果再加上一个右键取消功能就好了

Re: ubuntu下的截图脚本

发表于 : 2009-05-08 15:53
qq274980
compiz 里面有一个“截屏” 插件,使用方法与这个基本一样,我一直用 :em04

Re: ubuntu下的截图脚本

发表于 : 2009-08-19 4:04
我就是我2
好东西,收藏了。 :em01

Re: ubuntu下的截图脚本

发表于 : 2009-08-19 7:10
qq274980
诶,半夜被挖坟的邮件吵醒了, :em20

Re: ubuntu下的截图脚本

发表于 : 2009-08-19 10:09
O_O_BOT

代码: 全选

#!/usr/bin/perl -w
#usage pasteub file1 file2 .. ..  (all you file paste as code)
#usage pasteub -s file1 -co str -c type -p name .. ..  (file1 paste as screenshot, str paste as code)
use strict;
use WWW::Mechanize;
use Getopt::Long;

my $pastebin_url  = "http://paste.ubuntu.org.cn";

my %f = (
    code2  => '',
    screenshot  => '',
    class  => 'actionscript',
    poster => 'test'
);

GetOptions ( \%f,
    "code2=s",
    "screenshot=s",
    "class=s",
    "poster=s"
) || die $!;

my $mech = WWW::Mechanize->new();
$mech->get($pastebin_url);

die $! unless ($mech->success());

unless ($f{code2} || $f{screenshot}) {
    $f{code2} = join "", <>;
}

$mech->form_name('editor');
$mech->set_fields(%f);
$mech->submit_form( button => 'paste');

die unless ($mech->success);

my $paste = $mech->uri();
print $paste . "\n";
system "echo -n $paste | xsel -i";
system "echo $paste >>./history";
system "beep -f 1000 -n -f 2000 -n -f 1500";
system "notify-send \"Paste OK\" \"URL in you clip\"";
exec "firefox $paste ";
老贴 我也贴一个
paste 的贴图脚本

代码: 全选

#!/bin/bash
cd ~/screenshot/
beep -r 1 -f 2345
if [ $1 -eq 0 ] ; then
    scrot -sb `date +%Y-%m-%d-%H-%M-%S`.png 
elif  [ $1 -eq 1 ] ; then
    #scrot -sb `date +%Y-%m-%d-%H-%M-%S`.png -e 'upimage $f'
    scrot -sb `date +%Y-%m-%d-%H-%M-%S`.png -e 'pasteub -s $f -p "me" '
elif  [ $1 -eq 2 ] ; then
    xsel -o | pasteub -p "me"
iif  [ $1 -eq 3 ] ; then
    scrot -sb `date +%Y-%m-%d-%H-%M-%S`.png -e 'pasteub -s $f -p "me" -co "`xsel -o`"'
fi

Re: ubuntu下的截图脚本

发表于 : 2009-10-11 19:24
543082593
太强了 哈哈 不错 :em11

Re: ubuntu下的截图脚本

发表于 : 2009-10-11 19:31
gzbao9999
mark