-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtbsize.sh
executable file
·59 lines (45 loc) · 990 Bytes
/
tbsize.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# A script to set the general font for Thunderbird.
# Copyright (C) 2022 Embecosm Limited <www.embecosm.com>
# Contributor: Jeremy Bennett <jeremy.bennett@embecosm.com>
# SPDX-License-Identifier: GPL-3.0-or-later
# Optional argument is size to set as number of synonym
# Make the argument test case insensitive
shopt -s nocasematch
case $#
in
0)
fsz=12
;;
1)
case $1
in
hd)
fsz=12
;;
4k)
fsz=21
;;
[0-9]*)
fsz=$(echo $1 | sed -e 's/[^0-9]*//g')
;;
*)
echo "Usage: $0 [<size>]"
exit 1
;;
esac
;;
*)
echo "Usage: $0 [<size>]"
exit 1
;;
esac
lsz=$(( ( 2 + fsz * 4 ) / 3 ))
cd ${HOME}/.thunderbird
for f in */chrome/userChrome.css
do
sed -i -e "s/font-size: .\+px !important/font-size: ${fsz}px !important/" ${f}
sed -i -e "s/height: .\+px !important/height: ${lsz}px !important/" ${f}
done
echo "Base font size set to ${fsz}px, line spacing ${lsz}px."
echo "Will apply when Thunderbird is restarted"