Giter VIP home page Giter VIP logo

swayimg's Introduction

Swayimg: image viewer for Sway/Wayland

Now you can view images directly in the current terminal window! Screenshot

How it works

The program uses Sway IPC to determine the geometry of the currently focused container. This data is used to calculate the position and size of the new "overlay" window that will be used to draw the image. In the next step, swayimg adds two Sway rules for the self window: "floating enable" and "move position". Then it creates a new Wayland window and draws the image from the specified file.

Supported image formats

Known issues

  • Animation is not supported, only the first frame is displayed;
  • Image width or height cannot exceed 32767 pixels (Cairo limit);
  • BMP compressed images are not supported.

Usage

swayimg [OPTIONS]... [FILE]...

See man swayimg for details.

Examples:

  • View multiple files: swayimg photo.jpg logo.png
  • View all files (recursively) in the current directory in random order: swayimg -rR
  • View using pipes: wget -O- https://www.kernel.org/theme/images/logos/tux.png 2> /dev/null | swayimg -

Key bindings

  • Arrows and vim-like moving keys (hjkl): Move view point;
  • + or =: Zoom in;
  • -: Zoom out;
  • 0: Set scale to 100%;
  • Backspace: Reset scale to default;
  • F5 or [: Rotate 90 degrees anticlockwise;
  • F6 or ]: Rotate 90 degrees clockwise;
  • F7: Flip vertical;
  • F8: Flip horizontal;
  • i: Show/hide image properties;
  • F11 or f: Toggle full screen mode;
  • PgDown, Space, or n: Open next file;
  • PgUp or p: Open previous file;
  • N: Open file from next directory;
  • P: Open file from previous directory;
  • Esc, Enter, F10 or q: Exit the program.

Configuration

The viewer searches for the configuration file with name config in the following directories:

  • $XDG_CONFIG_HOME/swayimg
  • $HOME/.config/swayimg
  • $XDG_CONFIG_DIRS/swayimg
  • /etc/xdg/swayimg

Sample file is available here.

See man swayimgrc for details.

Install

Packaging status

Arch users can install the program from AUR: swayimg or swayimg-git package.

Alpine users can install the program from swayimg or swayimg-full package.

Other users can build from sources.

Build

CI

The project uses Meson build system:

meson build
ninja -C build
sudo ninja -C build install

swayimg's People

Contributors

artemsen avatar jirutka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.