mirror of
https://github.com/KittyKatt/screenFetch.git
synced 2026-04-24 03:00:16 -04:00
Updated OS X screenshot code to support multiple desktops.
This commit is contained in:
@@ -1755,7 +1755,15 @@ detectdroid () {
|
||||
takeShot () {
|
||||
if [[ -z $screenCommand ]]; then
|
||||
if [[ "$hostshot" == "1" ]]; then
|
||||
if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
|
||||
if [ "$distro" == "Mac OS X" ]; then
|
||||
screenCommand="screencapture -x ${shotfile}"
|
||||
displays="$(system_profiler SPDisplaysDataType | grep 'Resolution:' | wc -l | tr -d ' ')"
|
||||
for (( i=2; i<=$displays; i++))
|
||||
do
|
||||
screenCommand="${screenCommand} $(echo ${shotfile} | sed "s/\(.*\)\./\1_${i}./")"
|
||||
echo ${screenCommand}
|
||||
done
|
||||
printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; ${screenCommand} &> /dev/null
|
||||
else scrot -cd3 "${shotfile}"; fi
|
||||
if [ -f "${shotfile}" ]; then
|
||||
[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
|
||||
@@ -1765,7 +1773,15 @@ takeShot () {
|
||||
verboseOut "ERROR: Problem saving screenshot to ${shotfile}"
|
||||
fi
|
||||
else
|
||||
if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
|
||||
if [ "$distro" == "Mac OS X" ]; then
|
||||
screenCommand="screencapture -x ${shotfile}"
|
||||
displays="$(system_profiler SPDisplaysDataType | grep 'Resolution:' | wc -l | tr -d ' ')"
|
||||
for (( i=2; i<=$displays; i++))
|
||||
do
|
||||
screenCommand="${screenCommand} $(echo ${shotfile} | sed "s/\(.*\)\./\1_${i}./")"
|
||||
echo ${screenCommand}
|
||||
done
|
||||
printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; ${screenCommand} &> /dev/null
|
||||
else scrot -cd3 "${shotfile}"; fi
|
||||
if [ -f "${shotfile}" ]; then
|
||||
[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
|
||||
|
||||
Reference in New Issue
Block a user