4

When I'm trying to open an image in Ubuntu command line using the command eog filename.jpg, I get an error reading

Cannot open display:

Could someone please advise what else I need to run before this to open the image?

Note that I am accessing the machine directly, not ssh-ing in remotely.

heemayl
  • 91,753
tmnsoon
  • 41

1 Answers1

1

As it was found out in the comments , OP actually wanted to open images in full-tty environment ,i.e., not in graphical environment.

Natively there are no apps that will allow to open images in full-text environment, however one can install fbi package with the following command

sudo apt-get install fbi

The fbi package operates on rendering the image and writing it into framebuffer memory location , which is reference by /dev/fb0 device.

To ensure you don't need sudo privilege to run fbi, add yourself to the video group with the following command:

  sudo usermod -a -G video  $USER

Logout and log back in. At this point you can open images with:

 fbi path/to/image.png

For more advanced use of package fbi check out one of my other answer about setting TTY background.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497