Skip to content

Open URI

banner

An URI item can not only be used to open a website but also to open any URI that your operating system can handle. This includes opening files, directories, or even other applications.

Example URIs

Here are some examples of URIs that you can use with the Open-URI item:

  • http://example.com - Opens the website example.com in your default browser.
  • file:///path/to/file.txt - Opens the file file.txt in your default text editor.
  • mailto:foo@bar.com - Opens your default email client to send an email.

Placeholders

You can use placeholders in the URI which will be replaced by some actual values when the URI is opened. This allows for some very advanced use-cases! Below are the available placeholders:

  • {{app_name}}: The name of the application which was focused when the menu was opened.
  • {{window_name}}: The title of the window which was focused when the menu was opened.
  • {{pointer_x}}: The x-coordinate of the mouse pointer when the menu was opened.
  • {{pointer_y}}: The y-coordinate of the mouse pointer when the menu was opened.

Example Configuration

If you happen to edit your menus.json file by hand, you can create an Open-URI item with something like the following. You can read more about the structure of the menus.json file in its documentation.

The data property of the menu item must contain a uri property which contains the URI to open.

menus.json
// ...
{
"name": "GitHub",
"type": "uri",
"icon": "github",
"iconTheme": "simple-icons",
"data": {
"uri": "https://github.com"
}
},
// ...