barr 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 185b5db5b041d0198cd6832e6da6c279e52b49f9
4
- data.tar.gz: 8c2105ccfc2ba40f1e72c7813281d87ddc23653a
3
+ metadata.gz: 783dfa03603c5ca7a7411dae9c9bc66ff8286417
4
+ data.tar.gz: f7ff629578dbb0d417c5c8b0b87b0ed8997ae740
5
5
  SHA512:
6
- metadata.gz: d5b0bbaf1b4b58c55bae9246f3b597f9fbda345fda3069be30057a090e63b6ce0a710df64ffe38d8dddcd8b72a29a5a4e6a385aa539cb6f1ca761075cdf15cc1
7
- data.tar.gz: 884669dd60977c7549dbeb9b5ef907531de052ff40c6bb186b98cb9275d4f5308979ebe39c7a557b746e948c6f66fbdd731ab4d575ed7a402b0457d862331fff
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(bcolor: '#FFAAAA', fcolor: '#333333', interval: 10000)
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 `fcolor` option. | `'-'` |
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 bcolor: '#000', fcolor: '#FFF'
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
 
@@ -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
@@ -51,5 +51,9 @@ module Barr
51
51
  '%{F-}%{B-}'
52
52
  end
53
53
 
54
+ def invert_colors
55
+ '%{R}'
56
+ end
57
+
54
58
  end
55
59
  end
@@ -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.num}:} #{wsp.name} %{A}"
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
@@ -1,3 +1,3 @@
1
1
  module Barr
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-28 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler