Skip to content

Commit

Permalink
v1.1 README + run script.
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Jul 5, 2021
1 parent 97b96a0 commit 6a58e39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
19 changes: 12 additions & 7 deletions README.md
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.
13 changes: 10 additions & 3 deletions run
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

0 comments on commit 6a58e39

Please sign in to comment.