yaml parsing done
This commit is contained in:
parent
7a6fbe52b2
commit
1dd43cb390
3 changed files with 45 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
testing_config.yml
|
7
easyconf.py
Normal file
7
easyconf.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import yaml
|
||||
import io
|
||||
|
||||
with io.open("./testing_config.yml", 'r', encoding='utf8') as file:
|
||||
config = yaml.safe_load(file)
|
||||
|
||||
print(config['bar']['config'])
|
37
example_config.yml
Normal file
37
example_config.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
# SEE `man lemonbar`
|
||||
bar:
|
||||
|
||||
config:
|
||||
geometry: 'widthxheight+x+y' # bar geomtery
|
||||
bottom: true # dock bar at bottom
|
||||
force: true # force the bar to dock
|
||||
font: 'fontname' # see man page
|
||||
name: 'name' # set WM_NAME
|
||||
line_thickness: 3 # under/overline thickness
|
||||
bg_color: '#000' # default color of the bar
|
||||
fg_color: '#FFF' # default color of text
|
||||
offset: 0 # vertical offset of text in pixels. can be negative.
|
||||
line_color: '#ff0000' # default underline color
|
||||
|
||||
modules: # bar modules
|
||||
|
||||
time: # module name can be anything you want
|
||||
command: 'date' # command to be run
|
||||
refresh: 1000 # how often to refresh in milliseconds
|
||||
bg_color: '#000' # color of the bar behind the text of this module
|
||||
fg_color: '#FFF' # color of the text itself
|
||||
align: left # left, right, or center
|
||||
font: 'fontname' # the name of the font for this specific module
|
||||
line:
|
||||
type: underline # underline or overline
|
||||
color: '#000' # line color
|
||||
button:
|
||||
activator: left # how to activate the button. clicks: left, right, middle. scroll wheel: scrup, scrdown
|
||||
command: 'echo "hello" > ~/file.txt' # command to run when button is clicked
|
||||
# you may have multiple buttons with different activators.
|
||||
|
||||
memory: # define multiple modules...
|
||||
command: "free -h | awk '/Mem/ {print $3}'"
|
||||
refresh: 10000
|
||||
# etc...
|
||||
|
Loading…
Reference in a new issue