Feeling bored at work? Let's have some fun! The other day I stumbled upon a cool utility named globe-cli. As the name says, globe-cli is a command line ASCII globe generator to render an ASCII globe in your Terminal. You can rotate the globe in all direction, zoom in and zoom out a specific region in the globe using the mouse or keyboard. The globe-cli is written in Rust programming language and its source code is freely available under GPLv3. Without further ado, let us go ahead and run ASCII globe in Terminal with globe-cli utility in Linux.
Install globe-cli in Linux
Since globe-cli is written in Rust, we can install it using
cargo package manager. Make sure you have installed Rust programming language in your Linux box as described in the following link:
After installing Rust, run the following command to install globe-cli:
$ cargo install globe-cli
$ yay -S globe-cli
Run ASCII Globe In Terminal With globe-cli Utility
To run ASCII globe in your Terminal window, run:
$ globe -s
-s flag refers screensaver mode.
Looking at the static globe is kind of boring. Let's rotate the globe to make it look more alive like below:
$ globe -sc5
Now the globe will start to spin. Press any key to stop the rotation.
-srefers screensaver mode.
-crefers starting camera rotation speed. In our case, we used camera rotation speed as 5. Set higher or lower value for the
-cflag to increase or decrease the rotation speed. The default value is 0.
You can also enable the night side and rotate the globe on its axis:
$ globe -snc5 -g20
-nrefers night mode.
- -g refers starting globe rotation speed. In this case, we used 20. To rotate globe faster, use higher value. Likewise, use lower value to decrease the speed.
Can we zoom in or out a specific region? What about manual rotation? It is possible too. Enter into the interactive mode to zoom or rotate the globe with your keyboard or mouse:
$ globe -i
LEFT/RIGHT keyboard arrows to move around the globe. You can also press and hold the left mouse button and drag it to any direction to rotate the globe. To zoom in or zoom out, use the mouse scroll wheel.
The developer of globe-cli has added vim-style navigation for the interactive mode. So you can use the vim keybindings h, j, k, l to spin the globe.
Cool, isn't it?
Globe-cli supports few other options, such as set refresh rate, change globe template and apply custom texture etc. For more details, refer the help section.
To display help section, use
$ globe -h
$ globe --help
Globe help section:
globe-cli 0.2.0 adamsky <[email protected]> Render an ASCII globe in your terminal. USAGE: globe [FLAGS] [OPTIONS] FLAGS: -i, --interactive Interactive mode (input enabled) -s, --screensaver Screensaver mode (input disabled) -h, --help Prints help information -n, --night Enable displaying the night side of the globe -p, --pipe Read coordinates from stdin and display them on the globe -V, --version Prints version information OPTIONS: -c, --cam-rotation <move_per_frame> Starting camera rotation speed [default: 0] -z, --cam-zoom <distance> Starting camera zoom [default: 1.7] -f, --focus-speed <multiplier> Target focusing animation speed [default: 1] -g, --globe-rotation <move_per_frame> Starting globe rotation speed [default: 0] -l, --location <coords> Starting location coordinates [default: 0.4,0.6] -r, --refresh-rate <fps> Refresh rate in frames per second [default: 60] -t, --template <planet> Display a built-in globe template [default: earth] --texture <path> Apply custom texture from file --texture-night <path> Apply custom night side texture from file
Did you know that we can run the World Map in Terminal? Yes, you read that right! Meet MapSCII, a Braille and ASCII world map renderer for your xterm-compatible terminals. For more details, refer the following guide: