From 0f144c1ef9d831b1c663ef998f40e22c33156d9e Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Fri, 8 Sep 2023 14:43:41 +0530 Subject: Initial Commit * Adds Basic dot files configs --- .config/kitty/kitty-themes/.tools/libcapture.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 .config/kitty/kitty-themes/.tools/libcapture.sh (limited to '.config/kitty/kitty-themes/.tools/libcapture.sh') diff --git a/.config/kitty/kitty-themes/.tools/libcapture.sh b/.config/kitty/kitty-themes/.tools/libcapture.sh new file mode 100755 index 0000000..ff51591 --- /dev/null +++ b/.config/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 +} -- cgit v1.2.3