battman 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/battman_example.rb +3 -3
- data/lib/battman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b06de66b63cca9223b67e4032173c86429b02d8e
|
4
|
+
data.tar.gz: d03b52f4159656b4ad8ca536184db2e93f388ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86ecd5c55d008f5c80ed7b80d6c8a19be94ed7742c9e0a2258a7898ce170bafb03cda25b8a0a58b62d4a8d63906fc68b7ff73bfe669c7dedf5b41a7231c9c3b6
|
7
|
+
data.tar.gz: 198ac0346ee76370fc571d3ae0706305b3c099369fd00ed3e86080752dcd698a98a787c6af802781441a1a618ace4e25ee4e6e87df715a087e944f25b9acb831
|
data/README.md
CHANGED
@@ -20,11 +20,11 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
Check out [this example config](battman_example.rb)
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
27
|
-
1. Fork it ( https://github.com/
|
27
|
+
1. Fork it ( https://github.com/jreinert/battman/fork )
|
28
28
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
29
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
30
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/battman_example.rb
CHANGED
@@ -4,7 +4,7 @@ Battman::Battman.new do |battman|
|
|
4
4
|
|
5
5
|
battman.watch :acpi do |watcher|
|
6
6
|
|
7
|
-
current_state = :discharging # to
|
7
|
+
current_state = :discharging # defaulting to discharging
|
8
8
|
|
9
9
|
watcher.every 2.seconds do |status|
|
10
10
|
|
@@ -27,14 +27,14 @@ Battman::Battman.new do |battman|
|
|
27
27
|
|
28
28
|
if current_state == :discharging && value.in?(0...5)
|
29
29
|
`i3lock && systemctl suspend` if suspend
|
30
|
-
`notify-send -u critical 'Battery is critical'`
|
30
|
+
`notify-send -u critical 'Battery level is critical!'`
|
31
31
|
|
32
32
|
if value.in?(0..2)
|
33
33
|
`notify-send -u critical 'Suspending in 60 seconds! (plug in cable to abort)'`
|
34
34
|
suspend = true
|
35
35
|
end
|
36
36
|
else
|
37
|
-
|
37
|
+
suspend = false
|
38
38
|
end
|
39
39
|
|
40
40
|
end
|
data/lib/battman/version.rb
CHANGED