batalert 0.1.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 3feaa732f29966e9653afe5b681052f30032f3cd8da488895e5efe10b89f693b
4
- data.tar.gz: 4046045ed406ea8fc9d3d1336fc3007d5ac6d36046187443324facef29c79add
3
+ metadata.gz: 4b9da8a7685d06ef84a2a30b52ef1fc63be738baba33ba740664de3d3ff17819
4
+ data.tar.gz: dcd2abc5614b1eaa422fe6d93e77aace8ab58149621f5456f550fca642141c43
5
5
  SHA512:
6
- metadata.gz: f7dbe5328616bc9b0befdfe5c2eec4e9208cb389e39a21614615a3f16475089fd1e913ce81c47f1ff7523da5647d0e0f3e92e92ab9a61635d4306ad74ff1c602
7
- data.tar.gz: 549aa01a8dbdb5266b9278e0a8aceb2bfb5f1b31ecb0f257452af81f5b770d226dc1738032ea050af60cf8a51a5cd5f43d5d898329340fe2fc65aff88d7c2f05
6
+ metadata.gz: bd42d40df5609329a3be43362c11261c9d320c31bce447579a0e463f7825e554115eb639a095b1ee2d9345633aaa6bbe9e418f7fceeb33fa515c1744872ce7ff
7
+ data.tar.gz: 0c52a0ad0de25dea261260be295a0ceb983dce0a80fdb3555dcfc57b621b06f300bfd2c36a4b30575112e0f90c03b1f92a20fe60db70c59c64e02c79fd5af741
@@ -0,0 +1,66 @@
1
+ # batalert
2
+
3
+ `batalert` (aka *Battery Alert*) is a tool, written in Ruby, to notify the users when their battery is either under-charged (default: < 10%) or over-charged (default: > 90%).
4
+
5
+ > notify the users when their battery is either under-charged (default: < 10%) or over-charged (default: > 90%).
6
+
7
+ Ever ran out of battery whilst in the middle of work?
8
+ Well, say no more! `batalert` has got you covered!
9
+ Just consider installing it and put this on cron so that you never have to worry about running out of battery in midst of your work! Isn't that...amazing? 🚀
10
+
11
+ This is originally intended for [WM](https://en.wikipedia.org/wiki/Window_manager) users who don't have get battery notifications by default, but can be used by everyone who sees its worth!
12
+
13
+ How it works is that this tool, upon being set up, shall notify you when to put your battery on charging and when to unplug it, too. Whilst notifying so, it also numerically mentions your battery percentage at that particular moment.
14
+
15
+ ## Setting up `batalert`
16
+
17
+ #### Ways of installation:
18
+
19
+ - Install the [gem](https://rubygems.org/gems/batalert) from the [rubygems](https://rubygems.org/) archive:
20
+ `$ gem install batalert`
21
+
22
+ - Install the [package](https://tracker.debian.org/pkg/batalert) via apt (only for Sid and Bullseye):
23
+ `$ apt install batalert`
24
+
25
+ - Download the deb and install it manually:
26
+ The [release page](https://github.com/utkarsh2102/batalert/releases) has a .deb binary which can be downloaded with a single click. Once done, run:
27
+ `$ dpkg -i <path-to-deb>/batalert_<version>_all.deb`
28
+
29
+ #### Ways of setting it as a cron job:
30
+
31
+ - Set it up manually:
32
+ `$ crontab -e`
33
+
34
+ And then add the following line at the end:
35
+ `*/n * * * * /usr/bin/batalert`
36
+
37
+ **NOTE**: `n` is the duration of interval (in minutes) after which the binary is executed. So, for instance, if you want to schedule a cron after every 15 minutes (that's what I do), then the line becomes:
38
+ `*/15 * * * * /usr/bin/batalert`
39
+
40
+ - Use [whenever](https://www.rubyguides.com/2019/04/ruby-whenever-gem/) to schedule the cron automatically on your behalf:
41
+ (you can install `whenever` via `gem install whenever` or `apt install ruby-whenever`)
42
+ - Clone this repository:
43
+ `$ git clone https://github.com/utkarsh2102/batalert.git`
44
+ - Move to its parent directory:
45
+ `$ cd batalert`
46
+ - Set the value of interval in `config/schedule.rb`.
47
+ - Run `whenever` to schedule the cron:
48
+ `$ whenever --update-crontab`
49
+
50
+ ## Development
51
+
52
+ After checking out the repo, run `bin/setup` to install dependencies.
53
+ Then, run `rake` to run the tests.
54
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
+
56
+ To install this gem onto your local machine, run `bundle exec rake install`.
57
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
58
+
59
+ ## Contributing
60
+
61
+ As always, bug reports and pull requests are heartily welcomed! 💖
62
+ This project is intended to be a safe and welcoming space for collaboration.
63
+
64
+ ## License
65
+ `batalert` is available as open-source under the [MIT](https://github.com/utkarsh2102/batalert/blob/master/LICENSE) license.
66
+ Copyright © 2020 Utkarsh Gupta
@@ -0,0 +1,25 @@
1
+ # env :PATH, ENV['PATH']
2
+ # env :GEM_PATH, ENV['GEM_PATH']
3
+
4
+ # Use this file to easily define all of your cron jobs.
5
+ #
6
+ # It's helpful, but not entirely necessary to understand cron before proceeding.
7
+ # http://en.wikipedia.org/wiki/Cron
8
+
9
+ # Example:
10
+ #
11
+ # set :output, "/path/to/my/cron_log.log"
12
+ #
13
+ # every 2.hours do
14
+ # command "/usr/bin/some_great_command"
15
+ # runner "MyModel.some_method"
16
+ # rake "some:great:rake:task"
17
+ # end
18
+ #
19
+ # every 4.days do
20
+ # runner "AnotherModel.prune_old_records"
21
+ # end
22
+
23
+ every 15.minute do
24
+ command "/usr/local/bin/batalert"
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Batalert
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batalert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Utkarsh Gupta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-25 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: espeak-ruby
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: whenever
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: minitest
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +66,21 @@ dependencies:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
- description: "Battery notifications/alerts so your battery never dies! \U0001F4AF"
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description:
56
84
  email:
57
85
  - utkarsh@debian.org
58
86
  executables:
@@ -61,6 +89,8 @@ extensions: []
61
89
  extra_rdoc_files: []
62
90
  files:
63
91
  - LICENSE
92
+ - README.md
93
+ - config/schedule.rb
64
94
  - exe/batalert
65
95
  - lib/batalert.rb
66
96
  - lib/batalert/version.rb
@@ -86,5 +116,5 @@ requirements: []
86
116
  rubygems_version: 3.1.2
87
117
  signing_key:
88
118
  specification_version: 4
89
- summary: Battery notifications/alerts
119
+ summary: "Battery notifications/alerts for your favorite WM! \U0001F4AF"
90
120
  test_files: []