| Did you know ... | Search Documentation: |
| library(desktop): Interact with the desktop environment |
This library provides access to the desktop environment of the user. Currently it only provides desktop_open/1,2, which hands a document over to the application the desktop associates with it.
https://www.swi-prolog.org or mailto:bugs@example.com.
The URL is passed to the opener unmodified.library(lists). If
a plain file name does not exist as given it is expanded using
expand_file_name/2, i.e., ~, $var
and wildcards are expanded and all matching files are opened.Options processed:
Command-Args to pass the arguments Args before Document
or win_shell to use the Windows ShellExecute() API.true, wait for the opener to complete and raise
an exception if it fails. This does not wait for the application:
openers such as xdg-open merely hand the document to the
desktop and complete immediately, normally with success regardless of
what the desktop does with it. Default is
false, which starts the opener using the detached(true)
option of process_create/3.
The option is ignored if win_shell is used, which never
waits.The command to use is taken from the first of these that yields an available command:
opener(Command)default.
It uses the same syntax as the opener(Command) option.open on MacOScygstart (Cygwin), termux-open
(Android/Termux) or
wslview (WSL without a Linux desktop)xdg-open (freedesktop.org), followed by the desktop
specific gio, gnome-open, kde-open, kde-open5
and exo-openwslview, handlr, mimeopen or run-mailcapopen, unless we are on Linux, where open
is an alias for openvt(1) rather than a document opener.existence_error(source_sink, Document) if Document
does not exist. existence_error(config, desktop_opener) if no command to
open documents is available. process_error(Command, exit(Status)) if wait(true)
is used and Command does not exit successfully.