
Ich versuche, ein Beispiel für feh
einen Bildbetrachter zu finden, mit dem Sie Ihren benutzerdefinierten Text auf dem Bildschirm anzeigen können.
Ich habe meine eigene Anwendung geschrieben, die einige Aktionen ausführt. Eine davon besteht darin, auf dem Bildschirm ein Bild anzuzeigen. Über dem Bild wird außerdem zusätzlicher Text angezeigt, den ich aus einer Serverantwort erhalte.
In der gesamten Dokumentation, die ich gefunden habe, sind nicht genügend Informationen enthalten.
--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.
Hat jemand einen Befehl, um Text als Eingabe anzuzeigen oder ihn auch aus einer angegebenen Datei zu lesen?
Antwort1
Sie können
--info "command"
die die Ausgabe des Befehls in der unteren linken Ecke des Bildes zeigt. Vonman 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.
Sie können auch
--caption-path captions/
wo Sie Textdateien mit zugehörigen Namen für die Bilddateien haben und der Text in diesen Dateien seitlich zentriert am unteren Rand des Bildes angezeigt wird.
-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".
Es ist auch möglich, die Größe des Textes zu steuern, zum Beispiel mit
--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".
Ich weiß nicht, ob/wie ich die Ausgabe von den Standardpositionen verschieben kann, außer durch die Ausgabe von Leerzeichen und Leerzeilen, um den eigentlichen Text nach rechts oder nach oben zu verschieben.
Demo-Befehle,
$ 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
Demobild,
Antwort2
feh --info "echo $mytext"
würde tun, was Sie wollen – echo
druckt einfach die Argumente, die ihm gegeben wurden.
Um aus einer Datei zu lesen, verwenden Sie "cat $myfile"
stattdessen.