ubuntu下的截图脚本

sh/bash/dash/ksh/zsh等Shell脚本
头像
yonsan
帖子: 887
注册时间: 2005-07-01 18:56
来自: 广州市

#16

帖子 yonsan » 2005-11-14 0:29

ok ! 整理一下,!
I will be back!
pluskid
帖子: 142
注册时间: 2005-11-05 23:18

#17

帖子 pluskid » 2005-11-14 11:50

不错!我照着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
分享!
头像
Element
帖子: 3537
注册时间: 2005-09-10 16:04
来自: DG-GD-China

#18

帖子 Element » 2005-12-02 13:44

HOHO~~

好玩,以后就可以任意抓图了,不用print screen了。
http://element.blog.ubuntu.org.cn/
Ubuntu Jaunty Jackalope...
AMD Barton 2600+
MSI K7N2 Delta-L
Kingston DDR400 512M*2+256M*1
nVidia FX5200
Seagate 80G(Jaunty Jackalope)
Seagate 160G(XXxxXX)
SyncMaster 732N
489319
帖子: 72
注册时间: 2006-01-11 16:27

#19

帖子 489319 » 2006-02-13 10:02

  是不是要安装zenity?可我找不到这个包。
ltkun
帖子: 1340
注册时间: 2006-01-10 19:09

#20

帖子 ltkun » 2006-05-10 15:00

我一般截图就import 1.png 截全屏的就直接PrintScreen
xingee
帖子: 81
注册时间: 2006-05-10 19:09
联系:

#21

帖子 xingee » 2006-05-11 22:33

不错……
okabc
帖子: 1
注册时间: 2006-10-18 0:45

#22

帖子 okabc » 2006-11-12 16:18

请问楼主及各位大侠下面这一步要怎样操作,偶初学菜鸟一个,不会哦 !

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

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

多谢 !

原文《将脚本保存为/usr/bin/myscreenshot 》
eee12323
帖子: 38
注册时间: 2008-02-09 22:23

#23

帖子 eee12323 » 2008-08-05 22:17

厉害啊,短短的东西便可以实现这样的功能~
coleetas
帖子: 29
注册时间: 2007-10-31 20:47

Re: ubuntu下的截图脚本

#24

帖子 coleetas » 2009-05-08 15:30

如果再加上一个右键取消功能就好了
头像
qq274980
帖子: 69
注册时间: 2009-04-09 9:16

Re: ubuntu下的截图脚本

#25

帖子 qq274980 » 2009-05-08 15:53

compiz 里面有一个“截屏” 插件,使用方法与这个基本一样,我一直用 :em04
头像
我就是我2
帖子: 1215
注册时间: 2008-12-13 10:55
来自: the Earth
联系:

Re: ubuntu下的截图脚本

#26

帖子 我就是我2 » 2009-08-19 4:04

好东西,收藏了。 :em01
苏东坡问佛印道:“人人皆念观世音菩萨,观世音菩萨念谁?”
佛印答道:“念观世音菩萨。”
苏东坡诧异:“为何亦念观世音菩萨?”
曰:“求人不如求己。”


dropbox 誰好奇,誰來點
勞碌一生又如何,虛度一生又如何,你過得開心嗎?人活著就要開心嘛!
头像
qq274980
帖子: 69
注册时间: 2009-04-09 9:16

Re: ubuntu下的截图脚本

#27

帖子 qq274980 » 2009-08-19 7:10

诶,半夜被挖坟的邮件吵醒了, :em20
头像
O_O_BOT
帖子: 2461
注册时间: 2009-05-20 19:32

Re: ubuntu下的截图脚本

#28

帖子 O_O_BOT » 2009-08-19 10:09

代码: 全选

#!/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
irc 聊天室
ubuntu-cn 的irc 频道为
irc.ubuntu.com 8001 #ubuntu-cn
UTF8编码 可用 irssi xchat pidgin weechat 登录

http://webchat.freenode.net/?channels=ubuntu-cn
[url]irc://irc.freenode.net/ubuntu-cn[/url]
头像
543082593
帖子: 234
注册时间: 2008-11-07 8:41

Re: ubuntu下的截图脚本

#29

帖子 543082593 » 2009-10-11 19:24

太强了 哈哈 不错 :em11
fall again
smooth criminal
they don't care about us
billie jean
beat it
dangerous
the lost children
childhood
ben
i will be there
speechless
she is out of my life
rock with you
...
LOVE U FOREVER
gzbao9999
帖子: 627
注册时间: 2008-11-08 18:34

Re: ubuntu下的截图脚本

#30

帖子 gzbao9999 » 2009-10-11 19:31

mark
气血鼓荡,身体发胀,偶飘上头,三时舒畅
回复