xtabbedwindow 0.1.0 → 0.1.1
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/xtabbedwindow.rb +22 -2
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf348e0e5f4c9647ddb2e501166219326d52c691247dac427808354954a5b70
|
4
|
+
data.tar.gz: 02b9319e5ffc09ac1f6cdc1749eed823d8c8bfa0b89c07b03489630e3e0a538a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af1eac54f6653c9a416da4158f8a7767d281a6a6d208ec26391a0064d53b34f953f80892935b6b03531f9cc198b25a5559bf64ed43f67d07104ffe8d78878b45
|
7
|
+
data.tar.gz: 1ee10522ef18a4d59ee4fd4be36d8cdb94c5a9771fa1419d3a48914e6b2b74dedbd1d75608682333cc2aa2b57a0c9ed71fa62540ba93083eba491625e13163ca
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/xtabbedwindow.rb
CHANGED
@@ -11,8 +11,9 @@ class XTabbedWindow
|
|
11
11
|
|
12
12
|
attr_reader :window, :tabs
|
13
13
|
|
14
|
-
def initialize(name)
|
14
|
+
def initialize(name, new_tab: "Ctrl+t", scan_tabs: true)
|
15
15
|
|
16
|
+
@new_tab = new_tab
|
16
17
|
a = WMCtrl.instance.windows
|
17
18
|
@window = a.detect {|x| x.title =~ /#{name}/i}
|
18
19
|
|
@@ -20,12 +21,16 @@ class XTabbedWindow
|
|
20
21
|
sleep 0.3
|
21
22
|
@window.activate
|
22
23
|
end
|
24
|
+
|
25
|
+
@tabs = []
|
23
26
|
|
24
|
-
read_tabs()
|
27
|
+
read_tabs() if scan_tabs
|
25
28
|
|
26
29
|
end
|
27
30
|
|
28
31
|
def goto_tab(pattern)
|
32
|
+
|
33
|
+
read_tabs if @tabs.empty?
|
29
34
|
|
30
35
|
regex = pattern.is_a?(String) ? /^#{pattern}/i : pattern
|
31
36
|
|
@@ -49,6 +54,13 @@ class XTabbedWindow
|
|
49
54
|
i.times { XDo::Keyboard.char("Ctrl+Tab") }
|
50
55
|
|
51
56
|
end
|
57
|
+
|
58
|
+
def new_tab()
|
59
|
+
@window.activate
|
60
|
+
sleep 0.05
|
61
|
+
XDo::Keyboard.char(@new_tab)
|
62
|
+
sleep 0.3
|
63
|
+
end
|
52
64
|
|
53
65
|
def next_tab()
|
54
66
|
sleep 0.05
|
@@ -76,6 +88,14 @@ class XTabbedWindow
|
|
76
88
|
@tabs
|
77
89
|
|
78
90
|
end
|
91
|
+
|
92
|
+
def tab?(obj)
|
93
|
+
|
94
|
+
read_tabs if @tabs.empty?
|
95
|
+
regex = obj.is_a?(String) ? /^#{obj}|#{obj}/ : obj
|
96
|
+
@tabs.grep(regex).any?
|
97
|
+
|
98
|
+
end
|
79
99
|
|
80
100
|
def title()
|
81
101
|
sleep 0.05
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|