-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·26 lines (22 loc) · 1.1 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/bash
# stash the original font and store the game font.
terminal_font=$(gsettings get org.gnome.desktop.interface monospace-font-name)
game_font='square 13'
dir_path=$(dirname "$0")
log_dir="$dir_path"/.log
recovery_file="$log_dir"/recovery
msg="- your previous terminal font was $terminal_font
- to recover previous font, in case of any crash from the game, please run
gsettings set org.gnome.desktop.interface monospace-font-name $terminal_font"
if [[ ! -e $log_dir ]]; then mkdir -p $log_dir; fi
echo "$msg" > "$recovery_file"
echo "in case of any problem, please refer to the recovery file with"
echo "cat $recovery_file"
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 "$dir_path"/src/main.py;
gsettings set org.gnome.desktop.interface monospace-font-name "$terminal_font";
python "$dir_path"/src/score.py;
fi