ueberzug-bak


Nameueberzug-bak JSON
Version 18.2.1 PyPI version JSON
download
home_pagehttps://github.com/vesche/ueberzug-bak
Summaryueberzug is a command line util which allows to display images in combination with X11
upload_time2023-05-10 06:19:24
maintainer
docs_urlNone
authorUnknown
requires_python>=3.6
licenseGPLv3
keywords image media terminal ui gui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            NOTE: This is a fork of the original [ueberzug](https://github.com/seebye/ueberzug) project. I did not write this code.

# Überzug

Überzug is a command line util
which allows to draw images on terminals by using child windows.

Advantages to w3mimgdisplay:
- no race conditions as a new window is created to display images
- expose events will be processed,  
  so images will be redrawn on switch workspaces
- tmux support (excluding multi pane windows)
- terminals without the WINDOWID environment variable are supported
- chars are used as position - and size unit
- no memory leak (/ unlimited cache)

## Overview

- [Dependencies](#dependencies)
- [Installation](#installation)
- [Communication](#communication)  
  * [Command formats](#command-formats)
  * [Actions](#actions)
    + [Add](#add)
    + [Remove](#remove)
  * [Libraries](#libraries)
    + [~~Bash~~ (deprecated)](#bash)
    + [Python](#python)
    + [Python Urwid](https://github.com/seebye/urwid-ueberzogen)
  * [Examples](#examples)


## Dependencies

Libraries used in the c extension:  

- python
- X11
- Xext
- XRes

There are also other direct dependencies,  
but they will be installed by pip.

## Installation

```
$ pip install ueberzug-bak
```

Note: You can improve the performance of image manipulation functions
by using [pillow-simd](https://github.com/uploadcare/pillow-simd) instead of pillow.

## Communication

The communication is realised via stdin.  
A command is a request to execute a specific action with the passed arguments.  
(Therefore a command has to contain a key value pair "action": action_name)  
Commands are separated with a line break.

### Command formats

- json: Command as json object
- simple:  
  Key-value pairs seperated by a tab,  
  pairs are also seperated by a tab  
  **:warning: ONLY FOR TESTING!**  
  Simple was never intended for the usage in production!  
  It doesn't support paths containing tabs or line breaks  
  which makes it error prone.
- bash: dump of an associative array (`declare -p variable_name`)  

### Actions

#### Add

Name: add  
Description:  
Adds an image to the screen.  
If there's already an image with the same identifier  
it will be replaced.

| Key           | Type         | Description                                                        | Optional |
|---------------|--------------|--------------------------------------------------------------------|----------|
| identifier    | String       | a freely choosen identifier of the image                           | No       |
| x             | Integer      | x position                                                         | No       |
| y             | Integer      | y position                                                         | No       |
| path          | String       | path to the image                                                  | No       |
| width         | Integer      | desired width; original width will be used if not set              | Yes      |
| height        | Integer      | desired height; original width will be used if not set             | Yes      |
| ~~max_width~~ | Integer      | **Deprecated: replaced by scalers (this behavior is implemented by the default scaler contain)**<br>image will be resized (while keeping it's aspect ratio) if it's width is bigger than max width | Yes | image width |
| ~~max_height~~| Integer      | **Deprecated: replaced by scalers (this behavior is implemented by the default scaler contain)**<br>image will be resized (while keeping it's aspect ratio) if it's height is bigger than max height | Yes | image height |
| draw          | Boolean      | redraw window after adding the image, default True                 | Yes      | True    |
| synchronously_draw | Boolean | redraw window immediately                                          | Yes      | False   |
| scaler        | String       | name of the image scaler<br>(algorithm which resizes the image to fit into the placement) | Yes      | contain |
| scaling_position_x | Float   | the centered position, if possible<br>Specified as factor of the image size,<br>so it should be an element of [0, 1]. | Yes      | 0       |
| scaling_position_y | Float   | analogous to scaling_position_x                                    | Yes      | 0       |


ImageScalers:  

| Name          | Description                                                                      |
|---------------|----------------------------------------------------------------------------------|
| crop          | Crops out an area of the size of the placement size.                             |
| distort       | Distorts the image to the placement size.                                        |
| fit_contain   | Resizes the image that either the width matches the maximum width or the height matches the maximum height while keeping the image ratio. |
| contain       | Resizes the image to a size <= the placement size while keeping the image ratio. |
| forced_cover  | Resizes the image to cover the entire area which should be filled<br>while keeping the image ratio.<br>If the image is smaller than the desired size<br>it will be stretched to reach the desired size.<br>If the ratio of the area differs<br>from the image ratio the edges will be cut off. |
| cover         | The same as forced_cover but images won't be stretched<br>if they are smaller than the area which should be filled. |

#### Remove

Name: remove  
Description:  
Removes an image from the screen.  

| Key           | Type         | Description                                                        | Optional |
|---------------|--------------|--------------------------------------------------------------------|----------|
| identifier    | String       | a previously used identifier                                       | No       |
| draw          | Boolean      | redraw window after removing the image, default True               | Yes      |


### Libraries

Just a reminder: This is a GPLv3 licensed project, so if you use any of these libraries you also need to license it with a GPLv3 compatible license.

#### Bash

The library is deprecated.  
Dump associative arrays if you want to use ueberzug with bash.  

~~First of all the library doesn't follow the posix standard,  
so you can't use it in any other shell than bash.~~  

~~Executing `ueberzug library` will print the path to the library to stdout.~~  

~~**Functions**~~:

- ~~`ImageLayer` starts the ueberzug process and uses bashs associative arrays to transfer commands.~~  
- ~~Also there will be a function named `ImageLayer::{action_name}` declared for each action.~~  
  ~~Each of this function takes the key values pairs of the respective action as arguments.~~  
  ~~Every argument of these functions has to be an associative key value pair.~~  
  ~~`ImageLayer::{action_name} [{key0}]="{value0}" [{key1}]="{value1}" ...`~~  
  ~~Executing such a function builds the desired command string according to the passed arguments and prints it to stdout.~~  

#### Python

First of all everything which isn't mentioned here isn't safe to use and  
won't necessarily shipped with new coming versions.  

The library is included in ueberzug's package.  
```python
import ueberzug.lib.v0 as ueberzug
```

**Classes**:

1. Visibility:  
   An enum which contains the visibility states of a placement.  
   
   - VISIBLE
   - INVISIBLE
2. Placement:  
   A placement to put images on.  
   
   Every key value pair of the add action is an attribute (except identifier).  
   Changing one of it will lead to building and transmitting an add command *if the placement is visible*.  
   The identifier key value pair is implemented as a property and not changeable.  
   
   Constructor:  
   
   | Name          | Type         | Optional | Description                                    |
   |---------------|--------------|----------|------------------------------------------------|
   | canvas        | Canvas       | No       | the canvas where images should be drawn on     |
   | identifier    | String       | No       | a unique string used to address this placement |
   | visibility    | Visibility   | Yes      | the initial visibility state<br>(if it's VISIBLE every attribute without a default value needs to be set) |
   | \*\*kwargs    | dict         | Yes      | key value pairs of the add action              |
   
   Properties:  
   
   | Name          | Type         | Setter | Description                          |
   |---------------|--------------|--------|--------------------------------------|
   | identifier    | String       | No     | the identifier of this placement     |
   | canvas        | Canvas       | No     | the canvas this placement belongs to |
   | visibility    | Visibility   | Yes    | the visibility state of this placement<br>- setting it to VISIBLE leads to the transmission of an add command<br>- setting it to INVISIBLE leads to the transmission of a remove command |
   
   **Warning**:  
   The transmission of a command can lead to an IOError.  
   (A transmission happens on assign a new value to an attribute of a visible Placement.  
   The transmission is delayed till leaving a with-statement if lazy_drawing is used.)
3. ScalerOption:  
   Enum which contains the useable scaler names.  
4. Canvas:  
   Should either be used with a with-statement or with a decorated function.  
   (Starts and stops the ueberzug process)

   Constructor:  
   
   | Name          | Type         | default  | Description                                    |
   |---------------|--------------|----------|------------------------------------------------|
   | debug         | bool         | False    | suppresses printing stderr if it's false       |
   
   Methods:  
   
   | Name                 | Returns      | Description                          |
   |----------------------|--------------|--------------------------------------|
   | create_placement     | Placement    | prevents the use of the same identifier multiple times,<br>takes the same arguments as the Placement constructor (excluding canvas parameter) |
   | \_\_call\_\_         | Function     | Decorator which returns a function which calls the decorated function with the keyword parameter canvas=this_canvas_object.<br>Of course other arguments are also passed through. |
   | request_transmission | -            | Transmits queued commands if automatic\_transmission is enabled or force=True is passed as keyword argument. |
   
   Properties / Attributes:  
   
   | Name          | Type                    | Setter | Description                          |
   |---------------|-------------------------|--------|--------------------------------------|
   | lazy_drawing  | context manager factory | No     | prevents the transmission of commands till the with-statement was left<br>`with canvas.lazy_drawing: pass`|
   | synchronous_lazy_drawing  | context manager factory | No     | Does the same as lazy_drawing. Additionally forces the redrawing of the windows to happen immediately. |
   | automatic\_transmission  | bool | Yes    | Transmit commands instantly on changing a placement. If it's disabled commands won't be transmitted till a lazy_drawing or synchronous_lazy_drawing with-statement was left or request_transmission(force=True) was called. Default: True |




### Examples

Command formats:

- Json command format: `{"action": "add", "x": 0, "y": 0, "path": "/some/path/some_image.jpg"}`  
- Simple command format: `action add x   0   y   0   path    /some/path/some_image.jpg`  
- Bash command format: `declare -A command=([path]="/some/path/some_image.jpg" [action]="add" [x]="0" [y]="0" )`  

Bash:

```bash
# process substitution example:
ueberzug layer --parser bash 0< <(
    declare -Ap add_command=([action]="add" [identifier]="example0" [x]="0" [y]="0" [path]="/some/path/some_image0.jpg")
    declare -Ap add_command=([action]="add" [identifier]="example1" [x]="10" [y]="0" [path]="/some/path/some_image1.jpg")
    sleep 5
    declare -Ap remove_command=([action]="remove" [identifier]="example0")
    sleep 5
)

# group commands example:
{
    declare -Ap add_command=([action]="add" [identifier]="example0" [x]="0" [y]="0" [path]="/some/path/some_image0.jpg")
    declare -Ap add_command=([action]="add" [identifier]="example1" [x]="10" [y]="0" [path]="/some/path/some_image1.jpg")
    read
    declare -Ap remove_command=([action]="remove" [identifier]="example0")
    read
} | ueberzug layer --parser bash
```

Python library:  

- curses (based on https://docs.python.org/3/howto/curses.html#user-input):  
```python
  import curses
  import time
  from curses.textpad import Textbox, rectangle
  import ueberzug.lib.v0 as ueberzug
  
  
  @ueberzug.Canvas()
  def main(stdscr, canvas):
      demo = canvas.create_placement('demo', x=10, y=0)
      stdscr.addstr(0, 0, "Enter IM message: (hit Ctrl-G to send)")
  
      editwin = curses.newwin(5, 30, 3, 1)
      rectangle(stdscr, 2, 0, 2+5+1, 2+30+1)
      stdscr.refresh()
  
      box = Textbox(editwin)
  
      # Let the user edit until Ctrl-G is struck.
      box.edit()
  
      # Get resulting contents
      message = box.gather()
      demo.path = ''.join(message.split())
      demo.visibility = ueberzug.Visibility.VISIBLE
      time.sleep(2)
  
  
  if __name__ == '__main__':
      curses.wrapper(main)
  ```
  
- general example:  
  ```python
  import ueberzug.lib.v0 as ueberzug
  import time
  
  if __name__ == '__main__':
      with ueberzug.Canvas() as c:
          paths = ['/some/path/some_image.png', '/some/path/another_image.png']
          demo = c.create_placement('demo', x=0, y=0, scaler=ueberzug.ScalerOption.COVER.value)
          demo.path = paths[0]
          demo.visibility = ueberzug.Visibility.VISIBLE
  
          for i in range(30):
              with c.lazy_drawing:
                  demo.x = i * 3
                  demo.y = i * 3
                  demo.path = paths[i % 2]
              time.sleep(1/30)
  
          time.sleep(2)
  ```

Scripts:

- fzf with image preview: https://github.com/seebye/ueberzug/blob/master/examples/fzfimg.sh
- Mastodon viewer: https://github.com/seebye/ueberzug/blob/master/examples/mastodon.sh
- **F**zf **M**pd **U**ser **I**nterface: https://github.com/seebye/fmui

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vesche/ueberzug-bak",
    "name": "ueberzug-bak",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "image media terminal ui gui",
    "author": "Unknown",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4a/a8/4992b600ca9a9042b79a37dec91d19f158650389a6c824a87ad49f48742f/ueberzug-bak-18.2.1.tar.gz",
    "platform": null,
    "description": "NOTE: This is a fork of the original [ueberzug](https://github.com/seebye/ueberzug) project. I did not write this code.\n\n# \u00dcberzug\n\n\u00dcberzug is a command line util\nwhich allows to draw images on terminals by using child windows.\n\nAdvantages to w3mimgdisplay:\n- no race conditions as a new window is created to display images\n- expose events will be processed,  \n  so images will be redrawn on switch workspaces\n- tmux support (excluding multi pane windows)\n- terminals without the WINDOWID environment variable are supported\n- chars are used as position - and size unit\n- no memory leak (/ unlimited cache)\n\n## Overview\n\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [Communication](#communication)  \n  * [Command formats](#command-formats)\n  * [Actions](#actions)\n    + [Add](#add)\n    + [Remove](#remove)\n  * [Libraries](#libraries)\n    + [~~Bash~~ (deprecated)](#bash)\n    + [Python](#python)\n    + [Python Urwid](https://github.com/seebye/urwid-ueberzogen)\n  * [Examples](#examples)\n\n\n## Dependencies\n\nLibraries used in the c extension:  \n\n- python\n- X11\n- Xext\n- XRes\n\nThere are also other direct dependencies,  \nbut they will be installed by pip.\n\n## Installation\n\n```\n$ pip install ueberzug-bak\n```\n\nNote: You can improve the performance of image manipulation functions\nby using [pillow-simd](https://github.com/uploadcare/pillow-simd) instead of pillow.\n\n## Communication\n\nThe communication is realised via stdin.  \nA command is a request to execute a specific action with the passed arguments.  \n(Therefore a command has to contain a key value pair \"action\": action_name)  \nCommands are separated with a line break.\n\n### Command formats\n\n- json: Command as json object\n- simple:  \n  Key-value pairs seperated by a tab,  \n  pairs are also seperated by a tab  \n  **:warning: ONLY FOR TESTING!**  \n  Simple was never intended for the usage in production!  \n  It doesn't support paths containing tabs or line breaks  \n  which makes it error prone.\n- bash: dump of an associative array (`declare -p variable_name`)  \n\n### Actions\n\n#### Add\n\nName: add  \nDescription:  \nAdds an image to the screen.  \nIf there's already an image with the same identifier  \nit will be replaced.\n\n| Key           | Type         | Description                                                        | Optional |\n|---------------|--------------|--------------------------------------------------------------------|----------|\n| identifier    | String       | a freely choosen identifier of the image                           | No       |\n| x             | Integer      | x position                                                         | No       |\n| y             | Integer      | y position                                                         | No       |\n| path          | String       | path to the image                                                  | No       |\n| width         | Integer      | desired width; original width will be used if not set              | Yes      |\n| height        | Integer      | desired height; original width will be used if not set             | Yes      |\n| ~~max_width~~ | Integer      | **Deprecated: replaced by scalers (this behavior is implemented by the default scaler contain)**<br>image will be resized (while keeping it's aspect ratio) if it's width is bigger than max width | Yes | image width |\n| ~~max_height~~| Integer      | **Deprecated: replaced by scalers (this behavior is implemented by the default scaler contain)**<br>image will be resized (while keeping it's aspect ratio) if it's height is bigger than max height | Yes | image height |\n| draw          | Boolean      | redraw window after adding the image, default True                 | Yes      | True    |\n| synchronously_draw | Boolean | redraw window immediately                                          | Yes      | False   |\n| scaler        | String       | name of the image scaler<br>(algorithm which resizes the image to fit into the placement) | Yes      | contain |\n| scaling_position_x | Float   | the centered position, if possible<br>Specified as factor of the image size,<br>so it should be an element of [0, 1]. | Yes      | 0       |\n| scaling_position_y | Float   | analogous to scaling_position_x                                    | Yes      | 0       |\n\n\nImageScalers:  \n\n| Name          | Description                                                                      |\n|---------------|----------------------------------------------------------------------------------|\n| crop          | Crops out an area of the size of the placement size.                             |\n| distort       | Distorts the image to the placement size.                                        |\n| fit_contain   | Resizes the image that either the width matches the maximum width or the height matches the maximum height while keeping the image ratio. |\n| contain       | Resizes the image to a size <= the placement size while keeping the image ratio. |\n| forced_cover  | Resizes the image to cover the entire area which should be filled<br>while keeping the image ratio.<br>If the image is smaller than the desired size<br>it will be stretched to reach the desired size.<br>If the ratio of the area differs<br>from the image ratio the edges will be cut off. |\n| cover         | The same as forced_cover but images won't be stretched<br>if they are smaller than the area which should be filled. |\n\n#### Remove\n\nName: remove  \nDescription:  \nRemoves an image from the screen.  \n\n| Key           | Type         | Description                                                        | Optional |\n|---------------|--------------|--------------------------------------------------------------------|----------|\n| identifier    | String       | a previously used identifier                                       | No       |\n| draw          | Boolean      | redraw window after removing the image, default True               | Yes      |\n\n\n### Libraries\n\nJust a reminder: This is a GPLv3 licensed project, so if you use any of these libraries you also need to license it with a GPLv3 compatible license.\n\n#### Bash\n\nThe library is deprecated.  \nDump associative arrays if you want to use ueberzug with bash.  \n\n~~First of all the library doesn't follow the posix standard,  \nso you can't use it in any other shell than bash.~~  \n\n~~Executing `ueberzug library` will print the path to the library to stdout.~~  \n\n~~**Functions**~~:\n\n- ~~`ImageLayer` starts the ueberzug process and uses bashs associative arrays to transfer commands.~~  \n- ~~Also there will be a function named `ImageLayer::{action_name}` declared for each action.~~  \n  ~~Each of this function takes the key values pairs of the respective action as arguments.~~  \n  ~~Every argument of these functions has to be an associative key value pair.~~  \n  ~~`ImageLayer::{action_name} [{key0}]=\"{value0}\" [{key1}]=\"{value1}\" ...`~~  \n  ~~Executing such a function builds the desired command string according to the passed arguments and prints it to stdout.~~  \n\n#### Python\n\nFirst of all everything which isn't mentioned here isn't safe to use and  \nwon't necessarily shipped with new coming versions.  \n\nThe library is included in ueberzug's package.  \n```python\nimport ueberzug.lib.v0 as ueberzug\n```\n\n**Classes**:\n\n1. Visibility:  \n   An enum which contains the visibility states of a placement.  \n   \n   - VISIBLE\n   - INVISIBLE\n2. Placement:  \n   A placement to put images on.  \n   \n   Every key value pair of the add action is an attribute (except identifier).  \n   Changing one of it will lead to building and transmitting an add command *if the placement is visible*.  \n   The identifier key value pair is implemented as a property and not changeable.  \n   \n   Constructor:  \n   \n   | Name          | Type         | Optional | Description                                    |\n   |---------------|--------------|----------|------------------------------------------------|\n   | canvas        | Canvas       | No       | the canvas where images should be drawn on     |\n   | identifier    | String       | No       | a unique string used to address this placement |\n   | visibility    | Visibility   | Yes      | the initial visibility state<br>(if it's VISIBLE every attribute without a default value needs to be set) |\n   | \\*\\*kwargs    | dict         | Yes      | key value pairs of the add action              |\n   \n   Properties:  \n   \n   | Name          | Type         | Setter | Description                          |\n   |---------------|--------------|--------|--------------------------------------|\n   | identifier    | String       | No     | the identifier of this placement     |\n   | canvas        | Canvas       | No     | the canvas this placement belongs to |\n   | visibility    | Visibility   | Yes    | the visibility state of this placement<br>- setting it to VISIBLE leads to the transmission of an add command<br>- setting it to INVISIBLE leads to the transmission of a remove command |\n   \n   **Warning**:  \n   The transmission of a command can lead to an IOError.  \n   (A transmission happens on assign a new value to an attribute of a visible Placement.  \n   The transmission is delayed till leaving a with-statement if lazy_drawing is used.)\n3. ScalerOption:  \n   Enum which contains the useable scaler names.  \n4. Canvas:  \n   Should either be used with a with-statement or with a decorated function.  \n   (Starts and stops the ueberzug process)\n\n   Constructor:  \n   \n   | Name          | Type         | default  | Description                                    |\n   |---------------|--------------|----------|------------------------------------------------|\n   | debug         | bool         | False    | suppresses printing stderr if it's false       |\n   \n   Methods:  \n   \n   | Name                 | Returns      | Description                          |\n   |----------------------|--------------|--------------------------------------|\n   | create_placement     | Placement    | prevents the use of the same identifier multiple times,<br>takes the same arguments as the Placement constructor (excluding canvas parameter) |\n   | \\_\\_call\\_\\_         | Function     | Decorator which returns a function which calls the decorated function with the keyword parameter canvas=this_canvas_object.<br>Of course other arguments are also passed through. |\n   | request_transmission | -            | Transmits queued commands if automatic\\_transmission is enabled or force=True is passed as keyword argument. |\n   \n   Properties / Attributes:  \n   \n   | Name          | Type                    | Setter | Description                          |\n   |---------------|-------------------------|--------|--------------------------------------|\n   | lazy_drawing  | context manager factory | No     | prevents the transmission of commands till the with-statement was left<br>`with canvas.lazy_drawing: pass`|\n   | synchronous_lazy_drawing  | context manager factory | No     | Does the same as lazy_drawing. Additionally forces the redrawing of the windows to happen immediately. |\n   | automatic\\_transmission  | bool | Yes    | Transmit commands instantly on changing a placement. If it's disabled commands won't be transmitted till a lazy_drawing or synchronous_lazy_drawing with-statement was left or request_transmission(force=True) was called. Default: True |\n\n\n\n\n### Examples\n\nCommand formats:\n\n- Json command format: `{\"action\": \"add\", \"x\": 0, \"y\": 0, \"path\": \"/some/path/some_image.jpg\"}`  \n- Simple command format: `action add x   0   y   0   path    /some/path/some_image.jpg`  \n- Bash command format: `declare -A command=([path]=\"/some/path/some_image.jpg\" [action]=\"add\" [x]=\"0\" [y]=\"0\" )`  \n\nBash:\n\n```bash\n# process substitution example:\nueberzug layer --parser bash 0< <(\n    declare -Ap add_command=([action]=\"add\" [identifier]=\"example0\" [x]=\"0\" [y]=\"0\" [path]=\"/some/path/some_image0.jpg\")\n    declare -Ap add_command=([action]=\"add\" [identifier]=\"example1\" [x]=\"10\" [y]=\"0\" [path]=\"/some/path/some_image1.jpg\")\n    sleep 5\n    declare -Ap remove_command=([action]=\"remove\" [identifier]=\"example0\")\n    sleep 5\n)\n\n# group commands example:\n{\n    declare -Ap add_command=([action]=\"add\" [identifier]=\"example0\" [x]=\"0\" [y]=\"0\" [path]=\"/some/path/some_image0.jpg\")\n    declare -Ap add_command=([action]=\"add\" [identifier]=\"example1\" [x]=\"10\" [y]=\"0\" [path]=\"/some/path/some_image1.jpg\")\n    read\n    declare -Ap remove_command=([action]=\"remove\" [identifier]=\"example0\")\n    read\n} | ueberzug layer --parser bash\n```\n\nPython library:  \n\n- curses (based on https://docs.python.org/3/howto/curses.html#user-input):  \n```python\n  import curses\n  import time\n  from curses.textpad import Textbox, rectangle\n  import ueberzug.lib.v0 as ueberzug\n  \n  \n  @ueberzug.Canvas()\n  def main(stdscr, canvas):\n      demo = canvas.create_placement('demo', x=10, y=0)\n      stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n  \n      editwin = curses.newwin(5, 30, 3, 1)\n      rectangle(stdscr, 2, 0, 2+5+1, 2+30+1)\n      stdscr.refresh()\n  \n      box = Textbox(editwin)\n  \n      # Let the user edit until Ctrl-G is struck.\n      box.edit()\n  \n      # Get resulting contents\n      message = box.gather()\n      demo.path = ''.join(message.split())\n      demo.visibility = ueberzug.Visibility.VISIBLE\n      time.sleep(2)\n  \n  \n  if __name__ == '__main__':\n      curses.wrapper(main)\n  ```\n  \n- general example:  \n  ```python\n  import ueberzug.lib.v0 as ueberzug\n  import time\n  \n  if __name__ == '__main__':\n      with ueberzug.Canvas() as c:\n          paths = ['/some/path/some_image.png', '/some/path/another_image.png']\n          demo = c.create_placement('demo', x=0, y=0, scaler=ueberzug.ScalerOption.COVER.value)\n          demo.path = paths[0]\n          demo.visibility = ueberzug.Visibility.VISIBLE\n  \n          for i in range(30):\n              with c.lazy_drawing:\n                  demo.x = i * 3\n                  demo.y = i * 3\n                  demo.path = paths[i % 2]\n              time.sleep(1/30)\n  \n          time.sleep(2)\n  ```\n\nScripts:\n\n- fzf with image preview: https://github.com/seebye/ueberzug/blob/master/examples/fzfimg.sh\n- Mastodon viewer: https://github.com/seebye/ueberzug/blob/master/examples/mastodon.sh\n- **F**zf **M**pd **U**ser **I**nterface: https://github.com/seebye/fmui\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "ueberzug is a command line util which allows to display images in combination with X11",
    "version": "18.2.1",
    "project_urls": {
        "Bug Reports": "https://github.com/vesche/ueberzug-bak/issues",
        "Homepage": "https://github.com/vesche/ueberzug-bak",
        "Source": "https://github.com/vesche/ueberzug-bak"
    },
    "split_keywords": [
        "image",
        "media",
        "terminal",
        "ui",
        "gui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4aa84992b600ca9a9042b79a37dec91d19f158650389a6c824a87ad49f48742f",
                "md5": "fbaff5fce7a3aab801c085472ef29d8d",
                "sha256": "2077a0253b0783a1dcd2636bd3bfba430fbd8fa46c281e6e31bca1c3691b6ff7"
            },
            "downloads": -1,
            "filename": "ueberzug-bak-18.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fbaff5fce7a3aab801c085472ef29d8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 58576,
            "upload_time": "2023-05-10T06:19:24",
            "upload_time_iso_8601": "2023-05-10T06:19:24.244729Z",
            "url": "https://files.pythonhosted.org/packages/4a/a8/4992b600ca9a9042b79a37dec91d19f158650389a6c824a87ad49f48742f/ueberzug-bak-18.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-10 06:19:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vesche",
    "github_project": "ueberzug-bak",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ueberzug-bak"
}
        
Elapsed time: 0.07380s