Compare commits

...

2 Commits

2 changed files with 14 additions and 4 deletions

View File

@ -5,7 +5,7 @@ script to record your screen in [sway](https://swaywm.org).
Really, it doesn't do anything else. Really, it doesn't do anything else.
# Why? ## Why?
Because I had enough bringing up shells, using tiresome aliases, Because I had enough bringing up shells, using tiresome aliases,
or, god forbid, firing up a whole OBS Studio just to record my screen. or, god forbid, firing up a whole OBS Studio just to record my screen.
@ -13,7 +13,7 @@ or, god forbid, firing up a whole OBS Studio just to record my screen.
I wanted a simple keyboard shortcut to toggle screen recording on and off at will, I wanted a simple keyboard shortcut to toggle screen recording on and off at will,
and I have the impression other people may wish the same. and I have the impression other people may wish the same.
# Does it depend on anything? ## Does it depend on anything?
Yes, to use `screenrecord.sh` you need: Yes, to use `screenrecord.sh` you need:
@ -25,7 +25,7 @@ Yes, to use `screenrecord.sh` you need:
These lovely utilities are often already available on many `sway` setups. These lovely utilities are often already available on many `sway` setups.
# How do I use it? ## How do I use it?
1. Either clone the repo or copy the latest `screenrecord.sh` 1. Either clone the repo or copy the latest `screenrecord.sh`
somewhere in your home. For the sake of this example, let's assume you somewhere in your home. For the sake of this example, let's assume you
@ -54,10 +54,17 @@ These lovely utilities are often already available on many `sway` setups.
} }
``` ```
# License ## Special thanks
This script is loosely based on the following gist:
https://gist.github.com/ugursogukpinar/f390d9f4c829fb1b05fc74a12dd482bb
## License
Public domain, enjoy this code at will and use it at your own risk. Public domain, enjoy this code at will and use it at your own risk.
See [unlicense.org](https://unlicense.org/) for details or read the `LICENSE` file. See [unlicense.org](https://unlicense.org/) for details or read the `LICENSE` file.
----------
Cheers :) Cheers :)

View File

@ -76,4 +76,7 @@ if ! isrunning; then
elif [ ! -z "$tflag" ]; then elif [ ! -z "$tflag" ]; then
# Toggle recording off # Toggle recording off
kill -s INT -- "$pid" kill -s INT -- "$pid"
else
printf -- "%s: operation refused, recording already in progress.\n" "$(basename -- "$0" .sh)" >&2
exit 1
fi fi