-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
# snake | ||
# Neo-snake | ||
|
||
gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 13' | ||
gsettings set org.gnome.desktop.interface monospace-font-name 'square 13' | ||
gsettings set org.gnome.desktop.interface monospace-font-name 'square 13' && python src/main.py && gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 13' | ||
## 1. Installation | ||
### a. The game font. | ||
**Neo-snake** uses a special font that allows the terminal to display squares characters. | ||
|
||
One can download the *square* font [here](https://strlen.com/square/). | ||
|
||
Dowload font [here](https://strlen.com/square/). | ||
Once the .ttf file in dowloaded, simply move it inside one of the system fonts directory. | ||
|
||
Put it inside `/usr/share/fonts`, `/usr/local/share/fonts` or `~/.fonts`. The latter does not require `sudo`. | ||
On Ubuntu 20.04 LTS, such directories are under `/usr/share/fonts`, `/usr/local/share/fonts` or `~/.fonts`. The latter does not require `sudo` rights as it is only local. | ||
|
||
Run the code with `./run` | ||
### b. Python modules | ||
No particular dependencies (?). | ||
|
||
## 2. Run the code. | ||
Run the code by running the `./run` command in the shell. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
#! /usr/bin/bash | ||
gsettings set org.gnome.desktop.interface monospace-font-name 'square 13' | ||
python src/main.py | ||
gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 13' | ||
terminal_font=$(gsettings get org.gnome.desktop.interface monospace-font-name) | ||
game_font='square 13' | ||
|
||
if [[ $(fc-list | grep -c square) == 0 ]]; | ||
then echo "square.ttf not found."; | ||
echo "please install the square font (available at https://strlen.com/square/) inside /usr/share/fonts, /usr/local/share/fonts or ~/.fonts"; | ||
else gsettings set org.gnome.desktop.interface monospace-font-name "$game_font"; | ||
python src/main.py; | ||
gsettings set org.gnome.desktop.interface monospace-font-name "$terminal_font"; | ||
fi |