first commit
This commit is contained in:
53
color-parser.py
Normal file
53
color-parser.py
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import json;
|
||||||
|
import os;
|
||||||
|
import sys;
|
||||||
|
from colorist import hex;
|
||||||
|
from colorist import ColorHex;
|
||||||
|
from colorist import BgColorHex;
|
||||||
|
|
||||||
|
red = ColorHex("#ff0000");
|
||||||
|
yellow = ColorHex("#ffff00");
|
||||||
|
green = ColorHex("#00ff00");
|
||||||
|
|
||||||
|
def get_current_d() :
|
||||||
|
return os.getcwd();
|
||||||
|
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Has the directory changed?{yellow.OFF}");
|
||||||
|
diff_d = input(f"{red}>>{red.OFF} 1 or enter -- no, 2 -- yes : {yellow.OFF}");
|
||||||
|
|
||||||
|
if (diff_d == 1 or diff_d == "") :
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Okey, use ~/.cache/wal/{yellow.OFF}");
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Go to the specified directory.{yellow.OFF}");
|
||||||
|
os.chdir('../../../../.cache/wal');
|
||||||
|
else:
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Specify the directory: {yellow.OFF}");
|
||||||
|
w_directory = input();
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Go to the specified directory.{yellow.OFF}");
|
||||||
|
os.chdir(f"{w_directory}");
|
||||||
|
|
||||||
|
print(f"{red}>>{red.OFF} {green}START PARSING PROCESS{green.OFF} {red}<<{red.OFF}");
|
||||||
|
|
||||||
|
with open("colors.json", "r") as f:
|
||||||
|
data = json.load(f);
|
||||||
|
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Successfully.{yellow.OFF}");
|
||||||
|
print(f"{red}>>{red.OFF}{yellow} Output.{yellow.OFF}");
|
||||||
|
|
||||||
|
print("Used wallpaper:",data['wallpaper']);
|
||||||
|
print();
|
||||||
|
|
||||||
|
print("> SPECIAL <");
|
||||||
|
|
||||||
|
for i in data['special'] :
|
||||||
|
bg_color = BgColorHex(data['special'][f"{i}"]);
|
||||||
|
color = ColorHex(data['special'][f"{i}"])
|
||||||
|
print(f"{i} --> {bg_color}{color}#######{color.OFF}{bg_color.OFF}");
|
||||||
|
|
||||||
|
print();
|
||||||
|
print("> COLORS <");
|
||||||
|
|
||||||
|
for i in data['colors'] :
|
||||||
|
bg_color = BgColorHex(data['colors'][f"{i}"]);
|
||||||
|
color = ColorHex(data['colors'][f"{i}"])
|
||||||
|
print(f"{i} --> {bg_color}{color}#######{color.OFF}{bg_color.OFF}");
|
||||||
|
|
||||||
Reference in New Issue
Block a user