Skip to content

Instantly share code, notes, and snippets.

@cvan
Last active December 12, 2021 22:48
Show Gist options
  • Save cvan/829e57bd560d0cdacba55170d88e8aca to your computer and use it in GitHub Desktop.
Save cvan/829e57bd560d0cdacba55170d88e8aca to your computer and use it in GitHub Desktop.
a VSCode search-and-replace pattern to convert OneTab exported bookmarks to Linux xdg-open commands to open in browser tabs

Requirements

Steps

  1. Open browser with OneTab extension installed.

  2. Open OneTab manager (via context menu: right-click on a page, click OneTab > Display OneTab).

  3. In the top-right corner, tap on Export / Import URLs.

  4. Under Export URLs, select the expanded textarea field, and copy the lines you want.

    https://example.com/?test | Example Domain
    
  5. Create a new file in your text editor.

  6. Search and replace all with this pattern:

    Find
    ([^\s\|]+)( .*)?$

    Replace
    xdg-open "$1";

  7. Select and copy the output:

    xdg-open "https://example.com?test";
    
  8. To open the browser tabs, open a command-line terminal and paste these commands in the prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment