Blame


1 8e69d76d 2023-10-24 op # myterm
2 8e69d76d 2023-10-24 op
3 8e69d76d 2023-10-24 op #!/bin/ksh
4 8e69d76d 2023-10-24 op
5 8e69d76d 2023-10-24 op A wrapper script to launch xterm with a cute random background color.
6 8e69d76d 2023-10-24 op
7 8e69d76d 2023-10-24 op Got the idea from deadpixi' sam fork (the editor), where one can pass a
8 8e69d76d 2023-10-24 op list of colours as `background' and sam will use a random one.
9 8e69d76d 2023-10-24 op
10 8e69d76d 2023-10-24 op I'm actually using the same list of the sam example configuration:
11 8e69d76d 2023-10-24 op
12 6cd3e124 2024-02-08 op set -A colours white seashell oldlace lightcyan \
13 de9d2b51 2024-02-09 op lightyellow mintcream snow thistle1 wheat \
14 de9d2b51 2024-02-09 op azure lavenderblush bisque antiquewhite \
15 de9d2b51 2024-02-09 op aliceblue lemonchiffon oldlace
16 8e69d76d 2023-10-24 op
17 8e69d76d 2023-10-24 op ksh has not a great syntax for arrays, but this will choose (with modulo
18 8e69d76d 2023-10-24 op bias!) a random colour and use it as xterm background.
19 8e69d76d 2023-10-24 op
20 6a4434d6 2023-10-24 op exec xterm -bg "${colours[$((RANDOM % ${#colours[@]}))]}" "$@"