Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixscalefinal #127

Closed
wants to merge 27 commits into from
Closed

Fixscalefinal #127

wants to merge 27 commits into from

Commits on Feb 2, 2024

  1. Configuration menu
    Copy the full SHA
    68a5c6a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a023ff1 View commit details
    Browse the repository at this point in the history
  3. Move to clap_derive so CLI arguments are typed

    * Renames `clap.rs` to `cli.rs` because otherwise there's confusion between the `clap` crate and local module.
    * `Cli` struct added that almost identically represents the current state of the CLI with no logical changes.
    
    ---
    
    ## `--help` Comparison
    
    Before: https://gist.github.com/AndreasBackx/5945b366e989159f4669e7ba30c13239
    
    After:  https://gist.github.com/AndreasBackx/8929c8bde080eac0cafd33128210b0cc
    
    Diff (ignoring whitespace changes due to table alignment):
    ```diff
    1c1
    < Screenshot tool for compositors implementing zwlr_screencopy_v1.
    ---
    > Screenshot tool for wlroots based compositors implementing the zwlr_screencopy_v1 protocol.
    9d8
    <   -c, --cursor                      Enable cursor in screenshots
    10a10
    >   -c, --cursor                      Enable cursor in screenshots
    12c12
    <   -l, --listoutputs                 List all valid outputs
    ---
    >   -l, --list-outputs                List all valid outputs
    14c14
    <       --chooseoutput                Present a fuzzy selector for outputs
    ---
    >       --choose-output               Present a fuzzy selector for outputs
    16a17
    >
    ```
    
    You can see that the only changes are:
    - About is longer, this is now using the value from Cargo.toml instead of a duplicate text that was shorter.
    - Some have a dash where the English words would have a space, e.g: "list-outputs" instead of "listoutputs". I've also made the old still work via an alias: https://gist.github.com/AndreasBackx/6025e91844e3d766d4264a01ae4d1a71
    
    This seems like a tiny improvement? I plan to make further changes later, but I want to keep PRs separate.
    AndreasBackx committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    87be331 View commit details
    Browse the repository at this point in the history
  4. Improve CLI design

    This "improves" (and that is subjective) the design of the CLI. I am aiming to get some feedback on what people think of the new design:
    
    ```
    Screenshot tool for wlroots based compositors implementing the zwlr_screencopy_v1 protocol.
    
    Usage: wayshot [OPTIONS] [OUTPUT]
    
    Arguments:
      [OUTPUT]
              Where to save the screenshot, "-" for stdout. Defaults to "$UNIX_TIMESTAMP-wayshot.$EXTENSION"
    
    Options:
          --log-level <LOG_LEVEL>
              Log level to be used for printing to stderr
    
              [default: info]
              [possible values: trace, debug, info, warn, error]
    
      -s, --slurp <SLURP_ARGS>
              Arguments to call slurp with for selecting a region
    
      -c, --cursor
              Enable cursor in screenshots
    
          --encoding <FILE_EXTENSION>
              Set image encoder, if output file contains an extension, that will be used instead
    
              [default: png]
              [aliases: extension, format, output-format]
    
              Possible values:
              - jpg: JPG/JPEG encoder
              - png: PNG encoder
              - ppm: PPM encoder
              - qoi: Qut encoder
    
      -l, --list-outputs
              List all valid outputs
    
      -o, --output <OUTPUT>
              Choose a particular output/display to screenshot
    
          --choose-output
              Present a fuzzy selector for output/display selection
    
      -h, --help
              Print help (see a summary with '-h')
    
      -V, --version
              Print version
    ```
    
    The main changes are:
    1. `--debug` is now `--log-level` because this makes it easy to select more specifically what log level to use. I considered using `-v`, `-vv`... to increase verbosity but the `clap-verbosity-crate` uses `log` and not `tracing`. We could use it somewhat, but we'd pull in `log` (which seems fine) and we'd need to map from `log`'s Level to `tracing`'s Level enums (they use inverse ordering).
    2.  `--stdout` and `--file` has been made an optional positional argument. This because it's what other CLIs often do and I wasn't sure what to call the option otherwise because `--output` and `-O`/`-o` is often what others use but we use it here to refer to displays/monitors/Wayland outputs. This avoids that confusion hopefully and I've also clarified this in the documentation.
        * Additionally if a path is given, its extension will always be used. So you cannot save `jpg` to `foo.png`. Perhaps this behaviour can be changed, though I don't see a reason to support this weird edge case? When is someone saving `png` to `jpg`?
    3. `--extension` is `--encoding` with aliases like `extension`.
    
    Again, let me know what you think.
    AndreasBackx committed Feb 2, 2024
    1 Configuration menu
    Copy the full SHA
    736b651 View commit details
    Browse the repository at this point in the history
  5. Remove explicit panics and exits

    Let's bubble up errors instead of panicking and also not use `exit(...)` because it does not call destructors which might give issues.
    AndreasBackx committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    7d6e20b View commit details
    Browse the repository at this point in the history
  6. Make region, sizing, and positioning data structs reusable

    We use different structs/fields to store the same three types of data everywhere:
    - Position (x,y)
    - Size (width,height)
    - Region(position, size)
    
    This makes it so they all reuse the same information.
    AndreasBackx committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    044910d View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2024

  1. feat: Merge pull request #78

    Introduce freeze feature
    Shinyzenith authored Feb 12, 2024
    Configuration menu
    Copy the full SHA
    f2aa2b6 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

  1. Configuration menu
    Copy the full SHA
    8f22e6d View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2024

  1. Configuration menu
    Copy the full SHA
    9e7919e View commit details
    Browse the repository at this point in the history
  2. feat(clipboard): implement clipboard integration (#91)

    * feat(clipboard): implement clipboard integration
    
    Add the --clipboard flag and implement functionality to make image available on the clipboard using wl-clipboard-rs.
    
    * style(format): apply code formatting to cli.rs
    
    * feat(clipboard): implement fork wait for clipboard
    
    Add functionality offering image on clipboard persistently in the background
    
    * feat(clipboard): inform user about wayshot persisting in background with --clipboard
    
    * feat(clipboard): use tracing::warn instead of print if fork fails
    
    * feat(clipboard): Switch from the fork crate to the nix crate for daemonization
    
    * style(format): code formatting to wayshot.rs
    
    * style(typo): corrected a typo in the comments
    CheerfulPianissimo authored Mar 23, 2024
    Configuration menu
    Copy the full SHA
    b9219b1 View commit details
    Browse the repository at this point in the history
  3. docs(ManPage): Fix capitalization issue

    Signed-off-by: Shinyzenith <[email protected]>
    Shinyzenith committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    e43ab9f View commit details
    Browse the repository at this point in the history
  4. docs: Document clipboard interaction

    Signed-off-by: Shinyzenith <[email protected]>
    Shinyzenith committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    440bd26 View commit details
    Browse the repository at this point in the history
  5. chore: Update Cargo.lock

    Signed-off-by: Shinyzenith <[email protected]>
    Shinyzenith committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    f7f134f View commit details
    Browse the repository at this point in the history
  6. feat: added time_stamp flag (#93)

    * feat: added time_stamp flag
    
    * Syntax Refactor and filename format fixed
    
    * file name format fixes
    
    * wayshot-{timestamp}.{extension} as default filename
    
    * chore: Update Cargo.lock
    
    Signed-off-by: Shinyzenith <[email protected]>
    
    ---------
    
    Signed-off-by: Shinyzenith <[email protected]>
    Authored-by: rachancheet <[email protected]>
    Co-authored-by: Shinyzenith <[email protected]>
    rachancheet and Shinyzenith authored Mar 23, 2024
    Configuration menu
    Copy the full SHA
    5370c08 View commit details
    Browse the repository at this point in the history
  7. chore: Update Cargo.lock

    Signed-off-by: Shinyzenith <[email protected]>
    Shinyzenith committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    d7200c7 View commit details
    Browse the repository at this point in the history
  8. feat: Add support for webp (#98)

    Signed-off-by: Shinyzenith <[email protected]>
    
    ---------
    
    Signed-off-by: Shinyzenith <[email protected]>
    Co-authored-by: Shinyzenith <[email protected]>
    Gigas002 and Shinyzenith authored Mar 23, 2024
    Configuration menu
    Copy the full SHA
    017be62 View commit details
    Browse the repository at this point in the history
  9. refactor(libwayshot): Reduce allocations (#99)

    * refactor: remove unnecessary to_string()
    
    * refactor: fix clippy warnings
    
    * refactor: remove 1 level of indirection via &Vec<T> -> &[T]
    
    Typically `&Vec<T>` isn't something you want when you need a read-only view
    over a Vec, because it adds another level of indirection: Vec already stores
    a pointer to heap-allocated buffer internally.
    
    Using slices `&[T]` removes such unnecessary level of indirection and
    is considered a cleaner design. It is cache friendlier and can be better
    optimized by the compiler (not that it should matter in this case).
    murlakatamenka authored Mar 23, 2024
    Configuration menu
    Copy the full SHA
    f53e650 View commit details
    Browse the repository at this point in the history
  10. feat: account for directories in file path (#96)

    Signed-off-by: Shinyzenith <[email protected]>
    
    ---------
    
    Signed-off-by: Shinyzenith <[email protected]>
    Authored-by: rachancheet <[email protected]>
    Co-authored-by: Shinyzenith <[email protected]>
    rachancheet and Shinyzenith authored Mar 23, 2024
    Configuration menu
    Copy the full SHA
    2afa5b0 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2024

  1. fix: Clipboard flag ignored if path is qualified to file (#108)

    * feat(clipboard): fix issue #106 clipboard flag ignored if path is qualified to file
    
    * feat(clipboard): clarify flag description of --clipboard
    
    * feat(clipboard): enable multiline comment description for --clipboard feature flag
    
    Signed-off-by: Shinyzenith <[email protected]>
    
    * feat(clipboard): reduce buffer allocations for encoding image
    
    * feat(clipboard): improve code quality
    
    * feat(clipboard): code style change: perform match inside function call
    
    ---------
    
    Signed-off-by: Shinyzenith <[email protected]>
    Co-authored-by: Shinyzenith <[email protected]>
    CheerfulPianissimo and Shinyzenith authored Mar 26, 2024
    Configuration menu
    Copy the full SHA
    7381159 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. Configuration menu
    Copy the full SHA
    2cb242c View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2024

  1. feat(clipboard): fix interaction with freeze and select feature: Issue

    …#109 (#110)
    
    * feat(clipboard): fix interaction with freeze and select feature:  Issue #109
    
    * feat(clipboard): handle callback fails
    CheerfulPianissimo authored Apr 6, 2024
    Configuration menu
    Copy the full SHA
    10b748f View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Destroy layer shell surfaces

    * [fix] unmap layer shell surfaces before destroying them
    CheerfulPianissimo authored May 28, 2024
    Configuration menu
    Copy the full SHA
    2dd8af6 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. Configuration menu
    Copy the full SHA
    7934fd2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c3c802 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2024

  1. Update documentation with changes in freeze-feat (#116)

    * [docs] update manpage (1) with changes in freeze-feat
    
    * [fix] make arguments to slurp optional
    
    * [docs] update manpage(7) with cli changes
    
    * [docs] update README with new cli
    CheerfulPianissimo authored Aug 25, 2024
    Configuration menu
    Copy the full SHA
    5c3e220 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. Add screencopy dmabuf backend (#122)

    * [feat] rough MVP for screencpy+dmabuf
    
    * [feat] refactor MVP into libwayshot - create new constructor
    
    * [refactor] first draft of dmabuf API
    
    * [refactor]
    - Add error handling
    - Add example/demo for wayshot dmabuf API
    
    * [feat] import wayland-egl-ctx for use as MVP for dmabuf import functionality
    
    * [fix] correct modifier_lo parameter in waymirror-egl MVP
    
    * [feat] get waymirror-egl dmabuf MVP demo working
    
    * [feat] refactored dmabuf->eglImage API into libwayshot
    
    * [feat] - Implemented clean dropping of EGLImage
    -  Improved API docs for dmabuf functions
    
    * [fix]  libwayshot build error fixed
    
    * [fix] remove hardcoded GPU path from libwayshot constructor
    
    * [fix]] remove reduntant dmabuf_to_texture call from waymirror-egl
    
    * [docs] document WayshotConnection dmabuf constructor
    
    * [feat] Added helper/wrapper function to convert screencapture EGLImages into GL textures
    
    * [fix] improved logging in dmabuf API code
    
    * [doc] update waymirror-egl Readme
    
    * [fix] change logging level in waymirror-egl to Debug
    
    * [fix] remove unnecessary .gitignore in waymirror-egl
    
    * [ci/cd] attempting to fix the build
    
    * [ci\cd] add libegl system deps to fix github CI
    
    * [fix] remove unused egl_image struct field in Waymirror demo
    CheerfulPianissimo authored Aug 28, 2024
    Configuration menu
    Copy the full SHA
    5d69000 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2024

  1. Configuration menu
    Copy the full SHA
    ce83302 View commit details
    Browse the repository at this point in the history