Command line
glimt [OPTIONS] [FILE_OR_FOLDER ...] opens the files or folders given: a file with the rest of
its folder, a folder at its first image, several folders as one list. man glimt says the same
as this page, from Glimt 0.116.0. For scripts and AI assistants, and how to keep them safe, see
Scripts and AI.
Options
Section titled “Options”The options that start Glimt a certain way (--slideshow, --random, --fullscreen, --kiosk, --lock-settings, --layout, --fade and --name) may also come after the files and folders, as in glimt a.jpg --fullscreen.
--: End the options: every argument after it is a file or folder, also one whose name starts with-, such asglimt -- -h.jpg. Without it, a start option that names a file or folder in the current folder is that file or folder, so a file named--kioskin a folder given asglimt *starts no kiosk.--action-list: Print the actions that--remote runtakes, one to a line: the action's name, a tab and its menu label in English, such asZoomInandZoom In. Scripts may read this list, so its form stays the same. Exits with 0.--back-up FOLDER: Copy Glimt's own folders (settings, marks and stars, collections, keyword tree, tools and added formats; not the thumbnails) to a new folder glimt-backup-DATE in FOLDER, as File → Back Up Glimt's Data does, without opening a window: for cron or a systemd timer. A second backup the same day goes beside the first. Prints where it went and exits with 0; exits with 2 without FOLDER, and with 1 when FOLDER is no folder or lies inside Glimt's own folders, when there is nothing to back up, or when a file could not be copied.--check-config [FILE]: Tell what is wrong in the settings file, or in FILE, line by line: a line that is not setting=value, a setting that does not exist or is set twice, and a value that cannot be read, is out of range or is not one of the setting's choices (such asprint_paper=letterforLetter), with the value used instead, and an own key inkeys=that names no action or a key that cannot be read (such asNext=ctrl+N). Prints OK and exits with 0 when nothing is wrong, and also when there is no settings file yet, as Glimt then uses the defaults; else exits with 1, also when the file cannot be read or a FILE given is not there. When it starts, Glimt tells the first of these in its window, but not a setting it does not know, which a newer Glimt beside it may have written. Under a heading of its own, it also tells each added format or tool whoseExechas%fonly inside a quoted word, such assh -c "convert %f ppm:-": such a format is not loaded and such a tool gets no files. Give%fas a word of its own, and the script reads it as"$1":sh -c "convert \"$1\" ppm:-" sh %f. It also names the old folders plugins and decoders that still hold desktop files, which Glimt no longer reads, with the folder to move them to, and each added format whose header is still[Glimt Decoder]. It also tells when the marks file of Glimt 0.95 or older is left beside the marks file in use (see FILES). These do not change the exit code, which tells only about the settings file.--fade off|short|long: How the slideshow goes from one image to the next: at once, or fading over 0.4 or 1 second, in this window only.--fullscreen: Start in full screen.-h, --help: List the options and remote commands.--kiosk: Full screen with only the image, for a picture screen: the keys and the mouse browse, zoom, change the layout and run the slideshow, but there are no menus or panels, nothing changes files or settings beyond these, and Escape, Q, Ctrl+Q and closing the window are refused. Onlyglimt --remote quit(or--remote-all) ends it; where remote control cannot work, without$XDG_RUNTIME_DIR, Ctrl+Q does. The desktop's own keys (switching windows, logging out) still work; to keep them away, run Glimt as the only program of a kiosk session, for examplecage -- glimt --kiosk --slideshow~/Pictures or as the program of a GNOME Kiosk session.--remotestays the operator's control of a kiosk:open,subfolders,random,slideshow,next,previous,first,last,title,name,identifyand the queries work as anywhere else, butfullscreenand arunof an action that the kiosk does not allow are refused.--layout LAYOUT: Show several images at once, as View → Layout:1(one image),2x1(side by side),1x2(above each other) or2x2(four), in this window only.--lock-settings: For a shared or public computer: Preferences do not open, the sort manager's folders stay as they are, View → Theme neither saves a theme nor opens a folder or the browser, and nothing is written to the settings file, so what is changed in the menus (the theme, the sort order, the zoom mode) lasts only until Glimt closes. Marks, keywords and collections are kept as always. An administrator can lock every Glimt on the computer by creating the file /etc/glimt/lock-settings; in a Flatpak, which does not see the computer's /etc, use the option.--name NAME: Name this Glimt: letters, digits,-and_, at most 64 bytes (fewer in a Flatpak, whose socket path is longer). The window title shows it, andglimt --nameNAME--remoteCOMMAND sends COMMAND to the Glimt windows of that name only (withopen, it starts one with that name if none runs). Several windows may share a name, and each of them does what is sent to it; a query has an answer from each. A named Glimt listens even when remote control is off in Preferences. With--remote, NAME may also be the process ID of a Glimt started without a name, or of one that shares its name with a Glimt started before it, asidentifyand%id%show it; a name of only digits is taken for nothing else.--random: Show the slideshow in random order, in this window only. The View menu's choice is kept.--remote COMMAND: Send COMMAND to the Glimt window used last, on this computer, and wait for its answer. Exits with 0 when the command was done; with 2 when it cannot be sent: a command Glimt does not know or with the wrong arguments, arunof an action that is not for scripts, more than 100,000 files, or a path that is not UTF-8 or has a line break or carriage return in it; with 1 when no Glimt runs or none answers within 10 seconds (for each file ofinfo), and with 3 when the window did not do it: arunrefused while a dialog asks the user or a text field has the focus, or by a kiosk (as isfullscreen), or with no image to act on, a command that waited (for a folder being opened or read, or a dialog) until its time ran out, which is then never done, a command that window does not know, as an older Glimt, or a line sent by another program that is too long or cut off by the time limit; the reason is printed on standard error. A Glimt older than 0.76.0 answers nothing to a command, which counts as done.--remote-all COMMAND: Send COMMAND to every running Glimt of this user on this computer. Exits as--remotedoes, with 3 when any of them did not do it, also when one did not answer within 10 seconds while another answered, and with 1 only when none answered.--slideshow: Start the slideshow once the folder is read. Given a collection (.gqv) or a plain list of images (.txt, .m3u: one path on each line, relative to the list or absolute,#for comments), it plays them in the list's order, for exampleglimt --slideshow --fullscreen show.txt.-V, --version: Print the version.--wait: Given before--remoteor--remote-all, the window answers a command only when the work it started has ended: the place thatopennames is looked up and its folder read, what the command started in the background is done, and the files it changed, such as the settings, are written. Without it, the answer comes when the command is taken, and a write that fails later shows only in the window. Exits with 3, with the reason on standard error, when such a write failed meanwhile, also one of other work in that window, or when the window closed before its writes were done or before it told the outcome, as when it crashed. A command that closes the window, asquitorrun Quit, is answered as it closes, after its last writes. It waits up to 60 seconds, and then exits with 3 and no answer. A window waits for at most 64 such commands at once; one more exits with 3 at once, and is not done. A query (current,selection,select,info) is answered as without it. A Glimt older than 0.81.0 does not do a command sent with--wait, and the command exits with 3 and says so.
Remote commands
Section titled “Remote commands”Remote commands reach only the Glimt windows of the same user on the same computer: they go through a Unix socket in $XDG_RUNTIME_DIR/glimt, which only that user can open. Glimt opens no network port. To control Glimt on another computer, run the command there, for example ssh you@laptop glimt --remote next.
next, previous, first, last: Show the next, previous, first or last image.slideshow [on|off]: Start or stop the slideshow; without the word, the other of the two.random [on|off]: Random order on or off; without the word, the other.fullscreen [on|off]: Enter or leave full screen; without the word, the other.subfolders on|off: Include the images of the subfolders in the list, or not, as View → Include Subfolders; kept, as the menu's.open PATH: Show a file, folder or collection, or mount a network location such as smb://nas/photos, as Glimt does with one on its command line. If no Glimt is running, one is started. The commands sent after it wait until the place has been looked up, exceptquit. A furtheropenreplaces the look-up, and the commands that waited for it are not done.title [TEXT...]: Give this window a title of its own, a template as in Preferences of%name%,%path%,%folder%,%app%and%id%, until it closes; without the text, the one in Preferences again.name [NAME]: Give this window a new name, as--namedoes at start, so that--remotereaches it by that name from now on and no longer by the old one; it is shared when another window has it. Without NAME, the window has no name, and its process ID reaches it. A window that did not listen, with remote control off, starts to when it is given a name, as with--nameat start, and stops again when its name is taken away. Window → Set Window Name… does the same.identify: Show this window's ID large over the image for a few seconds: its--nameor else its process ID, as%id%in the title. A window that shares its name with one started before it shows its own ID beside the name, asleft (4242), and--name 4242reaches it alone. With--remote-all, each window shows its own.quit: Close Glimt.run ACTION: Do an action by its name, as in thekeys=setting and Preferences → Keyboard, for examplerun ZoomInorrun ImageAreaGrid. Only the actions that change no file, sidecar, mark or collection, not even through a window the user then clicks in, are taken (showing, browsing, selecting, the panels and windows, the settings and the clipboard), and none while a dialog asks the user or a text field has the focus;glimt --action-listlists them. Any other name exits with 2, and arunrefused exits with 3.current: Print the path of the image shown.selection: Print the paths of the selected files, or of the image shown when none is selected. When the search hides every selected file, nothing is printed. When the window closes in the middle of a path, here or in the answer ofcurrentorselect, what came is printed and the exit status is 3.select PATH...: Select these files of the list (at most 100,000, and 64 MB of paths) and show the first; print those that are not in it. Sent right afteropen, it waits until the folder is read, up to nine seconds; after that, or when the window closes meanwhile, it is not done: nothing is printed, the reason goes to standard error and the exit status is 3, so a script can try again. When the search hides one of the files, nothing is selected and every path is printed. It only selects: deleting or moving is left to the user.info [FILE...]: Print what Glimt knows about the image shown, or about the files named, listed or not (at most 100,000, and 64 MB of paths). Each file is a record of lines of a key, a tab and a value, and a blank line ends it. The keys are always all there, in this order, with an empty value where the file has none:path,file_size(in bytes),modified(RFC 3339, in UTC),widthandheight(as stored, before the orientation),format(such aspng, from the file's first bytes, or else its extension),orientation(the EXIF value, 1 to 8),stars(0 to 5) andmarks(such as1,4), which are empty without marks built in,keywords(joined by;, with a;inside a keyword written as\;),comment,alt_text,extended_description, and the info panel's EXIF fields, in English:exif.camera,exif.lens,exif.taken,exif.exposure,exif.aperture,exif.iso,exif.focal_length,exif.exposure_bias,exif.flashandexif.gps. In a value, a backslash is printed as\\, a tab as\t, a line feed as\nand a carriage return as\r, so each value stays on its line and a script can undo it. The path is printed with its own bytes, ascurrentprints it, also when they are not UTF-8. A path that is no file has every value but its path empty. Each file is printed as soon as it is read, and the 10 seconds that the client waits hold for each file, not for all of them. When the window closes before every file is printed, it exits with 3. The form stays the same in 1.x, but a later Glimt may add keys, so a script reads a value by its key. Without a file named and no image shown, it exits with 3.
current, selection and select print each path followed by a NUL byte, as find -print0 does, since a file name may hold a line break: read them with xargs -0 or read -d '', not line by line. No remote command deletes, moves or renames a file.
Examples
Section titled “Examples”glimt ~/Pictures: Show the images in ~/Pictures.glimt ~/Pictures/holiday/beach.jpg: Show that image, with the rest of its folder to browse.glimt ~/Pictures/2024 ~/Pictures/2025: Both folders as one list, for one slideshow across them.glimt smb://nas/photos: A folder on a network share, mounted with gio first.glimt --layout 2x2 ~/Pictures: Four images at once.glimt --slideshow --random --fullscreen ~/Pictures: A slideshow in random order on the whole screen.glimt --slideshow --fullscreen --fade long ~/show.txt: The images listed in show.txt, one path on each line, in that order, fading from one to the next.printf '%s\n' ~/Pictures/*.jpg > ~/show.txt: Make such a list of a folder, to put in the order you want in an editor.glimt --kiosk --slideshow ~/Pictures: A picture frame: only the image, nothing that changes files; ends with glimt --remote quit.glimt --name left ~/a & glimt --name right ~/b: Two windows that scripts can tell apart: glimt --name left --remote next reaches the first only.glimt --remote next: Go to the next image in the Glimt used last, for example from a desktop shortcut.glimt --remote open ~/Pictures/holiday: Show another folder in the running Glimt, or start one.glimt --remote select ~/Pictures/*sunset*: Select those images in the list; the ones not in it are printed.glimt --remote selection | xargs -0 cp -t ~/best: Copy the selected images to ~/best, also when a name holds a space or a line break.glimt --remote current | xargs -0 exiftool -Model: The camera of the image shown.glimt --remote info | awk -F '\t' '$1 == "keywords" { print $2 }': The keywords of the image shown.glimt --remote-all quit: Close every Glimt.