Skip to content

Commit

Permalink
feat: add Vivaldi support (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
normful committed Mar 11, 2022
1 parent 3944f8d commit c4a766d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ Supported browsers on the respective OS:
<td align=center>☑️</td>
<td align=center>☑️</td>
</tr>
<tr>
<td>Vivaldi</td>
<td align=center>☑️</td>
<td align=center>☑️</td>
<td align=center>☑️</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -133,7 +139,7 @@ Extension options:
require('telescope').setup {
extensions = {
bookmarks = {
-- Available: 'brave', 'buku', 'chrome', 'chrome_beta', 'edge', 'safari', 'firefox'
-- Available: 'brave', 'buku', 'chrome', 'chrome_beta', 'edge', 'safari', 'firefox', 'vivaldi'
selected_browser = 'brave',

-- Either provide a shell command to open the URL
Expand Down
1 change: 1 addition & 0 deletions lua/telescope/_extensions/bookmarks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ local title = {
edge = "Edge",
firefox = "Firefox",
safari = "Safari",
vivaldi = "Vivaldi",
}

---Set the configuration state.
Expand Down
21 changes: 21 additions & 0 deletions lua/telescope/_extensions/bookmarks/chrome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ local bookmarks_filepath = {
"Default",
"Bookmarks",
},
vivaldi = {
"Library",
"Application Support",
"Vivaldi",
"Default",
"Bookmarks",
},
},
Linux = {
brave = {
Expand Down Expand Up @@ -67,6 +74,12 @@ local bookmarks_filepath = {
"Default",
"Bookmarks",
},
vivaldi = {
".config",
"vivaldi",
"Default",
"Bookmarks",
},
},
Windows_NT = {
brave = {
Expand Down Expand Up @@ -105,6 +118,14 @@ local bookmarks_filepath = {
"Default",
"Bookmarks",
},
vivaldi = {
"AppData",
"Local",
"Vivaldi",
"User Data",
"Default",
"Bookmarks",
},
},
}

Expand Down
13 changes: 13 additions & 0 deletions lua/telescope/_extensions/bookmarks/vivaldi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local chrome = require "telescope._extensions.bookmarks.chrome"

local vivaldi = {}

---Collect all the bookmarks for the Vivaldi browser.
---NOTE: Vivaldi and Google Chrome uses the same underlying format to store bookmarks.
---@param state ConfigState
---@return Bookmark[]|nil
function vivaldi.collect_bookmarks(state)
return chrome.collect_bookmarks(state)
end

return vivaldi

0 comments on commit c4a766d

Please sign in to comment.