uh-wm 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -4
- data/lib/uh/wm/actions_handler.rb +5 -5
- data/lib/uh/wm/env.rb +1 -1
- data/lib/uh/wm/run_control.rb +2 -2
- data/lib/uh/wm/testing/acceptance_helpers.rb +13 -11
- data/lib/uh/wm/testing/headless.rb +9 -6
- data/lib/uh/wm/testing/x_client.rb +1 -1
- data/lib/uh/wm/version.rb +1 -1
- data/lib/uh/wm/workers/base.rb +1 -1
- data/lib/uh/wm/workers.rb +4 -4
- metadata +26 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bdfaa9044850872fdb32698f87fe8323e5e846519b6c6bec7815db47169ca8d1
|
4
|
+
data.tar.gz: b5fc6c161f4c491d6cf80f32eaa7ea2f494c21bda689424baa3bb7e6ea4628f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36a250861f7afa38a3fef39a72979d71576bfd71083e46e7405d42c4c050fa38f21374b8abbcbac6485c39c5c51bf9a240a5d08d4db073f8e229f496b7c70f0
|
7
|
+
data.tar.gz: fcfe9ec464a7ee86e725bb2fd93c02151d429057764fe987db90ceee1887adcb1aec4770ea3dbc571a9a3ebc86a9e967c4f90dd679b780725c2711795532b896
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ directly with ruby code.
|
|
7
7
|
|
8
8
|
The layout behavior can be changed, the default one being
|
9
9
|
implemented by the `uh-layout` ruby gem. A layout is a simple ruby
|
10
|
-
object responding to specific messages, so you can
|
10
|
+
object responding to specific messages, so you can write your own in
|
11
11
|
plain ruby without any dependency.
|
12
12
|
|
13
13
|
Main features:
|
@@ -16,7 +16,7 @@ plain ruby without any dependency.
|
|
16
16
|
* different adapters for event handling: blocking, multiplexing
|
17
17
|
with `select()` or `kqueue()`;
|
18
18
|
* configuration with a run control file;
|
19
|
-
* key bindings with user defined
|
19
|
+
* key bindings with user defined callbacks;
|
20
20
|
* configurable modifier key;
|
21
21
|
* user-defined layout behavior (ruby);
|
22
22
|
* external program execution;
|
@@ -67,8 +67,7 @@ BROWSERS = %w[
|
|
67
67
|
|
68
68
|
modifier :mod1 # This key is added to the modifier mask for *all*
|
69
69
|
# key bindings.
|
70
|
-
key(:p) { execute DMENU } # Execute given command in a shell
|
71
|
-
# is pressed.
|
70
|
+
key(:p) { execute DMENU } # Execute given command in a shell with mod1+p.
|
72
71
|
key(:Q) { quit } # Quit when mod1+shift+q is pressed (a capitalized
|
73
72
|
# key adds shift to mod mask).
|
74
73
|
key(:enter) { execute VT } # Common key names (`enter') are translated to
|
@@ -68,16 +68,16 @@ module Uh
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# Forwards unhandled messages prefixed with `layout_` to the layout,
|
71
|
-
#
|
71
|
+
# replacing the prefix with `handle_`
|
72
72
|
# @example
|
73
|
-
# layout_foo # delegates to `layout.
|
73
|
+
# layout_foo # delegates to `layout.handle_foo'
|
74
74
|
def method_missing m, *args, &block
|
75
75
|
if respond_to? m
|
76
76
|
meth = layout_method m
|
77
77
|
log "#{layout.class.name}##{meth} #{args.inspect}"
|
78
|
-
|
78
|
+
if layout.respond_to? meth
|
79
79
|
layout.send meth, *args
|
80
|
-
|
80
|
+
else
|
81
81
|
log_error "Layout does not implement `#{meth}'"
|
82
82
|
end
|
83
83
|
else
|
@@ -100,7 +100,7 @@ module Uh
|
|
100
100
|
private
|
101
101
|
|
102
102
|
def layout_method m
|
103
|
-
m.to_s.
|
103
|
+
m.to_s.sub(/\Alayout_/, 'handle_').to_sym
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
data/lib/uh/wm/env.rb
CHANGED
data/lib/uh/wm/run_control.rb
CHANGED
@@ -75,7 +75,7 @@ module Uh
|
|
75
75
|
# @param arg [Class, Object, Hash] A layout class, a layout instance, or
|
76
76
|
# options for the default layout
|
77
77
|
# @param options [Hash] Layout options
|
78
|
-
def layout arg,
|
78
|
+
def layout arg, options = {}
|
79
79
|
case arg
|
80
80
|
when Class
|
81
81
|
if options.any?
|
@@ -144,7 +144,7 @@ module Uh
|
|
144
144
|
translated_keysym = KEYSYM_TRANSLATIONS.key?(translate_key) ?
|
145
145
|
KEYSYM_TRANSLATIONS[translate_key] :
|
146
146
|
translate_key
|
147
|
-
keysym =~ /[A-Z]/ ? [translated_keysym, :shift] : translated_keysym
|
147
|
+
keysym.to_s =~ /[A-Z]/ ? [translated_keysym, :shift] : translated_keysym
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'baf/testing/
|
1
|
+
require 'baf/testing/process'
|
2
2
|
|
3
3
|
require 'uh'
|
4
4
|
require 'uh/wm/testing/x_client'
|
@@ -13,7 +13,8 @@ module Uh
|
|
13
13
|
attr_reader :other_wm
|
14
14
|
|
15
15
|
def icccm_window_start
|
16
|
-
@icccm_window =
|
16
|
+
@icccm_window = Baf::Testing::Process.new %w[xmessage window],
|
17
|
+
env_allow: %w[DISPLAY]
|
17
18
|
@icccm_window.start
|
18
19
|
end
|
19
20
|
|
@@ -33,20 +34,21 @@ module Uh
|
|
33
34
|
uhwm_request_quit
|
34
35
|
end
|
35
36
|
|
36
|
-
def uhwm_wait_ready
|
37
|
-
wait_output! LOG_READY
|
38
|
-
end
|
39
|
-
|
40
37
|
def uhwm_run_wait_ready options = '-v'
|
41
|
-
|
42
|
-
|
38
|
+
cmd = $_baf[:program] + options.split(' ')
|
39
|
+
env = Baf::Testing::ENV_WHITELIST + $_baf[:env_allow]
|
40
|
+
Baf::Testing::Process.new(cmd, env_allow: env).tap do |uhwm|
|
41
|
+
uhwm.start
|
42
|
+
Baf::Testing.wait_output LOG_READY, stream: -> { uhwm.output }
|
43
|
+
end
|
43
44
|
end
|
44
45
|
|
45
|
-
def with_other_wm
|
46
|
-
|
46
|
+
def with_other_wm uhwm_command
|
47
|
+
env = Baf::Testing::ENV_WHITELIST + $_baf[:env_allow]
|
48
|
+
@other_wm = Baf::Testing::Process.new uhwm_command, env_allow: env
|
47
49
|
@other_wm.start
|
48
50
|
yield
|
49
|
-
|
51
|
+
uhwm_request_quit
|
50
52
|
@other_wm = nil
|
51
53
|
end
|
52
54
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'baf/testing/process'
|
2
2
|
|
3
3
|
module Uh
|
4
4
|
module WM
|
@@ -8,15 +8,18 @@ module Uh
|
|
8
8
|
DISPLAY_SCREEN = '640x480x24'
|
9
9
|
|
10
10
|
def with_xvfb
|
11
|
-
xvfb =
|
11
|
+
xvfb = Baf::Testing::Process.new %W[
|
12
12
|
Xvfb -ac #{DISPLAY_NAME} -screen 0 #{DISPLAY_SCREEN}
|
13
|
-
]
|
13
|
+
]
|
14
14
|
xvfb.start
|
15
15
|
original_display = ENV['DISPLAY']
|
16
16
|
ENV['DISPLAY'] = DISPLAY_NAME
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
begin
|
18
|
+
yield
|
19
|
+
ensure
|
20
|
+
ENV['DISPLAY'] = original_display
|
21
|
+
xvfb.stop
|
22
|
+
end
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
data/lib/uh/wm/version.rb
CHANGED
data/lib/uh/wm/workers/base.rb
CHANGED
data/lib/uh/wm/workers.rb
CHANGED
@@ -2,9 +2,9 @@ module Uh
|
|
2
2
|
module WM
|
3
3
|
module Workers
|
4
4
|
FACTORIES = {
|
5
|
-
block: ->(options) { Blocking.new(options) },
|
6
|
-
kqueue: ->(options) { KQueue.new(options) },
|
7
|
-
mux: ->(options) { Mux.new(options) }
|
5
|
+
block: ->(options) { Blocking.new(**options) },
|
6
|
+
kqueue: ->(options) { KQueue.new(**options) },
|
7
|
+
mux: ->(options) { Mux.new(**options) }
|
8
8
|
}.freeze
|
9
9
|
|
10
10
|
class << self
|
@@ -16,7 +16,7 @@ module Uh
|
|
16
16
|
FACTORIES.key? type
|
17
17
|
end
|
18
18
|
|
19
|
-
def build type,
|
19
|
+
def build type, options = {}
|
20
20
|
(FACTORIES[type] or fail ArgumentError, "unknown worker: `#{type}'")
|
21
21
|
.call options
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uh-wm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: baf
|
@@ -79,33 +79,47 @@ dependencies:
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 0.4.2
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
82
|
+
name: cucumber
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
87
|
+
version: '3.2'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
94
|
+
version: '3.2'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rake
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
95
109
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
110
|
+
name: rspec
|
97
111
|
requirement: !ruby/object:Gem::Requirement
|
98
112
|
requirements:
|
99
113
|
- - "~>"
|
100
114
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
115
|
+
version: '3.11'
|
102
116
|
type: :development
|
103
117
|
prerelease: false
|
104
118
|
version_requirements: !ruby/object:Gem::Requirement
|
105
119
|
requirements:
|
106
120
|
- - "~>"
|
107
121
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
122
|
+
version: '3.11'
|
109
123
|
description: |2
|
110
124
|
uhwm is a minimalistic tiling and stacking window manager for X. It
|
111
125
|
shares some similarities with dwm and wmii, but is written in ruby so
|
@@ -145,7 +159,7 @@ homepage: https://rubygems.org/gems/uh-wm
|
|
145
159
|
licenses:
|
146
160
|
- BSD-3-Clause
|
147
161
|
metadata: {}
|
148
|
-
post_install_message:
|
162
|
+
post_install_message:
|
149
163
|
rdoc_options: []
|
150
164
|
require_paths:
|
151
165
|
- lib
|
@@ -160,9 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
174
|
- !ruby/object:Gem::Version
|
161
175
|
version: '0'
|
162
176
|
requirements: []
|
163
|
-
|
164
|
-
|
165
|
-
signing_key:
|
177
|
+
rubygems_version: 3.3.17
|
178
|
+
signing_key:
|
166
179
|
specification_version: 4
|
167
180
|
summary: minimalistic tiling and stacking X window manager
|
168
181
|
test_files: []
|