From 22bbedd73e2b31b5188b38ca3166e146c5f3d431 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Mon, 8 May 2023 09:42:29 +0200 Subject: Bunch of changes. --- stow/mpv/.config/mpv/scripts/youtube-quality.lua | 10 +++++----- .../.config/nvim/ftplugin/typescript/typescript.vim | 2 ++ stow/qutebrowser/.config/qutebrowser/config.py | 19 ++++++++++++------- stow/ranger/.config/ranger/rc.conf | 2 +- stow/ranger/.config/ranger/rifle.conf | 3 +++ stow/rcs/.config/rcs/bash_aliases | 3 ++- stow/rcs/.config/rcs/bash_vars | 7 +++++-- stow/sxhkd/.config/sxhkd/sxhkdrcbspc | 2 +- stow/tmux/.tmux.conf | 7 ++++--- stow/vim/.vim/ftplugin/sh/sh.vim | 2 +- stow/vim/.vim/ftplugin/sh/snippets/template.txt | 10 ++++++---- stow/vim/.vim/ftplugin/tex/tex.vim | 2 +- stow/vim/.vim/ftplugin/typescript/typescript.vim | 4 ++-- stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim | 5 +++-- stow/vim/.vim/rc/color.vim | 9 ++++++--- 15 files changed, 54 insertions(+), 33 deletions(-) diff --git a/stow/mpv/.config/mpv/scripts/youtube-quality.lua b/stow/mpv/.config/mpv/scripts/youtube-quality.lua index b587f37..a906e10 100644 --- a/stow/mpv/.config/mpv/scripts/youtube-quality.lua +++ b/stow/mpv/.config/mpv/scripts/youtube-quality.lua @@ -112,7 +112,7 @@ function show_menu() draw_menu() end function choose_prefix(i) - if i == selected and i == active then return opts.selected_and_active + if i == selected and i == active then return opts.selected_and_active elseif i == selected then return opts.selected_and_inactive end if i ~= selected and i == active then return opts.unselected_and_active @@ -157,11 +157,11 @@ function show_menu() mp.add_forced_key_binding(opts.toggle_menu_binding, "escape", destroy) draw_menu() - return + return end local ytdl = { - path = "youtube-dl", + path = "yt-dlp", searched = false, blacklisted = {} } @@ -186,7 +186,7 @@ function download_formats() url = string.gsub(url, "ytdl://", "") -- Strip possible ytdl:// prefix. -- don't fetch the format list if we already have it - if format_cache[url] ~= nil then + if format_cache[url] ~= nil then local res = format_cache[url] return res, table_size(res) end @@ -240,7 +240,7 @@ end -- register script message to show menu -mp.register_script_message("toggle-quality-menu", +mp.register_script_message("toggle-quality-menu", function() if destroyer ~= nil then destroyer() diff --git a/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim b/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim index 9e56582..4e3b812 100644 --- a/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim +++ b/stow/nvim/.config/nvim/ftplugin/typescript/typescript.vim @@ -6,6 +6,8 @@ nnoremap gr :lua vim.lsp.buf.references() nnoremap gR :lua vim.lsp.buf.rename() nnoremap e :lua vim.diagnostic.open_float() nnoremap E :lua vim.diagnostic.setloclist() +nnoremap m :lua vim.diagnostic.disable() +nnoremap M :lua vim.diagnostic.enable() nnoremap [e :lua vim.diagnostic.goto_prev({float=false}) nnoremap ]e :lua vim.diagnostic.goto_next({float=false}) nnoremap a :lua vim.lsp.buf.code_action() diff --git a/stow/qutebrowser/.config/qutebrowser/config.py b/stow/qutebrowser/.config/qutebrowser/config.py index a8702d7..52f1f9a 100644 --- a/stow/qutebrowser/.config/qutebrowser/config.py +++ b/stow/qutebrowser/.config/qutebrowser/config.py @@ -1358,9 +1358,10 @@ c.url.default_page = '/home/taamas/.mainpage/index.html' ## `:open google qutebrowser`. ## Type: Dict c.url.searchengines = { - 'DEFAULT': 'https://searx.be/search?q={}&categories=general', #searx.be - 's': 'https://searx.be/search?q={}&categories=general', #searx.be - 'i': 'https://searx.be/search?q={}&categories=images', #searx.be images + 'DEFAULT': 'https://duckduckgo.com/?q={}', #searx + #'DEFAULT': 'https://searx.work/search?q={}&categories=general', #searx + #'s': 'https://searx.work/search?q={}&categories=general', #searx + #'i': 'https://searx.work/search?q={}&categories=images', #searx images 'ddg': 'https://duckduckgo.com/?q={}', #duckduckgo 'y': 'https://www.youtube.com/results?search_query={}', #youtube 'tw': 'https://twitter.com/{}', #twitter @@ -1398,7 +1399,11 @@ c.url.searchengines = { 'te': 'https://simplytranslate.org/?engine=google&text={}&sl=auto&tl=en', # SimplyTranslate to English 'tiempo': 'https://www.eltiempo.es/{}.html', # eltiempo.es, 'dq': 'https://dream-quest.fandom.com/wiki/{}', # Dream Quest - 'wb': 'https://wiby.me/?q={}' # Wiby + 'wb': 'https://wiby.me/?q={}', # Wiby + 'mtgart': 'https://www.artofmtg.com/?s={}', # Art of MTG + 'bgg': 'https://boardgamegeek.com/geeksearch.php?action=search&q={}&objecttype=boardgame', # Board Games Geek + 'bga': 'https://boardgamearena.com/gamepanel?game={}', # Board Game Arena + 'do': 'http://wiki.dominionstrategy.com/index.php/{}' # Dominion Wiki } ## Page(s) to open at the start. @@ -1595,9 +1600,9 @@ config.bind('U', 'undo') ## Custom normal mode bindings # open url with mpv -config.bind(',v', 'spawn sh -c "mpv {url}; disown"') -config.bind(',fv', 'hint links spawn sh -c "nohup mpv {hint-url}; disown"') -config.bind(',Fv', 'hint all spawn sh -c "nohup mpv {hint-url}; disown"') +config.bind(',v', 'spawn sh -c "mpv {url} && disown"') +config.bind(',fv', 'hint links spawn sh -c "nohup mpv {hint-url} && disown"') +config.bind(',Fv', 'hint all spawn sh -c "nohup mpv {hint-url} && disown"') config.bind(',V', 'spawn mpvFloat.sh {url}') config.bind(',fV', 'hint links spawn mpvFloat.sh {hint-url}') config.bind(',FV', 'hint all spawn mpvFloat.sh {hint-url}') diff --git a/stow/ranger/.config/ranger/rc.conf b/stow/ranger/.config/ranger/rc.conf index c5559e8..d5e1f05 100644 --- a/stow/ranger/.config/ranger/rc.conf +++ b/stow/ranger/.config/ranger/rc.conf @@ -439,7 +439,7 @@ map cm search_next order=mtime map ca search_next order=atime # Tabs -map tab_new ~ +map tab_new map tab_close map tab_move 1 map tab_move -1 diff --git a/stow/ranger/.config/ranger/rifle.conf b/stow/ranger/.config/ranger/rifle.conf index 7bfca63..8c41dd4 100644 --- a/stow/ranger/.config/ranger/rifle.conf +++ b/stow/ranger/.config/ranger/rifle.conf @@ -156,6 +156,9 @@ ext pdf, has evince, X, flag f = evince -- "$@" #ext pdf, has epdfview, X, flag f = epdfview -- "$@" #ext pdf, has qpdfview, X, flag f = qpdfview "$@" +ext cbr, has zathura, X, flag f = zathura -- "$@" +ext cbz, has zathura, X, flag f = zathura -- "$@" + ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER" ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@" diff --git a/stow/rcs/.config/rcs/bash_aliases b/stow/rcs/.config/rcs/bash_aliases index 4d7fa58..1b021f1 100644 --- a/stow/rcs/.config/rcs/bash_aliases +++ b/stow/rcs/.config/rcs/bash_aliases @@ -47,8 +47,9 @@ alias cnb="vim ~/.config/newsboat/config" alias cnbu="vim ~/.config/newsboat/urls" alias ctmux="vim ~/.tmux.conf" -alias upgrade="sudo pacman -Syu" alias s="sudo pacman -S" +alias syu="sudo pacman -Syu" +alias upgrade="sudo pacman -Syu" alias starwars="telnet towel.blinkenlights.nl" alias adormir="mpv -vo caca ~/videos/Adormir.mp4 && clear 2>/dev/null" diff --git a/stow/rcs/.config/rcs/bash_vars b/stow/rcs/.config/rcs/bash_vars index c4b23a9..f835c7c 100644 --- a/stow/rcs/.config/rcs/bash_vars +++ b/stow/rcs/.config/rcs/bash_vars @@ -13,7 +13,8 @@ export VIEWER="sxiv" export GPG_TTY="$(tty)" -export PLANTUML="$HOME/programs/plantUML/plantuml.jar" +# Default installation place by the Arch plantuml package +export PLANTUML="/usr/share/java/plantuml/plantuml.jar" export LEDGER_FILE="$HOME/docs/ledger.dat" export REMOTE_LEDGER_FILE="taamas@taamas.xyz:data/ledger.dat" @@ -58,6 +59,7 @@ export CONFIG_FOLDER_WP="$HOME/media/images/wallpapers" export CONFIG_FOLDER_RANDOMWP="$HOME/media/images/wallpapers/shufs/current" export CONFIG_WPLIST="$HOME/.local/share/wpHistory.dat" export CONFIG_WPPOINTER="/tmp/wppointer" +export CONFIG_DEFAULTWP="$HOME/defaultwp" ########### # Visuals # @@ -103,7 +105,8 @@ export JAVA_HOME="/usr/lib/jvm/default/" PATH="${PATH}:${JAVA_HOME}/bin" # Add ruby bins (gems) folder to path -PATH="${PATH}:$(ruby -e 'puts Gem.user_dir')/bin" +export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" +PATH="${PATH}:${GEM_HOME}/bin" # Add cargo bins folder to path PATH="${PATH}:${HOME}/.cargo/bin" diff --git a/stow/sxhkd/.config/sxhkd/sxhkdrcbspc b/stow/sxhkd/.config/sxhkd/sxhkdrcbspc index 4da5192..d231aae 100644 --- a/stow/sxhkd/.config/sxhkd/sxhkdrcbspc +++ b/stow/sxhkd/.config/sxhkd/sxhkdrcbspc @@ -19,7 +19,7 @@ super + shift + {period,comma} super + {n,p} bspc desktop {next,prev}.local -f;\ dunstify -r "$(dunstifyIDs.sh bspwmDesktop)" -t 500 \ - "$(bspc query -D -d focused.local --names)" + "$(bspc query --desktops --desktop focused.local --names)" # Send node to next or previous desktop on focused monitor super + shift + {n,p} diff --git a/stow/tmux/.tmux.conf b/stow/tmux/.tmux.conf index 3b855b8..be03787 100644 --- a/stow/tmux/.tmux.conf +++ b/stow/tmux/.tmux.conf @@ -13,13 +13,15 @@ set -g status-keys vi #set-option -g status-style attr=default # status bar set-option -g status-style "fg=colour4 bg=default" +#set-option -g status-justify centre +set-option -g status-justify absolute-centre # status bar windows -set-window-option -g window-status-style "fg=colour4 bg=default" +set-option -g window-status-style "fg=colour4 bg=default" # status bar selected window set -g window-status-current-style "fg=colour13 bg=default" #set-window-option -g window-status-current-attr bold default # pane borders -set-option -g pane-border-style "fg=colour0 bg=default" +set-option -g pane-border-style "fg=colour8 bg=default" set-option -g pane-active-border-style "fg=colour4 bg=default" # pane number display set-option -g display-panes-colour colour4 @@ -31,7 +33,6 @@ set-window-option -g clock-mode-colour colour4 # sizes set -g status-interval 60 set -g status-left-length 20 -#set -g status-left '#[fg=green](#S) #(whoami) ' set -g status-left '(#S) ' #zoom #{?window_zoomed_flag, ,🔍} diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim index 58d39fe..f716617 100644 --- a/stow/vim/.vim/ftplugin/sh/sh.vim +++ b/stow/vim/.vim/ftplugin/sh/sh.vim @@ -11,7 +11,7 @@ setlocal textwidth=110 let mapleader = " " nnoremap C :sp ~/.vim/ftplugin/sh/sh.vim -nnoremap +x :!chmod 744 % +nnoremap +x :!chmod 744 % nnoremap x :w:!./% nnoremap X :w:!./% diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt index 171dcf8..8b257fe 100644 --- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt +++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt @@ -4,14 +4,16 @@ # # Usage: template.sh [-ac] [-b OPTARG] FILE... -usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..." +scriptName="${0##*/}" + +usageMessage="Usage: ${scriptName} [-ac] [-b OPTARG] FILE..." error() { - printf '%s error: %s\n' "$0" "$*" >&2 + printf '%s error: %s\n' "$scriptName" "$*" >&2 } errorAndUsage() { - printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2 + printf '%s error: %s\n%s\n' "$scriptName" "$*" "$usageMessage" >&2 } # Process options @@ -31,7 +33,7 @@ while getopts ':ab:c' opt; do ;; '?' ) - printf '%s\n' "$usageMessage" + printf '%s\n' "$usageMessage" >&2 exit 1 esac diff --git a/stow/vim/.vim/ftplugin/tex/tex.vim b/stow/vim/.vim/ftplugin/tex/tex.vim index c57bbc5..0893e40 100644 --- a/stow/vim/.vim/ftplugin/tex/tex.vim +++ b/stow/vim/.vim/ftplugin/tex/tex.vim @@ -47,4 +47,4 @@ inoremap lenumerate \begin{enumerate}o litemize \begin{itemize}o\end{itemize}kkI\itemI<++>k<$a inoremap litem \item<++>k$a inoremap limage \begin{figure}[h]\begin{center}\includegraphics[width=\textwidth]{}\caption{<++>}\end{center}\end{figure}<++>4k$i -inoremap ltable \begin{table}[h]\makebox[\linewidth]{\centering\centering\begin{tabular}{ccxxx}\toprule<++>&<++>\\\midrule<++>&<++>\\\bottomrule\end{tabular}}\end{table}<++>?xxxcw +inoremap ltable \begin{table}[h]\makebox[\linewidth]{\begin{tabular}{ccxxx}\toprule<++>&<++>\\\midrule<++>&<++>\\\bottomrule\end{tabular}}\end{table}<++>?xxxcw diff --git a/stow/vim/.vim/ftplugin/typescript/typescript.vim b/stow/vim/.vim/ftplugin/typescript/typescript.vim index 65e3c1a..b91ea16 100644 --- a/stow/vim/.vim/ftplugin/typescript/typescript.vim +++ b/stow/vim/.vim/ftplugin/typescript/typescript.vim @@ -19,8 +19,8 @@ let mapleader = " " nnoremap C :sp ~/.vim/ftplugin/typescript/typescript.vim -nnoremap s :!tmux new-window -db -t 9 -n 'npm start' npm start -nnoremap S :!tmux new-window -b -t 9 -n 'npm start' 'tmux set -w remain-on-exit on; npm start' +nnoremap s :silent !~/scripts/tmux/tmux-npmStart.sh +nnoremap S :silent !~/scripts/tmux/tmux-npmStart.sh -r let mapleader = "," diff --git a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim index c904efe..7d36f10 100644 --- a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim +++ b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim @@ -27,8 +27,9 @@ nnoremap C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim nnoremap temp :r ~/.vim/ftplugin/vimwiki/snips/template.txt nnoremap tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt/<+++>cf> -nnoremap c :w:!toPDF.sh "%" -nnoremap o :w:!toPDF.sh -o "%" +nnoremap c :silent w:!toPDF.sh "%" +nnoremap o :silent w:!toPDF.sh -o "%" +nnoremap O :silent w:!toPDF.sh -o "%" let mapleader = "," diff --git a/stow/vim/.vim/rc/color.vim b/stow/vim/.vim/rc/color.vim index ec18335..e57d86b 100644 --- a/stow/vim/.vim/rc/color.vim +++ b/stow/vim/.vim/rc/color.vim @@ -13,9 +13,9 @@ highlight LineNr cterm=NONE highlight CursorLineNr ctermfg=5 highlight CursorLineNr cterm=underline -" Completion color -highlight Pmenu ctermbg=blue ctermfg=black -highlight PmenuSel ctermbg=darkblue ctermfg=white +" Completion color (also nvim LSP hint color) +"highlight Pmenu ctermbg=blue ctermfg=black +"highlight PmenuSel ctermbg=darkblue ctermfg=white " Panel border color "highlight VertSplit ctermbg=black ctermfg=darkblue @@ -31,6 +31,9 @@ highlight SpellBad ctermbg=red ctermfg=black " Comments colors highlight Comment ctermfg=green +" QuickFix colors +highlight QuickFixLine ctermbg=darkblue ctermfg=black + " Line size marking highlight ColorColumn ctermbg=darkblue ctermfg=black "Redjail Bomb (thx Damian Conway!) -- cgit v1.2.1