2 pointsby codevogel_com7 hours ago1 comment
  • codevogel_com7 hours ago
    I recently switched over to Nix with Hyprland as my WM.

    I tried looking for a simple tool that allowed me to capture screenshots like I would in Windows and Linux Mint using `SUPER+SHIFT+S`, so I could quickly paste them into Discord and whatnot. I found a couple of tools such as hyprshot and hyprcap, and read some articles about taking screenshots with slurp and grim, but I couldn't really find a tool that felt like a 'plug and play' experience.

    So, I built `peck` ([https://github.com/codevogel/peck](https://github.com/codevogel/peck)) . It's a simple bash script using [bashly](https://bashly.dev/), providing a (in my eyes) much more user-friendly interface to set up screen captures for Wayland. It wraps existing tools such as grim and wf-recorder, adding a lot of niceties such as being able to output the files to a temporary folder (as to not clog up the file system), and immediately copying the output files to the clipboard. Using a few env variables or flags, you can easily change how peck behaves, without needing to write custom bash scripts.

    For example, let's take a look at a Hyprland setup for peck:

         bind=$mainMod SHIFT, S, exec, peck --clipboard --temp --freeze
         bind=$mainMod SHIFT, R, exec, peck --record --clipboard --temp
         bind=$mainMod SHIFT, G, exec, peck --record --clipboard --temp --format=gif
    
    This would set `SUPER+SHIFT+[S|R|G]` to capture a screenshot, recording, or gif respectively, instructing peck to store the file in a temporary dir (which is cleared upon next invocation), and copy the output file to the clipboard, ready for pasting. Stopping a screen capture is as simple as hitting the record key again. Of course, we can also provide specific directories to store the captures in.

    `peck` makes it much trivial to setup screen captures and recordings on Wayland with an easy to understand interface, rather having to dig for multiple tools and learn all their formats individually.