fvwm-window-search 1.0.0 → 1.1.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -5
  3. data/dmenu.patch +18 -17
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1365fa4326358bdf06efd23fa5e8a42348dfad1a4acae24f169fa603c0c6f8c2
4
- data.tar.gz: da1fc15018240a4d37bad24726e81f60cfe44232e7e23b172d30c7d5d384d91c
3
+ metadata.gz: 580941b472f2b948d9f6d854a337a1d066646c7b3705986f76f3b429845026a3
4
+ data.tar.gz: 2e7b0a76b19a24514641ce603f35eee86f380bc8293c155014e80bfba9b24652
5
5
  SHA512:
6
- metadata.gz: 2bd53629fa900f2c1b30e6cd02a4de7db3bde4676ec5b0c5dcef9c5ef9a26c3c174cce33a58470060643da89532fccb478609110d31fdc7faeb1aab765a8706a
7
- data.tar.gz: 0ecc94c5b3161697d3f71cf02e20ef06d70b4d878c5b224b6f3737335aa494bd9b6bb5637c97e953b36169f6b67a13aeaff916b5885806649554b3f18590286c
6
+ metadata.gz: e85229be05ab43082df6362ca7b4b72c5f57cfdca85835027c979f305d01c332d74d5fa6830338548e08beb0718b4b25f2cd382c03da4ff66b5bce7a05429d79
7
+ data.tar.gz: e9926afb792d151259ca4dadd48d6346da71437cbdc7642009392d08ff1e03a610b10b78e12475a58a6b901efb0551192d2977394e08e06aabdf51772e7c46e2
data/README.md CHANGED
@@ -12,7 +12,7 @@ Incremental window search & immediate switch to the selected window
12
12
 
13
13
  ## Reqs
14
14
 
15
- * Ruby (tested w/ 2.7.0)
15
+ * Ruby
16
16
  * `xwininfo` & `xdotool` (`xorg-x11-utils` & `xdotool` Fedora pkgs)
17
17
 
18
18
  ## Compilation
@@ -32,18 +32,26 @@ To customise dmenu or filtering, create a yaml file
32
32
  dmenu:
33
33
  fn: Monospace-12
34
34
  b: false
35
+ selhook-return-key-focus-only: true
35
36
  filter:
36
37
  name: ['System Monitor']
38
+ resource: []
39
+ class: []
37
40
  ~~~
38
41
 
39
- This passes to dmenu `-fn` & `-b` CLOs & instructs to filter out any
40
- window that matches `System Monitor` regexp in its title.
42
+ Subkeys in `dmenu` are the usual CLOs for
43
+ [dmenu(1)][]. `selhook-return-key-focus-only` is a custom one, that
44
+ enables window focusing on pressing Return only.
41
45
 
42
- See the defaults in `fvwm-window-search` file.
46
+ [dmenu(1)]: https://manpages.debian.org/unstable/suckless-tools/dmenu.1.en.html
47
+
48
+ `filter` key tells what windows should be filtered out. Each value in
49
+ a subkey is an array of regexes. See the defaults in
50
+ `fvwm-window-search` file.
43
51
 
44
52
  ## Bugs
45
53
 
46
- * Tested only w/ Fvwm3.
54
+ * Tested only w/ Ruby-2.7.0 & Fvwm3.
47
55
  * No distinction between normal & iconified windows.
48
56
 
49
57
  ## License
@@ -14,18 +14,19 @@ index a03a95c..ee5cffb 100644
14
14
  $(OBJ): arg.h config.h config.mk drw.h
15
15
 
16
16
  diff --git a/config.def.h b/config.def.h
17
- index 1edb647..c6d081f 100644
17
+ index 1edb647..1920110 100644
18
18
  --- a/config.def.h
19
19
  +++ b/config.def.h
20
- @@ -21,3 +21,6 @@ static unsigned int lines = 0;
20
+ @@ -21,3 +21,7 @@ static unsigned int lines = 0;
21
21
  * for example: " /?\"&[]"
22
22
  */
23
23
  static const char worddelimiters[] = " ";
24
24
  +
25
25
  +/* -selhook option; run a command on every selection */
26
26
  +static const char *selection_hook = NULL;
27
+ +static int selection_hook_return_key_focus_only = 0;
27
28
  diff --git a/dmenu.c b/dmenu.c
28
- index 65f25ce..69254ee 100644
29
+ index 65f25ce..274668a 100644
29
30
  --- a/dmenu.c
30
31
  +++ b/dmenu.c
31
32
  @@ -304,6 +304,62 @@ movewordedge(int dir)
@@ -99,29 +100,29 @@ index 65f25ce..69254ee 100644
99
100
  puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
100
101
  if (!(ev->state & ControlMask)) {
101
102
  cleanup();
102
- @@ -572,6 +629,7 @@ run(void)
103
+ @@ -572,6 +629,8 @@ run(void)
103
104
  break;
104
105
  case KeyPress:
105
106
  keypress(&ev.xkey);
106
- + selhook(selection_hook, sel);
107
+ + if (!selection_hook_return_key_focus_only)
108
+ + selhook(selection_hook, sel);
107
109
  break;
108
110
  case SelectionNotify:
109
111
  if (ev.xselection.property == utf8)
110
- @@ -690,7 +748,8 @@ static void
111
- usage(void)
112
- {
113
- fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
114
- - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
115
- + " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n"
116
- + " [-selhook cmd]\n", stderr);
117
- exit(1);
118
- }
119
-
120
- @@ -733,6 +792,8 @@ main(int argc, char *argv[])
112
+ @@ -712,6 +771,8 @@ main(int argc, char *argv[])
113
+ else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
114
+ fstrncmp = strncasecmp;
115
+ fstrstr = cistrstr;
116
+ + } else if (!strcmp(argv[i], "-selhook-return-key-focus-only")) {
117
+ + selection_hook_return_key_focus_only = 1;
118
+ } else if (i + 1 == argc)
119
+ usage();
120
+ /* these options take one argument */
121
+ @@ -733,6 +794,8 @@ main(int argc, char *argv[])
121
122
  colors[SchemeSel][ColFg] = argv[++i];
122
123
  else if (!strcmp(argv[i], "-w")) /* embedding window id */
123
124
  embed = argv[++i];
124
- + else if(!strcmp(argv[i], "-selhook")) /* a command to run */
125
+ + else if (!strcmp(argv[i], "-selhook")) /* a command to run */
125
126
  + selection_hook = argv[++i];
126
127
  else
127
128
  usage();
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fvwm-window-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Gromnitsky
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2020-07-18 00:00:00.000000000 Z
11
+ date: 2020-07-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Search for windows interactively using a patched dmenu utility.