diff options
author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2020-05-01 11:57:48 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-05 20:18:19 +0200 |
commit | f82de63856af94c2649901cbb303a42531d27cac (patch) | |
tree | 7f5094949a64372d8de0994b520cca4dd55b5a22 /contrib | |
parent | grimshot: Add a separate flag for notifications (diff) | |
download | sway-f82de63856af94c2649901cbb303a42531d27cac.tar.gz sway-f82de63856af94c2649901cbb303a42531d27cac.tar.zst sway-f82de63856af94c2649901cbb303a42531d27cac.zip |
grimshot: Add a man page
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/grimshot | 8 | ||||
-rw-r--r-- | contrib/grimshot.1 | 96 | ||||
-rw-r--r-- | contrib/grimshot.1.scd | 71 |
3 files changed, 168 insertions, 7 deletions
diff --git a/contrib/grimshot b/contrib/grimshot index ed32334b..08a5fd1b 100755 --- a/contrib/grimshot +++ b/contrib/grimshot | |||
@@ -11,13 +11,7 @@ | |||
11 | ## - `mktemp`: to create a temporary file | 11 | ## - `mktemp`: to create a temporary file |
12 | ## Those are needed to be installed, if unsure, run `grimshot check` | 12 | ## Those are needed to be installed, if unsure, run `grimshot check` |
13 | ## | 13 | ## |
14 | ## Examples: | 14 | ## See `man 1 grimshot` or `grimshot usage` for further details. |
15 | ## `grimshot copy win` - to copy current window | ||
16 | ## `grimshot save area` - to select area and save it to default file (Pictures/Grimshot-$datetime.png) | ||
17 | ## `grimshot save screen ~/screenshot.png` - to save screenshot under ~/screenshot.png | ||
18 | ## `grimshot save output ~/screenshot.png` - to save screenshot under ~/screenshot.png | ||
19 | ## `grimshot` - usage | ||
20 | ## `grimshot check` - verify if tools are installed | ||
21 | 15 | ||
22 | getTargetDirectory() { | 16 | getTargetDirectory() { |
23 | test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ | 17 | test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ |
diff --git a/contrib/grimshot.1 b/contrib/grimshot.1 new file mode 100644 index 00000000..6e764007 --- /dev/null +++ b/contrib/grimshot.1 | |||
@@ -0,0 +1,96 @@ | |||
1 | .\" Generated by scdoc 1.10.1 | ||
2 | .\" Complete documentation for this program is not available as a GNU info page | ||
3 | .ie \n(.g .ds Aq \(aq | ||
4 | .el .ds Aq ' | ||
5 | .nh | ||
6 | .ad l | ||
7 | .\" Begin generated content: | ||
8 | .TH "grimshot" "1" "2020-05-05" | ||
9 | .P | ||
10 | .SH NAME | ||
11 | .P | ||
12 | grimshot - a helper for screenshots within sway | ||
13 | .P | ||
14 | .SH DESCRIPTION | ||
15 | .P | ||
16 | grimshot [--notify] (copy|save) [TARGET] [FILE] | ||
17 | grimshot check | ||
18 | grimshot usage | ||
19 | .P | ||
20 | \fB--notify\fR | ||
21 | .RS 4 | ||
22 | Show notifications to the user that a screenshot has been taken. | ||
23 | .P | ||
24 | .RE | ||
25 | \fBsave\fR | ||
26 | .RS 4 | ||
27 | Save the screenshot into a regular file. Grimshot will write images | ||
28 | files to \fB$XDG_SCREENSHOTS_DIR\fR if this is set (or defined | ||
29 | in `user-dirs.dir`), or otherwise fall back to `$XDG_PICTURES_DIR` | ||
30 | .P | ||
31 | .RE | ||
32 | \fBcopy\fR | ||
33 | .RS 4 | ||
34 | Copy the screenshot data (as image/png) into the clipboard. | ||
35 | .P | ||
36 | .RE | ||
37 | .SH SYNOPSIS | ||
38 | .P | ||
39 | Grimshot is an easy to use screenshot tool for sway. It relies on grim, slurp | ||
40 | and jq to do the heavy lifting, and mostly provides an easy to use interface. | ||
41 | .P | ||
42 | A recommended usage pattern is to just bind this to Super+P via sway: | ||
43 | .P | ||
44 | .nf | ||
45 | .RS 4 | ||
46 | # Screenshots: | ||
47 | # Cmd+P: Current window | ||
48 | # Cmd+Shift+p: Select region | ||
49 | # Cmd+Alt+p Current output | ||
50 | # Cmd+Ctrl+p Select a window | ||
51 | |||
52 | bindsym Mod4+p exec grimshot active | ||
53 | bindsym Mod4+Shift+p exec grimshot region | ||
54 | bindsym Mod4+Mod1+p exec grimshot output | ||
55 | bindsym Mod4+Ctrl+p exec grimshot window | ||
56 | .fi | ||
57 | .RE | ||
58 | .P | ||
59 | .SH TARGETS | ||
60 | .P | ||
61 | grimshot can capture the following named targets: | ||
62 | .P | ||
63 | \fIactive\fR | ||
64 | .RS 4 | ||
65 | Captures the currently active window. | ||
66 | .P | ||
67 | .RE | ||
68 | \fIscreen\fR | ||
69 | .RS 4 | ||
70 | Captures the entire screen. This includes all visible outputs. | ||
71 | .P | ||
72 | .RE | ||
73 | \fIregion\fR | ||
74 | .RS 4 | ||
75 | Allows manually selecting a rectangular region, and captures that. | ||
76 | .P | ||
77 | .RE | ||
78 | \fIwindow\fR | ||
79 | .RS 4 | ||
80 | Allows manually selecting a single window (by clicking on it), and | ||
81 | captures it. | ||
82 | .P | ||
83 | .RE | ||
84 | \fIoutput\fR | ||
85 | .RS 4 | ||
86 | Captures the currently active output. | ||
87 | .P | ||
88 | .RE | ||
89 | .SH OUTPUT | ||
90 | .P | ||
91 | Grimshot will always print the filename of the captured screenshot to | ||
92 | stdout. | ||
93 | .P | ||
94 | .SH SEE ALSO | ||
95 | .P | ||
96 | \fBgrim\fR(1) | ||
diff --git a/contrib/grimshot.1.scd b/contrib/grimshot.1.scd new file mode 100644 index 00000000..afc6362e --- /dev/null +++ b/contrib/grimshot.1.scd | |||
@@ -0,0 +1,71 @@ | |||
1 | grimshot(1) | ||
2 | |||
3 | # NAME | ||
4 | |||
5 | grimshot - a helper for screenshots within sway | ||
6 | |||
7 | # DESCRIPTION | ||
8 | |||
9 | grimshot [--notify] (copy|save) [TARGET] [FILE] | ||
10 | grimshot check | ||
11 | grimshot usage | ||
12 | |||
13 | *--notify* | ||
14 | Show notifications to the user that a screenshot has been taken. | ||
15 | |||
16 | *save* | ||
17 | Save the screenshot into a regular file. Grimshot will write images | ||
18 | files to *$XDG_SCREENSHOTS_DIR* if this is set (or defined | ||
19 | in `user-dirs.dir`), or otherwise fall back to `$XDG_PICTURES_DIR` | ||
20 | |||
21 | *copy* | ||
22 | Copy the screenshot data (as image/png) into the clipboard. | ||
23 | |||
24 | # SYNOPSIS | ||
25 | |||
26 | Grimshot is an easy to use screenshot tool for sway. It relies on grim, slurp | ||
27 | and jq to do the heavy lifting, and mostly provides an easy to use interface. | ||
28 | |||
29 | A recommended usage pattern is to just bind this to Super+P via sway: | ||
30 | |||
31 | ``` | ||
32 | # Screenshots: | ||
33 | # Cmd+P: Current window | ||
34 | # Cmd+Shift+p: Select region | ||
35 | # Cmd+Alt+p Current output | ||
36 | # Cmd+Ctrl+p Select a window | ||
37 | |||
38 | bindsym Mod4+p exec grimshot active | ||
39 | bindsym Mod4+Shift+p exec grimshot region | ||
40 | bindsym Mod4+Mod1+p exec grimshot output | ||
41 | bindsym Mod4+Ctrl+p exec grimshot window | ||
42 | ``` | ||
43 | |||
44 | # TARGETS | ||
45 | |||
46 | grimshot can capture the following named targets: | ||
47 | |||
48 | _active_ | ||
49 | Captures the currently active window. | ||
50 | |||
51 | _screen_ | ||
52 | Captures the entire screen. This includes all visible outputs. | ||
53 | |||
54 | _region_ | ||
55 | Allows manually selecting a rectangular region, and captures that. | ||
56 | |||
57 | _window_ | ||
58 | Allows manually selecting a single window (by clicking on it), and | ||
59 | captures it. | ||
60 | |||
61 | _output_ | ||
62 | Captures the currently active output. | ||
63 | |||
64 | # OUTPUT | ||
65 | |||
66 | Grimshot will always print the filename of the captured screenshot to | ||
67 | stdout. | ||
68 | |||
69 | # SEE ALSO | ||
70 | |||
71 | *grim*(1) | ||