Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexherbo2/webextension-dmenu
Tab search, selection and beyond with a dmenu filter program
https://github.com/alexherbo2/webextension-dmenu
chrome dmenu firefox tab-search webextension
Last synced: about 2 months ago
JSON representation
Tab search, selection and beyond with a dmenu filter program
- Host: GitHub
- URL: https://github.com/alexherbo2/webextension-dmenu
- Owner: alexherbo2
- License: unlicense
- Created: 2019-10-03T16:54:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-21T17:45:52.000Z (over 1 year ago)
- Last Synced: 2024-05-21T04:25:01.519Z (8 months ago)
- Topics: chrome, dmenu, firefox, tab-search, webextension
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
Awesome Lists containing this project
README
# [dmenu] for [Chrome] and [Firefox] – [WebExtensions]
[dmenu]: https://tools.suckless.org/dmenu/
[Chrome]: https://google.com/chrome/
[Firefox]: https://mozilla.org/firefox/
[WebExtensions]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensionsTab search, selection and beyond with a dynamic menu program.
[![Thumbnail](https://img.youtube.com/vi_webp/tgrmss3u2aE/maxresdefault.webp)](https://youtube.com/playlist?list=PLdr-HcjEDx_nLeC2_aQwpTQrWZ1un1nAZ)
[![Button](https://www.iconfinder.com/icons/317714/download/png/16)](https://youtube.com/playlist?list=PLdr-HcjEDx_nLeC2_aQwpTQrWZ1un1nAZ)## Dependencies
- [jq]
[jq]: https://stedolan.github.io/jq/
###### Extensions
- [Shell]
[Shell]: https://github.com/alexherbo2/webextension-shell
## Installation
###### Chrome
``` sh
make chrome
```Open the _Extensions_ page by navigating to `chrome://extensions`, enable _Developer mode_ then _Load unpacked_ to select the extension directory: `target/chrome`.
###### Firefox
``` sh
make firefox
```- Open `about:config`, change `xpinstall.signatures.required` to `false`.
- Open `about:addons` ❯ _Extensions_, click _Install add-on from file_ and select the package file: `target/firefox/package.zip`.## Configuration
###### Chrome
Open `chrome://extensions/configureCommands` to configure the keyboard shortcuts.
###### Firefox
Open `about:addons` ❯ _Extensions_ and click _Manage extension shortcuts_ in the menu.
## Usage
- Press Control + q to tab search.
- Press Control + Q to bring a tab.
- Press Alt + q to open a bookmark.
- Press Alt + Q to search history.## Commands
###### `tab-search`
Tab search.
Default: Control + q.###### `bring-tab`
Bring tab.
Default: Control + Q.###### `open-bookmark`
Open bookmark.
Default: Alt + q.###### `search-history`
Search history.
Default: Alt + Q.## Options
###### `dmenu`
Pipe tabs through the given external filter program.
Default:``` json
{
"command": "dmenu",
"arguments": []
}
```**Example** – Run with [fzf] and [Alacritty]:
`~/.local/bin/dmenu`
``` sh
#!/bin/sh# A drop-in dmenu replacement using fzf with Alacritty.
# – fzf (https://github.com/junegunn/fzf)
# – Alacritty (https://github.com/alacritty/alacritty)# Create IO files
state=$(mktemp -d)
input=$state/input
output=$state/output
trap 'rm -Rf "$state"' EXIT# Get input
cat > "$input"# Run fzf with Alacritty
alacritty --class 'popup' --command sh -c 'fzf < "$1" > "$2"' -- "$input" "$output"# Write output
cat "$output"# Exit code
if test ! -s "$output"; then
exit 1
fi
```[fzf]: https://github.com/junegunn/fzf
[Alacritty]: https://github.com/alacritty/alacritty## Cross-extension messaging
``` javascript
// Environment variables
switch (true) {
case (typeof browser !== 'undefined'):
var PLATFORM = 'firefox'
var DMENU_EXTENSION_ID = '[email protected]'
break
case (typeof chrome !== 'undefined'):
var PLATFORM = 'chrome'
var DMENU_EXTENSION_ID = 'gonendiemfggilnopogmkafgadobkoeh'
break
}// Initialization
const dmenu = {}
dmenu.port = chrome.runtime.connect(DMENU_EXTENSION_ID)
dmenu.send = (command, ...arguments) => {
dmenu.port.postMessage({ command, arguments })
}// Usage
dmenu.send('tab-search')
```You can find some examples in [Krabby].
[Krabby]: https://krabby.netlify.app
See the [source](src) for a complete reference.