diff options
author | Indrajith K L | 2024-06-27 17:51:18 +0530 |
---|---|---|
committer | Indrajith K L | 2024-06-27 17:51:18 +0530 |
commit | 57eb70137b5bbcdabdc0f02eea5477b3e5f845a1 (patch) | |
tree | e78187146c506d5a640545dee99cc3e9860e25dc /kitty/kitty-themes/.tools/libcapture.sh | |
download | dots-57eb70137b5bbcdabdc0f02eea5477b3e5f845a1.tar.gz dots-57eb70137b5bbcdabdc0f02eea5477b3e5f845a1.tar.bz2 dots-57eb70137b5bbcdabdc0f02eea5477b3e5f845a1.zip |
Adds Arch Linux dotfiles
Diffstat (limited to 'kitty/kitty-themes/.tools/libcapture.sh')
-rwxr-xr-x | kitty/kitty-themes/.tools/libcapture.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kitty/kitty-themes/.tools/libcapture.sh b/kitty/kitty-themes/.tools/libcapture.sh new file mode 100755 index 000000000..ff5159187 --- /dev/null +++ b/kitty/kitty-themes/.tools/libcapture.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +function capture_linux() { + local title="$1" + local output="$2" + import -window "$title" "$output" +} + +function capture_osx() { + local title="$1" + local output="$2" + # get system id of the new created window + sys_id=$(./windowid.swift "kitty" "$title") + screencapture -wl"$sys_id" "$output" +} + +function capture() { + if [[ "$OSTYPE" == "linux-gnu" ]]; then + capture_linux "$@" + elif [[ "$OSTYPE" == "darwin"* ]]; then + capture_osx "$@" + fi +} |