barr 0.2.0 → 0.2.1
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/README.md +4 -3
- data/examples/i3_cpu_mem.rb +1 -1
- data/lib/barr/block.rb +4 -0
- data/lib/barr/blocks/i3.rb +3 -2
- data/lib/barr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 783dfa03603c5ca7a7411dae9c9bc66ff8286417
|
4
|
+
data.tar.gz: f7ff629578dbb0d417c5c8b0b87b0ed8997ae740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c1b135b858d7390de3518b7545ad98a677787a4f9c4911a3bad13a3eeb162353b03086243837f611fab6361337302f35248d23c7b9efc82f0427212dfd129d2
|
7
|
+
data.tar.gz: 3a87c77612eb73638820410b83b32073ecea7cddc77d0eda0e59f2f5a3bf9ff9d1246babfe17107af8f82baf66f13b348c7687f350c683507bbee2d0d9224e3f
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ require 'barr'
|
|
37
37
|
# Add a 'Whoami' block. This just outputs logged in username
|
38
38
|
# Give it a peach background, grey text and updates every 10000 seconds
|
39
39
|
# It will be aligned to the left of the bar
|
40
|
-
@manager.add Barr::Blocks::Whoami.new(
|
40
|
+
@manager.add Barr::Blocks::Whoami.new(bgcolor: '#FFAAAA', fgcolor: '#333333', interval: 10000)
|
41
41
|
|
42
42
|
# Add a 'Clock' block.
|
43
43
|
# Clocks can be formatted in the type strftime fashion. This example outputs the current Hour and Minute
|
@@ -80,7 +80,7 @@ All blocks inherit their behaviour from a base Block. This means that all blocks
|
|
80
80
|
| Option | Value | Description | Default |
|
81
81
|
| ------ | ----- | ----------- | ------- |
|
82
82
|
| `fgcolor` | RGB Hex string or `-` | Equivalent to lemonbar's `%{F}` format. Takes a hex string in the format of `#FFF`, `#FFFFFF`, or `#FFFFFFFF` (for transparency). | `'-'` |
|
83
|
-
| `bgcolor` | RGB Hex string or `-` | As above. To use the configured lemonbar colors, use `'-'`. This also applies to the `
|
83
|
+
| `bgcolor` | RGB Hex string or `-` | As above. To use the configured lemonbar colors, use `'-'`. This also applies to the `fgcolor` option. | `'-'` |
|
84
84
|
| `icon` | String | This is prepended to each blocks' data. It can be a normal string like `'CPU:'` or a unicode string like `"\uf164"` (thumbs up in Font Awesome | `''` |
|
85
85
|
| `interval` | Integer | How frequently the Block should perform its `update!` method in seconds. The block is drawn to lemonbar every second, this just affects how frequently the data can change. | `5` |
|
86
86
|
| `align` | Symbol | One of `:l`, `:c`, `:r` for left, centre and right alignment respectively. | `:l` |
|
@@ -138,7 +138,7 @@ You can also add Blocks straight to the manager if you'd like to skip that step,
|
|
138
138
|
|
139
139
|
seperate_block = Barr::Blocks::Whoami.new
|
140
140
|
|
141
|
-
@man.add Barr::Blocks::Whoami.new
|
141
|
+
@man.add Barr::Blocks::Whoami.new bgcolor: '#000', fgcolor: '#FFF'
|
142
142
|
@man.add(Barr::Blocks::Whoami.new(icon: 'Me!', align: :c))
|
143
143
|
@man.add separate_block
|
144
144
|
```
|
@@ -183,6 +183,7 @@ Shows selected filesystem's used and free space.
|
|
183
183
|
| Option | Value | Description | Default |
|
184
184
|
| --- | --- | --- | --- |
|
185
185
|
| `focus_markers` | 2 element Array | These are used to 'highlight' the active workspace. The first element is used on the left of the active workspace, the second element on the right. | ['>', '<'] |
|
186
|
+
| `invert_focus_colors` | bool | Should the block's `fgcolor` and `bgcolor` attributes be reversed for the workspace that is currently focused. | `false` |
|
186
187
|
|
187
188
|
#### ip
|
188
189
|
|
data/examples/i3_cpu_mem.rb
CHANGED
@@ -5,7 +5,7 @@ require 'barr'
|
|
5
5
|
|
6
6
|
@man = Barr::Manager.new
|
7
7
|
|
8
|
-
i3 = Barr::Blocks::I3.new icon: "\uf108", bgcolor: '#114152', fgcolor: '#DAC1DE', align: :l, focus_markers: ["\uf0a4",'']
|
8
|
+
i3 = Barr::Blocks::I3.new icon: "\uf108", bgcolor: '#114152', fgcolor: '#DAC1DE', align: :l, focus_markers: ["| \uf0a4",' |'], invert_focus_colors: true
|
9
9
|
|
10
10
|
cpu = Barr::Blocks::CPU.new icon: "\uf108 CPU:", bgcolor: '#491A5E', align: :r
|
11
11
|
|
data/lib/barr/block.rb
CHANGED
data/lib/barr/blocks/i3.rb
CHANGED
@@ -11,15 +11,16 @@ module Barr
|
|
11
11
|
super
|
12
12
|
|
13
13
|
@focus_markers = opts[:focus_markers] || %w(> <)
|
14
|
+
@invert_focus_colors = opts[:invert_focus_colors] || false
|
14
15
|
@i3 = i3_connection
|
15
16
|
end
|
16
17
|
|
17
18
|
def update!
|
18
19
|
@workspaces = @i3.workspaces.map do |wsp|
|
19
20
|
if wsp.focused
|
20
|
-
"#{l_marker}#{wsp.name}#{r_marker}"
|
21
|
+
"#{invert_colors if @invert_focus_colors}#{l_marker}#{wsp.name}#{r_marker}#{invert_colors if @invert_focus_colors}"
|
21
22
|
else
|
22
|
-
"%{A:barr_i3ipc workspace #{wsp.
|
23
|
+
"%{A:barr_i3ipc \"workspace #{wsp.name.gsub(":","\\:")}\":} #{wsp.name} %{A}"
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
data/lib/barr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Russell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|