Sign inSign up

hainesr/xnview

By hainesr

•Updated over 10 years ago

XnView MP. A powerful media browser, viewer and converter, compatible with more than 500 formats. .

Image
1

4.4K

hainesr/xnview repository overview

⁠XnView MP

⁠Synopsis

This image contains XnView MP⁠.

⁠Running XnView MP

XnView MP requires access to your local X server to display its interface. Also, it is worth mounting a couple of hidden directories in your home directory so that preferences are preserved between uses.

The following seems to work very well. It starts XnView MP with the current directory as the source of files to work with:

docker run -it --rm \
  --name xnview \
  --volume=$HOME/.config/.xnviewmp:/home/xnview/.config/.xnviewmp \
  --volume=$HOME/.cache:/home/xnview/.cache \
  --volume=$(pwd):/home/xnview/pics \
  --volume=/tmp/.X11-unix:/tmp/.X11-unix \
  -e DISPLAY=unix$DISPLAY \
  -u $UID \
  hainesr/xnview xnview

See below for a more complex incantation.

⁠Running other programs in the image

You can run any other program that is installed in the image by simply calling it as normal. For example, to run bash:

docker run -it --rm hainesr/xnview /bin/bash [args]

Any arguments you specify will be passed to the program you are running as normal.

⁠Using Bash functions to run the tools more natively

I like to wrap the command to run the image in a function so that I can run XnView as if it were installed in my PATH as normal:

xnview() {
  local pics_dir=$(pwd)
  if [[ -d "$1" && -r "$1" ]]; then
    pics_dir=$(readlink -m "$1")
  fi

  docker run -it --rm \
    --name xnview \
    --volume=$HOME/.config/.xnviewmp:/home/xnview/.config/.xnviewmp \
    --volume=$HOME/.cache:/home/xnview/.cache \
    --volume="$pics_dir":/home/xnview/pics \
    --volume=/tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=unix$DISPLAY \
    -u $UID \
    hainesr/xnview xnview
} > /dev/null

With this you can run xnview as follows:

$ xnview [directory]

If the directory argument is provided, and it is readable, xnview will use this as its pictures directory, otherwise it will use the current directory. This also suppresses the console output from XnView; to enable it again, for debugging purposes, delete just the > /dev/null part of the last line.

See my dotfiles⁠ for more details.

Tag summary

Content type

Image

Digest

Size

199.1 MB

Last updated

over 10 years ago

docker pull hainesr/xnview