Skip to content

Commit d8fe04b

Browse files
committed
release v0.1.0.0 ✨
1 parent a260476 commit d8fe04b

File tree

3 files changed

+78
-8
lines changed

3 files changed

+78
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Revision history for guzzle
2+
3+
## 0.1.0.0 -- 2025-07-04
4+
5+
* First version. Released on an unsuspecting world.

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
1-
guzzle
2-
======
1+
guzzle 💦
2+
=========
3+
4+
guzzle is a Wayland screen capture CLI tool.
5+
6+
guzzle does not try to do any of these things:
7+
- support X11
8+
- capture anything other than pixels from a screen
9+
- have a GUI
10+
11+
## Usage
12+
13+
```
14+
guzzle [sink] [selection] [capture]
15+
```
16+
`sink` can be one of:
17+
- `copy` - copy the contents to the clipboard (default)
18+
- `save` - save the contents to a file (default if `--file` is present)
19+
- `print` - print the contents to stdout
20+
21+
The output filename for `save` is the current date and time, unless the `--file` argument is given.
22+
23+
The `--file` argument can also be given for other `sink` options, in which case a file will be saved in addition to the specified action.
24+
25+
`selection` can be one of:
26+
- `area` - select a region
27+
- `window` - select a visible window
28+
- `output` - select a visible display output / monitor
29+
- `screen` - all visible outputs
30+
- `anything` - select a region, window, or output (default)
31+
32+
Selections can be saved and reused with the `--area-name` arguments. When an area name is first used, the user will have to make a selection. On subsequent uses, the saved area will be used automatically.
33+
34+
`capture` can be one of:
35+
- `screenshot` - make a screenshot of the selected region (default)
36+
- `video` - record a video of the selected region
37+
38+
Capture can be delayed with the `--delay` argument, which accepts the number of seconds to wait for your make-up crew to finish.
39+
40+
The duration of video recordings can be specified with the `--duration` argument, which accepts the number of seconds for the recording.
41+
42+
### Examples
43+
44+
```
45+
guzzle copy window --file=browser.png --area-name=browser
46+
```
47+
- The user is prompted to select a visible window on the screen.
48+
- The image of the window will be copied to the clipboard and also saved to the file `browser.png`.
49+
- The area currently occupied by the window will be stored and reused on later invocations with `--area-name=browser`.
50+
51+
## Requirements
52+
53+
guzzle looks for the following programs on the `PATH`:
54+
- `slurp` (the original inspiration for this project's name)
55+
- `grim`
56+
- `wl-recorder`
57+
- `wl-copy`
58+
59+
You don't have to worry about any of that if you use Nix.
60+
61+
### Window managers
62+
63+
guzzle talks to window manager APIs to get window and monitor regions.
64+
65+
The currently supported window managers are
66+
- Sway
67+
- Hyprland
68+
- anything else you, the helpful reader, will contribute in PRs :-)

app/Sink.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ sink SinkArgs{..} Content{..} = do
6565
<&> (-<.> extension contentType)
6666
let hasFile = isJust file || sinkAction == Just Save || contentType == MP4
6767
when hasFile $ LazyByteString.writeFile filename content
68-
case sinkAction of
69-
Nothing -> LazyByteString.putStr content
70-
Just Print -> LazyByteString.putStr content
71-
Just Save -> pure ()
72-
Just Copy | hasFile -> WlCopy.wlCopyFile filename
73-
Just Copy -> WlCopy.wlCopy Content{..}
68+
case fromMaybe Copy sinkAction of
69+
Copy | hasFile -> WlCopy.wlCopyFile filename
70+
Copy -> WlCopy.wlCopy Content{..}
71+
Save -> pure ()
72+
Print -> LazyByteString.putStr content

0 commit comments

Comments
 (0)