fidget 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fidget.rb +2 -2
- data/lib/fidget/platform/{linux.rb → posix.rb} +5 -4
- data/lib/fidget/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 886d0692227eb027e7461841ae2f0b12680e42e5
|
|
4
|
+
data.tar.gz: 4c8b1f9a08d8a94abae42043d453a7c783928586
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63e92d4f812193f4a09ec4e30e10a0b7d1e84097980ff4aebc6e4d4068f4f61798bb056ae69712bdf3228529666e04b48d8e49cb3fb812fbba04b671f30070c3
|
|
7
|
+
data.tar.gz: 816b5ea2e48d93c4597d270881d12b8e4e6799cea3a7f26f241d42fa9505c3fec120b09ce23fe53d33b614e9283362ab06500d90f3d6932a51720a186deff788
|
data/lib/fidget.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
class Fidget::Platform
|
|
2
2
|
require "dbus"
|
|
3
|
+
@@cookie = nil
|
|
3
4
|
|
|
4
5
|
def self.current_process(options)
|
|
5
6
|
return false unless required_binaries
|
|
@@ -20,8 +21,6 @@ class Fidget::Platform
|
|
|
20
21
|
yield
|
|
21
22
|
resume(options)
|
|
22
23
|
end
|
|
23
|
-
|
|
24
|
-
pid
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
def self.allow_sleep
|
|
@@ -49,7 +48,7 @@ class Fidget::Platform
|
|
|
49
48
|
|
|
50
49
|
def self.root_win
|
|
51
50
|
ids = `xwininfo -root`.each_line.collect do |line|
|
|
52
|
-
next unless line =~ /Window id: (0x\
|
|
51
|
+
next unless line =~ /Window id: (0x\h+)/
|
|
53
52
|
$1
|
|
54
53
|
end.compact
|
|
55
54
|
raise "Parsing xwininfo failed" unless ids.size == 1
|
|
@@ -69,7 +68,9 @@ class Fidget::Platform
|
|
|
69
68
|
# This is possibly because the inhibit expires when the dbus-session command terminates
|
|
70
69
|
# I don't know if this will work in other distros though. Yay for consistency. *\o/*
|
|
71
70
|
begin
|
|
72
|
-
|
|
71
|
+
dbus_screensaver.Inhibit(root_win, 'Administratively disabled') do |res|
|
|
72
|
+
@@cookie = res
|
|
73
|
+
end
|
|
73
74
|
rescue => e
|
|
74
75
|
STDERR.puts 'Fidget: DBus action failed.'
|
|
75
76
|
STDERR.puts e.message
|
data/lib/fidget/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fidget
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Ford
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby-dbus
|
|
@@ -39,16 +39,16 @@ executables:
|
|
|
39
39
|
extensions: []
|
|
40
40
|
extra_rdoc_files: []
|
|
41
41
|
files:
|
|
42
|
-
- README.md
|
|
43
42
|
- LICENSE
|
|
43
|
+
- README.md
|
|
44
44
|
- bin/fidget
|
|
45
|
+
- lib/fidget.rb
|
|
45
46
|
- lib/fidget/logger.rb
|
|
46
47
|
- lib/fidget/platform/darwin.rb
|
|
47
|
-
- lib/fidget/platform/linux.rb
|
|
48
48
|
- lib/fidget/platform/null.rb
|
|
49
|
+
- lib/fidget/platform/posix.rb
|
|
49
50
|
- lib/fidget/platform/windows.rb
|
|
50
51
|
- lib/fidget/version.rb
|
|
51
|
-
- lib/fidget.rb
|
|
52
52
|
homepage: https://github.com/binford2k/fidget
|
|
53
53
|
licenses:
|
|
54
54
|
- Apache 2.0
|
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
69
69
|
version: '0'
|
|
70
70
|
requirements: []
|
|
71
71
|
rubyforge_project:
|
|
72
|
-
rubygems_version: 2.
|
|
72
|
+
rubygems_version: 2.5.2
|
|
73
73
|
signing_key:
|
|
74
74
|
specification_version: 4
|
|
75
75
|
summary: Cross platform tool to prevent your computer from sleeping.
|