66 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
#import time
 | 
						|
#start_ts=time.time() 
 | 
						|
 | 
						|
import os
 | 
						|
env=os.environ
 | 
						|
 | 
						|
################# general ############
 | 
						|
config.load_autoconfig(False)
 | 
						|
c.tabs.tabs_are_windows = True
 | 
						|
c.tabs.show = 'never'
 | 
						|
######################################
 | 
						|
 | 
						|
############### keybinds ##############
 | 
						|
for mode in ['normal','insert','hint','passthrough','command','prompt','yesno','register']:
 | 
						|
  m = c.bindings.commands[mode]={}
 | 
						|
  d = c.bindings.default[mode]
 | 
						|
  
 | 
						|
  m['<Cut>'] = 'fake-key -g <Ctrl-x>'
 | 
						|
  m['<Copy>'] =	'fake-key -g <Ctrl-c>'
 | 
						|
  m['<Paste>'] = 'fake-key -g <Ctrl-v>'
 | 
						|
 | 
						|
  noremap=[
 | 
						|
    'n','h',	'N','H',	'<Ctrl-N>','<Ctrl-H>',
 | 
						|
    'e','j',	'E','J',	'<Ctrl-E>','<Ctrl-J>',
 | 
						|
    'i','k',	'I','K',	'<Ctrl-I>','<Ctrl-K>',
 | 
						|
    'o','l',	'O','L',	'<Ctrl-O>','<Ctrl-L>',
 | 
						|
 | 
						|
    'k','n',	'K','N',	'<Ctrl-K>','<Ctrl-N>',
 | 
						|
    'l','i',	'L','I',	'<Ctrl-L>','<Ctrl-I>',
 | 
						|
    'h','o',	'H','O',	'<Ctrl-H>','<Ctrl-O>',
 | 
						|
    'j','e',	'J','E',	'<Ctrl-J>','<Ctrl-E>',
 | 
						|
  ]
 | 
						|
  for i in range(0,len(noremap)-1,2):
 | 
						|
    cmd=d.get(noremap[i+1])
 | 
						|
    if(cmd):
 | 
						|
      m[noremap[i]]=cmd
 | 
						|
 | 
						|
c.bindings.key_mappings.update(dict(zip("ьЬыЫфФпПбБжЖлЛуУяЯаАрРсСтТгГмМнНеЕиИоОчЧцЦдДвВзЗкКхХ", "qQwWfFpPbBjJlLuUyYaArRsStTgGmMnNeEiIoOxXcCdDvVzZkKhH")))
 | 
						|
############################################
 | 
						|
 | 
						|
# styles
 | 
						|
#c.colors.webpage.preferred_color_scheme = 'dark'
 | 
						|
c.colors.webpage.darkmode.enabled = True
 | 
						|
c.colors.webpage.darkmode.threshold.background = 128
 | 
						|
c.colors.webpage.darkmode.threshold.foreground = 127
 | 
						|
c.colors.webpage.bg = '#'+env['QB_THEME_COLOR_BG']
 | 
						|
c.fonts.default_family = 'Roboto'
 | 
						|
c.fonts.default_size = '12pt'
 | 
						|
##########################################
 | 
						|
 | 
						|
# search engines
 | 
						|
c.url.searchengines = {
 | 
						|
  'DEFAULT':'https://google.com/search?hl=en&q={}',
 | 
						|
  '!d':		'https://lite.duckduckgo.com/lite?&q={}',
 | 
						|
  '!g':		'https://google.com/search?hl=en&q={}',
 | 
						|
  '!y':		'https://ya.ru/search/?text={}',
 | 
						|
}
 | 
						|
###########################################
 | 
						|
 | 
						|
# start page ############
 | 
						|
c.url.default_page = 'file:///home/'+env['USER']+'/.local/share/qutebrowser/start.html'
 | 
						|
c.url.start_pages = ['file:///home/'+env['USER']+'/.local/share/qutebrowser/start.html']
 | 
						|
########################################
 | 
						|
 | 
						|
#print(f"Execution time {time.time() - start_ts}") 
 |