Commit graph

36 commits

Author SHA1 Message Date
Alan 3caf6914fe Update grimshot.1.scd
Fixed typo. The object is **files**, which is plural. **image** modifies files; it's not countable.
2022-04-23 22:34:11 +02:00
Alice Carroll a5f01a0e04 Support cursor capture in grimshot
Refactor argument parser

Bring back `sh` compatibility

Default to NOTIFY=no
2022-04-21 10:41:48 +02:00
Hugo Osvaldo Barrera 96102184ab grimshot: Exit 1 on cancellation
Whenever the selection is cancelled by the user, exit 1, since not
screenshot has been taken.
2021-07-10 13:03:42 +02:00
Simon Ser 5cdce42d1b contrib: drop incr_version script
This isn't used anymore.
2021-06-24 18:35:00 +02:00
Aljaz Gantar 1a0f86be4e refactor icon_for_window function 2021-04-09 22:08:53 +02:00
Aljaz Gantar 61df9eb62a fix type error when class_name none 2021-04-09 22:08:53 +02:00
Mark Stosberg 8f2eeae285 grimshot: document support for piping to STDOUT. 2021-02-23 17:07:53 +01:00
Pierre-Albéric TROUPLIN a3d45c3280 Prevent inactive-windows-transparency.py to crash on lockscreen 2021-02-16 11:45:10 +01:00
William Culhane 7c9706de71 grimshot: Fix man page issues
This fixes a few formatting errors in SYNOPSIS, moves the command
options out of SYNOPSIS, swaps the labels on the SYNOPSIS and
DESCRIPTION sections, creates an EXAMPLES section and slightly rewords
parts of the OPTIONS, DESCRIPTION, EXAMPLES, and OUTPUT sections.
2020-12-26 17:37:41 +01:00
Michael Weiss 380f6c9b46 contrib/_incr_version: Disallow the "v"-prefixed version format
The check is a bit strange but should be POSIX compliant.
2020-07-17 05:44:24 -06:00
Vinko Kašljević c65cd1cffa Add check for empty GEOM variable
In case when slurp is used to select part of screen or a window, if user aborts
the selection, grimshot will capture the whole screen instead of exiting. This
is fixed with check for empty variable.
2020-07-15 18:49:32 +02:00
David Arnold 21b77f376d grimshot: fix POSIX compliance
source is not POSIX compliant, '.' is.
https://stackoverflow.com/a/11588629
2020-06-17 22:33:10 +02:00
David Arnold 62e28f6129 grimshot: Unary operator expected
fixes this error:
/usr/local/bin/grimshot: line 22: [: ==: unary operator expected
2020-06-17 22:32:05 +02:00
Paul Ouellette b1d08db5f5 Fix some mistakes in grimshot docs 2020-05-10 17:25:54 -04:00
Hugo Osvaldo Barrera 9cda5a5bd6 grimshot: Skip creating a temp file when copying 2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera f82de63856 grimshot: Add a man page 2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera b10b6b552b grimshot: Add a separate flag for notifications
Make notifications a separate flag. Personally, I trigger grimshot
myself most of the time (via sway bindsym) rather than by some external
means, so I don't need to be notified of it happening.

However, keep a flag with this functionality there for those scenarios
there it's necessary to inform the user.

Also print the file location when saving the screenshot.
2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera 1191a41fb2 grimshot: Allow manually picking a window
(with slurp)
2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera 25a0130e81 grimshot: Show usage when on invalid command
Show the usage output when an invalid command is received. Otherwise
things like `grimshot --help` save a screenshot, which is really
unexpected and hurts users trying to remember the right commands /
arguments.
2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera 61d59180b8 grimshot: Avoid screenshots overwriting each other
Due to the date format used, if several screenshots are taken in
succession, each one overwrote the other.

This change set makes each one have a different name to avoid this.

Also avoid using spaces, since many scripts and tools are unhappy with
file names with spaces.
2020-05-05 20:18:19 +02:00
Hugo Osvaldo Barrera dce8abcdab grimshot: Allow configuring default directory
`$XDG_PICTURES_DIR` is a very loosely defined thing; it's a directory
where "pictures" are stored, which no clearer definition.

Some people use it for photographs they take, other use it for images
they save from the internet, and others use it for screenshots.

Having lots of tools save their output there (anything that's an image
goes there) can easily make it a kitchen sink.

To work around this, use `$XDG_SCREENSHOTS_DIR` as a target directory
for screenshots by default. If not-so-standard variable is unset, fall
back to the previous setting; `$XDG_PICTURES_DIR`.

This also drops an external dependency, which was (a) an overkill (b)
not flexible enough.
2020-05-05 20:18:19 +02:00
Torstein Husebø af294289b1 treewide: fix typos 2020-02-18 21:53:57 +01:00
Cyril Levis 3f0225eea3 Change wording 2020-02-04 23:52:08 +01:00
Cyril Levis 0f97580552 Add the possibility to capture only one screen if several screens are use. 2020-02-04 23:52:08 +01:00
JR Boyens 0106dd135c Use transparency arg in the window focus event 2020-01-09 19:53:53 -07:00
Drew DeVault 2a00bb0650 _incr_version: always overwrite old version number 2019-12-31 10:31:40 -05:00
Drew DeVault a44ae8869b _incr_version: prompt for target wlroots release 2019-12-31 10:27:13 -05:00
Thorben Günther 1cad862458 A Script to change sway workspace name.
This script automatically changes the workspace name when an application
gets closed, moved or openend.
2019-12-06 15:52:33 -05:00
Thorben Günther 6235423544 Improve transparency script
Transparency gets reset when the script is terminated.
Added command line option to set transparency strength without changing
the script.
Added support for multiple displays.
2019-12-06 15:52:33 -05:00
Manuel Mendez 8ffa3cf439 grimshot: fix branching on command exit status
The previous behavior was incorrect because `if` was checking the return
status of the `[` command which was never going to be an error. `[`
seems to only return an error if no args are provided. This was
basically a useless use of `[` anyway since it was just meant as a
straight interpretation of command exit, something that `if` can do
itself.

Compare:

```sh
[ ]; echo ?=$?
[ /bin/false ]; echo ?=$?
if [ /bin/false ]; then echo this is the unintended bug; fi
if /bin/false; then echo this will not be printed; fi
```
2019-11-17 17:18:54 +01:00
Lauri 992726a823 Grimshot: a helper for screenshots within sway
Usage:
   grimshot copy|save win|screen|area [FILE]
Troubleshoot:
   grimshot check

Requirements:
  - `grim`: screenshot utility for wayland
  - `slurp`: to select an area
  - `swaymsg`: to read properties of current window
  - `wl-copy`: clipboard utility
  - `jq`: json uliity to parse swaymsg output
  - `notify-send`: to show notifications
  Those are needed to be installed, if unsure, run `grimshot check`

Examples:

 `grimshot copy win` - to copy current window
 `grimshot save area` - to select area and save it to default file (Pictures/Grimshot-$datetime.png)
`grimshot save screen ~/screenshot.png` - to save screenshot under ~/screenshot.png
`grimshot` - usage
`grimshot check` - verify if tools are installed
2019-10-16 10:08:08 -04:00
Drew DeVault c55bc40cc1 chmod +x contrib/_incr_version 2019-08-27 12:30:48 +09:00
Drew DeVault c2030b9abd Add _incr_version to contrib/ 2019-08-27 12:29:42 +09:00
Konstantin Kharlamov 0d5aaf5359 A script to make inactive windows transparent
Sway has ability to apply transparency to arbitrary windows. This script
wires up this functional to one of popular use-cases from
i3+<compositor_name>.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2018-10-20 21:58:00 +03:00
Drew DeVault 53b5c4791e Remove contrib/awesome.config
We deprecated the stuff necessary to make this work.
2018-09-22 19:39:56 -04:00
Drew DeVault a2cf3be890 Move awesome config to contrib/ 2017-01-14 16:03:41 -05:00