You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# purr
2
2
3
3
### Introduction
4
-
purr is a zsh CLI tool for viewing and searching through Android logcat output. It leverages [fzf](https://github.com/junegunn/fzf) to provide a simple yet powerful user interface, fuzzy-finding capabilities, and much more.
4
+
purr is a zsh CLI tool for viewing and searching through Android logcat output. It leverages [fzf](https://github.com/junegunn/fzf) to provide a simple yet powerful user interface, fuzzy-finding capabilities, and much more.
5
5
6
6
### Motivation
7
7
While Android Studio's logcat viewer is sufficient for most app development, it breaks down when exposed to situations such as terminal-only access or when multiple devices need to be accessed quickly. When performing development on the Android operating system itself, developers revert to using raw `adb logcat` in shell.
@@ -20,24 +20,27 @@ There's even a mode to search through `adb shell` results; no more grepping thro
`purr` currently functions on Ubuntu Linux and Mac on zsh. It will attempt to source an `fzf` version locally if possible, but requires version `0.40.0` or higher.
23
+
### Installation
24
+
1. Download the latest release version.
25
+
2. Place the script in your PATH.
26
+
3. If you need a copy program, also put the bundled osc52_copy program in your PATH.
26
27
27
-
If you do not have `fzf``0.40.0` or higher locally, `purr` will use bundled `fzf` versions for `linux_x86_64`, `darwin_arm64` or `darwin_amd64` if applicable. If you have a different operating system, you need to download a `0.40.0` or higher `fzf` binary manually.
28
+
### Compilation
29
+
1. Clone the repo
30
+
2. Run "make"
28
31
29
-
Support for Windows may be provided in future, but is not a current priority.
32
+
### Dependencies
30
33
31
-
### Installation
32
-
1. Clone the repo
33
-
2. Add the scripts directory to your path
34
-
3. Run using `purr`
34
+
`purr` currently functions on Ubuntu Linux and Mac on `zsh`, and requires a local install of `fzf` with version `0.40.0` or higher, `perl`, and `adb`.
35
35
36
+
Some `purr` commands require a program to copy to clipboard. `purr` will check automatically for installations of `pbcopy`, `xsel`, and `wl-copy`. If the `COPY_PROGRAM` variable is set, purr will attempt to use it. If you are unsure of which copy program to use, a version of OSC52 copy is bundled and can be used if it is added to your path (and your terminal supports OSC52).
36
37
37
-
`purr` comes with two bundled programs:
38
+
Support for Windows may be provided in future, but is not a current priority.
38
39
39
-
*`purr_osc52_copy` is a fallback to copy to the system clipboard through SSH and TMUX sessions.
40
-
*`purr_fzf` is a bundled version of fzf `0.40.0` used if a higher version of `fzf` cannot be found.
`purr` includes a simple tool to help select the device serial from `adb devices`, or can read from the `$ANDROID_SERIAL` environment variable if set. Otherwise, `purr` has six command-line parameters:
@@ -53,8 +56,7 @@ Any other command-line parameters will print the help dialog.
53
56
54
57
Note that both `-a` and `-f` are read without validation; there is no guarantee that setting either parameter will not break `purr`.
55
58
56
-
#### Binds
57
-
The following hotkeys can be used:
59
+
### Hotkeys
58
60
59
61
#### General
60
62
* Escape: Exits `purr`. Ctrl-c and other methods also work, but may take longer, and may not gracefully exit.
@@ -77,6 +79,8 @@ The following hotkeys can be used:
77
79
* Ctrl-s: Enables scroll lock. While in scroll lock mode, your cursor will remain bound to the selected item as long as it remains in the search filter.
78
80
* Ctrl-f: Shorthand for enabling scroll lock and clearing the query. This allows you to go to the surrounding context of a selected item. Scroll lock will end once you move your cursor.
79
81
* Ctrl-j: Changes search modes between Chronological (default) and Relevance. This may be useful for fuzzy queries.
82
+
83
+
#### Querry
80
84
* Ctrl-alt-s: Adds the selected tag to your query. If the tag already exists in your query, do nothing.
81
85
* Ctrl-alt-d: Adds the inverse of the selected tag to your query. If the tag already exists in your query, remove it instead. Note that the inverse of the selected tag may also match non-tag lines in your log output.
82
86
@@ -94,13 +98,14 @@ The following hotkeys can be used:
94
98
#### History
95
99
`purr` saves a query string to history once it has not been changed for more than 3.5 seconds. You can use the following hotkeys to access history:
96
100
101
+
* Ctrl-r: Show the full history menu.
97
102
* Alt-shift-up: Move to the next entry in history.
98
103
* Alt-shift-down: Move to the previous entry in history.
99
104
100
105
When scrolling through history with alt-shift-up or alt-shift-down, your position in the history will reset once a string has been in the query for 3.5 seconds.
101
106
102
107
#### Editor
103
-
When you select a single line and press Ctrl-V, `purr` will open the selected line and surrounding context in a text editor. You can specify the text editor through the `$EDITOR` or `$EDITOR_PURR` environment variables; if no text editor is specified, `purr` will use `vim`.
108
+
When you select a single line and press Ctrl-V, `purr` will open the selected line and surrounding context in a text editor. You can specify the text editor through the `$EDITOR` or `$EDITOR_PURR` environment variables; if no text editor is specified, `purr` will use `vim`.
104
109
105
110
Note that logcat uses ANSI color codes to display color, so an editor that supports these codes is recommended; for example, [AnsiEsc](https://www.vim.org/scripts/script.php?script_id=302) for `Vim`.
106
111
@@ -110,11 +115,6 @@ If multiple lines are selected, only those selected lines will be opened in the
0 commit comments