March 12th Update

This commit is contained in:
Augusto Gunsch 2022-03-12 14:49:08 -03:00
parent af39225ac2
commit 15bfd14bf7
9 changed files with 96 additions and 59 deletions

View File

@ -80,11 +80,13 @@ local background_processes = {
"flameshot",
"nm-applet",
"lxpolkit",
"unclutter"
"unclutter",
"autocutsel -d -s PRIMARY",
"autocutsel -d"
}
local reload_programs = {
"customkeys"
"customkeys",
}
-- Table of layouts to cover with awful.layout.inc, order matters.
@ -280,14 +282,14 @@ awful.screen.connect_for_each_screen(function(s)
with_icon = true,
mute_color = beautiful.bg_urgent
},
--battery_widget{
--enable_battery_warning = true
--},
--brightness_widget {
--type = 'icon_and_text',
--program = 'brightnessctl',
--percentage = false
--},
battery_widget{
enable_battery_warning = true
},
brightness_widget {
type = 'icon_and_text',
program = 'brightnessctl',
percentage = false
},
mytextclock,
s.mylayoutbox,
}

View File

@ -24,7 +24,7 @@ theme.fg_focus = "#ffffff"
theme.fg_urgent = "#ffffff"
theme.fg_minimize = "#ffffff"
theme.useless_gap = dpi(2)
--theme.useless_gap = dpi(2)
theme.border_width = dpi(0.5)
theme.border_normal = "#000000"
theme.border_focus = "#ffffff"

View File

@ -14,8 +14,8 @@ highlight feedlist "---.*---" magenta default
browser "qutebrowser %u"
macro f set browser "feh %u"
macro m set browser "mpv %u"
macro M set browser "mpv %u" ; open-in-browser ; set browser "qutebrowser %u"
macro m set browser "yt-dlp -q -o - '%u' | mpv -"
macro M set browser "yt-dlp -q -o - '%u' | mpv -" ; open-in-browser ; set browser "qutebrowser %u"
macro q set browser "qutebrowser %u"
macro d set browser "yt-dlp -f best -o '~/videos/%(title)s.%(ext)s' '%u'"
macro D set browser "yt-dlp -f best -o '~/videos/%(title)s.%(ext)s' '%u'" ; open-in-browser ; set browser "qutebrowser %u"

View File

@ -11,7 +11,6 @@ set mouse=a
colorscheme torte
set list
set listchars=tab:*·,lead,trail:~,extends:>,precedes:<
set noet
filetype indent off
hi Whitespace ctermfg=233
hi SignColumn ctermbg=233
@ -34,20 +33,36 @@ nnoremap <silent> <F7> <cmd>%!unexpand -t4<cr><cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F8> <cmd>TagbarToggle<CR>
nnoremap <silent> <C-n> <cmd>NERDTreeToggle<CR>
noremap - ddp
nnoremap _ ddkP
nnoremap <silent> <leader>ev <cmd>tabnew $MYVIMRC<cr>
nnoremap <silent> <leader>sv <cmd>source $MYVIMRC<cr>
nnoremap <C-s> :%s//gc<left><left><left>
nnoremap <silent> <C-w>t <cmd>tabnew<cr>
nnoremap dL 0D
nnoremap - ddp
nnoremap _ ddkP
" auto quote
vnoremap <leader>" <esc>a"<esc>`<i"<esc>`>
nnoremap H 0
nnoremap L $
augroup python
autocmd FileType python :iabbrev <buffer> frompdb from pdb import set_trace; set_trace()
augroup END
augroup nerdtree
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
augroup END
let g:airline_theme = "powerlineish"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline#extensions#nerdtree_statusline = 1
call plug#begin('~/.config/nvim/plugged')
Plug 'vim-airline/vim-airline'
@ -69,26 +84,13 @@ Plug 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim'
Plug 'preservim/tagbar'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-sleuth'
call plug#end()
augroup python
autocmd FileType python :iabbrev <buffer> frompdb from pdb import set_trace; set_trace()
augroup END
augroup nerdtree
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
augroup END
let g:airline_theme = "powerlineish"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline#extensions#nerdtree_statusline = 1
lua << EOF
--- nvim-compe
require'compe'.setup {

View File

@ -120,7 +120,7 @@ config.set('content.javascript.enabled', True, 'chrome://*/*')
config.set('content.javascript.enabled', True, 'qute://*/*')
# Editor
config.set('editor.command', [ 'st', '-e', 'nvim', '{file}' ]);
config.set('editor.command', [ 'alacritty', '-e', 'nvim', '{file}' ]);
# When/how to show the scrollbar.
# Type: String
@ -166,7 +166,17 @@ c.tabs.show = 'always'
# the search engine name to the search term, e.g. `:open google
# qutebrowser`.
# Type: Dict
c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?q={}', 'aw': 'https://wiki.archlinux.org/index.php?search={}', 'yt': 'https://yewtu.be/search?q={}', 'lb': 'https://lbry.tv/$/search?q={}', 'wp': 'https://en.wikipedia.org/w/index.php?search={}', 'bc': 'https://www.bitchute.com/search/?query={}', 'wiby': 'https://wiby.me/?q={}' }
c.url.searchengines = {
'DEFAULT': 'https://duckduckgo.com/?q={}',
'aur': 'https://aur.archlinux.org/packages?O=0&K={}',
'ddg': 'https://duckduckgo.com/?q={}',
'pypi': 'https://pypi.org/search/?q={}',
'aw': 'https://wiki.archlinux.org/index.php?search={}',
'yt': 'https://yewtu.be/search?q={}', 'lb': 'https://lbry.tv/$/search?q={}',
'wp': 'https://en.wikipedia.org/w/index.php?search={}',
'bc': 'https://www.bitchute.com/search/?query={}',
'wiby': 'https://wiby.me/?q={}',
}
# Background color for hints. Note that you can use a `rgba(...)` value
# for transparency.

View File

@ -34,6 +34,11 @@ alias venv="source venv/bin/activate"
# search functions
alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules"
# pipe yd-dlp to mpv
ytmpv() {
yt-dlp -q -o - "$1" | mpv -
}
goto() {
open="$(grepa "$@" | fzf --ansi -1)"
if [ ! -z "$open" ]; then
@ -47,5 +52,3 @@ goto() {
# NVM - Dynamic loading trick
alias nvm="unalias nvm && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; nvm"
alias node="unalias node && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; node"
source "$HOME/.swallow"

View File

@ -1,22 +0,0 @@
#!/bin/sh
MPV=/usr/bin/mpv
mpv() {
EXT=${*##*.}
case "$*" in
*--no-video*)
$MPV $*
;;
*)
case "$EXT" in
ogg|opus|mp3)
$MPV $*
;;
*)
swallow $MPV $*
;;
esac
;;
esac
}

View File

@ -18,6 +18,8 @@ bindkey -v
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[OA" history-beginning-search-backward-end
bindkey "^[OB" history-beginning-search-forward-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end

40
local/bin/dict-repl Executable file
View File

@ -0,0 +1,40 @@
#!/usr/bin/python3.9
from sys import argv, stderr
from subprocess import run
from os import system
import readline
PROMPT = 'dict> '
def print_databases(file=stderr):
proc = run(('dict', '-D'), encoding='utf-8', capture_output=True)
print(proc.stdout, file=file, end='')
if len(argv) != 2:
print('usage: %s <database>' % argv[0], file=stderr)
print_databases()
exit(1)
db = argv[1]
proc = run(('dict', '-d', db, 'dummy'), capture_output=True)
if proc.returncode == 39:
print('ERROR: invalid database', file=stderr)
print_databases()
exit(1)
try:
while True:
word = input(PROMPT)
if word:
proc = run(('dict', '-f', '-d', db, word), encoding='utf-8', capture_output=True)
if proc.stdout:
lines = proc.stdout.splitlines()
lines = lines[2:]
print()
print('\n'.join(lines))
print()
else:
print('\nNo definitions found', end='\n\n')
except (EOFError, KeyboardInterrupt):
print()