mirror of
https://git.adityakumar.xyz/config.git
synced 2024-11-12 21:09:45 +00:00
23 lines
463 B
Bash
Executable file
23 lines
463 B
Bash
Executable file
#!/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
|
|
}
|