barabara 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/barabara/config.rb +2 -2
- data/lib/barabara/modules/lemonbar.rb +19 -6
- data/lib/barabara/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a5a8677921fc942822f26bce8282a47153496ab564969fb27609454ecba6fab
|
4
|
+
data.tar.gz: 36facf5e163322d9fb0b6325f3a2296b3bb104117e9e8bff2eebc8ebeabd81b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e37e4b9dc3b5939398c475c7e97182d8b6be50561ecfd26bdaab1afc480ae2360753a2367caf98304307aaab940858f6a05e4079bec8557ff3252d1dfe243bf9
|
7
|
+
data.tar.gz: 242704e57c26b2e802905f7a4c4e5af036e185c7de7dfec38c7b618a4e691a127b355642a3f885c4a968727fbd129f9a7cfb2958b3c86f4853c5cc3279fa6040
|
data/lib/barabara/config.rb
CHANGED
@@ -64,8 +64,8 @@ module Barabara
|
|
64
64
|
name: "barabara", height: 12,
|
65
65
|
format: "%%{S%<monitor>s}%%{l}%<tags>s%<sep>s %%{c} %<window_title>s %%{r} %<volume>s %<battery>s %<sep>s %<time>s %<sep>s %<weather>s\n",
|
66
66
|
fonts: {
|
67
|
-
text: "-lucy-tewi-medium-*-normal-*-11-*-*-*-*-*-*-*",
|
68
|
-
glyphs: "-wuncon-siji-medium-r-normal-*-10-100-75-75-c-80-iso10646-1"
|
67
|
+
text: { name: "-lucy-tewi-medium-*-normal-*-11-*-*-*-*-*-*-*", offset: 0 },
|
68
|
+
glyphs: { name: "-wuncon-siji-medium-r-normal-*-10-100-75-75-c-80-iso10646-1", offset: 0 }
|
69
69
|
},
|
70
70
|
snippets: { sep: "%%{B-}%%{F%<ac_winbr>s}|%%{F-}" },
|
71
71
|
extra_opts: ["| sh"]
|
@@ -34,12 +34,11 @@ module Barabara
|
|
34
34
|
cmd_opts = [
|
35
35
|
"-B '#{@colors[:in_framebr]}'",
|
36
36
|
"-F '#{@colors[:ac_text]}'",
|
37
|
-
"-g x#{options[:height]}+0+0",
|
38
|
-
"-n #{options[:name]}", '-a 30'
|
39
|
-
"-f #{options[:fonts][:text]}",
|
40
|
-
"-f #{options[:fonts][:glyphs]}"
|
37
|
+
"-g 'x#{options[:height]}+0+0'",
|
38
|
+
"-n '#{options[:name]}'", '-a 30'
|
41
39
|
]
|
42
|
-
cmd_opts
|
40
|
+
cmd_opts.concat font_opts(options[:fonts])
|
41
|
+
cmd_opts.concat options[:extra_opts] if options.key?(:extra_opts)
|
43
42
|
cmd_opts
|
44
43
|
end
|
45
44
|
|
@@ -64,7 +63,7 @@ module Barabara
|
|
64
63
|
monitor: monitor
|
65
64
|
))
|
66
65
|
end
|
67
|
-
string
|
66
|
+
string.delete "\n"
|
68
67
|
end
|
69
68
|
|
70
69
|
def render
|
@@ -75,6 +74,20 @@ module Barabara
|
|
75
74
|
@panel_data.merge!(data)
|
76
75
|
render
|
77
76
|
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def font_opts(fonts = {})
|
81
|
+
fonts.flat_map do |type, font_def|
|
82
|
+
if font_def.is_a? String
|
83
|
+
["-f '#{font_def}'"]
|
84
|
+
elsif font_def.key? :offset
|
85
|
+
["-o '#{font_def[:offset]}'", "-f '#{font_def[:name]}'"]
|
86
|
+
else
|
87
|
+
["-f '#{font_def[:name]}'"]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
78
91
|
end
|
79
92
|
end
|
80
93
|
end
|
data/lib/barabara/version.rb
CHANGED