-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdmenu_awesome_terminal_fonts
executable file
·46 lines (42 loc) · 2.49 KB
/
dmenu_awesome_terminal_fonts
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
#!/usr/bin/python3
# _____ _ ____ ____ ____ ____ _____
# / // \ / _ \/ __\/ _ \/ __\/__ __\
# | __\| | | / \|| \/|| / \|| \/| / \
# | | | |_/\| |-||| __/| \_/|| / | |
# \_/ \____/\_/ \|\_/ \____/\_/\_\ \_/
#
from python_dmenu_lib import *
def get_codepoints():
codepoints = {}
with open("/usr/share/fonts/awesome-terminal-fonts/pomicons-regular.sh", "rb") as file:
for line in file:
if line.startswith(b"CODEPOINT_OF_POMICONS_"):
name, codepoint = line.split(b"=")
name = name.replace(b"CODEPOINT_OF_POMICONS_", b"").decode().lower().strip().replace("_", " ")
codepoint = codepoint.replace(b"'",b"").replace(b'"', b"").lower().strip()
codepoints[name] = (b"\u" + codepoint).decode("unicode-escape")
with open("/usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.sh", "rb") as file:
for line in file:
if line.startswith(b"CODEPOINT_OF_AWESOME_"):
name, codepoint = line.split(b"=")
name = name.replace(b"CODEPOINT_OF_AWESOME_", b"").decode().lower().strip().replace("_", " ")
codepoint = codepoint.replace(b"'",b"").replace(b'"', b"").lower().strip()
codepoints[name] = (b"\u" + codepoint).decode("unicode-escape")
with open("/usr/share/fonts/awesome-terminal-fonts/octicons-regular.sh", "rb") as file:
for line in file:
if line.startswith(b"CODEPOINT_OF_OCTICONS_"):
name, codepoint = line.split(b"=")
name = name.replace(b"CODEPOINT_OF_OCTICONS_", b"").decode().lower().strip().replace("_", " ")
codepoint = codepoint.replace(b"'",b"").replace(b'"', b"").lower().strip()
codepoints[name] = (b"\u" + codepoint).decode("unicode-escape")
with open("/usr/share/fonts/awesome-terminal-fonts/devicons-regular.sh", "rb") as file:
for line in file:
if line.startswith(b"CODEPOINT_OF_DEVICONS_"):
name, codepoint = line.split(b"=")
name = name.replace(b"CODEPOINT_OF_DEVICONS_", b"").decode().lower().strip().replace("_", " ")
codepoint = codepoint.replace(b"'",b"").replace(b'"', b"").lower().strip()
codepoints[name] = (b"\u" + codepoint).decode("unicode-escape")
codepoints = {f"{k} {codepoints[k]}": codepoints[k] for k in sorted(codepoints.keys())}
return codepoints
if __name__ == "__main__":
exit(main(get_codepoints, " "))