yaml config ftw

This commit is contained in:
Jack L. Frost 2016-09-27 10:20:03 +03:00
parent b01792ec1b
commit aa43dd1e7d
3 changed files with 3 additions and 18 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'yaml' require 'yaml'
require 'erb'
$queue = Queue.new $queue = Queue.new
$workers = [] $workers = []
@ -37,8 +38,6 @@ end
$config = YAML.load_file('./rc.yaml') $config = YAML.load_file('./rc.yaml')
load './rc'
Dir["./mod/*"].each do |file| Dir["./mod/*"].each do |file|
load file load file
end end
@ -61,6 +60,6 @@ trap("SIGUSR1") { $queue << 1 }
IO.popen(lemonbar_cmd, "w") do |pipe| IO.popen(lemonbar_cmd, "w") do |pipe|
while true do while true do
data = $queue.pop data = $queue.pop
pipe.puts draw() pipe.puts ERB.new($config['format']).result
end end
end end

15
rc
View File

@ -1,15 +0,0 @@
# vim: ft=ruby
def draw()
bg_f = $config['colours']['bg_focused']
panel = [
$panel_data[:bspwm_pager],
"%{r}",
"%{F#{bg_f}}%{F-}%{B#{bg_f}} ",
$panel_data[:date],
" %{B-}"
]
return panel.join
end

View File

@ -4,6 +4,7 @@ geometry: '1902x14+9+9'
fontspec: '-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*' fontspec: '-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
window_name: 'moltenbar' window_name: 'moltenbar'
active_areas: '128' active_areas: '128'
format: "<%= $panel_data[:bspwm_pager] %>%{r}%{F<%= $config['colours']['bg_focused'] %>}%{F-}%{B<%= $config['colours']['bg_focused'] %>} <%= $panel_data[:date] %> %{B-}"
colours: colours:
fg: '#f9f9f9' fg: '#f9f9f9'
fg_focused: '#f9f9f9' fg_focused: '#f9f9f9'