yay separate panels
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
9c9846a970
commit
d3e4787481
66
moltenbar
66
moltenbar
|
@ -152,48 +152,49 @@ Dir.new("#{config['mod_dir']}").each_child do |m|
|
|||
load("#{config['mod_dir']}/#{m}")
|
||||
end
|
||||
|
||||
pipe_r, pipe_w = IO.pipe
|
||||
config["panels"].each do |panelName, panelConf|
|
||||
pipe_r, pipe_w = IO.pipe
|
||||
|
||||
config["modules"].each do |modName, modType|
|
||||
panelConf["modules"].each do |modName, modType|
|
||||
modClass = Modules.get[modType]
|
||||
Object.const_get(modClass).new(config, modName, pipe_w).run
|
||||
end
|
||||
|
||||
Signal.trap("INT") do cleanup; end
|
||||
Signal.trap("TERM") do cleanup; end
|
||||
|
||||
if config['geometry'] == nil
|
||||
config['gap'] ||= 0
|
||||
config['height'] ||= 14
|
||||
|
||||
gap = config['gap'].to_i
|
||||
|
||||
if config['width'] == nil
|
||||
y, x = get_x_dims()
|
||||
config['width'] = y.to_i - (gap * 2)
|
||||
Object.const_get(modClass).new(panelConf, modName, pipe_w).run
|
||||
end
|
||||
|
||||
config['geometry'] = "%{w}x%{h}+%{gap}+%{gap}" % [
|
||||
w: config['width'],
|
||||
h: config['height'],
|
||||
Signal.trap("INT") do cleanup; end
|
||||
Signal.trap("TERM") do cleanup; end
|
||||
|
||||
if panelConf['geometry'] == nil
|
||||
panelConf['gap'] ||= 0
|
||||
panelConf['height'] ||= 14
|
||||
|
||||
gap = panelConf['gap'].to_i
|
||||
|
||||
if panelConf['width'] == nil
|
||||
y, x = get_x_dims()
|
||||
panelConf['width'] = y.to_i - (gap * 2)
|
||||
end
|
||||
|
||||
panelConf['geometry'] = "%{w}x%{h}+%{gap}+%{gap}" % [
|
||||
w: panelConf['width'],
|
||||
h: panelConf['height'],
|
||||
gap: gap
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
lemonbar_cmd = [
|
||||
lemonbar_cmd = [
|
||||
"lemonbar",
|
||||
"-g", config['geometry'],
|
||||
"-f", config['fontspec'],
|
||||
"-n", config['window_name'],
|
||||
"-a", config['active_areas'],
|
||||
"-F", config['colours']['fg'],
|
||||
"-B", config['colours']['bg']
|
||||
]
|
||||
"-g", panelConf['geometry'],
|
||||
"-f", panelConf['fontspec'],
|
||||
"-n", panelConf['window_name'],
|
||||
"-a", panelConf['active_areas'],
|
||||
"-F", panelConf['colours']['fg'],
|
||||
"-B", panelConf['colours']['bg']
|
||||
]
|
||||
|
||||
printf("Launching lemonbar as:\n %s\n", lemonbar_cmd.join(" "))
|
||||
printf("Launching lemonbar as:\n %s\n", lemonbar_cmd.join(" "))
|
||||
|
||||
p = Panel.new(config)
|
||||
IO.popen(lemonbar_cmd, "w+") do |pipe_lb|
|
||||
p = Panel.new(panelConf)
|
||||
IO.popen(lemonbar_cmd, "w+") do |pipe_lb|
|
||||
pipe_lb.sync = true
|
||||
|
||||
DoSystem.new("system", pipe_lb).run
|
||||
|
@ -204,4 +205,5 @@ IO.popen(lemonbar_cmd, "w+") do |pipe_lb|
|
|||
p.modData[mod_name] = data
|
||||
pipe_lb.printf("%s\n", p.render())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
# vim: ft=yaml sw=2 et
|
||||
|
||||
#geometry: '1262x14+9+9'
|
||||
height: 14
|
||||
gap: 9
|
||||
fontspec: '-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
|
||||
window_name: 'moltenbar'
|
||||
active_areas: '128'
|
||||
modules:
|
||||
panels:
|
||||
main:
|
||||
#geometry: '1262x14+9+9'
|
||||
height: 14
|
||||
gap: 9
|
||||
fontspec: '-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
|
||||
window_name: 'moltenbar'
|
||||
active_areas: '128'
|
||||
modules:
|
||||
pager: bspwm_pager
|
||||
taskbar: bspwm_taskbar
|
||||
date: date
|
||||
|
@ -15,8 +17,8 @@ modules:
|
|||
www: network
|
||||
xnt: network
|
||||
warp: network
|
||||
format: "@{pager}%{FC{bg}}%{BC{bg_focused}}%{F-} @{taskbar}%{FC{bg_focused}} %{B-} %{r}%{FC{bg_focused}} %{F-}%{BC{bg_focused}} LA: @{la} Mem (used): @{memory} Internet: @{www} Warp: @{warp} XNT: @{xnt} @{date} %{B-}"
|
||||
colours:
|
||||
format: "@{pager}%{FC{bg}}%{BC{bg_focused}}%{F-} @{taskbar}%{FC{bg_focused}} %{B-} %{r}%{FC{bg_focused}} %{F-}%{BC{bg_focused}} LA: @{la} Mem (used): @{memory} Internet: @{www} Warp: @{warp} XNT: @{xnt} @{date} %{B-}"
|
||||
colours:
|
||||
fg: '#f9f9f9'
|
||||
fg_focused: '#f9f9f9'
|
||||
bg: '#001f1f1f'
|
||||
|
@ -26,8 +28,8 @@ colours:
|
|||
warn_colour: "#FFFF00"
|
||||
crit_colour: "#FF0000"
|
||||
|
||||
# Module settings
|
||||
mod:
|
||||
# Module settings
|
||||
mod:
|
||||
pager:
|
||||
show_empty_desktops: false
|
||||
show_single_monitor: false
|
||||
|
|
Loading…
Reference in New Issue
Block a user