Git Product home page Git Product logo

orhun / menyoki Goto Github PK

View Code? Open in Web Editor NEW
594.0 12.0 13.0 1.56 MB

Screen{shot,cast} and perform ImageOps on the command line ๐ŸŒฑ ๐Ÿž๏ธ

Home Page: https://menyoki.cli.rs

License: GNU General Public License v3.0

Rust 99.51% Dockerfile 0.49%
screencast screenshot gif-maker image-analysis gif-recorder screen-recorder screen-capture image-processing image-conversion image image-manipulation command-line command-line-tool rust capture animation animated-png apng hacktoberfest

menyoki's Introduction


Screen{shot,cast} and perform ImageOps on the command line ๐ŸŒฑ ๐Ÿž๏ธ


menyoki is a screencast and screenshot utility that can also perform various image related operations such as making/splitting GIFs and modifying/analyzing/viewing image files. It aims to be a lightweight command line tool for either helping out on day-to-day life operations or complicated detail-centric issues. Originally it was designed to record/screenshot terminal windows but it can be tweaked easily for other purposes with command line arguments, environment variables, or a configuration file.

Table of Contents

Supported Platforms

  • Linux
    • X11 (fully supported)
    • Wayland (no record/capture)
  • Windows (no record/capture)
  • macOS (no record/capture)

menyoki requires a window system implementation of the supported platform for record and capture actions. Other features are expected to work normally since they don't require a window system running (or grabbing a window to operate on). For example, despite the macOS is not listed as a supported platform, menyoki still can perform image operations such as edit, analyze and view if it's compiled on macOS.

Supported Formats

Installation

Packaging status

Requirements

  • Rust: 1.56.1+
  • Dependencies
    • Arch Linux: libx11, libxrandr
    • Debian, Ubuntu: libx11-dev/librust-x11-dev, libxrandr-dev
    • Fedora: libX11-devel, libXrandr

Cargo

menyoki can be installed from crates.io using cargo if Rust is installed.

cargo install menyoki

Use --force option to update.

cargo install menyoki --force

Arch Linux

menyoki can be installed from the Arch Linux extra repository.

pacman -S menyoki

Or if you prefer, you can use an available AUR package for installation.

paru menyoki
  • Clone the package and compile it with makepkg:
git clone https://aur.archlinux.org/menyoki-git.git
cd menyoki-git
makepkg -si

Docker

Docker Hub

Download the orhunp/menyoki image from Docker Hub (see available tags):

docker pull orhunp/menyoki:<tag>

Run a container:

docker run orhunp/menyoki:<tag>

Building an image

After cloning the repository, you can build an image from Dockerfile:

docker build -t menyoki .

Then you can either run a container:

docker run menyoki

or spawn a shell inside the container with running it interactively:

docker run -it menyoki /bin/bash

Manual

From source

  1. Clone the repository.
git clone https://github.com/orhun/menyoki.git && cd menyoki/
  1. Build the project and install binary.
cargo install --path .

Releases

  1. Download the latest archive from releases page and extract it.
  2. Move menyoki binary to /usr/local/bin/ (Linux)

Features

Usage

Action
Result

Command line arguments of menyoki are designed to be as intuitive as possible. As a result of that, an action can be performed with a chain of subcommands along with the flags and options. The general prototype for the usage of command line arguments is the following:

menyoki (ACTION) (FORMAT) (OUTPUT)

The subcommand that will indicate the action is mandatory whereas format and output subcommands might be optional (or they might not exist at all). The format subcommand can be one of the supported formats and output basically corresponds to the save subcommand.

The default format is the first listed subcommand if there is not any subcommand given for specifying a format. On the other hand, save subcommand uses the "menyoki" directory in the home (or images if it exists) as the default output directory.

General

Flags and options that will generally affect the execution of menyoki can be set before specifying the main action to perform. Then the main subcommand (action) must be specified.

menyoki [FLAGS] [OPTIONS] <SUBCOMMAND>

Arguments

FLAGS:
    -h, --help       Print help information
    -V, --version    Print version information
    -v, --verbose    Increase logging verbosity
    -q, --quiet      Do not show output

OPTIONS:
    -c, --config <FILE>    Set the configuration file
        --color <HEX>      Set the main color [default: 3AA431]

SUBCOMMANDS:
    record     Record an animation
    split      Split an animation into frames
    make       Make an animation from frames
    capture    Capture an image
    edit       Edit an image
    analyze    Analyze an image
    view       View an image

Examples

Command Action
menyoki -V Print the version information
menyoki -vv --color FF00FF <action> Set log verbosity level to 2 (trace) and use "FF00FF" as the main color
menyoki -q -c menyoki.conf <action> Run in quiet mode and read the configuration from "menyoki.conf"

Record

menyoki can record an area of a window or the whole screen and encode it as a supported format. Area selection and resize is performed with the key bindings.

A few scenarios that record action might be helpful would be:

  • Record a specific area of a window
  • Record for a given duration
  • Record the output of a command (especially for TUI applications)

Encoding options can be changed using the arguments of the provided format. (See the output of menyoki record gif --help)

menyoki record [FLAGS] [OPTIONS] [COMMAND] [SUBCOMMAND]

Arguments

FLAGS:
    -r, --root          Record the root window
    -f, --focus         Record the focused window
        --select        Select the window to record
        --parent        Record the parent of the window
        --with-alpha    Record with the alpha channel
        --no-keys       Disable the action keys while recording
    -m, --mouse         Select the window with mouse click
    -h, --help          Print help information

OPTIONS:
        --action-keys <KEYS>    Set the action keys [default: LAlt-S,LAlt-Enter]
        --cancel-keys <KEYS>    Set the cancel keys [default: LControl-D,Escape]
    -b, --border <BORDER>       Set the border width [default: 1]
    -p, --padding <T:R:B:L>     Set the record area padding
    -s, --size <WxH>            Set the record area size
    -d, --duration <S>          Set the duration for recording [default: โˆž]
    -c, --countdown <S>         Set the countdown before recording [default: 3]
    -t, --timeout <S>           Set the timeout for window selection [default: 300]
    -i, --interval <MS>         Set the refresh interval for window selection [default: 10]
        --font <FONT>           Set the font to use for window selection
        --monitor <NUM>         Set the monitor to record as root window

ARGS:
    <COMMAND>    Set the command to run

SUBCOMMANDS:
    gif     Use the GIF encoder
    apng    Use the APNG encoder
    save    Save the output file(s)

Examples

Command Action
menyoki record Select a window and start recording with default settings
menyoki record --root --countdown 5 Record the root window after 5 seconds of countdown
menyoki record --focus --with-alpha Record the focused window with the alpha channel (for transparency)
menyoki record --size 200x300 --duration 10 Record an area of size 200x300 for 10 seconds
menyoki record --padding 20:10:0:10 --timeout 120 Record an area with given padding and set window selection timeout to 120 seconds
menyoki record --parent Record the parent window of the selected window
menyoki record --root --select --monitor 1 Record the first monitor as root window
menyoki record --border 5 Record the area selected by a border with 5 width
menyoki record --action-keys LControl-Q,LAlt-W Record with the default settings using custom key bindings
menyoki record --cancel-keys LControl-X,E Record with the default settings using custom key bindings
menyoki record gif --fps 15 --quality 90 Record 15 frames per second with 90% quality
menyoki record gif --gifski Record and encode using the gifski encoder
menyoki record gif save "test.gif" --timestamp Record and save as "test.gif" with timestamp in the file name
menyoki record apng --fps 30 Record 30 frames per second and encode as APNG
menyoki -q record save "-" > test.gif Record and redirect output to "test.gif"
menyoki -q record save "-" | xclip -selection clipboard -t image/gif Record and pipes output to xclip's clipboard selection, specifying target as a gif
menyoki -q record "kmon -t 2000" Execute the command and record its output in quiet mode
menyoki record --font "-*-dejavu sans-*-*-*-*-17-*-*-*-*-*-*-*" Use custom font for showing the area size (see xfontsel)

Pro Tip

Use slop for selecting an area of the root window (fullscreen) with mouse interaction.

menyoki record --root --size $(slop)

Split

menyoki can split an animation into frames (extract images) if the split subcommand is provided and it can save frames as one of the supported formats with the use of trailing format subcommand.

menyoki split [OPTIONS] <FILE> [SUBCOMMAND]

Arguments

FLAGS:
    -h, --help    Print help information

OPTIONS:
    -d, --dir <DIRECTORY>    Set the output directory

ARGS:
    <FILE>    Set the animation file

SUBCOMMANDS:
    png     Use the PNG encoder
    jpg     Use the JPG encoder
    webp    Use the WebP encoder
    bmp     Use the BMP encoder
    ico     Use the ICO encoder
    tiff    Use the TIFF encoder
    tga     Use the TGA encoder
    pnm     Use the PNM encoder
    ff      Use the farbfeld encoder
    exr     Use the OpenEXR encoder

Examples

Command Action
menyoki split rec.gif Extract frames from the "rec.gif" file
menyoki split rec.gif jpg --quality 100 Extract frames as JPEG in maximum quality
menyoki split rec.gif --dir frames/ Extract frames and save them to the specified directory

Make

make subcommand serves the purpose of creating an animation from a set of images. For example, it can be used for making GIFs from given images either via the command line or the specified directory.

menyoki make [FLAGS] [OPTIONS] <FRAMES>... [SUBCOMMAND]

Arguments

FLAGS:
        --gifski     Use the gifski encoder
        --fast       Encode 3 times faster (gifski)
    -n, --no-sort    Use frames in the order given
    -h, --help       Print help information

OPTIONS:
    -f, --fps <FPS>            Set the FPS [default: 20]
    -q, --quality <QUALITY>    Set the frame quality (1-100) [default: 75]
    -r, --repeat <REPEAT>      Set the number of repetitions [default: โˆž]
    -d, --dir <DIRECTORY>      Set the directory to read frames
        --format <FORMAT>      Set the animation format [default: gif]  [possible values: gif, apng]

ARGS:
    <FRAMES>...    Set the animation frames

SUBCOMMANDS:
    save    Save the output file(s)

Examples

Command Action
menyoki make 1.png 2.png Make a GIF that consists of two frames as "1.png" and "2.png"
menyoki make 1.png 2.png --fps 5 --quality 100 Make a GIF with the specified properties from given frames
menyoki make 1.png 2.png save 3.gif --date Make a GIF and save the file ("3.gif") with the date information
menyoki make 1.png 2.png --format apng Make an APNG from the given frames
menyoki make --dir frames/ Make a GIF from the frames in the specified directory

Capture

menyoki can capture (screenshot) an area of a window or the whole screen and encode it as a supported format. Formats like png, jpg, and pnm have their own flags and options that might be used for changing the default encoding settings. Similar to the record subcommand, area selection and resize is performed with the key bindings. The same flags and options might apply for both record and capture subcommands since the actions are abstractly alike.

menyoki capture [FLAGS] [OPTIONS] [COMMAND] [SUBCOMMAND]

Arguments

FLAGS:
    -r, --root          Capture the root window
    -f, --focus         Capture the focused window
        --select        Select the window to capture
        --parent        Record the parent of the window
        --with-alpha    Capture with the alpha channel
    -m, --mouse         Select the window with mouse click
    -h, --help          Print help information

OPTIONS:
        --action-keys <KEYS>    Set the action keys [default: LAlt-S,LAlt-Enter]
        --cancel-keys <KEYS>    Set the cancel keys [default: LControl-D,Escape]
    -b, --border <BORDER>       Set the border width [default: 1]
    -p, --padding <T:R:B:L>     Set the capture area padding
    -s, --size <WxH>            Set the capture area size
    -c, --countdown <S>         Set the countdown before capturing [default: 0]
    -t, --timeout <S>           Set the timeout for window selection [default: 300]
    -i, --interval <MS>         Set the refresh interval for window selection [default: 10]
        --font <FONT>           Set the font to use for window selection
        --monitor <NUM>         Set the monitor to capture as root window

ARGS:
    <COMMAND>    Set the command to run

SUBCOMMANDS:
    png     Use the PNG encoder
    jpg     Use the JPG encoder
    webp    Use the WebP encoder
    bmp     Use the BMP encoder
    ico     Use the ICO encoder
    tiff    Use the TIFF encoder
    tga     Use the TGA encoder
    pnm     Use the PNM encoder
    ff      Use the farbfeld encoder
    exr     Use the OpenEXR encoder
    save    Save the output file(s)

Examples

Command Action
menyoki capture Select a window and screenshot with default settings
menyoki capture --root --countdown 5 Screenshot the root window after 5 seconds of countdown
menyoki capture --focus --with-alpha Screenshot the focused window with the alpha channel (for transparency)
menyoki capture --size 200x300 --duration 10 Screenshot an area of size 200x300 for 10 seconds
menyoki capture --padding 20:10:0:10 --timeout 120 Screenshot an area with given padding and set window selection timeout to 120 seconds
menyoki capture --mouse Screenshot the selected window with a mouse click
menyoki capture png --filter avg --compression fast Screenshot and encode with the specified PNG options
menyoki capture jpg --quality 100 Screenshot and encode with the specified JPEG options
menyoki capture webp --lossless Screenshot and encode with the specified WEBP options
menyoki capture pnm --format pixmap --encoding ascii Screenshot and encode with the specified PNM options
menyoki capture ff save "test.ff" --timestamp Screenshot and save as "test.ff" in farbfeld format with timestamp in the file name
menyoki -q capture png save "-" > test.png Screenshot and redirect output to "test.png"
menyoki -q capture png save "-" | xclip -selection clipboard -t image/png Screenshot and pipe output to xclip's clipboard selection, specifying an image/png target
menyoki -q capture "kmon -t 2000" Execute the command and screenshot its output in quiet mode (sets countdown to 3 implicitly)

Also, see the pro tip about --size argument.

Edit

edit subcommand can be used to edit (manipulate/filter/convert) files in one of the supported formats. Apart from the flags and options that edit provides, other encoding options can be specified via format subcommand.

menyoki edit [FLAGS] [OPTIONS] <FILE> [SUBCOMMAND]

Arguments

FLAGS:
        --convert      Convert image using the given encoder
        --grayscale    Convert image to grayscale
        --invert       Invert the colors of the image
    -h, --help         Print help information

OPTIONS:
        --crop <T:R:B:L>             Apply padding to crop the image
        --resize <WxH>               Resize the image without keeping the aspect ratio
        --ratio <RATIO>              Resize the image proportionally by aspect ratio [default: 1.0]
        --rotate <ROTATE>            Rotate the image (clockwise) [possible values: 90, 180, 270]
        --flip <FLIP>                Flip the image [possible values: horizontal, vertical]
        --blur <SIGMA>               Blur the image [default: 0.0]
        --hue <HUE>                  Adjust the hue of the image [default: ยฑ0]
        --contrast <CONTRAST>        Adjust the contrast of the image [default: ยฑ0.0]
        --brightness <BRIGHTNESS>    Adjust the brightness of the image [default: ยฑ0]
        --filter <FILTER>            Set the sampling filter for scaling [default: lanczos3]  [possible values: nearest, triangle, catmull-rom, gaussian,
                                     lanczos3]

ARGS:
    <FILE>    Set the input file

SUBCOMMANDS:
    gif     Use the GIF encoder
    apng    Use the APNG encoder
    png     Use the PNG encoder
    jpg     Use the JPG encoder
    webp    Use the WebP encoder
    bmp     Use the BMP encoder
    ico     Use the ICO encoder
    tiff    Use the TIFF encoder
    tga     Use the TGA encoder
    pnm     Use the PNM encoder
    ff      Use the farbfeld encoder
    exr     Use the OpenEXR encoder
    save    Save the output file(s)

Examples

Command Action
menyoki edit test.png Re-encode the "test.png" file without editing
menyoki edit test.png --grayscale Convert image to grayscale
menyoki edit test.png --invert Invert the colors of the image
menyoki edit test.png --crop 20:20:20:20 Apply the given padding to image for cropping
menyoki edit test.png --resize 300x300 Resize the image to 300x300 (without keeping the aspect ratio)
menyoki edit test.png --ratio 0.5 Resize the image to half the size (using the aspect ratio)
menyoki edit test.png --ratio 2.0 --filter gaussian Resize the image using the specified sampling filter
menyoki edit test.png --rotate 90 Rotate the image 90 degrees (clockwise)
menyoki edit test.png --flip horizontal Flip the image horizontally
menyoki edit test.png --blur 2.0 Blur the image
menyoki edit test.png --hue 100 Adjust the hue of the image
menyoki edit test.png --contrast -10.5 Adjust the contrast of the image
menyoki edit test.png --brightness 50 Adjust the brightness of the image
menyoki edit test.png --convert tga Convert image to TGA format
menyoki edit test.png --convert jpg --quality 80 Convert image to JPEG in 80% quality
menyoki edit test.gif --ratio 0.25 gif --quality 80 Resize and re-encode "test.gif"
menyoki edit test.gif gif --speed 0.5 Slow down the GIF (half the speed)
menyoki edit test.gif gif --cut-beginning 1.0 --cut-end 0.5 Cut the duration of GIF by seconds
menyoki edit test.apng --convert gif Convert APNG to GIF
menyoki edit test.ff --grayscale --convert pnm --format arbitrary save "output" --with-extension --date "%H%M%S" test.ff (farbfeld) -> grayscale -> output_020035.pam (PNM)

Analyze

analyze subcommand serves the purpose of inspecting an image file which is in a supported format and creating a report based on the image details. The report consists of 2 to 3 sections that are file, image, and EXIF information.

menyoki analyze [FLAGS] [OPTIONS] <FILE> [SUBCOMMAND]

Arguments

FLAGS:
        --timestamp    Use Unix timestamp for report dates
    -h, --help         Print help information

OPTIONS:
    -t, --time-zone <TIMEZONE>    Set the time zone of the report [default: utc]  [possible values: utc, local]

ARGS:
    <FILE>    Set the image file

SUBCOMMANDS:
    save    Save the output file(s)

Examples

Command Action
menyoki analyze test.jpg Inspect "test.jpg" and print the report
menyoki analyze test.jpg save test_report.txt Inspect "test.jpg" and save the report as "test_report.txt"
menyoki analyze test.jpg --timestamp Inspect the file and create a report based on timestamps
menyoki analyze test.jpg --time-zone local Inspect the file and create a report based on local time zone
menyoki analyze test.jpg --timestamp save --timestamp Use timestamps for both analysis report and file name
Example report
menyoki - image analysis report

File Information
  File:     "Canon_40D.jpg" (8.0 KB)
  Created:  2020-11-11 231334.850884475 UTC
  Modified: 2020-11-11 231334.850884475 UTC
  Accessed: 2020-11-11 231404.647510552 UTC

Image Information
  Format:     JPEG
  Dimensions: 100x68px
  Color Type: RGB8
  Main Colors:
   โ€ข #433D2BFF
   โ€ข #989069FF
   โ€ข #8B7458FF
   โ€ข #ADA791FF

EXIF Data
  Make: "Canon"
  Model: "Canon EOS 40D"
  Orientation: row 0 at top and column 0 at left
  XResolution: 72 pixels per inch
  YResolution: 72 pixels per inch
  ResolutionUnit: inch
  Software: "GIMP 2.4.5"
  DateTime: 2008-07-31 103811
  YCbCrPositioning: co-sited
  ExposureTime: 1/160 s
  FNumber: f/7.1
  ExposureProgram: manual
  PhotographicSensitivity: 100
  ExifVersion: 2.21
  DateTimeOriginal: 2008-05-30 155601
  DateTimeDigitized: 2008-05-30 155601
  ComponentsConfiguration: YCbCr_
  ShutterSpeedValue: 7.375 EV
  ApertureValue: 5.625 EV
  ExposureBiasValue: 0 EV
  MeteringMode: pattern
  Flash: fired, no return light detection function, forced
  FocalLength: 135 mm
  UserComment: (530 bytes binary data)
  SubSecTime: "00"
  SubSecTimeOriginal: "00"
  SubSecTimeDigitized: "00"
  FlashpixVersion: 1.0
  ColorSpace: sRGB
  PixelXDimension: 100 pixels
  PixelYDimension: 68 pixels
  InteroperabilityIndex: "R98"
  InteroperabilityVersion: 1.00
  FocalPlaneXResolution: 4438.356164383562 pixels per inch
  FocalPlaneYResolution: 4445.969125214408 pixels per inch
  FocalPlaneResolutionUnit: inch
  CustomRendered: normal process
  ExposureMode: manual exposure
  WhiteBalance: auto white balance
  SceneCaptureType: standard
  GPSVersionID: 2.2.0.0
  Compression: JPEG (T)
  XResolution: 72 pixels per inch (T)
  YResolution: 72 pixels per inch (T)
  ResolutionUnit: inch (T)
  JPEGInterchangeFormat: 1090 (T)
  JPEGInterchangeFormatLength: 1378 (T)

generated on 2020-11-11 23:14:04.652826438 UTC

View

view subcommand can be used to simply view an image from the terminal. It uses the core library of viu.

menyoki view [FLAGS] <FILE>

Arguments

FLAGS:
    -t, --transparent    Display transparent image with transparent background
    -h, --help           Print help information

ARGS:
    <FILE>    Set the input file

Examples

Command Action
menyoki view test.jpg View "test.jpg" from the terminal
menyoki view test.png --transparent View "test.png" from the terminal with transparency enabled

Other

It's possible to change the GIF, APNG, PNG, JPG, and PNM encoding options with specifying flags/options to the corresponding subcommands. Also, save subcommand can be used for changing the default output settings.

GIF/APNG

FLAGS:
        --gifski    Use the gifski encoder         <only in GIF>
        --fast      Encode 3 times faster (gifski) <only in GIF>
    -h, --help    Print help information

OPTIONS:
    -f, --fps <FPS>            Set the FPS [default: 20]
    -q, --quality <QUALITY>    Set the frame quality (1-100) [default: 75] <only in GIF>
    -r, --repeat <REPEAT>      Set the number of repetitions [default: โˆž]
    -s, --speed <SPEED>        Set the GIF speed [default: 1.0]
        --cut-beginning <S>    Cut the beginning of the GIF [default: 0.0]
        --cut-end <S>          Cut the end of the GIF [default: 0.0]

SUBCOMMANDS:
    save    Save the output file(s)

(Some options might be only usable with a particular action)

PNG

FLAGS:
    -h, --help    Print help information

OPTIONS:
    -c, --compression <COMPRESSION>    Set the compression level [default: fast]  [possible values: default, fast, best]
    -f, --filter <FILTER>              Set the filter algorithm [default: sub]  [possible values: none, sub, up, avg, paeth]

SUBCOMMANDS:
    save    Save the output file(s)

JPG

FLAGS:
    -h, --help    Print help information

OPTIONS:
    -q, --quality <QUALITY>    Set the image quality (1-100) [default: 90]

SUBCOMMANDS:
    save    Save the output file(s)

WEBP

FLAGS:
    -l, --lossless    Use lossless encoding
    -h, --help        Print help information

OPTIONS:
    -q, --quality <QUALITY>    Set the lossy encoding quality (1-100) [default: 80]

SUBCOMMANDS:
    save    Save the output file(s)

PNM

FLAGS:
    -h, --help    Print help information

OPTIONS:
    -f, --format <FORMAT>        Set the PNM format [default: pixmap]  [possible values: bitmap, graymap, pixmap, arbitrary]
    -e, --encoding <ENCODING>    Set the encoding for storing the samples [default: binary]  [possible values: binary, ascii]

SUBCOMMANDS:
    save    Save the output file(s)

Save

FLAGS:
    -e, --with-extension    Always save the file with an extension
    -t, --timestamp         Add Unix timestamp to the file name
    -h, --help              Print help information

OPTIONS:
    -d, --date <FORMAT>    Add formatted date/time to the file name [default: %Y%m%dT%H%M%S]

ARGS:
    <FILE>    Set the output file

Key Bindings

Key bindings are only used and present while capture or record actions are performed. Essentially key bindings are for selecting capture/record areas and resizing them without any mouse interaction.

There are 3 types of key bindings in terms of performed action:

  • Action keys (main action keys such as LAlt-S, can be customized via --action-keys and --cancel-keys options)
  • Cancel keys (the keys that will cancel the operation, e.g. LControl-D)
  • Miscellaneous keys (the keys that can be used for resizing the selected area such as LAlt-[up])
Key Action
LAlt-[S/Enter] Start/stop recording or screenshot the selected area
LControl-D, Escape Cancel the current operation
LControl-C Cancel the current operation or stop recording
LAlt-[arrow keys/hjkl] Increase the area padding (decrease the size of the area)
LControl-LAlt-[arrow keys/hjkl] Decrease the area padding (increase the size of the area)
LShift-LAlt-[arrow keys/hjkl] Reposition the selected area (move around)
LAlt-[1-9] Set the speed factor of changing the area size (default: 3)
LAlt-R Reset the area padding to default

key bindings

Configuration

It's possible to override the default command line arguments with a configuration file. It can be specified via --config option or $MENYOKI_CONFIG environment variable. Also, it can be placed to a location where menyoki looks for as default:

  • {CONFIG_DIR}/menyoki.conf
  • {CONFIG_DIR}/menyoki/menyoki.conf
  • {CONFIG_DIR}/menyoki/config

{CONFIG_DIR} can be one of the following depending on the platform:

  • Linux: $XDG_CONFIG_HOME or $HOME/.config
    • e.g. /home/orhun/.config
  • macOS: $HOME/Library/Application Support
    • e.g. /Users/Orhun/Library/Application Support
  • Windows: {FOLDERID_RoamingAppData}
    • e.g. C:\Users\Orhun\AppData\Roaming
Default configuration file*
[general]
verbose = 0
quiet = false
color = 3AA431

[record]
root = false
focus = true
select = true
parent = false
with-alpha = false
no-keys = false
mouse = false
action-keys = LAlt-S,LAlt-Enter
cancel-keys = LControl-D,Escape
border = 1
#padding = T:R:B:L
#size = WxH
duration = โˆž
countdown = 3
timeout = 300
interval = 10
#font =
#monitor =
#command =

[split]
#dir =
#file =

[make]
#no-sort = false
fps = 20
quality = 75
repeat = โˆž
#dir =
format = gif

[capture]
root = false
focus = true
select = true
parent = false
with-alpha = false
mouse = false
action-keys = LAlt-S,LAlt-Enter
cancel-keys = LControl-D,Escape
border = 1
#padding = T:R:B:L
#size = WxH
countdown = 0
timeout = 300
interval = 10
#font =
#monitor =
#command =

[edit]
convert = false
grayscale = false
invert = false
#crop = T:R:B:L
#resize = WxH
ratio = 1.0
#rotate =
#flip =
blur = 0.0
hue = ยฑ0
contrast = ยฑ0.0
brightness = ยฑ0
filter = lanczos3
#file =

[analyze]
timestamp = false
time-zone = utc
#file =

[view]
transparent = false
#file =

[save]
with-extension = false
timestamp = false
date = %Y%m%dT%H%M%S
#file =

[gif]
gifski = false
fast = false
fps = 20
quality = 75
repeat = โˆž
speed = 1.0
cut-beginning = 0.0
cut-end = 0.0

[apng]
fps = 20
repeat = โˆž
speed = 1.0
cut-beginning = 0.0
cut-end = 0.0

[png]
compression = fast
filter = sub

[jpg]
quality = 90

[webp]
quality = 80
lossless = false

[pnm]
format = pixmap
encoding = binary

Environment Variables

Corresponding environment variables can be set for overriding the command line flags and options. The general prototype of the variables that menyoki checks are the following:

MENYOKI_{SECTION}_{ARGUMENT}=value

Examples

Command Environment Variables
menyoki --quiet MENYOKI_GENERAL_QUIET=true
menyoki record gif --fps 10 save --timestamp MENYOKI_GIF_FPS=10 MENYOKI_SAVE_TIMESTAMP=true
menyoki capture --size 200x300 jpg --quality 100 MENYOKI_CAPTURE_SIZE=200x300 MENYOKI_JPG_QUALITY=100
menyoki edit test.png --ratio 2.0 --filter triangle MENYOKI_EDIT_RATIO=2.0 MENYOKI_EDIT_FILTER=triangle
menyoki split test.gif --dir frames/ pnm --format graymap MENYOKI_SPLIT_DIR=frames/ MENYOKI_PNM_FORMAT=graymap
menyoki analyze test.png --timestamp save --date %H%M%S MENYOKI_ANALYZE_TIMESTAMP=true MENYOKI_SAVE_DATE=%H%M%S
menyoki view test.png --transparent MENYOKI_VIEW_TRANSPARENT=true

Roadmap

The following are the ultimate goals of the menyoki project.

Accessibility

menyoki should be packaged for other distributions and package managers (such as Nixpkgs and Homebrew) for easy access and installation.

Platforms

Supported platforms list should be extended by implementing the core features of menyoki on different systems. (See #2, #4 and #5)

Formats

All the image formats that image-rs supports for encoding should be implemented in menyoki. Also, the implementation of other image and video formats should be considered for encoding the frames in record/capture action. (See supported formats)

Optimization

Encoding/decoding of some formats like GIF might be optimized for speed and efficiency. Alternative ways and options should be considered depending on the benchmarks in such cases.

Testing

menyoki should be tested against different platforms and bugs must be reported for further development and support.

Resources

About the project

Why "menyoki"?

It's a reference to the author's favorite character from the game Patapon 2.

https://patapon.fandom.com/wiki/Menyokki?file=Moriussoo_evo.jpg

Menyokki (aka Tree-Pon due to his resembling a tree) is a type of Rarepon introduced in Patapon 2. Its evolved form is Kisuk, and its ultimate form is Moriussoo. These Rarepons are green and resemble plants in various stages of development: Menyokki is a seedling, Kisuk is a sapling and Moriussoo is a full-grown tree.

The Menyokki sprite that is used as the project's logo was originally drawn by OwocekTV for the fan made game Patafour. He is also the creator and lead developer of Patafour and he is working on bringing the long awaited 4th installment of the Patapon franchise to life with the rest of the team.

Thanks to owodzeg for his hard work on Patafour and the help with the menyoki logo. Kudos!

Social Media

  • Follow @menyoki_cli
  • https://orhun.dev
    • Follow @orhun
    • Follow @orhundev

Funding

If you like the menyoki and/or other projects on my GitHub profile, consider supporting me on GitHub Sponsors or Patreon!

License

GNU General Public License (v3.0)

Copyright

Copyright ยฉ 2020-2024, Orhun Parmaksฤฑz

menyoki's People

Contributors

dependabot[bot] avatar felixonmars avatar jereljr avatar jregistr avatar kianmeng avatar orhun avatar ribosomerocker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

menyoki's Issues

RUSTSEC-2022-0013: Regexes with large repetitions on empty sub-expressions take a very long time to parse

Regexes with large repetitions on empty sub-expressions take a very long time to parse

Details
Package regex
Version 0.1.80
URL https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw
Date 2022-03-08
Patched versions >=1.5.5

The Rust Security Response WG was notified that the regex crate did not
properly limit the complexity of the regular expressions (regex) it parses. An
attacker could use this security issue to perform a denial of service, by
sending a specially crafted regex to a service accepting untrusted regexes. No
known vulnerability is present when parsing untrusted input with trusted
regexes.

This issue has been assigned CVE-2022-24713. The severity of this vulnerability
is "high" when the regex crate is used to parse untrusted regexes. Other uses
of the regex crate are not affected by this vulnerability.

Overview

The regex crate features built-in mitigations to prevent denial of service
attacks caused by untrusted regexes, or untrusted input matched by trusted
regexes. Those (tunable) mitigations already provide sane defaults to prevent
attacks. This guarantee is documented and it's considered part of the crate's
API.

Unfortunately a bug was discovered in the mitigations designed to prevent
untrusted regexes to take an arbitrary amount of time during parsing, and it's
possible to craft regexes that bypass such mitigations. This makes it possible
to perform denial of service attacks by sending specially crafted regexes to
services accepting user-controlled, untrusted regexes.

Affected versions

All versions of the regex crate before or equal to 1.5.4 are affected by this
issue. The fix is include starting from regex 1.5.5.

Mitigations

We recommend everyone accepting user-controlled regexes to upgrade immediately
to the latest version of the regex crate.

Unfortunately there is no fixed set of problematic regexes, as there are
practically infinite regexes that could be crafted to exploit this
vulnerability. Because of this, we do not recommend denying known problematic
regexes.

Acknowledgements

We want to thank Addison Crump for responsibly disclosing this to us according
to the Rust security policy, and for helping review the fix.

We also want to thank Andrew Gallant for developing the fix, and Pietro Albini
for coordinating the disclosure and writing this advisory.

See advisory page for additional details.

Doesn't capture window decorations

Describe the bug
When trying to select a window with either capture or record, it will only select the area excluding the top border, and if I had any on the sides I'd assume those would be missing too.

To Reproduce
Steps to reproduce the behavior:

  1. Run menyoki capture
  2. Select a window
  3. See marked area excludes the window decorations

Expected behavior
The entire window to be captured

Screenshots/Logs
The top part of the window is cut off:
2020-12-16_01-30-21

System Information

  • OS: Arch Linux x86_64 5.9.14-zen1-1-zen
  • Rust Version: 1.48.0-1 from [extra]
  • Project Version: 1.1.0

webp recording throwing an error

Describe the bug
I tried to record webp but got the error below

oz-mint@ozmint-MACH-WX9:~/tmp/menyoki-1.7.0$ ./menyoki record webp
[2023-03-04T13:29:22 INFO menyoki::util::command] Running the command...
[2023-03-04T13:29:22 INFO menyoki::x11::window] Starting in 3[2023-03-04T13:29:22 ERROR menyoki] IO error: `No such file or directory (os error 2)`

To Reproduce
Steps to reproduce the behavior:
image

System Information

  • OS: Linux Mint 21.1 Vera
  • Project Version: 1.7.0

RUSTSEC-2022-0006: Data race in `Iter` and `IterMut`

Data race in Iter and IterMut

Details
Package thread_local
Version 0.2.7
URL Amanieu/thread_local-rs#33
Date 2022-01-23
Patched versions >=1.1.4

In the affected version of this crate, {Iter, IterMut}::next used a weaker memory ordering when loading values than what was required, exposing a potential data race
when iterating over a ThreadLocal's values.

Crates using Iter::next, or IterMut::next are affected by this issue.

See advisory page for additional details.

CLI is awkward to use

Describe the bug
I think the CLI is a bit awkward to use and overuses subcommands in favor of flags.

To Reproduce
For instance, menyoki record --root --size $(slop) apng save /tmp/hello.apng. This is somewhat awkward.

Expected behavior
How about menyoki record --size-select --format apng --output /tmp/hello.apng. I think this makes a lot more sense. We could also have a shortform -f apng -o /tmp/hello.apng.

Cargo installation fails on Ubuntu 20.04

Describe the bug
Cargo installation errors and fails to install.

To Reproduce
Steps to reproduce the behavior:

  1. cargo install menyoki

Expected behavior
menyoki should be installed

Screenshots/Logs

    Updating crates.io index
  Installing menyoki v1.0.1
   Compiling autocfg v1.0.1
   Compiling libc v0.2.81
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling cfg-if v0.1.10
   Compiling byteorder v1.3.4
   Compiling const_fn v0.4.3
   Compiling bitflags v1.2.1
   Compiling crc32fast v1.2.1
   Compiling adler v0.2.3
   Compiling scopeguard v1.1.0
   Compiling adler32 v1.2.0
   Compiling rayon-core v1.9.0
   Compiling proc-macro2 v0.4.30
   Compiling getrandom v0.1.15
   Compiling proc-macro2 v1.0.24
   Compiling bytemuck v1.4.1
   Compiling unicode-xid v0.2.1
   Compiling color_quant v1.1.0
   Compiling unicode-xid v0.1.0
   Compiling syn v1.0.54
   Compiling either v1.6.1
   Compiling syn v0.15.44
   Compiling pkg-config v0.3.19
   Compiling ppv-lite86 v0.2.10
   Compiling num-derive v0.2.5
   Compiling weezl v0.1.3
   Compiling cc v1.0.66
   Compiling maybe-uninit v2.0.0
   Compiling failure_derive v0.1.8
   Compiling gimli v0.23.0
   Compiling lzw v0.10.0
   Compiling unicode-width v0.1.8
   Compiling scoped_threadpool v0.1.9
   Compiling rustc-demangle v0.1.18
   Compiling nix v0.18.0
   Compiling object v0.22.0
   Compiling ahash v0.4.6
   Compiling log v0.4.11
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling imgref v1.7.0
   Compiling strsim v0.8.0
   Compiling natord v1.0.9
   Compiling wild v2.0.4
   Compiling input-event-codes v0.2.1
   Compiling quick-error v2.0.0
   Compiling mutate_once v0.1.1
   Compiling dunce v1.0.1
   Compiling bytesize v1.0.1
   Compiling dominant_color v0.3.0
   Compiling hex v0.4.2
   Compiling miniz_oxide v0.3.7
   Compiling inflate v0.4.5
   Compiling rgb v0.8.25
   Compiling gif v0.11.1
   Compiling gif v0.10.3
   Compiling hashbrown v0.9.1
   Compiling kamadak-exif v0.5.2
   Compiling crossbeam-utils v0.8.1
   Compiling num-traits v0.2.14
   Compiling memoffset v0.6.1
   Compiling miniz_oxide v0.4.3
   Compiling num-integer v0.1.44
   Compiling rayon v1.5.0
   Compiling num-iter v0.1.42
   Compiling crossbeam-utils v0.7.2
   Compiling num-rational v0.2.4
   Compiling num-rational v0.3.2
   Compiling resize v0.5.5
   Compiling gif-dispose v3.0.1
error[E0599]: no method named `to_int_unchecked` found for type `f32` in the current scope
   --> /home/asheboy/.cargo/registry/src/github.com-1ecc6299db9ec823/resize-0.5.5/src/px.rs:185:45
    |
185 |             (0f32).max(f.round()).min(255.).to_int_unchecked()
    |                                             ^^^^^^^^^^^^^^^^ method not found in `f32`

error[E0599]: no method named `to_int_unchecked` found for type `f32` in the current scope
   --> /home/asheboy/.cargo/registry/src/github.com-1ecc6299db9ec823/resize-0.5.5/src/px.rs:199:47
    |
199 |             (0f32).max(f.round()).min(65535.).to_int_unchecked()
    |                                               ^^^^^^^^^^^^^^^^ method not found in `f32`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `resize`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `menyoki v1.0.1`, intermediate artifacts can be found at `/tmp/cargo-install5nci6h`

Caused by:
  build failed

System Information

โฏ lsb_release -a
No LSB modules are available.
Distributor ID: Neon
Description:    KDE neon User Edition 5.20
Release:        20.04
Codename:       focal
โฏ cargo --version
cargo 1.43.

[1.0.2] Gif recording won't work on Arch Linux

Describe the bug
Recording does not work

To Reproduce
Steps to reproduce the behavior:

  1. Run menyoki record rec gif
  2. See error

Expected behavior
The recording begins?

Screenshots/Logs

[2020-12-08T19:24:31 INFO menyoki::x11::window] Starting in 3[2020-12-08T19:24:31 INFO menyoki::util::command] Running the command...
thread 'main' panicked at 'Failed to run the command: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/app.rs:212:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fishย : Tรขche , 'LANG=C menyoki record rec gif' terminรฉe par le signal SIGABRT (Abandon)

System Information

  • OS: Arch Linux x86_64 5.9.9-arch1-1
  • Rust Version: 1.48.0
  • Project Version: 1.0.2

Additional context
N/A

The duration argument (-d <S>) doesn't seem to work

Describe the bug
I expected this command to record for 10 seconds and exit, but it didn't exit:

menyoki record -d 10 gif --fps 30 -s save x.gif

System Information

  • OS: FreeBSD 14.0
  • Rust Version: 1.74.1
  • Project Version: 1.7.0

Capture single screen

Is your feature request related to a problem? Please describe.
I use a dual monitor setup, and sometimes I would like to capture the whole of a single monitor. Currently it is possible by specifying --root --select and adjusting the selection to one monitor, but it would be nice to have an option to directly select a monitor

Describe the solution you'd like
A flag to select a monitor, preferably by screen id (or any other convenient way to reference a screen)

Describe alternatives you've considered
As mentioned above, the flags can be used to eventually capture a single screen. It may be possible to write a script to compute the appropriate parameters to capture one screen, but if it is feasible a flag would be preferable

Can't run executable from linux-musl archive

Running the latest linux-musl executable does not work.

To Reproduce
Steps to reproduce the behavior:

  1. Download menyoki-1.2.0-x86_64-unknown-linux-musl.tar.gz
  2. Extract tar xfv ... and cd menyoki-1.2.0
  3. Run ./menyoki

Expected behavior
The menyoki usage is displayed.

Screenshots/Logs
-bash: ./menyoki: No such file or directory

System Information

  • OS: Debian 9.3 64bit
  • Rust Version: -
  • Project Version: 1.2.0

Adaptive framerate

When recording a gif I always have to trade off file size and smoothness of the recording. I think there's a way to do better.

In general, I expect smoothness when looking at small elements โ€“ mouse movements, dropdowns, etc. If, however, the entire screen is animated, it is OK for the framerate to drop significantly.

I wish there was a way to specify the framerate as a min and max value. For example, --min-fps 10 --max-fps 60 can mean that during high-bitrate moments, the gif will have an equivalent of 10 fps recording. However, at all other times, 60 fps can be maintained.

Recording the mouse pointer

Right now when you record anything, you can only see the window itself. The mouse pointer is not visible on the recording.

Just as an example, Peek has an option to record the mouse pointer:
Peek 2023-05-17 17-42

Notice how I use my mouse to draw attention to a specific part of the screen! It's super useful ๐Ÿ˜‡

Cannot build locally or through cargo install

I'm getting the following errors when trying to build locally or install through cargo install.
Running Void Linux (glibc). pkg-config is installed.

> uname -a
Linux void 5.9.12_2 #1 SMP 1607140463 x86_64 GNU/Linux
> cargo build
   Compiling addr2line v0.14.0
   Compiling imagequant-sys v2.13.1
   Compiling x11 v2.18.2
   Compiling crossbeam-utils v0.8.1
   Compiling num_cpus v1.13.0
   Compiling getrandom v0.1.15
   Compiling atty v0.2.14
   Compiling time v0.1.44
   Compiling term_size v0.3.2
error: failed to run custom build command for `x11 v2.18.2`

Caused by:
  process didn't exit successfully: `/home/kkga/repos/menyoki/target/debug/build/x11-0088155ec7df5726/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=X11_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=X11_STATIC
  cargo:rerun-if-env-changed=X11_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"x11\" \"x11 >= 1.4.99.1\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package x11 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `x11.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'x11\' found\nPackage x11 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `x11.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'x11\' found\n" } }', /home/kkga/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-2.18.2/build.rs:36:67
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
> cargo install menyoki
[...]
error: failed to run custom build command for `x11 v2.18.2`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installBWYeYv/release/build/x11-25ea6e890a1fdb77/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=X11_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=X11_STATIC
  cargo:rerun-if-env-changed=X11_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"x11\" \"x11 >= 1.4.99.1\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package x11 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `x11.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'x11\' found\nPackage x11 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `x11.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'x11\' found\n" } }', /home/kkga/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-2.18.2/build.rs:36:67
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `menyoki v1.0.1`, intermediate artifacts can be found at `/tmp/cargo-installBWYeYv`

Caused by:
  build failed

Include a way to select a capture zone with the cursor

Is your feature request related to a problem? Please describe.
You currently recommend using slop in a subshell like --size $(slop) for being able to select a capture zone. However, this is quite awkward and I'd really like for menyoki to just include that. It seems an odd omission in a tool such as this which comes with so many batteries just to find of them to be weirdly missing.

Describe the solution you'd like
Include a bunch of flags such as --size-select, --size-cursor, --size-window and don't depend on external tools for this.

Describe alternatives you've considered
A tool such as peek which has this.

Additional context
๐Ÿฑ

Linux (Wayland) support ๐ŸŒฑ

Is your feature request related to a problem? Please describe.
I love the concept and would like to give it a try, but my Linux system is wayland-based ๐Ÿ˜ž. Hope wayland support is added soon ๐Ÿ™

Describe the solution you'd like
There are existing tools for wlroots-based compositors, like https://github.com/ammen99/wf-recorder and https://github.com/emersion/grim. Hope it helps you to figure out the implementation support for Wayland. I'll be glad to help out too if it's needed.

Cancelling record or capture aborts

Describe the bug

[2020-12-02T15:58:54 WARN menyoki::x11::display] User interrupt detected.
thread 'main' panicked at 'Failed to get the window', src/app.rs:169:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped, if enabled)

To Reproduce
menyoki capture then Esc

Expected behavior
Not doing that; something to the effect of let window = self.window?; instead or the equivalent where it's assigned, probably.

System Information

  • OS: buster and sid
  • Rust Version: rustc 1.48.0 (7eac88abb 2020-11-16)
  • Project Version: e2f596b

RUSTSEC-2021-0139: ansi_term is Unmaintained

ansi_term is Unmaintained

Details
Status unmaintained
Package ansi_term
Version 0.12.1
URL ogham/rust-ansi-term#72
Date 2021-08-18

The maintainer has adviced this crate is deprecated and will not
receive any maintenance.

The crate does not seem to have much dependencies and may or may not be ok to use as-is.

Last release seems to have been three years ago.

Possible Alternative(s)

The below list has not been vetted in any way and may or may not contain alternatives;

See advisory page for additional details.

Expand shell expressions for files

Is your feature request related to a problem? Please describe.

Shell expressions are not expanded for input/output files.

$ menyoki edit "~/test.png"
[2023-05-10T19:50:30 ERROR menyoki] IO error: `No such file or directory (os error 2)`

Describe the solution you'd like

Use a crate such as shellexpand to handle these cases.

e.g. ~/test.png should be expanded as /home/orhun/test.png

Describe alternatives you've considered
None.

Additional context
None.

Build failure on QubesOS using debian-11 VM

user@personal:~$ cargo install menyoki
    Updating crates.io index
  Downloaded menyoki v1.0.1
  Downloaded 1 crate (75.5 KB) in 5.72s
  Installing menyoki v1.0.1
  Downloaded colored v2.0.0
  Downloaded bytesize v1.0.1
  Downloaded kamadak-exif v0.5.2
  Downloaded rust-ini v0.16.0
  Downloaded fern_colored v0.6.1
  Downloaded device_query v0.2.6
  Downloaded imgref v1.7.0
  Downloaded apng v0.2.0
  Downloaded image v0.23.12
  Downloaded dominant_color v0.3.0
  Downloaded x11 v2.18.2
  Downloaded natord v1.0.9
  Downloaded gifski v1.2.2
  Downloaded rgb v0.8.25
  Downloaded dirs v3.0.1
  Downloaded clap v2.33.3
  Downloaded png v0.16.7
  Downloaded gif v0.11.1
  Downloaded log v0.4.11
  Downloaded hex v0.4.2
  Downloaded ctrlc v3.1.7
  Downloaded chrono v0.4.19
  Downloaded flate2 v1.0.19
  Downloaded textwrap v0.11.0
  Downloaded cfg-if v0.1.10
  Downloaded resize v0.5.5
  Downloaded quick-error v2.0.0
  Downloaded wild v2.0.4
  Downloaded dirs-sys v0.3.5
  Downloaded crossbeam-channel v0.4.4
  Downloaded pbr v1.0.3
  Downloaded ordered-multimap v0.3.1
  Downloaded lodepng v3.2.2
  Downloaded gif-dispose v3.0.1
  Downloaded dunce v1.0.1
  Downloaded byteorder v1.3.4
  Downloaded color_quant v1.1.0
  Downloaded mutate_once v0.1.1
  Downloaded input-event-codes v0.2.1
  Downloaded jpeg-decoder v0.1.20
  Downloaded image v0.22.5
  Downloaded unicode-width v0.1.8
  Downloaded lazy_static v1.4.0
  Downloaded vec_map v0.8.2
  Downloaded strsim v0.8.0
  Downloaded weezl v0.1.3
  Downloaded imagequant v2.13.0
  Downloaded miniz_oxide v0.3.7
  Downloaded failure v0.1.8
  Downloaded ansi_term v0.11.0
  Downloaded term_size v0.3.2
  Downloaded atty v0.2.14
  Downloaded scoped_threadpool v0.1.9
  Downloaded pkg-config v0.3.19
  Downloaded libc v0.2.81
  Downloaded crc32fast v1.2.1
  Downloaded tiff v0.6.0
  Downloaded num-traits v0.2.14
  Downloaded num-rational v0.3.2
  Downloaded num-iter v0.1.42
  Downloaded bitflags v1.2.1
  Downloaded bytemuck v1.4.1
  Downloaded deflate v0.8.6
  Downloaded adler32 v1.2.0
  Downloaded nix v0.18.0
  Downloaded autocfg v1.0.1
  Downloaded maybe-uninit v2.0.0
  Downloaded num-integer v0.1.44
  Downloaded crossbeam-utils v0.7.2
  Downloaded png v0.15.3
  Downloaded gif v0.10.3
  Downloaded num-rational v0.2.4
  Downloaded cfg-if v1.0.0
  Downloaded backtrace v0.3.55
  Downloaded dlv-list v0.2.2
  Downloaded time v0.1.44
  Downloaded imagequant-sys v2.13.1
  Downloaded failure_derive v0.1.8
  Downloaded hashbrown v0.9.1
  Downloaded miniz_oxide v0.4.3
  Downloaded rayon v1.5.0
  Downloaded rustc-demangle v0.1.18
  Downloaded quote v1.0.7
  Downloaded object v0.22.0
  Downloaded inflate v0.4.5
  Downloaded addr2line v0.14.0
  Downloaded cc v1.0.66
  Downloaded lzw v0.10.0
  Downloaded synstructure v0.12.4
  Downloaded proc-macro2 v1.0.24
  Downloaded rand v0.7.3
  Downloaded syn v1.0.54
  Downloaded adler v0.2.3
  Downloaded either v1.6.1
  Downloaded unicode-xid v0.2.1
  Downloaded ahash v0.4.6
  Downloaded rayon-core v1.9.0
  Downloaded crossbeam-deque v0.8.0
  Downloaded gimli v0.23.0
  Downloaded tiff v0.3.1
  Downloaded crossbeam-utils v0.8.1
  Downloaded num_cpus v1.13.0
  Downloaded rand_chacha v0.2.2
  Downloaded crossbeam-epoch v0.9.1
  Downloaded ppv-lite86 v0.2.10
  Downloaded deflate v0.7.20
  Downloaded rand_core v0.5.1
  Downloaded getrandom v0.1.15
  Downloaded crossbeam-channel v0.5.0
  Downloaded scopeguard v1.1.0
  Downloaded memoffset v0.6.1
  Downloaded num-derive v0.2.5
  Downloaded proc-macro2 v0.4.30
  Downloaded syn v0.15.44
  Downloaded const_fn v0.4.3
  Downloaded quote v0.6.13
  Downloaded unicode-xid v0.1.0
   Compiling autocfg v1.0.1
   Compiling libc v0.2.81
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling cfg-if v0.1.10
   Compiling byteorder v1.3.4
   Compiling bitflags v1.2.1
   Compiling const_fn v0.4.3
   Compiling crc32fast v1.2.1
   Compiling rayon-core v1.9.0
   Compiling adler v0.2.3
   Compiling adler32 v1.2.0
   Compiling scopeguard v1.1.0
   Compiling proc-macro2 v0.4.30
   Compiling proc-macro2 v1.0.24
   Compiling getrandom v0.1.15
   Compiling bytemuck v1.4.1
   Compiling unicode-xid v0.2.1
   Compiling color_quant v1.1.0
   Compiling unicode-xid v0.1.0
   Compiling syn v1.0.54
   Compiling syn v0.15.44
   Compiling pkg-config v0.3.19
   Compiling either v1.6.1
   Compiling weezl v0.1.3
   Compiling num-derive v0.2.5
   Compiling maybe-uninit v2.0.0
   Compiling ppv-lite86 v0.2.10
   Compiling cc v1.0.66
   Compiling failure_derive v0.1.8
   Compiling gimli v0.23.0
   Compiling lzw v0.10.0
   Compiling object v0.22.0
   Compiling nix v0.18.0
   Compiling unicode-width v0.1.8
   Compiling scoped_threadpool v0.1.9
   Compiling ahash v0.4.6
   Compiling log v0.4.11
   Compiling rustc-demangle v0.1.18
   Compiling imgref v1.7.0
   Compiling strsim v0.8.0
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling dunce v1.0.1
   Compiling input-event-codes v0.2.1
   Compiling natord v1.0.9
   Compiling wild v2.0.4
   Compiling quick-error v2.0.0
   Compiling mutate_once v0.1.1
   Compiling bytesize v1.0.1
   Compiling dominant_color v0.3.0
   Compiling hex v0.4.2
   Compiling crossbeam-utils v0.8.1
   Compiling memoffset v0.6.1
   Compiling num-traits v0.2.14
   Compiling miniz_oxide v0.4.3
   Compiling num-integer v0.1.44
   Compiling rayon v1.5.0
   Compiling num-iter v0.1.42
   Compiling crossbeam-utils v0.7.2
   Compiling num-rational v0.2.4
   Compiling num-rational v0.3.2
   Compiling inflate v0.4.5
   Compiling miniz_oxide v0.3.7
   Compiling rgb v0.8.25
   Compiling gif v0.11.1
   Compiling x11 v2.18.2
   Compiling device_query v0.2.6
   Compiling addr2line v0.14.0
   Compiling gif v0.10.3
   Compiling imagequant-sys v2.13.1
   Compiling hashbrown v0.9.1
   Compiling kamadak-exif v0.5.2
   Compiling resize v0.5.5
   Compiling gif-dispose v3.0.1
error: failed to run custom build command for `x11 v2.18.2`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installIBqvK5/release/build/x11-ed44fc2aee6fb71d/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=X11_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=X11_STATIC
cargo:rerun-if-env-changed=X11_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"x11\" \"x11 >= 1.4.99.1\"", cause: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-2.18.2/build.rs:36:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: build failed, waiting for other jobs to finish...
error: failed to compile `menyoki v1.0.1`, intermediate artifacts can be found at `/tmp/cargo-installIBqvK5`

Caused by:
  build failed

Changing keybindings for cancel operation

I just found out about menyoki and find it great as it allows me to record my computer enterily through the keyboard.

Since I'm often hitting the Escape key when using the softwares installed on my computer, I would like to change the keybinding for the cancel action. However, I couldn't find any information on how to so in the man pages of both the configuration and the command.

Is it possible to change the keybindings for the key other than the action key ? Especially the cancel key ?
If not, would this be implemented in the future ?

Cancelling action should produce exit status

Is your feature request related to a problem? Please describe.
Throw exit status 1 when cancelling action(pressing Esc) to be able to use in scripts.

Example usage (this is bind to key e.g. PrtScr):

menyoki capture --root --select png && notify-send 'Screenshot taken`

Let's say I have decided to cancel operation, but notification will play always.

My usage:

menyoki -q capture --root --select png save "-" | tee "screenshot.png" | xclip -selection clipboard -t image/png && notify-send 'Screenshot taken`

If cancelled, this will create empty file + notification.

Describe the solution you'd like
Throw error/exit status by default or give option to throw it like --error.

Additional context
#21 #3

Ctrl+c does not work to stop during the saving of the gif.

Describe the bug
When the gif is being saved, pressing ctrl +c to cancel it, does not have any effect.

[2024-02-02T13:42:06 INFO menyoki::gif] Saving... (30%)

This is an issue when there is a long capture that we want to cancel anyway.

To Reproduce
Steps to reproduce the behavior:

  1. Run a capture
  2. stop the capture
  3. try to interrupt the saving process.

Expected behavior
The saving process should be stopped.

System Information

  • OS: [Arch Linux]
  • Project Version: [1.7.0]

Big amount of flags don't act as expected or optimally in capture subcommand

Describe the bug
It seems like most of the flags I'm trying to use do not behave as if they're supposed to, one of the things I kind of dislike is that menyoki doesn't implicitly set the q flag when it detects being piped to something, sort of like Bat(1), a Cat(1) clone in Rust.
Now, to a different problem: Say that you have a compositor that sets your windows' transparency by default, if you use something like:
menyoki -q cap --focus --with-alpha png save - | xclip -selection clipboard -t image/png
You will not get what was behind the window, because of it's transparency level, but you'll just get the window in normal transparency. What I thought I'd try to do that might incorporate my wallpaper, since that was what my goal was to include in my screenshot, was use the root option, but it cannot be used with focus , so I can't really get what the window actually looks like.


There's actually a raw X error that I recieve when I try:
menyoki -q cap --parent --root png save - | xclip -selection clipboard -t image/png
and I get the error even with just one of those flags, for both. I think this should be handled, like --root and --focus above.
In the same topic as raw X errors, it seems that the same as above, but replacing root with focus will generate the same effect.


One other thing I dislike is how long and sort of convoluted it makes your entire command to be, can you add in some ways to shorten more options, flags, and commands, maybe add in ways to do stuff easier than they can be done right now? I'd like if I just had to do:
menyoki cap -fa - | xclip -selection clipboard -t image/png, or maybe just try to make the copying part easier:
menyoki cap -Cfa, I believe this might be of very big help.
I'd also suggest making mouse-clicks work to select windows by default? It's really annoying to have to press Alt+S+Enter, it doesn't feel exactly like a sane default, IMHO.

One more thing, it for some reason looks like --with-alpha is completely useless, I'm not sure what the use for it is.
I was really interested in this project by the README, and I believe this could have pretty big potential, which is why I tested it and submitted this bug report. It looks like it's really nice.

Sorry if this felt more of a feature request than a bug report haha, I felt like I needed to say those things in here as well, I'd really appreciate it if this was made more easy to use and dependable.

System Information

  • OS: Artix Linux 5.10.15
  • Rust Version: 1.50.0
  • Project Version: 1.2.1

Mouse flag problems in record/capture commands

Describe the bug
There are a few issues I've encountered with the mouse flag:

  1. Pairing it with the root flag seems to take the screenshot immediately, not listening to my mouse input, but it does capture transparency, so that's nice. It also seems to work fine when I try to delay the screenshot and go to a workspace without a desktop, unlike the following point.
  2. Pairing it with the parent flag seems to work relatively as expected, it just doesn't show the overlay that it does by default, and it seems to error with:
[I] mon@artix-pc ~> menyoki -q cap --parent -m png save "-" | xclip -selection clipboard -t image/png
thread 'main' panicked at 'Failed to get the image', src/app.rs:415:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fish: Process 17789, 'menyoki' from job 1, 'menyoki -q cap --parent -m pn...' terminated by signal SIGABRT (Abort)

When I ran the command, switched to a different workspace that had no windows, and clicked on the wallpaper/desktop.

System Information

  • OS: Artix linux 5.10
  • Rust Version: 1.50
  • Project Version: 1.2.1

Support recording WebP

Is your feature request related to a problem? Please describe.
Encoding WebP animations with the following command would be nice.

$ menyoki record webp

Describe the solution you'd like
Incorporate a WebP animation encoder crate (since image does not support it) and implement the encoder.

Describe alternatives you've considered
None.

Additional context
Also reported in #35

segmentation fault with record command

Describe the bug
Invoking menyoki record returns seg fault.

[1] 358734 segmentation fault (core dumped) menyoki record

To Reproduce
Installed through
Expected behavior
A clear and concise description of what you expected to happen.

Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.

System Information

  • OS: Manjaro Arch 5.11.16-1-ck-zen
  • Rust Version: N/A
  • Menyoki: 1.3.0
  • XFCE desktop, AwesomeWM

Additional context
Only with the -r command, it invokes and completes successfully.

Menyoki is unable to capture screen on QubesOS

user@personal:~$ menyoki record gif --fps 10
[2020-12-09T00:20:45 INFO menyoki::x11::display] 
 Window title  -> "(?)"
 Window size   -> [1x1]
[2020-12-09T00:20:45 ERROR menyoki::x11] BadMatch (invalid parameter attributes) [Opcode: 61, Serial: 19]
Selected area -> [1x1] 
...

Steps to reproduce

  1. Get QubesOS R4.1 (most likely reproducible on R4.0 as well)
  2. Create a new VM based on debian-11
  3. In VM install package librust-x11-dev to avoid build failure (#7)
  4. In VM install cargo to get rustlang backend
  5. In VM Run cargo install menyoki
  6. In VM Run menyoki record gif --fps 10 and expect failure highlighted above.

Additional information

Works on Flameshot

Using alternative flameshot called as flameshot gui works.

Effects of qubes-issues/6271

Might be affected by QubesOS/qubes-issues#6271

Borders are not visible

Describe the bug
When starting a record/capture on the root window, the borders of the capture area are not visible. The selected area correctly shows up in the terminal, and completing the capture also saves the correct image (as per the selection shown in terminal)

To Reproduce
Steps to reproduce the behavior:

  1. Run menyoki capture --root --select
  2. Try resizing the capture area
  3. The new dimensions are seen on the terminal, but the border cannot be seen

Expected behavior
The borders of the capture area should be seen even on the root window

Screenshots/Logs
N/A

System Information

  • OS: Linux 5.4.0-58-generic Ubuntu 20.04 x86_64
  • Rust Version: 1.50.0-nightly
  • Project Version: 1.1.0
  • X server version: 2:1.20.8-2ubuntu2.6
  • WM: awesomeWM 4.3

Additional context
Previous discussion here

RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations

Potential segfault in localtime_r invocations

Details
Package chrono
Version 0.4.19
URL chronotope/chrono#499
Date 2020-11-10

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

See advisory page for additional details.

Support pause during recording

Is your feature request related to a problem? Please describe.
While recording a long-lasting operation, the user might want to pause recording and then continue afterwards.

Describe the solution you'd like
Add a key binding for pausing the recording.

Describe alternatives you've considered
None.

Additional context
None.

Support recording WebM

Is your feature request related to a problem? Please describe.
I can't record to WebM.

Describe the solution you'd like
I'd like to record to WebM. Ideally in a MKV container.

Describe alternatives you've considered
Recording to WebP which is sadly also not availagle.

Additional context
pls gib webm

Stop recording throw an error and does not generate any gif

Describe the bug

Stop recording throw an error and does not generate any gif

To Reproduce
Steps to reproduce the behavior:

  1. Start recording
  2. Press the cancel key
  3. An error is thrown and no gif is saved

Expected behavior
A gif should be created for the recording time

Screenshots/Logs

[2024-02-02T13:55:51 INFO menyoki::x11::display]
 Window title  -> "(?)"
 Window size   -> [828x385]
[2024-02-02T13:55:52 INFO menyoki::x11::display]
 Window title  -> "(?)"
 Window size   -> [828x715]
[2024-02-02T13:55:58 INFO menyoki::record] Recording 20 FPS...
[2024-02-02T13:56:00 WARN menyoki::record] User interrupt detected.
[2024-02-02T13:56:00 ERROR menyoki] Frame error: `No frames found to save`

System Information

  • OS: [Arch Linux x86_64]
  • Project Version: [1.7.0]
  • xorg-server version: [21.1.11-1]

hidpi support?

Is your feature request related to a problem? Please describe.
I have a 2K (2560x1600px) screen 181x113 in size (8.4" diagonal). That's tiny and very very dense (primitive calculation says 360ish DPI or 14px/mm but I'm not sure if I'm counting right).

The default X DPI is 96 and XDrawString() doesn't respect the Xft.dpi resource that I use to offset the incredible minusculity of the text at default size for reasons I assume obvious. The text with the resolution at the centre is, quite literally, unreadable from more than a hand's width away from the screen.

Describe the solution you'd like
The solution is probably fontconfig?

Describe alternatives you've considered
I've tried to convince XDrawString() to use a different or bigger font via XSetFont(), but haven't had much success; this might be because it's too arcane for me, or I might be holding it wrong.

Additional context
Confer this YouTube video, resize to 113x181 for optimum viewing experience: https://youtu.be/D2xb2ijuxeQ (frankly, I'm having trouble on my 27" display).

I'm very much not opposed to implementing this myself, but, well, I might need a suggestion or two on how to proceed.

RUSTSEC-2020-0071: Potential segfault in the time crate

Potential segfault in the time crate

Details
Package time
Version 0.1.44
URL time-rs/time#293
Date 2020-11-18
Patched versions >=0.2.23
Unaffected versions =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

The affected functions from time 0.2.7 through 0.2.22 are:

  • time::UtcOffset::local_offset_at
  • time::UtcOffset::try_local_offset_at
  • time::UtcOffset::current_local_offset
  • time::UtcOffset::try_current_local_offset
  • time::OffsetDateTime::now_local
  • time::OffsetDateTime::try_now_local

The affected functions in time 0.1 (all versions) are:

  • at
  • at_utc
  • now

Non-Unix targets (including Windows and wasm) are unaffected.

Patches

Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

Workarounds

No workarounds are known.

References

time-rs/time#293

See advisory page for additional details.

Support lodepng for encoding PNGs

Is your feature request related to a problem? Please describe.

lodepng is a pure Rust PNG image decoder and encoder. Allows easy reading and writing of PNG files without any system dependencies.

We can support this crate as an alternative to the default PNG encoder.

Describe the solution you'd like

Add --lodepng flag to CLI/config and use lodepng encoder if it is set.

Describe alternatives you've considered
-

Additional context

We can make lodepng default if it is more performant.

Prevent raw errors and use logging instead

Describe the bug
In some cases menyoki might encounter an error and terminate itself without handling the error. (#20) For that, it often uses expect and it causes to print raw Rust errors. These cases should be handled more elegantly and errors should be printed to stdout with log::error macro.

To Reproduce
Steps to reproduce the behavior:

  1. Run menyoki rec -f -c 0
  2. Press ESC
  3. See error:
thread 'main' panicked at 'No frames found to save', src/app.rs:453:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

Expected behavior

[2021-03-09T11:20:04 ERROR menyoki::app] No frames found to save.

System Information

  • OS: Arch Linux x86_64 5.11.2-arch1-1
  • Rust Version: 1.50.0-stable
  • Project Version: 1.2.1

Improve the key bindings documentation

Is your feature request related to a problem? Please describe.
See #52 #53

Describe the solution you'd like
The key bindings documentation can be improved to clear up possible confusions.

Describe alternatives you've considered
None.

Additional context
#52 (comment)

Cannot capture images on dwm.

Describe the bug
Cannot capture images or select windows when using on dwm.

To Reproduce
Steps to reproduce the behavior:

  1. Try capturing with menyoki capture or any other command
  2. It only selects the terminal window from which the command is being run and when the keys Alt + Enter are pressed shows the image is being saved.
  3. It shows a blank image when opened.

Expected behavior
Allow to select the window and capture it.

Logs
When I focus on another window and press Alt+Enter this was the output

[2020-12-07T16:04:09 DEBUG menyoki::x11] Record window: Focus(Some(Geometry { x: 0, y: 0, width: 0, height: 0 }))
[2020-12-07T16:04:09 DEBUG menyoki::x11::display] Window ID: 41943045
[2020-12-07T16:04:09 INFO menyoki::x11::display]
 Window title  -> "(?)"
 Window size   -> [1054x1057]
[2020-12-07T16:04:11 DEBUG menyoki::x11::display] Window ID: 18916785
[2020-12-07T16:04:11 INFO menyoki::x11::display]
 Window title  -> "(?)"
 Window size   -> [1x1]
[2020-12-07T16:04:11 ERROR menyoki::x11] BadMatch (invalid parameter attributes) [Opcode: 61, Serial: 1937]
[2020-12-07T16:04:17 DEBUG menyoki::x11::display] Selected window: Some(18916785)
[2020-12-07T16:04:18 DEBUG menyoki::app] File { path: "/home/zeus/menyoki/cap.png", format: Png }
[2020-12-07T16:04:18 DEBUG menyoki::app] Command: None
[2020-12-07T16:04:18 INFO menyoki::app] Capturing an image...
[2020-12-07T16:04:18 ERROR menyoki::x11] BadMatch (invalid parameter attributes) [Opcode: 61, Serial: 4405]
[2020-12-07T16:04:18 ERROR menyoki::x11] BadMatch (invalid parameter attributes) [Opcode: 61, Serial: 5906]
[2020-12-07T16:04:18 ERROR menyoki::x11] BadMatch (invalid parameter attributes) [Opcode: 73, Serial: 5907]
thread 'main' panicked at 'Failed to get the image', src/app.rs:414:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

System Information
Linux 5.9.11-arch2-1 x86_64 GNU/Linux
WM : DWM 6.1
Additional context
I'm using a dual monitor setup and can take the screenshot of the entire screen spanning 2 monitors. But it should be possible to capture and record individual windows.

Captured media in stdout

Hey - is it possible to output the captured buffer so you can pipe it to other commands (e.g. xclip)

Related: is there an existing way to copy a capture to the clipboard?

Cheers

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.