Code Monkey home page Code Monkey logo

wayshot's People

Contributors

andreasbackx avatar angelofallars avatar c-h-johnson avatar decodetalkers avatar gigablaster avatar mstoeckl avatar shinyzenith avatar vivienm 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

wayshot's Issues

Problem with converting from grim to wayshot

Hi,

I use fish as shell and Sway as WM, and I believe one of it, causing problems with some commands that I try convert from grim to wayshot:

What works:

bindsym 1 exec 'wayshot -f ~/ps_$(date +"%Y%m%d%H%M%S").png', mode "default"
bindsym 2 exec 'wayshot --stdout | wl-copy', mode "default"

What I couldn't make convert:

bindsym 3 exec 'grim -g "$(slurp)" ~/ps_$(date +"%Y%m%d%H%M%S").png', mode "default"
bindsym 4 exec 'grim -g "$(slurp)" - | wl-copy', mode "default"

I tried to convert them to like this, but from Sway they don't wont to work (nothing happens):

  • For bindsym 3 tried to make it:
wayshot -s "$(slurp -f '%x %y %w %h')" -f ~/ps_$(date +"%Y%m%d%H%M%S").png

If I try from console:

wayshot -s "(slurp -f '%x %y %w %h')" -f ~/ps_(date +"%Y%m%d%H%M%S").png                                                                                                         5m26s/23:53
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/wayshot.rs:73:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If I try in bash

wayshot -s "$(slurp -f '%x %y %w %h')" -f ~/ps_$(date +"%Y%m%d%H%M%S").png

It' just working.

  • For bindsym 4 tried to make it:
wayshot -s "$(slurp -f '%x %y %w %h')" --stdout | wl-copy

If I try from console:

wayshot -s "(slurp -f '%x %y %w %h')" --stdout | wl-copy
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/wayshot.rs:73:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If I try in bash

wayshot -s "$(slurp -f '%x %y %w %h')" --stdout | wl-copy

It' just working.

Error: Cargo test failing

After this commit cargo test is failing. Even though it is not used in Makefile, cargo test is used by default for rust packages in nix.
So the question is: Will there be a fix for that, or should tests just be ignored?

Release tags are gone

Why did you remove all the release tags?! These are important (among others) for distributions that package wayshot. I’m maintainer of the wayshot package in Alpine Linux, just wanted to move it from the testing repository to the community repository and noticed that the build is broken due to missing source.

Support instantly taking screenshot before choosing portion with slurp

I often want to take a screenshot from a popup window, whether it be in the browser or elsewhere. Unfortunately these popups close when focus is lost. MacOS takes a screenshot when the screenshot button is pressed and the selection tool then allows you to select a portion of the screen thus allowing you to take screenshot of popups.

Having this functionality in Wayshot would not be trivial as it would require creating an overlay on which slurp can then be used. Currently slurp is also run before Wayshot so we cannot take a screenshot and show it as a moment capture before running slurp so that needs to be changed as well. We could make --slurp accept any command and run it from inside of the CLI so we can take a screenshot first and show it to the user after which we can run slurp to select what thay want and then we'd only need to do a crop. What do you think?

Serious performance issues since 1.2.2

Since release tag 1.2.2 I have noticed significant performance issues with wayshot. Earlier on running it on hyperfine against grim, I would notice that wayshot was generally faster but now it's no longer true.

On the current multi output composited screenshot branch, it's very often ~ 1.96 times slower.

This could be due to unnecessary clones and wayland dispatches as outlined by @mstoeckl.

I will try my best to resolve this. If anyone can pinpoint other points of performance issues, please populate this thread so they can be resolved.

Tag libwayshot 1.x

Todo:

  • finalize on api design.
  • create changelog from 0.2 to 1.x
  • remove all unwraps, expects, and exits

wayshot-git does not build from Arch AUR

wayshot-git does not build from Arch AUR

╰> paru -S wayshot-git
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

:: Conflicts found:
    rustup: rust (cargo)  rust (rustfmt)  rust  rust (cargo)  rust (rustfmt)  

:: Conflicting packages will have to be confirmed manually

Repo Make (1) rustup-1.24.3-2
Aur (1) wayshot-git-1.1.1.55.g4235f3c-3

:: Proceed with installation? [Y/n]: 

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
[sudo] password for justine: 
resolving dependencies...
looking for conflicting packages...
:: rustup and rust are in conflict. Remove rust? [y/N] y

Packages (2) rust-1:1.61.0-1 [removal]  rustup-1.24.3-2

Total Installed Size:     7.73 MiB
Net Upgrade Size:      -514.24 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                [--------------------------------------------------------------------------------------] 100%
(1/1) checking package integrity                                                                                                              [--------------------------------------------------------------------------------------] 100%
(1/1) loading package files                                                                                                                   [--------------------------------------------------------------------------------------] 100%
(1/1) checking for file conflicts                                                                                                             [--------------------------------------------------------------------------------------] 100%
(2/2) checking available disk space                                                                                                           [--------------------------------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) removing rust                                                                                                                           [--------------------------------------------------------------------------------------] 100%
(1/1) installing rustup                                                                                                                       [--------------------------------------------------------------------------------------] 100%
You may need to run rustup update stable
and possibly also rustup self upgrade-data
Optional dependencies for rustup
    lldb: rust-lldb script
    gdb: rust-gdb script
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
fetching devel info...
==> Making package: wayshot-git 1.1.1.55.g4235f3c-3 (Mon 27 Jun 2022 03:01:42 PM BST)
==> Retrieving sources...
  -> Updating wayshot git repo...
Fetching origin
==> Validating source files with sha256sums...
    wayshot ... Skipped
==> Making package: wayshot-git 1.1.1.55.g4235f3c-3 (Mon 27 Jun 2022 03:01:43 PM BST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating wayshot git repo...
Fetching origin
==> Validating source files with sha256sums...
    wayshot ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of wayshot git repo...
Cloning into 'wayshot'...
done.
==> Starting pkgver()...
==> Updated version: wayshot-git 1.1.7.83.g95f62eb-1
==> Sources are ready.
wayshot-git-1.1.1.55.g4235f3c-3: parsing pkg list...
==> Making package: wayshot-git 1.1.7.83.g95f62eb-1 (Mon 27 Jun 2022 03:01:45 PM BST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
error: no override and no default toolchain set
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'wayshot-git-1.1.1.55.g4235f3c-3': 
error: packages failed to build: wayshot-git-1.1.1.55.g4235f3c-3

build.rs is misused and invoked on any change to sources

Current build.rs is misused and slows down iteration time, because it only builds docs and doesn't need to run on any change to sources.

In my case, for around ~3 seconds while I work on #95 and #100

Solutions are well known:

  • rerun-if-changed for docs/*.scd files
  • or to use environment variable to trigger building man pages:
// build.rs
fn main() {
    if std::env::var("BUILD_DOCS").is_err() {
        std::process::exit(0);
    }

    // build docs if env var is set
}
BUILD_DOCS=1 cargo build --release

CLI: simplify and make friendlier and more Unix-like

Here are some of the issues:

  1. Long flags should be made kebab case for readability:
  • --listoutputs -> --list-outputs
  • --choseoutputs -> --choose-outputs

cp, mv, curl, wget, rg have it like that.

  1. --file <PATH> and --stdout can be replaced with optional [FILE] argument.
match `FILE` {
    Some('-') => // stdout
    Some(path) => // write to path
    None => {
       // write <unixtime>-wayshot.png to current dir
       // print "Saved to <path>" to stdin/stdout, to make the default invocation obvious
    }
}

- for stdout is a common Unix convention.

  1. Help (--help)
  • move --debug to the end of the help, because that's not what a user typically looks for when learning how to use a new tool
  • specify supported extensions. Now they are only mentioned in README and manpage
  • colors! Clap v4 can have clap v3 colored help or custom style, for example, I like rustic's (permalink)
  1. --list-outputs

Currently, output of --list-outputs isn't suitable to pipe to another selector (fzf/skim or GUI dmenu-like fuzzel, wofi), because it's done via tracing:

if args.get_flag("listoutputs") {
let valid_outputs = wayshot_conn.get_all_outputs();
for output in valid_outputs {
tracing::info!("{:#?}", output.name);
}
exit(1);
}

It's output to stderr and exits with an error code 1 for no reason.

Should be: just 1 output per line to stdout, and 0 exit code. Good for:

wayshot --output "$(wayshot --list-outputs | fuzzel --dmenu)"

to be bound to a specific hotkey, like PrintScreen.

  1. Add TAB-completion

clap is used for CLI, clap_complete is one step away. Completion scripts can be generated during build time, there is already bulid.rs in the project


I'll make a draft PR to address those issues, to me all of them are straight improvements of wayshot's UX.

libwayshot outputting garbage on other monitors

I'm trying to port tsoding's boomer to wayland and i'm trying to use this library to take a screenshot of all screens, however only the first screen appears correctly and the other screen just has a bunch of garbage:

imagem

No man pages in wayshot-bin AUR Package

Steps to reproduce:

Install wayshot-bin 1.2.2-2 from the AUR

$ pacman -Ql wayshot-bin
wayshot-bin /usr/
wayshot-bin /usr/bin/
wayshot-bin /usr/bin/wayshot

Installing wayshot-git 1.1.9.98.g538caac-1 doesn't have the same issue.

$ pacman -Ql wayshot-git
wayshot-git /usr/
wayshot-git /usr/bin/
wayshot-git /usr/bin/wayshot
wayshot-git /usr/share/
wayshot-git /usr/share/man/
wayshot-git /usr/share/man/man1/
wayshot-git /usr/share/man/man1/wayshot.1.gz
wayshot-git /usr/share/man/man7/
wayshot-git /usr/share/man/man7/wayshot.7.gz

External Montior Not Detected

My understanding is that the default command wayshot should take a full screenshot of the active monitor. When I have my external monitor selected it still defaults to my laptop's screen.

❯ uname -a
Linux baalsecundus 5.16.11-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 24 Feb 2022 02:18:22 +0000 x86_64 GNU/Linux
❯ paru -Qs "river-git|wlroots-15|wayshot-git"
local/river-git 0.1.0.r49.ge67a942-1
    A dynamic tiling wayland compositor.
local/wayshot-git 1.1.5.64.g02c5041-1
    A screenshot tool for wlroots compositors.
local/wlroots-15 0.15.0.r.-1
    Modular Wayland compositor library (git version)

2022-02-26T11:22:05,378128712-07:00

Implement config file

Hello everyone! Thank you for developing great screenshotting tool for Wayland desktops.

Since I personally prefer use configs instead of running apps with args, I came up with idea of implementing config file for wayshot. Sorry if you think that it doesn't fit for this project.
Here's an example with some properties I find essential for a screenshoting tool:

[keybindings]
screen = "ALT,PRTSCR"
selection = "PRTSCR"
window = "CTRL,PRTSCR"
cancel = "ESC"
save = "CTRL,C"

[screenshot]
# not sure what value should be here, since I've never used it
display = "default"
cursor = false

[screenshot.clipboard]
clipboard = true

[screenshot.filesystem]
filesystem = true
path = "~/images/screenshots"
format = "%Y-%m-%d_%H:%M:%S"
extension = "webp"

Looked into wayshot/src/clap.rs for some properties to include here too.
I may be guessing something incorrectly, since I'm not aware which of these are in scope of the project (e.g. probably the keybindings should be handled on a compositor-level config..?)

AFAIK there's no reads from keyboard in program, since it uses slurp for selection, so I don't think the keybindings are in the scope of the project, not at until #1 is closed, at least.
Except for this, I think that path is in progress in #96?
And from the looks of it, it doesn't seem hard to implement custom format specification.

Support JPEG XL

If I understand correctly, wayshot by default save files as png and we can save as jpg extension too. I don't know if this is possible or would be enchantment you wanted in your project, but saving screenshots as JPEG XL (jxl) files would be awesome.

Very nice project!

Libwayshot API inclusive of multi monitor setups.

Currently all multi output handling is done in wayshot itself. Maybe this could be consolidated into the libwayshot API itself ?

I don't know if that would be a good API design but I presume most downstream projects would want to support multi-monitor setups and making it trivial in the API itself would reduce fragmentation in the implementations of multi-monitor and overall make it easier for the consumers of the API.

This thread is for further discussion on the topic, feel free to pitch in.

Automated performance testing

In relation to #42: I think we should consider adding some CI with automated perf testing to check for regressions.

I am not exactly sure how we'd go about setting up the pipeline for this but it would definitely be a step in the positive direction.

Can't compile e03feb5 commit version

There was update in Arch AUR wayshot-git package and it fails at this:

==> Starting build()...
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.122
   Compiling bitflags v1.2.1
   Compiling proc-macro2 v1.0.37
   Compiling unicode-xid v0.2.2
   Compiling pkg-config v0.3.25
   Compiling xml-rs v0.8.4
   Compiling memchr v2.4.1
   Compiling lazy_static v1.4.0
   Compiling log v0.4.16
   Compiling smallvec v1.8.0
   Compiling once_cell v1.10.0
   Compiling scoped-tls v1.0.0
   Compiling crc32fast v1.3.2
   Compiling minimal-lexical v0.2.1
   Compiling downcast-rs v1.2.0
   Compiling adler32 v1.2.0
   Compiling adler v1.0.2
   Compiling termcolor v1.1.3
   Compiling hashbrown v0.11.2
   Compiling strsim v0.10.0
   Compiling fastrand v1.7.0
   Compiling remove_dir_all v0.5.3
   Compiling bytemuck v1.9.1
   Compiling color_quant v1.1.0
   Compiling byteorder v1.4.3
   Compiling textwrap v0.15.0
   Compiling jpeg-decoder v0.2.4
   Compiling libloading v0.7.3
   Compiling deflate v1.0.0
   Compiling miniz_oxide v0.5.1
error: failed to run custom build command for `log v0.4.16`

Caused by:
  process didn't exit successfully: `/home/roland/.cache/paru/clone/wayshot-git/src/wayshot/target/release/build/log-47e1f50aa54007f1/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
  --- stdout
  cargo:rustc-cfg=atomic_cas
  cargo:rustc-cfg=has_atomics
  cargo:rerun-if-changed=build.rs
warning: build failed, waiting for other jobs to finish...
error: build failed
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'wayshot-git-1.1.1.55.g4235f3c-3':
error: packages failed to build: wayshot-git-1.1.1.55.g4235f3c-3

Maybe log crate version is to high?

[FR] Optimize png with oxipng

png by default is a reasonable choice. However, it's surely doesn't offer the best compression as of today. For instance, lossless webp consistently beats png in terms of compression ratio.

I suggest adding a separate flag to optimize png output via awesome oxipng crate, something like:

wayshot --extension png --optimize -f /tmp/test.png

It is easy via oxipng::optimize_from_memory:

let opts = oxipng::Options::default(); // = preset 2
// let opts = oxipng::Options::from_preset(<u8 from 0 to 6>);
let optimized_png_buf = oxipng::optimize_from_memory(&png_buf, &opts)?;

Here is a little script to evaluate the savings:

mkdir /tmp/wayshot && cd /tmp/wayshot

wayshot -f wayshot.png

for i in {0..6}; do
  time oxipng --opt "$i" --pretend wayshot.png
done

Results for a sample image (2560x1080, 414 KiB) on Ryzen 5600:

oxipng 9.0
293709 bytes (30.67% smaller)
oxipng --opt "$i" --pretend wayshot.png  0.14s user 0.00s system 99% cpu 0.143 total
---
279314 bytes (34.07% smaller)
oxipng --opt "$i" --pretend wayshot.png  0.31s user 0.01s system 99% cpu 0.322 total
---
274489 bytes (35.21% smaller)
oxipng --opt "$i" --pretend wayshot.png  0.63s user 0.02s system 129% cpu 0.500 total
---
265868 bytes (37.24% smaller)
oxipng --opt "$i" --pretend wayshot.png  2.23s user 0.02s system 264% cpu 0.852 total
---
265107 bytes (37.42% smaller)
oxipng --opt "$i" --pretend wayshot.png  3.77s user 0.03s system 303% cpu 1.252 total
---
265107 bytes (37.42% smaller)
oxipng --opt "$i" --pretend wayshot.png  8.67s user 0.04s system 580% cpu 1.498 total
---
265107 bytes (37.42% smaller)
oxipng --opt "$i" --pretend wayshot.png  12.80s user 0.05s system 781% cpu 1.643 total

Pretty good imo, and using oxipng from Rust itself will be even faster (no CLI args parsing, no buffer copy).

Reasonable tradeoff of little extra CPU for decent savings in file size even with fast-ish presets 0-2.


Surely I can do the plumbing myself, wayshot --stdout | <best-image-encoder> - <name.ext>, but I think wayshot and its users will benefit from implementing this feature.

Build fails on latest: "No such file or directory"

When I try to install via wayshot-git on Arch Linux or build it after cloning the repo, I get this error:

error: failed to run custom build command for `wayshot v1.2.2 (/home/sg/Downloads/wayshot/wayshot)`

Caused by:
  process didn't exit successfully: `/home/sg/Downloads/wayshot/target/release/build/wayshot-2c57142df8cfca8d/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', wayshot/build.rs:54:32
  stack backtrace:
     0:     0x56493fc559da - std::backtrace_rs::backtrace::libunwind::trace::ha9053a9a07ca49cb
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
     1:     0x56493fc559da - std::backtrace_rs::backtrace::trace_unsynchronized::h9c2852a457ad564e
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x56493fc559da - std::sys_common::backtrace::_print_fmt::h457936fbfaa0070f
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5
     3:     0x56493fc559da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779d7bf7f70cb0c
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22
     4:     0x56493fc72a9e - core::fmt::write::h5a4baaff1bcd3eb5
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17
     5:     0x56493fc53805 - std::io::Write::write_fmt::h4bc1f301cb9e9cce
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15
     6:     0x56493fc557a5 - std::sys_common::backtrace::_print::h5fcdc36060f177e8
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5
     7:     0x56493fc557a5 - std::sys_common::backtrace::print::h54ca9458b876c8bf
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9
     8:     0x56493fc56dff - std::panicking::default_hook::{{closure}}::hbe471161c7664ed6
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22
     9:     0x56493fc56b3b - std::panicking::default_hook::ha3500da57aa4ac4f
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9
    10:     0x56493fc573a8 - std::panicking::rust_panic_with_hook::h50c09d000dc561d2
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:692:13
    11:     0x56493fc572a9 - std::panicking::begin_panic_handler::{{closure}}::h9e2b2176e00e0d9c
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13
    12:     0x56493fc55e46 - std::sys_common::backtrace::__rust_end_short_backtrace::h5739b8e512c09d02
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
    13:     0x56493fc56fb2 - rust_begin_unwind
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
    14:     0x56493fc09413 - core::panicking::panic_fmt::hf33a1475b4dc5c3e
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
    15:     0x56493fc09803 - core::result::unwrap_failed::hdff5465d74574b44
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
    16:     0x56493fc0fbac - core::result::Result<T,E>::unwrap::h6a0b186923f2584c
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1090:23
    17:     0x56493fc0e57a - build_script_build::read_and_replace_by_ext::h4f1badb8c8044035
                                 at /home/sg/Downloads/wayshot/wayshot/build.rs:54:17
    18:     0x56493fc0dbf3 - build_script_build::main::hd6a68b3c3badc776
                                 at /home/sg/Downloads/wayshot/wayshot/build.rs:23:44
    19:     0x56493fc1172b - core::ops::function::FnOnce::call_once::h40ed78a42bf7b569
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:250:5
    20:     0x56493fc1523e - std::sys_common::backtrace::__rust_begin_short_backtrace::h5dda9afabc2093ce
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:134:18
    21:     0x56493fc0b9b1 - std::rt::lang_start::{{closure}}::h6767f225fc8f766a
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:166:18
    22:     0x56493fc5114c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd6efcd3bec896f2c
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
    23:     0x56493fc5114c - std::panicking::try::do_call::hce04e543bb1f4cbb
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
    24:     0x56493fc5114c - std::panicking::try::h3342dd4e1f680968
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
    25:     0x56493fc5114c - std::panic::catch_unwind::h148ce1e59ac0cee7
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
    26:     0x56493fc5114c - std::rt::lang_start_internal::{{closure}}::h25f9dda2057a67fe
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
    27:     0x56493fc5114c - std::panicking::try::do_call::h7caaaeaf9401650b
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
    28:     0x56493fc5114c - std::panicking::try::he7d15285746cbbc2
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
    29:     0x56493fc5114c - std::panic::catch_unwind::h89fb4f50c0301fe0
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
    30:     0x56493fc5114c - std::rt::lang_start_internal::h078acd489417d3c1
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
    31:     0x56493fc0b98a - std::rt::lang_start::h97bd7c64a5c463fb
                                 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:165:17
    32:     0x56493fc0eb6e - main
    33:     0x7f539fa0f850 - <unknown>
    34:     0x7f539fa0f90a - __libc_start_main
    35:     0x56493fc099e5 - _start
    36:                0x0 - <unknown>

Cargo.lock is outdated in 1.2.1 release

$ cargo build --locked
error: the lock file Cargo.lock needs to be updated but --locked was passed to prevent this
--- Cargo.lock
+++ Cargo.lock.updated
@@ -442,7 +442,7 @@

 [[package]]
 name = "wayshot"
-version = "1.2.0"
+version = "1.2.1"
 dependencies = [
  "clap",
  "env_logger",

Getting error when trying to do region select screenshot that is copied to stdout

When I run wayshot --stdout -s "$(slurp)" | wl-copy or wayshot -s "$(slurp -p)" --stdout | wl-copy

I get this error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/wayshot.rs:65:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

When I run with RUST_BACKTRACE=full I get :

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/wayshot.rs:65:69
stack backtrace:
   0:     0x55823ae7953d - <unknown>
   1:     0x55823ae96ccc - <unknown>
   2:     0x55823ae76d71 - <unknown>
   3:     0x55823ae7abc5 - <unknown>
   4:     0x55823ae7a8e6 - <unknown>
   5:     0x55823ae7b156 - <unknown>
   6:     0x55823ae7b047 - <unknown>
   7:     0x55823ae799f4 - <unknown>
   8:     0x55823ae7ad79 - <unknown>
   9:     0x55823ad965d3 - <unknown>
  10:     0x55823ad96663 - <unknown>
  11:     0x55823adbaa33 - <unknown>
  12:     0x55823adb31d6 - <unknown>
  13:     0x55823adcdcd3 - <unknown>
  14:     0x55823add67d9 - <unknown>
  15:     0x55823ae71a0e - <unknown>
  16:     0x55823adb47c2 - <unknown>
  17:     0x7f03885cf790 - <unknown>
  18:     0x7f03885cf84a - __libc_start_main
  19:     0x55823ad96815 - <unknown>
  20:                0x0 - <unknown>

Screenrecordings through linux-dmabuf / screencopy.

It would be nice to have this integrated into wayshot also. Given our screencopy backend it should be simpler to achieve than without it.

I don't know if I should extend the scope of the application to desktop recordings too but It's worth considering.

Feel free to give your opinion in this thread.

Update clap for atty

clap 3.0 will have color, but it is sad that it induced atty... we need to upgrade to 4.0

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.