barr 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +19 -0
- data/lib/barr.rb +2 -0
- data/lib/barr/blocks/battery.rb +31 -0
- data/lib/barr/blocks/i3.rb +6 -0
- data/lib/barr/blocks/processes.rb +16 -0
- data/lib/barr/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1325be83970f3c39bd02fb2cbdae88e2ba56fc06
|
4
|
+
data.tar.gz: 6f538d8834b692fa2c738429affdc4ceac7d3e77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83c7b0e7b9c402689db78859badc46f9e56af8b94e6df1450479d711ec8c5e7c8dfad064f89c9923e16a66be559ec98e5ff1b3343e71b0b5f7cff3fe2d09c606
|
7
|
+
data.tar.gz: 11a34a6d9d699f5b6947eb6f32c1b836e35bf1067e3c458af7d0d619c04c18f2e335c83c1971b620cc8b43360adb9ce837f1446a642991ee247bc03532fa481e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -146,6 +146,17 @@ seperate_block = Barr::Blocks::Whoami.new
|
|
146
146
|
|
147
147
|
### Block Specific Configuration
|
148
148
|
|
149
|
+
#### Battery
|
150
|
+
|
151
|
+
Show battery status.
|
152
|
+
|
153
|
+
`battery = Barr::Blocks::Battery.new show_remaining: true`
|
154
|
+
|
155
|
+
| Option | Value | Description | Default |
|
156
|
+
| --- | --- | --- | --- |
|
157
|
+
| `show_remaining` | bool | Show the remaining battery time | `true` |
|
158
|
+
|
159
|
+
|
149
160
|
#### Clock
|
150
161
|
|
151
162
|
Shows the current date and/or time.
|
@@ -204,6 +215,14 @@ Shows current RAM usage.
|
|
204
215
|
|
205
216
|
There are no `Mem` block specific configurable options.
|
206
217
|
|
218
|
+
#### Processes
|
219
|
+
|
220
|
+
Shows the number of currently active processes on your system.
|
221
|
+
|
222
|
+
`proc = Barr::Blocks::Processes.new`
|
223
|
+
|
224
|
+
There are no `Processes` block specific configurable options.
|
225
|
+
|
207
226
|
#### Rhythmbox
|
208
227
|
|
209
228
|
**Requires Rhythmbox and rhythmbox-client**. Shows currently playing artist and/or track, as well as control buttons. Control buttons use FontAwesome.
|
data/lib/barr.rb
CHANGED
@@ -2,12 +2,14 @@ require 'barr/version'
|
|
2
2
|
require 'barr/manager'
|
3
3
|
require 'barr/block'
|
4
4
|
|
5
|
+
require 'barr/blocks/battery'
|
5
6
|
require 'barr/blocks/clock'
|
6
7
|
require 'barr/blocks/cpu'
|
7
8
|
require 'barr/blocks/hdd'
|
8
9
|
require 'barr/blocks/i3'
|
9
10
|
require 'barr/blocks/ip'
|
10
11
|
require 'barr/blocks/mem'
|
12
|
+
require 'barr/blocks/processes'
|
11
13
|
require 'barr/blocks/rhythmbox'
|
12
14
|
require 'barr/blocks/temperature'
|
13
15
|
require 'barr/blocks/whoami'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'barr/block'
|
2
|
+
|
3
|
+
module Barr
|
4
|
+
module Blocks
|
5
|
+
|
6
|
+
class Battery < Block
|
7
|
+
attr_reader :show_remaining
|
8
|
+
|
9
|
+
def initialize opts={}
|
10
|
+
super
|
11
|
+
@show_remaining = opts[:show_remaining].nil? ? true : opts[:show_remaining]
|
12
|
+
end
|
13
|
+
|
14
|
+
def update!
|
15
|
+
if @show_remaining == true
|
16
|
+
@output = battery_remaining
|
17
|
+
else
|
18
|
+
@output = battery_no_remaining
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def battery_remaining
|
23
|
+
`acpi | cut -d ',' -f 2-3`.chomp
|
24
|
+
end
|
25
|
+
|
26
|
+
def battery_no_remaining
|
27
|
+
`acpi | cut -d ',' -f 2`.chomp
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/barr/blocks/i3.rb
CHANGED
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.2
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,12 +126,14 @@ files:
|
|
126
126
|
- exe/barr_i3ipc
|
127
127
|
- lib/barr.rb
|
128
128
|
- lib/barr/block.rb
|
129
|
+
- lib/barr/blocks/battery.rb
|
129
130
|
- lib/barr/blocks/clock.rb
|
130
131
|
- lib/barr/blocks/cpu.rb
|
131
132
|
- lib/barr/blocks/hdd.rb
|
132
133
|
- lib/barr/blocks/i3.rb
|
133
134
|
- lib/barr/blocks/ip.rb
|
134
135
|
- lib/barr/blocks/mem.rb
|
136
|
+
- lib/barr/blocks/processes.rb
|
135
137
|
- lib/barr/blocks/rhythmbox.rb
|
136
138
|
- lib/barr/blocks/temperature.rb
|
137
139
|
- lib/barr/blocks/whoami.rb
|