diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 5fcdc22..ce4e85a 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -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, } diff --git a/config/awesome/themes/default/theme.lua b/config/awesome/themes/default/theme.lua index ec42ffd..e66a3f4 100644 --- a/config/awesome/themes/default/theme.lua +++ b/config/awesome/themes/default/theme.lua @@ -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" diff --git a/config/newsboat/config b/config/newsboat/config index eb58eff..b39824c 100644 --- a/config/newsboat/config +++ b/config/newsboat/config @@ -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" diff --git a/config/nvim/init.vim b/config/nvim/init.vim index b4b7197..6ca2aea 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -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 %!unexpand -t4%!sed 's/[ \t]*$//' nnoremap TagbarToggle nnoremap NERDTreeToggle -noremap - ddp -nnoremap _ ddkP - nnoremap ev tabnew $MYVIMRC nnoremap sv source $MYVIMRC nnoremap :%s//gc nnoremap t tabnew + nnoremap dL 0D +nnoremap - ddp +nnoremap _ ddkP " auto quote vnoremap " a"``> nnoremap H 0 nnoremap L $ +augroup python + autocmd FileType python :iabbrev 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 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 { diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index c7f47f9..d9cae38 100644 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -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. diff --git a/home/aliases b/home/aliases index 0d3998d..b5fcb33 100644 --- a/home/aliases +++ b/home/aliases @@ -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" diff --git a/home/swallow b/home/swallow deleted file mode 100644 index f1f60ab..0000000 --- a/home/swallow +++ /dev/null @@ -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 -} diff --git a/home/zshrc b/home/zshrc index 2986fb4..2986566 100644 --- a/home/zshrc +++ b/home/zshrc @@ -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 diff --git a/local/bin/dict-repl b/local/bin/dict-repl new file mode 100755 index 0000000..bbd182a --- /dev/null +++ b/local/bin/dict-repl @@ -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 ' % 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()