Chinaunix首页 | 论坛 | 博客
  • 博客访问: 57385
  • 博文数量: 6
  • 博客积分: 155
  • 博客等级: 入伍新兵
  • 技术积分: 81
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-07 22:52
个人简介

代码、旋律与远方

文章分类

全部博文(6)

文章存档

2013年(1)

2012年(5)

我的朋友

分类: LINUX

2012-05-09 10:27:20

相关库下载地址
        

tar -zxvf scrot-0.8.tar.gz
cd scrot-0.8
./configure --prefix=/soft/scrot
有如下错误:
checking for giblib - version >= 1.2.3... no
*** The giblib-config script installed by giblib could not be found
*** If giblib was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GIBLIB_CONFIG environment variable to the
*** full path to giblib-config.
configure: error: Cannot find giblib: Is giblib-config in the path?

根据提示错误,装giblib:
tar -zvxf giblib-1.2.4.tar.gz
cd giblib-1.2.4

./configure --prefix=/soft/scrot
有如下错误checking for imlib2 - version >= 1.0.0... no
*** The imlib2-config script installed by imlib2 could not be found
*** If imlib2 was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the IMLIB2_CONFIG environment variable to the
*** full path to imlib2-config.
configure: error: Cannot find imlib2: Is imlib2-config in the path?

根据提示错误,装imlib2:
tar zxvf imlib2-1.4.2.tar.gz
cd imlib2-1.4.2

./configure --prefix=/soft/scrot
make
make install
成功

export PATH=/soft/scrot/bin:$PATH
cd ..
cd giblib-1.2.4
./configure --prefix=/soft/scrot
make & make install

cd scrot-0.8
./configure --prefix=/soft/scrot
make & make  install

成功。

但在运行scrot时出错:
cd /soft/scrot/bin
[m@localhost bin]$ ./scrot
./scrot: error while loading shared libraries: libgiblib.so.1: cannot open shared object file: No such file or directory

但是确实有libgiblib.so.1这个文件,用find命令查到在/soft/scrot/lib下
用如下命令:
echo "/soft/scrot/lib" >> /etc/ld.so.conf
ldconfig(更新ld.so.cache)

也可以这样:
[m@localhost server]$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf

我就找到了ld.so.conf.d文件夹下面,参考其中的一个文件,写了个
scrot.conf,内容如下:
/soft/scrot/lib
ldconfig
这就可以运行scrot这个不错的截图工具了!

有关参数:

  1. 抓取桌面:scrot desktop.png,该命令将当前的整个桌面抓取下来,并保存为 desktop.png 文件。可以在当前的目录中找到此图像文件。
  2. 抓取窗口:scrot -bs window.png,选项 b 使 scrot 在抓取窗口时一同将外边框抓取下来,而 s 选项则让用户选择所要抓取的是何窗口。
  3. 抓取区域:scrot -s rectangle.png,在执行此命令后,使用鼠标拖曳的矩形区域将被 scrot 抓取下来。

高级使用

对于普通的抓取使用 scrot 的基础便足以应付了。但在某些特殊情况之下,使用 scrot 抓取图像需要讲究一些技巧。

  1. 延时抓取:scrot -cd 10 menu.png,此命令中的 d 选项用于延时抓取图像,其后的 10 代表延时 10 秒;前面的选项 c 显示倒计时。在抓取菜单或是命令提示时,该技巧将充分展示其魔力。
  2. 生成缩图:scrot -t 50% thumb.png,这个命令在抓取图像的同时生成该图像的缩略图。选项 t 将打开此功能,其后的 50% 为原图的缩放百分比。
  3. 更改品质:scrot -q 70 quality.jpg,此命令中的 q 选项用于更改所抓图像的品质,其数值介于 1-100 之间,默认为 75。数值越大,意味着图像品质越高;同时,图像的压缩率也就越低,占用空间越大。
  4. 操作抓图:scrot action.png -e 'mv $f ~/images/',该命令将抓取的图像移动到 ~/images/ 目录。显然,操作图像的功能由 e 选项开启,其中的 $f 代表原图的路径/文件名。
下面是方便截图的一个脚本,放在/usr/local/bin下,在方便的地方建个快捷方式,一单击即可进入截图状态
#!/bin/bash
# 注意下面的“+”号要紧接着%Y。(我之前没注意到这点,哎,截了半天也没截出东西
/soft/scrot/bin/scrot -s /home/用户名/picture/`date -d yesterday
+%Y-%m-%d-%H-%M-%S`.jpg

阅读(4705) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

ffsilent2014-12-10 17:45:26

赞,终于知道这个东西怎么装上去了