mirror of
https://gitlab.com/manzerbredes/i3-colors.git
synced 2025-04-07 00:56:24 +02:00
Improve log+refactoring
This commit is contained in:
parent
1bb0ed2eb9
commit
8159cebf20
4 changed files with 10 additions and 8 deletions
5
TODO.org
5
TODO.org
|
@ -1,9 +1,8 @@
|
||||||
#+TITLE: "i3-colors Project Todo List"
|
#+TITLE: "i3-colors Project Todo List"
|
||||||
#+AUTHOR: "Loic Guegan"
|
#+AUTHOR: "Loic Guegan"
|
||||||
|
|
||||||
- Refactoring [0/3]:
|
- Refactoring [1/3]:
|
||||||
- [ ] Change src/parser.py name
|
- [X] Change src/parser.py name => now config.py
|
||||||
- [ ] Change src/theme.py name
|
|
||||||
- [ ] Improve function/variables names
|
- [ ] Improve function/variables names
|
||||||
|
|
||||||
- YAML Theme Parser [0/2]:
|
- YAML Theme Parser [0/2]:
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import parser, theme, os, argparse, subprocess
|
import config, theme, os, argparse, subprocess
|
||||||
|
|
||||||
|
|
||||||
##### Utils Functions #####
|
##### Utils Functions #####
|
||||||
def log(title, content): print("\033[92m{}\033[00m: {}" .format(title,content))
|
def log(msg,title=""):
|
||||||
|
if len(title)>0:
|
||||||
|
print("\033[92m{}\033[00m: {}" .format(title,msg))
|
||||||
|
else:
|
||||||
|
print(msg)
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,8 +22,8 @@ args = args_parser.parse_args()
|
||||||
##### Apply Theme #####
|
##### Apply Theme #####
|
||||||
loaded_theme=theme.load(args.theme_path)
|
loaded_theme=theme.load(args.theme_path)
|
||||||
for meta_key,meta_value in loaded_theme["meta"].items():
|
for meta_key,meta_value in loaded_theme["meta"].items():
|
||||||
log(meta_key.title(),meta_value)
|
log(meta_value,title=meta_key.title())
|
||||||
parser.apply_theme(os.environ["HOME"]+"/.config/i3/config",loaded_theme)
|
config.apply_theme(os.environ["HOME"]+"/.config/i3/config",loaded_theme)
|
||||||
if args.restart:
|
if args.restart:
|
||||||
subprocess.Popen("i3-msg restart".split())
|
subprocess.Popen("i3-msg restart".split())
|
||||||
#######################
|
#######################
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import yaml,re
|
import yaml,re
|
||||||
|
|
||||||
|
|
||||||
def configure(theme):
|
def configure(theme):
|
||||||
if "colors" in theme:
|
if "colors" in theme:
|
||||||
colors=theme["colors"]
|
colors=theme["colors"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue