Modularize qutebrowser config for reuse
This commit is contained in:
		
							parent
							
								
									d053f9d145
								
							
						
					
					
						commit
						8d92f8c8f2
					
				
					 4 changed files with 84 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
import dracula.draw
 | 
			
		||||
import keybindings
 | 
			
		||||
 | 
			
		||||
config.load_autoconfig()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -24,34 +25,7 @@ c.url.searchengines = {'DEFAULT': 'bookmarks.serguzim/?q={}'}
 | 
			
		|||
 | 
			
		||||
c.zoom.default = 125
 | 
			
		||||
 | 
			
		||||
config.bind(',v', 'spawn --userscript view_in_mpv {url}')
 | 
			
		||||
config.bind(',V', 'hint links spawn --userscript view_in_mpv {hint-url}')
 | 
			
		||||
 | 
			
		||||
config.bind(',b', 'spawn brave {url}')
 | 
			
		||||
config.bind(',B', 'hint links spawn brave {hint-url}')
 | 
			
		||||
 | 
			
		||||
config.bind(',j',  'spawn --userscript format_json')
 | 
			
		||||
 | 
			
		||||
config.bind(',g', 'open {url:scheme}://github1s.com{url:path}{url:query}')
 | 
			
		||||
config.bind(',rr', 'open {url:scheme}://removeddit.com{url:path}{url:query}')
 | 
			
		||||
config.bind(',rt', 'open {url:scheme}://reddit.tube{url:path}{url:query}')
 | 
			
		||||
config.bind(',s', 'spawn steam steam://openurl/{url}')
 | 
			
		||||
 | 
			
		||||
PASS_SCRIPT_DEFAULT = 'spawn --userscript qute-pass --no-insert-mode --username-target secret --username-pattern "login: (.+)" '
 | 
			
		||||
config.bind(',p',  PASS_SCRIPT_DEFAULT)
 | 
			
		||||
config.bind(',Pu', PASS_SCRIPT_DEFAULT + '--username-only')
 | 
			
		||||
config.bind(',Pi', PASS_SCRIPT_DEFAULT + '--password-only')
 | 
			
		||||
config.bind(',Po', PASS_SCRIPT_DEFAULT + '--otp-only')
 | 
			
		||||
 | 
			
		||||
config.bind(',q', 'spawn --userscript qr {url}')
 | 
			
		||||
config.bind(',Q', 'hint links spawn --userscript qr {hint-url}')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
config.bind('<Alt-9>', 'tab-focus 9')
 | 
			
		||||
 | 
			
		||||
config.bind('<Ctrl-Tab>', 'tab-next')
 | 
			
		||||
config.bind('<Ctrl-Shift-Tab>', 'tab-prev')
 | 
			
		||||
 | 
			
		||||
keybindings.init(config)
 | 
			
		||||
 | 
			
		||||
dracula.draw.blood(c, {
 | 
			
		||||
    'spacing': {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
import keybindings
 | 
			
		||||
 | 
			
		||||
config.load_autoconfig(False)
 | 
			
		||||
 | 
			
		||||
c.tabs.show = 'never'
 | 
			
		||||
| 
						 | 
				
			
			@ -6,5 +8,4 @@ c.auto_save.session = False
 | 
			
		|||
 | 
			
		||||
c.url.start_pages = ['https://twitch.tv/']
 | 
			
		||||
 | 
			
		||||
config.bind('<Ctrl-Tab>', 'tab-next')
 | 
			
		||||
config.bind('<Ctrl-Shift-Tab>', 'tab-prev')
 | 
			
		||||
keybindings.init(config)
 | 
			
		||||
							
								
								
									
										27
									
								
								.config/qutebrowser/keybindings.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								.config/qutebrowser/keybindings.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
def init(c):
 | 
			
		||||
    c.bind(',v', 'spawn --userscript view_in_mpv {url}')
 | 
			
		||||
    c.bind(',V', 'hint links spawn --userscript view_in_mpv {hint-url}')
 | 
			
		||||
 | 
			
		||||
    c.bind(',b', 'spawn brave {url}')
 | 
			
		||||
    c.bind(',B', 'hint links spawn brave {hint-url}')
 | 
			
		||||
 | 
			
		||||
    c.bind(',j',  'spawn --userscript format_json')
 | 
			
		||||
 | 
			
		||||
    c.bind(',g', 'open {url:scheme}://github1s.com{url:path}{url:query}')
 | 
			
		||||
    c.bind(',rr', 'open {url:scheme}://removeddit.com{url:path}{url:query}')
 | 
			
		||||
    c.bind(',rt', 'open {url:scheme}://reddit.tube{url:path}{url:query}')
 | 
			
		||||
    c.bind(',s', 'spawn steam steam://openurl/{url}')
 | 
			
		||||
 | 
			
		||||
    pass_script_default = 'spawn --userscript qute-pass --no-insert-mode --username-target secret --username-pattern "login: (.+)" '
 | 
			
		||||
    c.bind(',p',  pass_script_default)
 | 
			
		||||
    c.bind(',Pu', pass_script_default + '--username-only')
 | 
			
		||||
    c.bind(',Pi', pass_script_default + '--password-only')
 | 
			
		||||
    c.bind(',Po', pass_script_default + '--otp-only')
 | 
			
		||||
 | 
			
		||||
    c.bind(',q', 'spawn --userscript qr {url}')
 | 
			
		||||
    c.bind(',Q', 'hint links spawn --userscript qr {hint-url}')
 | 
			
		||||
 | 
			
		||||
    c.bind('<Alt-9>', 'tab-focus 9')
 | 
			
		||||
 | 
			
		||||
    c.bind('<Ctrl-Tab>', 'tab-next')
 | 
			
		||||
    c.bind('<Ctrl-Shift-Tab>', 'tab-prev')
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue