gnome-backlight 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/backlight.rb +32 -0
- metadata +47 -0
data/backlight.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# All backlight.rb code is Copyright 2011 by Pascal Ryckmans <firestarter87@users.sf.net>.
|
4
|
+
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License.
|
5
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
6
|
+
# You can find a copy of the GNU General Public License on <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
|
7
|
+
|
8
|
+
# I wanted to change my screen brightness on Debian Wheezy with Gnome3, trough the normal menu.
|
9
|
+
# This didn't seem to work after some searching I found the file I needed to change in order to change the brightness.
|
10
|
+
# This script gives me easy access to the file to change my backlight fast and easy.
|
11
|
+
# This script is tested on a Acer Aspire 7750 with Debian GNU/Linux 'Wheezy'.
|
12
|
+
|
13
|
+
# Make this script executable to make it it work!
|
14
|
+
# Also add a line to your .bashrc file for easy access: alias backlight="sudo /DESTINATION_OF_RUBY_SCRIPT.rb"
|
15
|
+
|
16
|
+
def is_numeric?(s)
|
17
|
+
!!Float(s) rescue false
|
18
|
+
end
|
19
|
+
|
20
|
+
$info = ARGV[0]
|
21
|
+
|
22
|
+
if (($info != nil) && (is_numeric?($info)))
|
23
|
+
puts "Your backlight value is now set to #{$info}."
|
24
|
+
$path = File.expand_path("/sys/class/backlight/intel_backlight/brightness")
|
25
|
+
open( $path, "w" ) do |brightness|
|
26
|
+
brightness.puts "#{$info}"
|
27
|
+
end
|
28
|
+
|
29
|
+
else
|
30
|
+
puts "Your backlight value is"
|
31
|
+
exec ('cat /sys/class/backlight/intel_backlight/brightness')
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gnome-backlight
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Pascal R.
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-31 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Change the backlight in Gnome3.
|
15
|
+
email: firestarter87@users.sf.net
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- backlight.rb
|
21
|
+
homepage: https://rubygems.org/profiles/firestarter87
|
22
|
+
licenses:
|
23
|
+
- GNU GPL v2
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.8.7
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 1.8.23
|
43
|
+
signing_key:
|
44
|
+
specification_version: 3
|
45
|
+
summary: I had problems changing my brightness/backlight, this script makes it easy
|
46
|
+
for me.
|
47
|
+
test_files: []
|