Skip to content

Commit 269478e

Browse files
authoredJul 1, 2023
docs: Add "Using joshuto with qutebrowser" (kamiyaa#345)
1 parent 09bd69e commit 269478e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎docs/misc.md

+31
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,34 @@ Unlike ranger, it’s currently not possible to scroll the children-panel or a p
6969
with the mouse wheel.
7070

7171
Unlike ranger, Joshuto allows to set the cursor in the children-panel with a right click.
72+
73+
## Using joshuto with [qutebrowser](https://qutebrowser.org/)
74+
75+
In order to use joshuto as the file picker in qutebrowser, you need to first add a quit
76+
keybind that outputs the selected files. You can do this in `keymap.toml` like so:
77+
78+
79+
```toml
80+
[default_view]
81+
82+
keymap = [
83+
{ keys = ["o"], command = "quit --output-selected-files" },
84+
# other keybinds...
85+
]
86+
```
87+
88+
Next, you need to edit qutebrowser's `config.py` to open joshuto in your terminal of choice,
89+
then output the resulting directory, file, or files to a file named `{}`. Here's an example
90+
with [kitty](https://sw.kovidgoyal.net/kitty/index.html):
91+
92+
```python
93+
# Use joshuto as the file selector
94+
c.fileselect.handler = 'external'
95+
c.fileselect.folder.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
96+
c.fileselect.multiple_files.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
97+
c.fileselect.single_file.command = ['kitty', '-e', 'joshuto', '--output-file', '{}']
98+
```
99+
100+
Now when the file picker opens in qutebrowser, you should see joshuto in your terminal emulator
101+
of choice. Use the visual selector (default `V`) if you need to select multiple files and press
102+
the key you defined earlier to send the file or files you highlighted back to qutebrowser.

0 commit comments

Comments
 (0)
Please sign in to comment.