summaryrefslogtreecommitdiff
path: root/.local/bin/manualgen
blob: 16a765370caeae31af4690403d7b409058a1edd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

config=$(cat $HOME/.config/sxhkd/sxhkdrc | sed "
s/^\s.*//g;
s/^#\s.*//;
s/^##\s/##\n-\ \*\*/;
s/#-#\s*/##\n-->/;
s/\s*#-#$/\n##/;
/^$/d" | awk '/##/{if (x)print x;x="";next}{x=(!x)?$0:x"**:`"$0;}STOP{print x;}' |
	sed "s/-->/##\ /;
			s/:\(.*\)$/:\1\`/;
			s/\s+\s/+/g;
			s/#\*\*:.*//;
      s/\(^##.*\)/\1\n/g")

manual=$(cat $HOME/.config/manual.part)

printf "$manual\n$config" | lowdown -sTms | pdfroff -itk -mspdf | zathura -