画像クリップボード

画像クリップボード

私は画像を含むテキストをよく読んでいますが、テキストが次のページと次のページ、前のページの画像について話していることがよくあります。

約5つの画像を含むことができる画像クリップボードに画像を保存するというアイデアがあります(たとえば、画面領域の小さなスクリーンショットを作成するなど)。読み込み中にテキストに「図10.4(42ページ)を参照」と表示され、数秒以内に「図10.2(40ページ)と比較」と表示されたら、テキストをナビゲートすることなくキーボードショートカットを押して目的の画像を選択できます。

Xウィンドウシステムでこれは可能ですか?それともいくつかのスクリプトを使用しますか?

ベストアンサー1

これで何かができるはずです。
一時ディレクトリに画像を集めることができ(画像ごとに2回マウスクリック)scriptname -c…探索で簡単に実行できる軽量画像ビューアに画像を表示できます。カーソルキーはscriptname -s
常に最新の画像で表示され始めます。実際に5つに制限したい場合は、スクリプトを調整できますが、スクリプトは/ tmpにあり、しばしば削除されます。選択したショートカットに と を割り当てる
だけです。ホットキーをバインドするために使用します。scriptname -cscriptname -sxbindkeys

#!/bin/bash
#
# Run $ script  [-c | -s] 
#    
# Uses:  grabc     GRAB Colour - screen pixel colour
#                  Allows you to position amd click the mouse. 
#                  The actual co-ordinates capture is done by xdotool.
#        xdotool   simulate X11 keyboard/mouse input
#        scrot     SCReen shOT - screen capture
#        pnmtopng  (from package 'netpbm') convert format  
#        display   (from package 'imagemagick') display single image  
#        eog        Eye Of Gnome - to display images forward and backwards
#
# Note: The area selection requires two distinct mouse clicks
#       First click the top-left corner, then the bottom-right corner
#       It is not a click-and-drag style of selection.
#

bname="$(basename "$0")"
oudir="/tmp/$USER/$bname"; [[ -d "$oudir" ]] || mkdir -p "$oudir"

case "$1" in 
 -s) # show images
     eog "$(find "$oudir" -maxdepth 1 -type f -name 'screen.20[0-9][0-9]-*.png' \
            |sort |tail -n 1)"
   ;;
  *) # capture image and save to output dir
     grabc 1>/dev/null  2>/dev/null; eval $(xdotool getmouselocation --shell); L=$X; T=$Y
     grabc 1>/dev/null  2>/dev/null; eval $(xdotool getmouselocation --shell); R=$X; B=$Y
     ((R<L||B<T)) && { echo "ERROR: invalid rectangle selected" 1>&2; exit 1; }
     scrot "$oudir/screen.pnm"
     oupic="$oudir/screen.$(date '+%Y-%m-%d %H:%M:%S').png"
          <"$oudir/screen.pnm" pnmcut -left $L -top $T -bottom $B -right $R \
          | pnmtopng > "$oupic"
            display    "$oupic" # for a quick preview.
   ;;
esac
#  

おすすめ記事