juxt 1.2.0__tar.gz → 1.4.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: juxt
3
- Version: 1.2.0
3
+ Version: 1.4.0
4
4
  Summary: Fast desktop tool for navigating N-dimensional hypercubes of plots
5
5
  Project-URL: Homepage, https://github.com/ColinMoldenhauer/juxt
6
6
  Project-URL: Documentation, https://juxt.readthedocs.io
@@ -66,13 +66,30 @@ pip install juxt[ssh]
66
66
  ```bash
67
67
  juxt /path/to/plots/ # auto-detect axes from a directory of images
68
68
  juxt "plots/{sensor}_{date}.png" # explicit local template
69
+ juxt "plots/*.png" # wildcard match, recursing into subdirs
69
70
  juxt myhost:/path/to/plots/ # remote directory over SSH
70
71
  juxt "myhost:/path/{sensor}_{date}.png" # remote template over SSH
71
72
  juxt config.yaml # explicit config file
72
73
  ```
73
74
 
75
+ A `*` in the path is matched recursively (unlike a shell glob, it reaches into nested subdirectories), and the matched files are split into axes the same way directory auto-detection is. Combine it with `--NAME VALUE ...` to pin a `{placeholder}` to a fixed set of directories and aggregate congruent files found under each:
76
+
77
+ ```bash
78
+ juxt "{root}/*.png" --root run1 run2 # pool plots/*.png-style files found under run1/ and run2/
79
+ ```
80
+
81
+ If you'd rather have one *named* axis for an arbitrarily deep (and possibly differently-shaped) subtree, instead of it being auto-split into several anonymous axes, write `{**name}` in place of a regular placeholder. It captures across `/`, and any leading path segments shared by every match are pruned out of the axis value and folded into the template as fixed text, so `dir/AM/plot.png` and `dir/PM/plot.png` become axis values `AM/plot` and `PM/plot` rather than the full `dir/AM/plot`:
82
+
83
+ ```bash
84
+ juxt "{root}/{**plot}.png" --root run1 run2 # one 'plot' axis per run, however deep it's nested
85
+ ```
86
+
87
+ `{**name}` is limited to one per template (two independent `/`-crossing captures in one path would be ambiguous), and pass `--full-path` to see the whole matched path instead of the pruned suffix.
88
+
74
89
  For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
75
90
 
91
+ Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
92
+
76
93
  ## Config
77
94
 
78
95
  ### Auto-discover mode
@@ -142,6 +159,7 @@ Default mode is **tap**. Each axis is assigned one letter key — tap it to step
142
159
  | lowercase letter | navigate +1 on that axis |
143
160
  | uppercase letter | navigate −1 on that axis |
144
161
  | `Ctrl`+letter | open value picker for that axis |
162
+ | | (`modifiers.swap: true` exchanges the `Ctrl` and `Shift` roles) |
145
163
  | `Space` | toggle between current and previous position |
146
164
  | `Home` / `End` | jump to first / last value |
147
165
  | `1`–`9` | jump to the Nth value |
@@ -152,16 +170,48 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
152
170
 
153
171
  Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
154
172
 
173
+ Matching is fuzzy: the characters you type only have to appear in order, so `:fh` reaches `fit-height` and `smp` finds `SMAP` in the value picker. Candidates are ranked best-first, prefix matches ahead of looser ones. Set `seek.fuzzy: false` in `~/.juxt/settings.yaml` for strict prefix matching.
174
+
175
+ Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
176
+
177
+ ## Shell completion
178
+
179
+ The same completion works at the shell prompt. Add one line to `~/.bashrc`:
180
+
181
+ ```bash
182
+ eval "$(juxt --bash-completion)"
183
+ ```
184
+
185
+ zsh needs `bashcompinit` first:
186
+
187
+ ```zsh
188
+ autoload -U bashcompinit && bashcompinit
189
+ eval "$(juxt --bash-completion)"
190
+ ```
191
+
192
+ Then `juxt plots/{sensor}/2⇥` completes at the prompt, as do the command-line options. ble.sh is handled as well, through its own hook. Reload the shell (`source ~/.bashrc`, or open a new terminal) for it to take effect.
193
+
194
+ Point `JUXT_COMPLETE` at `juxt-complete` if juxt lives in a virtualenv you do not activate:
195
+
196
+ ```bash
197
+ export JUXT_COMPLETE=~/env/juxt/bin/juxt-complete
198
+ ```
199
+
200
+ Placeholders standing for a known kind of value complete only as far as that value: `plots/{date}⇥` stops at `plots/{date}_` rather than swallowing the rest of the filename. The names that count are the ones listed under `placeholders:` in `~/.juxt/settings.yaml`, which juxt seeds with `date datetime time year month day doy` — edit or delete them, and completion follows. Date-style shorthands such as `{yyyy-mm-dd}` are recognised on sight, with or without an entry.
201
+
155
202
  | Command | Action |
156
203
  |---|---|
157
204
  | `:q` | quit |
158
205
  | `:fit` | fit image to window |
159
206
  | `:fit height` / `:fit width` | fit to height or width |
207
+ | `:fit-off` | stop fitting, keep the current zoom |
160
208
  | `:zoom N` | set zoom to N% |
161
209
  | `:fullscreen` | toggle fullscreen |
162
210
  | `:mode tap\|seek\|pin` | switch navigation mode |
163
211
  | `:grid [AXIS]` | tile an axis into a grid of viewports |
164
212
  | `:grid AXIS VAL …` | grid with a value subset |
213
+ | `:keys` | toggle the shortcut sidebar (`Ctrl+Shift+K`) |
214
+ | `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
165
215
  | `:grid-layout NxM` | change grid layout without exiting |
166
216
  | `:ungrid` | return to single-image view |
167
217
  | `:grid-sharex` / `:grid-sharey` | toggle synchronized pan/zoom |
@@ -182,4 +232,10 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
182
232
  | Key | Action |
183
233
  |---|---|
184
234
  | `Enter` | toggle fullscreen |
185
- | `Ctrl+H` | toggle status bar |
235
+ | `Ctrl+Shift+C` | copy the current image path to the clipboard |
236
+ | right-click | menu: copy image path / copy image |
237
+ | `Ctrl+Shift+H` | toggle status bar (start hidden with `--no-status-bar`) |
238
+ | `Ctrl+Shift+I` | toggle info sidebar (start open with `--info`) |
239
+ | `Ctrl+Shift+K` | toggle shortcut sidebar (start open with `--keys`) |
240
+ | `Ctrl+C` | copy the text selected in a sidebar (otherwise cancels a command / value picker) |
241
+ | `Ctrl+Shift+G` | open the grid builder dialogue |
@@ -33,13 +33,30 @@ pip install juxt[ssh]
33
33
  ```bash
34
34
  juxt /path/to/plots/ # auto-detect axes from a directory of images
35
35
  juxt "plots/{sensor}_{date}.png" # explicit local template
36
+ juxt "plots/*.png" # wildcard match, recursing into subdirs
36
37
  juxt myhost:/path/to/plots/ # remote directory over SSH
37
38
  juxt "myhost:/path/{sensor}_{date}.png" # remote template over SSH
38
39
  juxt config.yaml # explicit config file
39
40
  ```
40
41
 
42
+ A `*` in the path is matched recursively (unlike a shell glob, it reaches into nested subdirectories), and the matched files are split into axes the same way directory auto-detection is. Combine it with `--NAME VALUE ...` to pin a `{placeholder}` to a fixed set of directories and aggregate congruent files found under each:
43
+
44
+ ```bash
45
+ juxt "{root}/*.png" --root run1 run2 # pool plots/*.png-style files found under run1/ and run2/
46
+ ```
47
+
48
+ If you'd rather have one *named* axis for an arbitrarily deep (and possibly differently-shaped) subtree, instead of it being auto-split into several anonymous axes, write `{**name}` in place of a regular placeholder. It captures across `/`, and any leading path segments shared by every match are pruned out of the axis value and folded into the template as fixed text, so `dir/AM/plot.png` and `dir/PM/plot.png` become axis values `AM/plot` and `PM/plot` rather than the full `dir/AM/plot`:
49
+
50
+ ```bash
51
+ juxt "{root}/{**plot}.png" --root run1 run2 # one 'plot' axis per run, however deep it's nested
52
+ ```
53
+
54
+ `{**name}` is limited to one per template (two independent `/`-crossing captures in one path would be ambiguous), and pass `--full-path` to see the whole matched path instead of the pruned suffix.
55
+
41
56
  For directory and remote-directory modes, filenames are split on separators (`_` and `/` by default) and any position with more than one distinct value becomes an axis. You'll be prompted to name the axes on first run; use `-a` to skip.
42
57
 
58
+ Run `juxt` with no argument and it opens a dialog instead: a **Browse** tab for picking a directory (auto-discover), and a **Build path** tab for typing a `{placeholder}` template by hand, with `Tab` completing real directories and files along the way.
59
+
43
60
  ## Config
44
61
 
45
62
  ### Auto-discover mode
@@ -109,6 +126,7 @@ Default mode is **tap**. Each axis is assigned one letter key — tap it to step
109
126
  | lowercase letter | navigate +1 on that axis |
110
127
  | uppercase letter | navigate −1 on that axis |
111
128
  | `Ctrl`+letter | open value picker for that axis |
129
+ | | (`modifiers.swap: true` exchanges the `Ctrl` and `Shift` roles) |
112
130
  | `Space` | toggle between current and previous position |
113
131
  | `Home` / `End` | jump to first / last value |
114
132
  | `1`–`9` | jump to the Nth value |
@@ -119,16 +137,48 @@ Use `:mode tap|seek|pin` in the command bar to switch navigation modes.
119
137
 
120
138
  Press `:` to open the command bar (vim-style). Tab-completion narrows candidates as you type.
121
139
 
140
+ Matching is fuzzy: the characters you type only have to appear in order, so `:fh` reaches `fit-height` and `smp` finds `SMAP` in the value picker. Candidates are ranked best-first, prefix matches ahead of looser ones. Set `seek.fuzzy: false` in `~/.juxt/settings.yaml` for strict prefix matching.
141
+
142
+ Path arguments complete with `{placeholders}` in place: `:pattern plots/{sensor}/2⇥` lists what every sensor directory holds, so a template is built top-down instead of completing a concrete path and deleting the parts that should vary. `{` + `Tab` completes an existing axis name, and anonymous `{}` placeholders are numbered automatically.
143
+
144
+ ## Shell completion
145
+
146
+ The same completion works at the shell prompt. Add one line to `~/.bashrc`:
147
+
148
+ ```bash
149
+ eval "$(juxt --bash-completion)"
150
+ ```
151
+
152
+ zsh needs `bashcompinit` first:
153
+
154
+ ```zsh
155
+ autoload -U bashcompinit && bashcompinit
156
+ eval "$(juxt --bash-completion)"
157
+ ```
158
+
159
+ Then `juxt plots/{sensor}/2⇥` completes at the prompt, as do the command-line options. ble.sh is handled as well, through its own hook. Reload the shell (`source ~/.bashrc`, or open a new terminal) for it to take effect.
160
+
161
+ Point `JUXT_COMPLETE` at `juxt-complete` if juxt lives in a virtualenv you do not activate:
162
+
163
+ ```bash
164
+ export JUXT_COMPLETE=~/env/juxt/bin/juxt-complete
165
+ ```
166
+
167
+ Placeholders standing for a known kind of value complete only as far as that value: `plots/{date}⇥` stops at `plots/{date}_` rather than swallowing the rest of the filename. The names that count are the ones listed under `placeholders:` in `~/.juxt/settings.yaml`, which juxt seeds with `date datetime time year month day doy` — edit or delete them, and completion follows. Date-style shorthands such as `{yyyy-mm-dd}` are recognised on sight, with or without an entry.
168
+
122
169
  | Command | Action |
123
170
  |---|---|
124
171
  | `:q` | quit |
125
172
  | `:fit` | fit image to window |
126
173
  | `:fit height` / `:fit width` | fit to height or width |
174
+ | `:fit-off` | stop fitting, keep the current zoom |
127
175
  | `:zoom N` | set zoom to N% |
128
176
  | `:fullscreen` | toggle fullscreen |
129
177
  | `:mode tap\|seek\|pin` | switch navigation mode |
130
178
  | `:grid [AXIS]` | tile an axis into a grid of viewports |
131
179
  | `:grid AXIS VAL …` | grid with a value subset |
180
+ | `:keys` | toggle the shortcut sidebar (`Ctrl+Shift+K`) |
181
+ | `:grid-dialog` | open the grid builder dialogue (`Ctrl+Shift+G`) |
132
182
  | `:grid-layout NxM` | change grid layout without exiting |
133
183
  | `:ungrid` | return to single-image view |
134
184
  | `:grid-sharex` / `:grid-sharey` | toggle synchronized pan/zoom |
@@ -149,4 +199,10 @@ Press `:` to open the command bar (vim-style). Tab-completion narrows candidates
149
199
  | Key | Action |
150
200
  |---|---|
151
201
  | `Enter` | toggle fullscreen |
152
- | `Ctrl+H` | toggle status bar |
202
+ | `Ctrl+Shift+C` | copy the current image path to the clipboard |
203
+ | right-click | menu: copy image path / copy image |
204
+ | `Ctrl+Shift+H` | toggle status bar (start hidden with `--no-status-bar`) |
205
+ | `Ctrl+Shift+I` | toggle info sidebar (start open with `--info`) |
206
+ | `Ctrl+Shift+K` | toggle shortcut sidebar (start open with `--keys`) |
207
+ | `Ctrl+C` | copy the text selected in a sidebar (otherwise cancels a command / value picker) |
208
+ | `Ctrl+Shift+G` | open the grid builder dialogue |
@@ -7,10 +7,23 @@ import socket
7
7
  import sys
8
8
  from pathlib import Path
9
9
 
10
- from PySide6.QtCore import Qt, QSocketNotifier, QTimer
11
- from PySide6.QtGui import QCursor, QIcon
12
- from PySide6.QtWidgets import QApplication, QFileDialog, QInputDialog, QLineEdit, QProgressDialog
13
-
10
+ from .complete import SCRIPT_FLAGS, WORDS_FLAG, normalize_template
11
+ from .complete import main as _complete_main
12
+
13
+ # Shell completion runs on every Tab press, so answer it here — before Qt is
14
+ # imported — which also lets `juxt` itself back the completion when the
15
+ # standalone binary is all a user has installed.
16
+ if len(sys.argv) > 1 and sys.argv[1] in (*SCRIPT_FLAGS, WORDS_FLAG):
17
+ sys.exit(_complete_main(sys.argv[1:]))
18
+
19
+ from PySide6.QtCore import Qt, QSocketNotifier, QTimer # noqa: E402
20
+ from PySide6.QtGui import QCursor, QIcon # noqa: E402
21
+ from PySide6.QtWidgets import ( # noqa: E402
22
+ QApplication,
23
+ QInputDialog,
24
+ QLineEdit,
25
+ QProgressDialog,
26
+ )
14
27
  from .config import Config, _auto_keys, dump_config, load_config
15
28
  from .detect import (
16
29
  _axes_from_local_template,
@@ -20,10 +33,13 @@ from .detect import (
20
33
  _parse_remote_pattern,
21
34
  detect_config,
22
35
  detect_config_remote,
36
+ has_bare_wildcard,
23
37
  prompt_rename,
38
+ resolve_wildcard_template,
24
39
  )
25
40
  from .loader import preload, preload_remote
26
41
  from .settings import load_settings
42
+ from .startup import StartupDialog
27
43
  from .viewer import MainWindow
28
44
 
29
45
  log = logging.getLogger(__name__)
@@ -97,11 +113,42 @@ def _print_help() -> None:
97
113
  "",
98
114
  "keys (all modes)",
99
115
  None, # horizontal rule
100
- "↑ ↓ ← → navigate axes",
101
- "Space toggle between two positions",
102
- "1–9 jump to Nth value on active axis",
103
- ": command mode (:fit :zoom N :q)",
104
- "Ctrl+H toggle status bar",
116
+ "↑ ↓ ← → navigate axes",
117
+ "Space toggle between two positions",
118
+ "Home / End first / last value on active axis",
119
+ "1–9 jump to Nth value on active axis",
120
+ "Enter toggle fullscreen",
121
+ "Escape exit fullscreen / cancel",
122
+ ": command mode (:fit :zoom N :q)",
123
+ "Ctrl+C copy sidebar selection, else cancel command / picker",
124
+ "Ctrl+Shift+H toggle status bar",
125
+ "Ctrl+Shift+I toggle info sidebar",
126
+ "Ctrl+Shift+G open the grid builder",
127
+ "Ctrl+Shift+C copy current image path",
128
+ "Ctrl+Shift+K toggle shortcut sidebar",
129
+ "",
130
+ "view controls",
131
+ None, # horizontal rule
132
+ "0 reset zoom to 100%",
133
+ "double-click fit image to window",
134
+ "drag pan the image",
135
+ "right-click copy path / image menu",
136
+ "wheel step the ←/→ axis",
137
+ "Shift+wheel step the ↑/↓ axis",
138
+ "Ctrl+wheel zoom under the cursor",
139
+ "",
140
+ "mode keys",
141
+ None, # horizontal rule
142
+ "tap letter +1 on that axis (Letter = −1)",
143
+ " Ctrl+letter open value picker",
144
+ "seek letter incremental axis → value search",
145
+ "pin letter focus axis, then use arrows",
146
+ " Ctrl+letter open value picker",
147
+ "",
148
+ "Key bindings are configurable in",
149
+ "~/.juxt/settings.yaml (also via :settings);",
150
+ "modifiers.swap there exchanges the Ctrl",
151
+ "and Shift roles on axis letter keys.",
105
152
  "",
106
153
  ]
107
154
  pad = 2
@@ -123,34 +170,98 @@ def _print_help() -> None:
123
170
  PATH accepts several forms (auto-detected):
124
171
  /path/to/dir scan directory, detect axes from filenames
125
172
  plots/{sensor}_{date}.png local template with explicit placeholders
173
+ plots/{}/{}.png anonymous placeholders, named axis_1, axis_2, …
174
+ plots/*.png wildcard match, recursing into subdirs
175
+ {root}/*.png --root A B pin {root} then wildcard-match within each
176
+ {root}/{**plot}.png {**name} captures across '/', for one axis
177
+ spanning an arbitrarily deep subtree
126
178
  host:/path/to/dir remote directory over SSH (requires juxt[ssh])
127
179
  host:/path/{sensor}.png remote template over SSH (requires juxt[ssh])
128
180
  config.yaml explicit YAML config file
129
- (default: opens a directory picker)
181
+ (default: opens a dialog to browse a directory or build a template)
130
182
 
131
183
  -s, --separator SEP [...] separator(s) for auto-detection
132
184
  -a, --auto skip axis naming prompt
133
185
  --max-depth N max subdirectory search depth
134
186
  --save PATH save resolved config to PATH after detection
187
+ --NAME VALUE [...] pin a {placeholder}'s values instead of
188
+ globbing for them (template/wildcard PATH
189
+ only, must come after PATH); repeatable per
190
+ placeholder; required for every {placeholder}
191
+ before a '*' wildcard
192
+ --full-path show a {**name} axis as the full path matched
193
+ instead of pruning the part shared by every
194
+ match (see {root}/{**plot}.png above)
135
195
  --no-watch disable automatic file watching (local only)
136
196
  --watch-interval SEC poll remote for changes every SEC seconds (default: 5, 0 to disable)
137
197
  --axis-h NAME lock ←/→ to this axis on startup
138
198
  --axis-v NAME lock ↑/↓ to this axis on startup
139
199
  --squeeze drop axes with only one value
140
- --name NAME session name shown in window title (default: template basename)
200
+ --name NAME session name shown in window title (default: the template path
201
+ and any pinned values)
202
+
203
+ panels (toggled at runtime with Ctrl+Shift+I / Ctrl+Shift+H / Ctrl+Shift+K)
204
+ --info start with the info sidebar open (default: closed)
205
+ --no-info start with the info sidebar closed
206
+ --status-bar start with the status bar shown (default: shown)
207
+ --no-status-bar start with the status bar hidden
208
+ --keys start with the shortcut sidebar open (default: closed)
209
+ --no-keys start with the shortcut sidebar closed
141
210
 
142
211
  grid view
143
212
  --grid AXIS enter grid view for AXIS on startup
213
+ (or build one in the UI with Ctrl+Shift+G)
144
214
  --grid-values VAL ... show only these values in the grid (requires --grid)
145
215
  --grid-layout NxM explicit grid layout, e.g. 2x3 (requires --grid)
146
216
  --no-sharex disable synchronized horizontal pan/zoom in grid view
147
217
  --no-sharey disable synchronized vertical pan/zoom in grid view
148
218
  -h, --help show this message and exit
149
219
 
150
- navigation modes (switch with :mode)
151
- tap letter=+1/LETTER=-1 on that axis (default)
152
- seek type to search axes and values by prefix
153
- pin letter focuses axis; arrows navigate""")
220
+ shell completion (bash / zsh)
221
+ eval "$(juxt --bash-completion)" complete options and {placeholder} paths
222
+
223
+ commands (press : in the viewer, Tab completes)
224
+ :fit :fit-width :fit-height :fit-off :zoom N :fullscreen
225
+ :grid AXIS [VALUES|NxM] :grid-dialog :grid-layout NxM :ungrid
226
+ :grid-sharex on|off :grid-sharey on|off
227
+ :axis-h NAME :axis-v NAME :axis-auto :swap-axes
228
+ :mode tap|seek|pin :switch-last :info :keys
229
+ :pattern PATH :reload :watch true|false
230
+ :remove-axis NAME :remove-value AXIS VALUE
231
+ :change-key AXIS LETTER :settings
232
+ :copy-image :copy-path :write [PATH] :quit""")
233
+
234
+
235
+ def _parse_axis_pins(unknown: list[str]) -> dict[str, list[str]]:
236
+ """Turn leftover argv (`['--sensor', 'A', 'B', '--date', 'X']`) into
237
+ `{'sensor': ['A', 'B'], 'date': ['X']}`.
238
+
239
+ Axis names are taken verbatim, unlike a generic flag-to-kwarg grabber,
240
+ since a {placeholder} name may itself contain hyphens (e.g. {yyyy-mm-dd}).
241
+ Must appear after PATH on the command line — argparse would otherwise
242
+ swallow a pinned value as PATH before it ever sees the real one.
243
+ """
244
+ pins: dict[str, list[str]] = {}
245
+ current: str | None = None
246
+ for arg in unknown:
247
+ if arg.startswith("--"):
248
+ current = arg[2:]
249
+ if not current:
250
+ raise SystemExit(f"Unexpected argument {arg!r}")
251
+ if current in pins:
252
+ raise SystemExit(f"Duplicate axis flag: --{current}")
253
+ pins[current] = []
254
+ else:
255
+ if current is None:
256
+ raise SystemExit(
257
+ f"Unrecognized argument {arg!r}. To pin a {{placeholder}}'s "
258
+ f"values, use '--NAME VALUE ...' after PATH."
259
+ )
260
+ pins[current].append(arg)
261
+ for name, values in pins.items():
262
+ if not values:
263
+ raise SystemExit(f"--{name} was given no values to pin.")
264
+ return pins
154
265
 
155
266
 
156
267
  class _HelpAction(argparse.Action):
@@ -164,7 +275,7 @@ class _HelpAction(argparse.Action):
164
275
  parser.exit()
165
276
 
166
277
 
167
- def _parse_args() -> argparse.Namespace:
278
+ def _parse_args() -> tuple[argparse.Namespace, dict[str, list[str]]]:
168
279
  p = argparse.ArgumentParser(prog="juxt", add_help=False)
169
280
  p.add_argument("path", nargs="?", default=None, metavar="PATH")
170
281
  p.add_argument("-s", "--separator", metavar="SEP", nargs="+")
@@ -177,6 +288,16 @@ def _parse_args() -> argparse.Namespace:
177
288
  p.add_argument("--axis-v", metavar="NAME", default=None)
178
289
  p.add_argument("--squeeze", action="store_true", default=False)
179
290
  p.add_argument("--name", metavar="NAME", default=None)
291
+ p.add_argument("--full-path", action="store_true", default=False)
292
+ # Initial panel visibility; both are still toggleable at runtime.
293
+ # These are declared here so parse_known_args recognises them; an
294
+ # unrecognised --flag after PATH is read as an axis pin instead.
295
+ p.add_argument("--info", dest="info", action="store_true", default=False)
296
+ p.add_argument("--no-info", dest="info", action="store_false")
297
+ p.add_argument("--status-bar", dest="status_bar", action="store_true", default=True)
298
+ p.add_argument("--no-status-bar", dest="status_bar", action="store_false")
299
+ p.add_argument("--keys", dest="keys", action="store_true", default=False)
300
+ p.add_argument("--no-keys", dest="keys", action="store_false")
180
301
 
181
302
  g = p.add_argument_group("grid view")
182
303
  g.add_argument("--grid", metavar="AXIS", default=None)
@@ -186,11 +307,16 @@ def _parse_args() -> argparse.Namespace:
186
307
  g.add_argument("--no-sharey", action="store_true", default=False)
187
308
 
188
309
  p.add_argument("-h", "--help", action=_HelpAction)
189
- return p.parse_args()
310
+
311
+ # Any flag not recognized above and appearing after PATH is treated as
312
+ # '--{placeholder} VALUE ...', pinning that template placeholder to an
313
+ # explicit value list instead of discovering it by globbing.
314
+ args, unknown = p.parse_known_args()
315
+ return args, _parse_axis_pins(unknown)
190
316
 
191
317
 
192
318
  def main():
193
- args = _parse_args()
319
+ args, pins = _parse_args()
194
320
  import os
195
321
  _setup_logging(
196
322
  os.environ.get("JUXT_LOG_LEVEL", "WARNING").upper(),
@@ -243,42 +369,55 @@ def main():
243
369
  return _pw_cache[0]
244
370
 
245
371
  if args.path is None:
246
- dlg = QFileDialog(None, "Select image directory", str(Path.home()))
247
- dlg.setFileMode(QFileDialog.FileMode.Directory)
248
- dlg.setOption(QFileDialog.Option.ShowDirsOnly, True)
249
- dlg.setOption(QFileDialog.Option.DontUseNativeDialog, True)
250
- if not app_icon.isNull():
251
- dlg.setWindowIcon(app_icon)
372
+ dlg = StartupDialog(str(Path.home()), app_icon=app_icon)
373
+ QTimer.singleShot(0, lambda: dlg.move(
374
+ _startup_screen.geometry().center() - dlg.rect().center()))
252
375
  QTimer.singleShot(0, lambda: _force_focus(dlg))
253
- chosen = dlg.selectedFiles()[0] if dlg.exec() else ""
376
+ chosen = dlg.chosen_path() if dlg.exec() else ""
254
377
  if not chosen:
255
378
  sys.exit(0)
256
379
  args.path = chosen
257
380
 
258
381
  try:
259
- raw = args.path
382
+ raw = normalize_template(args.path) # anonymous {} → {axis_1}, {axis_2}, …
260
383
  if _is_remote_pattern(raw):
261
384
  remote_cfg, remote_tmpl = _parse_remote_pattern(raw)
262
385
  if '{' in remote_tmpl:
263
- axes = _axes_from_remote_template(remote_tmpl, remote_cfg, _ask_password)
386
+ axes = _axes_from_remote_template(remote_tmpl, remote_cfg, _ask_password, pinned=pins)
264
387
  config = Config(template=remote_tmpl, axes=axes,
265
388
  keys=_auto_keys(axes), remote=remote_cfg)
266
389
  else:
390
+ if pins:
391
+ raise ValueError(
392
+ "--<axis> VALUE pinning requires a {placeholder} template, "
393
+ "not a plain remote directory"
394
+ )
267
395
  config, sep, n_remote = detect_config_remote(
268
396
  remote_tmpl, remote_cfg, args.separator, _ask_password)
269
397
  if not args.auto:
270
398
  config = prompt_rename(config, n_remote, sep)
271
399
  elif Path(raw).is_dir():
400
+ if pins:
401
+ raise ValueError(
402
+ "--<axis> VALUE pinning requires a {placeholder} template, not a directory"
403
+ )
272
404
  p = Path(raw)
273
405
  files = _iter_images(p, args.max_depth)
274
406
  config, sep = detect_config(p, args.separator, args.max_depth)
275
407
  if not args.auto:
276
408
  config = prompt_rename(config, len(files), sep, p, args.max_depth)
277
409
  elif raw.lower().endswith((".yaml", ".yml")):
410
+ if pins:
411
+ raise ValueError(
412
+ "--<axis> VALUE pinning requires a {placeholder} template, not a YAML config"
413
+ )
278
414
  config = load_config(raw)
415
+ elif has_bare_wildcard(raw):
416
+ template, axes = resolve_wildcard_template(raw, pinned=pins)
417
+ config = Config(template=template, axes=axes, keys=_auto_keys(axes))
279
418
  elif '{' in raw:
280
- axes = _axes_from_local_template(raw)
281
- config = Config(template=raw, axes=axes, keys=_auto_keys(axes))
419
+ template, axes = _axes_from_local_template(raw, pinned=pins, full_path=args.full_path)
420
+ config = Config(template=template, axes=axes, keys=_auto_keys(axes))
282
421
  else:
283
422
  print(
284
423
  f"Error: {raw!r} is not a directory, YAML config, "
@@ -394,6 +533,9 @@ def main():
394
533
  if not m:
395
534
  print(f"Warning: --grid-layout {args.grid_layout!r} is not a valid NxM layout, ignoring",
396
535
  file=sys.stderr)
536
+ elif int(m.group(1)) < 1 or int(m.group(2)) < 1:
537
+ print(f"Warning: --grid-layout {args.grid_layout!r} needs rows and cols >= 1, ignoring",
538
+ file=sys.stderr)
397
539
  else:
398
540
  grid_layout = (int(m.group(1)), int(m.group(2)))
399
541
 
@@ -416,13 +558,26 @@ def main():
416
558
  axis_h=args.axis_h,
417
559
  axis_v=args.axis_v,
418
560
  session_name=args.name,
561
+ pinned_axes=list(pins),
419
562
  seek_greedy=settings.seek_greedy,
563
+ seek_fuzzy=settings.seek_fuzzy,
564
+ swap_modifiers=settings.swap_modifiers,
565
+ skip_missing=settings.skip_missing,
566
+ dim_missing=settings.dim_missing,
567
+ sidebar_copy=settings.sidebar_copy,
420
568
  keybindings=settings.keybindings,
569
+ highlight=settings.highlight,
570
+ highlight_candidates=settings.highlight_candidates,
571
+ sidebar_separator=settings.sidebar_separator,
572
+ sidebar_list_larger_than=settings.sidebar_list_larger_than,
421
573
  grid=args.grid,
422
574
  grid_values=args.grid_values,
423
575
  grid_layout=grid_layout,
424
576
  grid_sharex=not args.no_sharex,
425
577
  grid_sharey=not args.no_sharey,
578
+ show_info=args.info,
579
+ show_status_bar=args.status_bar,
580
+ show_keys=args.keys,
426
581
  )
427
582
  window.move(_startup_screen.geometry().topLeft())
428
583
  window.showMaximized()
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.2.0'
22
- __version_tuple__ = version_tuple = (1, 2, 0)
21
+ __version__ = version = '1.4.0'
22
+ __version_tuple__ = version_tuple = (1, 4, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None