diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-02 15:37:12 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:24:58 +0530 |
| commit | 8f974223f4318ed9a0d3035b4c11d0f5b015efec (patch) | |
| tree | 028782193fa5c3cfa20a32b83b8f22e948c3ed9d /init.lua | |
| parent | 398b1a4b398324311b6e0f15d2e4ede5ad8500ff (diff) | |
| download | null-browser-8f974223f4318ed9a0d3035b4c11d0f5b015efec.tar.gz null-browser-8f974223f4318ed9a0d3035b4c11d0f5b015efec.zip | |
Refactor dmenu to be instantiable + add luassert for assertions
Diffstat (limited to '')
| -rw-r--r-- | init.lua | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,6 +1,6 @@ print('hello starting up...') -local dmenu = require 'null-browser.extras.dmenu' +local Dmenu = require 'null-browser.extras.dmenu' local history = require 'null-browser.extras.history' local search_engines = require 'null-browser.extras.search-engines' @@ -14,16 +14,23 @@ history.attach_hooks() search_engines.urls['ld'] = 'https://lite.duckduckgo.com/?q={}' +local menu = Dmenu:new { + command = os.getenv('HOME') .. '/scripts/fzfmenu.sh', + prompt_arg = '--prompt', + query_arg = '-q', + args = { 'input', '--layout=default' }, +} + require 'null-browser.defaults.vi'.setup { - menu = dmenu, + menu = menu, history = history, transform_url_input = search_engines.transform_url_input, } --- web.set('permissions_persistance', 'never') +web.set('permissions_persistance', 'never') web.event.add_listener('PermissionRequested', { callback = function(event) - dmenu.select({ 'Allow', 'Deny' }, { prompt = 'Requesting permission for ' .. event.permission_type }, + menu:select({ 'Allow', 'Deny' }, { prompt = 'Requesting permission for ' .. event.permission_type }, function(err, choice) if err then return end if web.utils.string_trim(choice) == 'Allow' then |
