diff options
| -rw-r--r-- | .gitconfig | 1 | ||||
| -rw-r--r-- | .gitignore_global | 25 | ||||
| -rw-r--r-- | README | 1 | ||||
| -rwxr-xr-x | bin/memezoom | 2 | ||||
| -rwxr-xr-x | bin/screenshot | 22 |
5 files changed, 50 insertions, 1 deletions
@@ -3,6 +3,7 @@ email = alec@goncharow.dev [core] editor = nvim + excludesfile = /home/algo/.gitignore_global [pull] rebase = true [init] diff --git a/.gitignore_global b/.gitignore_global new file mode 100644 index 0000000..d2ae074 --- /dev/null +++ b/.gitignore_global @@ -0,0 +1,25 @@ +# rust? +**/target +**/*.rs.bk + +# idk +*.swp + +# compiled shaders +*.spv + +# mac pls +.DS_STORE + +# vim sessions +Session.vim + + +# yoinked from zig-lang +zig-cache/ +zig-out/ +/release/ +/debug/ +/build/ +/build-*/ +/docgen_tmp/ @@ -0,0 +1 @@ +Good luck diff --git a/bin/memezoom b/bin/memezoom index f7dbb44..378160c 100755 --- a/bin/memezoom +++ b/bin/memezoom @@ -13,7 +13,7 @@ TMP="" main() { TMP=$(mktemp) grim -g "$(eval echo "$FOCUSED")" "$TMP" - imv -u nearest_neighbour "$TMP" -f + imv -u nearest_neighbour "$TMP" -f -d #swaymsg '[app_id="imv"] fullscreen enable' } diff --git a/bin/screenshot b/bin/screenshot new file mode 100755 index 0000000..94e3bd3 --- /dev/null +++ b/bin/screenshot @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -o nounset +set -o pipefail +if [[ "${TRACE-0}" == "1" ]]; then + set -o xtrace +fi + + +FOCUSED=$(swaymsg -t get_tree | jq '.. | (.nodes? // empty)[] | select(.focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"') + +main() { + rect="$(slurp)" + if [ $? -eq 0 ]; then + grim -g "$rect" -t png - | wl-copy -t image/png + else + grim -g "$(eval echo "$FOCUSED")" -t png - | wl-copy -t image/png + fi + +} + +main "$@" |
