You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
610 B
22 lines
610 B
2 years ago
|
#!/usr/bin/env sh
|
||
|
|
||
|
# This magical spell reveals the dimensions of the terminal window, displaying the width and height as if by magic.
|
||
|
|
||
|
# Define the function to calculate the dimensions of the terminal window
|
||
|
fathom_dimensions() {
|
||
|
# Get the width of the terminal window
|
||
|
width=$(tput cols)
|
||
|
|
||
|
# Get the height of the terminal window
|
||
|
height=$(tput lines)
|
||
|
|
||
|
# Output the dimensions of the terminal window
|
||
|
echo "Width: $width"
|
||
|
echo "Height: $height"
|
||
|
}
|
||
|
|
||
|
# Check if the script is being called from another script
|
||
|
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
|
||
|
# If not, call the function
|
||
|
fathom_dimensions
|
||
|
fi
|