Scripts for using this st version with i3
This commit is contained in:
parent
1d33540ae9
commit
88a7bfa1cd
31 changed files with 139 additions and 0 deletions
71
st-scripts/foot-to-st.py
Normal file
71
st-scripts/foot-to-st.py
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#!/usr/bin/env python3
|
||||
#coding:utf-8
|
||||
"""
|
||||
Purpose: foot conf to st-color-at-start
|
||||
Created: 04.01.2021
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
def main(args):
|
||||
"""open foot file, parse, and dump st script"""
|
||||
with open(args.filename) as fh:
|
||||
lines = fh.readlines()
|
||||
mode = None
|
||||
colors = list(range(0, 16))
|
||||
for ii in lines:
|
||||
i = ii.rstrip()
|
||||
if i[0:4] == '[cur':
|
||||
mode = 'cursor'
|
||||
elif i[0:4] == '[col':
|
||||
mode = 'colors'
|
||||
else:
|
||||
if mode == 'cursor' and i[0:5] == 'color' :
|
||||
x = i.split('=')
|
||||
color256, color257 = x[1].split(' ')
|
||||
elif mode == 'colors':
|
||||
if i[0:4] == 'fore':
|
||||
color258 = i.split('=')[1]
|
||||
elif i[0:4] == 'back':
|
||||
color259 = i.split('=')[1]
|
||||
elif i[0:4] == 'regu':
|
||||
index = int(i[7])
|
||||
col = i.split('=')[1]
|
||||
colors[index] = f'{col}'
|
||||
elif i[0:4] == 'brig':
|
||||
index = int(i[6]) + 8
|
||||
col = i.split('=')[1]
|
||||
colors[index] = f'{col}'
|
||||
|
||||
print(f"""-C #{colors[0]}@0 \
|
||||
-C #{colors[1]}@1 \
|
||||
-C #{colors[2]}@2 \
|
||||
-C #{colors[3]}@3 \
|
||||
-C #{colors[4]}@4 \
|
||||
-C #{colors[5]}@5 \
|
||||
-C #{colors[6]}@6 \
|
||||
-C #{colors[7]}@7 \
|
||||
-C #{colors[8]}@8 \
|
||||
-C #{colors[9]}@9 \
|
||||
-C #{colors[10]}@10 \
|
||||
-C #{colors[11]}@11 \
|
||||
-C #{colors[12]}@12 \
|
||||
-C #{colors[13]}@13 \
|
||||
-C #{colors[14]}@14 \
|
||||
-C #{colors[15]}@15 \
|
||||
-C #{color256}@256 \
|
||||
-C #{color257}@257 \
|
||||
-C #{color258}@258 \
|
||||
-C #{color259}@259
|
||||
""")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('-f','--filename',type=str,required=True)
|
||||
main(ap.parse_args())
|
||||
Loading…
Add table
Add a link
Reference in a new issue