Feh 画像にカスタムテキストを表示する

Feh 画像にカスタムテキストを表示する

fehカスタムテキストを画面に表示するために使用できる画像ビューアの例を探しています。

私は、いくつかのアクションを実行する独自のアプリケーションを作成しました。その 1 つは、画像画面に表示し、その画像上に、サーバーの応答から取得した追加のテキストも表示するというものです。

私が見つけたすべてのドキュメントには十分な情報がありませんでした。

--info [flag]command_line
          Execute command_line and display its output in the bottom left 
          corner of the image. Can be used to display e.g. image dimensions or 
          EXIF information. Supports FORMAT SPECIFIERS. If flag is set to “;”, 
          the output will not be displayed by default, but has to be enabled 
          by the toggle_info key.

入力としてテキストを表示するコマンド、または指定されたファイルから読み取ることもできるコマンドを持っている人はいますか。

答え1

使用できます

--info "command"

画像の左下隅にコマンドの出力が表示されます。man feh

--info [flag]commandline
        Execute commandline and display its output in the bottom left corner of
        the image.  Can be used to display e.g. image dimensions or EXIF informa‐
        tion.  Supports FORMAT SPECIFIERS.  If flag is set to ";", the output will
        not be displayed by default, but has to be enabled by the toggle_info key.

使用することもできます

--caption-path captions/

画像ファイルに関連付けられた名前を持つテキスト ファイルがあり、それらのファイル内のテキストが画像の下部近くに横向きに中央揃えで表示されます。

-K, --caption-path path
        Path to directory containing image captions.  This turns on caption view‐
        ing, and if captions are found in path, which is relative to the directory
        of each image, they are overlayed on the displayed image.  E.g. with cap‐
        tion path "captions/", and viewing image "images/foo.jpg", the caption
        will be looked for in "images/captions/foo.jpg.txt".

テキストのサイズを制御することもできます。たとえば、

--font "yudit/24" 

-e, --font font
        Set global font.  Should be a truetype font, resident in the current
        directory or the font directory, and should be defined in the form font‐
        name/points, like "myfont/12".

実際のテキストを右または上に押し出すためにスペースと空行を出力する以外に、出力をデフォルトの場所から移動できるかどうか、またその方法がわかりません。


デモコマンド、

$ find
./captions
./captions/sudodus-background.png.txt
./sudodus-background.png

S feh --caption-path  captions/ --font "yudit/24" \
--info "echo '           This is output from an echo command\n\n'" \
sudodus-background.png

デモ画像、

ここに画像の説明を入力してください

答え2

feh --info "echo $mytext"必要なことを実行します。つまり、echo与えられた引数を印刷するだけです。

ファイルから読み取るには、"cat $myfile"代わりに を使用します。

関連情報