finished script to generate lemonbar command

This commit is contained in:
Noah Swerhun 2023-02-10 17:23:02 -06:00
parent 1dd43cb390
commit d3e2b6ec87
2 changed files with 33 additions and 7 deletions

View file

@ -1,7 +0,0 @@
import yaml
import io
with io.open("./testing_config.yml", 'r', encoding='utf8') as file:
config = yaml.safe_load(file)
print(config['bar']['config'])

33
lemonbar_command.py Normal file
View file

@ -0,0 +1,33 @@
import yaml
import io
with io.open("./testing_config.yml", 'r', encoding='utf8') as file:
config_file = yaml.safe_load(file)
lemonbar_command = "lemonbar -p"
lemonbar_cmd_options = config_file['bar']['config']
for item in lemonbar_cmd_options:
match item:
case 'geometry':
lemonbar_command += (" -g '" + lemonbar_cmd_options['geometry'] + "'")
case 'bottom':
lemonbar_command += (" -b")
case 'force':
lemonbar_command += (" -d")
case 'font':
lemonbar_command += (" -f '" + lemonbar_cmd_options['font'] + "'")
case 'name':
lemonbar_command += (" -n '" + lemonbar_cmd_options['name'] + "'")
case 'line_thickness':
lemonbar_command += (" -u " + lemonbar_cmd_options['line_thickness'])
case 'bg_color':
lemonbar_command += (" -B " + lemonbar_cmd_options['bg_color'])
case 'fg_color':
lemonbar_command += (" -F " + lemonbar_cmd_options['fg_color'])
case 'offset':
lemonbar_command += (" -o " + lemonbar_cmd_options['offset'])
case 'line_color':
lemonbar_command += (" -U " + lemonbar_cmd_options['line_color'])
print(lemonbar_command)