wallpapers 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +63 -0
- data/Rakefile +7 -7
- data/lib/wallpaper.rb +28 -28
- data/test/test_wallpaper.rb +15 -15
- metadata +6 -4
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
ubuntu_wallpaper [![Build Status](https://secure.travis-ci.org/rderoldan1/ubuntu_wallpaper.png)](http://secure.travis-ci.org/rderoldan1/ubuntu_wallpaper)
|
2
|
+
================
|
3
|
+
Change the wallpaper´s image of your ubuntu desktop without effort!
|
4
|
+
Ruby is the essence
|
5
|
+
https://rubygems.org/gems/wallpapers
|
6
|
+
Current release '0.0.8'
|
7
|
+
|
8
|
+
Why
|
9
|
+
=====
|
10
|
+
I have not found a easy solution on the web in order to change my laptop background image dinamically, with this Gem I put the
|
11
|
+
images that I like to display in a folder and magicly the Gem show all it
|
12
|
+
|
13
|
+
Requirements
|
14
|
+
===========
|
15
|
+
1. Ruby >= 1.8
|
16
|
+
2. Yaml
|
17
|
+
3. And that´s all :D
|
18
|
+
|
19
|
+
Download
|
20
|
+
========
|
21
|
+
$ gem install wallpapers
|
22
|
+
|
23
|
+
Use it
|
24
|
+
======
|
25
|
+
--> Beta Version
|
26
|
+
Load the gem
|
27
|
+
|
28
|
+
$ irb
|
29
|
+
$ irb(main):001:0> require "wallpaper"
|
30
|
+
|
31
|
+
Probably you will see and error with the config.yml, please fix it with the following command
|
32
|
+
|
33
|
+
$ sudo chmod 777 /var/lib/gems/1.9.1/gems/wallpapers-0.0.5/lib/config.yml
|
34
|
+
|
35
|
+
First Usage, please set the your backgrounds folder
|
36
|
+
|
37
|
+
$ irb(main):001:0> Wallpaper.set_path("/path/backgrounds_path")
|
38
|
+
$ Configuration file updated
|
39
|
+
|
40
|
+
Ok, your path is setted, now let's play!
|
41
|
+
|
42
|
+
$ irb(main):001:0> Wallpaper.run
|
43
|
+
|
44
|
+
then look at the screen..
|
45
|
+
|
46
|
+
**Important**
|
47
|
+
=============
|
48
|
+
The Gem is in Beta Version, for a couple of weeks the script run once, in future versions will run as daemon in the system
|
49
|
+
|
50
|
+
License
|
51
|
+
(The MIT License)
|
52
|
+
|
53
|
+
Copyright (c) 2012 Tataihono Nikora, GodMedia
|
54
|
+
|
55
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
56
|
+
documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the
|
57
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
58
|
+
persons to whom the Software is furnished to do so, subject to the following conditions:
|
59
|
+
|
60
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
61
|
+
Software.
|
62
|
+
|
63
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'rake/testtask'
|
2
|
-
|
3
|
-
Rake::TestTask.new do |t|
|
4
|
-
t.libs << 'test'
|
5
|
-
end
|
6
|
-
|
7
|
-
desc "Run tests"
|
1
|
+
require 'rake/testtask'
|
2
|
+
|
3
|
+
Rake::TestTask.new do |t|
|
4
|
+
t.libs << 'test'
|
5
|
+
end
|
6
|
+
|
7
|
+
desc "Run tests"
|
8
8
|
task :default => :test
|
data/lib/wallpaper.rb
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
class Wallpaper
|
3
|
-
puts File.dirname(__FILE__)
|
4
|
-
|
5
|
-
def self.get_path
|
6
|
-
config = YAML.load_file(File.dirname(__FILE__)+"/config.yml")
|
7
|
-
@path = config["path"]
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.set_path(path)
|
11
|
-
config = File.open(File.dirname(__FILE__)+"/config.yml",'w')
|
12
|
-
config.write "path: '#{path}'"
|
13
|
-
puts "Configuration file updated"
|
14
|
-
return config.close
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.run
|
18
|
-
path = self.get_path
|
19
|
-
files = Dir.entries(path)
|
20
|
-
files.each do |photo|
|
21
|
-
system("gsettings set org.gnome.desktop.background picture-uri 'file:////#{path}/#{photo}'")
|
22
|
-
sleep(5)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
|
1
|
+
require 'yaml'
|
2
|
+
class Wallpaper
|
3
|
+
puts File.dirname(__FILE__)
|
4
|
+
|
5
|
+
def self.get_path
|
6
|
+
config = YAML.load_file(File.dirname(__FILE__)+"/config.yml")
|
7
|
+
@path = config["path"]
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.set_path(path)
|
11
|
+
config = File.open(File.dirname(__FILE__)+"/config.yml",'w')
|
12
|
+
config.write "path: '#{path}'"
|
13
|
+
puts "Configuration file updated"
|
14
|
+
return config.close
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.run
|
18
|
+
path = self.get_path
|
19
|
+
files = Dir.entries(path)
|
20
|
+
files.each do |photo|
|
21
|
+
system("gsettings set org.gnome.desktop.background picture-uri 'file:////#{path}/#{photo}'")
|
22
|
+
sleep(5)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
|
data/test/test_wallpaper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require
|
3
|
-
|
4
|
-
class WallpaperTest < Test::Unit::TestCase
|
5
|
-
def test_call_class
|
6
|
-
assert_not_nil Wallpaper.new
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_gem
|
10
|
-
assert_kind_of Object, Gem::Specification.find_by_name("wallpapers","0.0.
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_open_file
|
14
|
-
assert_not_nil Wallpaper.get_path
|
15
|
-
end
|
1
|
+
require 'test/unit'
|
2
|
+
require "wallpaper"
|
3
|
+
|
4
|
+
class WallpaperTest < Test::Unit::TestCase
|
5
|
+
def test_call_class
|
6
|
+
assert_not_nil Wallpaper.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_gem
|
10
|
+
assert_kind_of Object, Gem::Specification.find_by_name("wallpapers","0.0.9")
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_open_file
|
14
|
+
assert_not_nil Wallpaper.get_path
|
15
|
+
end
|
16
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wallpapers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,17 +9,19 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A simple way to change the wallpaper image in ubuntu
|
15
15
|
email: rderoldan1@gmail.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
|
-
extra_rdoc_files:
|
18
|
+
extra_rdoc_files:
|
19
|
+
- README.md
|
19
20
|
files:
|
20
21
|
- Rakefile
|
21
22
|
- lib/wallpaper.rb
|
22
23
|
- lib/config.yml
|
24
|
+
- README.md
|
23
25
|
- test/test_wallpaper.rb
|
24
26
|
homepage: https://rubygems.org/gems/wallpapers
|
25
27
|
licenses: []
|
@@ -41,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
43
|
version: '0'
|
42
44
|
requirements: []
|
43
45
|
rubyforge_project:
|
44
|
-
rubygems_version: 1.8.
|
46
|
+
rubygems_version: 1.8.16
|
45
47
|
signing_key:
|
46
48
|
specification_version: 3
|
47
49
|
summary: Wallpapers!
|