From c88b67672f7be9a0cf6a409db91a0ce51802898b Mon Sep 17 00:00:00 2001 From: kpatel28 <15056154+kpatel28@users.noreply.github.com> Date: Sun, 25 Aug 2019 05:07:05 -0700 Subject: [PATCH] initial commit --- .Xdefaults | 1 + .Xresources | 132 + .bash_logout | 3 + .bash_profile | 1 + .bashrc | 41 + .config/.gitignore | 30 + .config/README.md | 9 + .config/aliasrc | 35 + .config/aliasrc_a | 36 + .config/bmdirs | 12 + .config/bmfiles | 3 + .config/compton/compton.conf | 22 + .config/dunst/dunstrc | 152 + .config/fontconfig/fonts.conf | 30 + .config/htop/htoprc | 26 + .config/i3/config | 193 ++ .config/ncmpcpp/bindings | 634 +++++ .config/ncmpcpp/config | 551 ++++ .config/ncmpcpp/error.log | 0 .config/neofetch/config.conf | 761 +++++ .config/nvim/autoload/pathogen.vim | 1 + .config/nvim/autoload/plug.vim | 2465 +++++++++++++++++ .../doc/neovim-latex-previewer.txt | 1 + .../ftplugin/tex/neovim-latex-previewer.vim | 1 + .config/nvim/doc/neovim-latex-previewer.txt | 1 + .config/nvim/ftplugin/tex.vim | 3 + .config/nvim/init.vim | 251 ++ .config/nvim/plugged/goyo.vim | 1 + .config/nvim/plugged/i3-vim-syntax | 1 + .config/nvim/plugged/nerdtree | 1 + .config/nvim/plugged/vim-airline | 1 + .config/nvim/plugged/vim-commentary | 1 + .config/nvim/plugged/vim-surround | 1 + .config/nvim/plugged/vimagit | 1 + .config/nvim/plugged/vimling | 1 + .config/nvim/plugged/vimwiki | 1 + .config/polybar/config | 335 +++ .config/polybar/launch.sh | 54 + .config/qutebrowser/.gitignore | 2 + .config/qutebrowser/autoconfig.yml | 7 + .config/qutebrowser/config.py | 293 ++ .config/qutebrowser/config.yml | 112 + .config/qutebrowser/defaults.py | 1873 +++++++++++++ .config/qutebrowser/qsettings/QtProject.conf | 8 + .config/qutebrowser/quickmarks | 1 + .config/ranger/commands.py | 216 ++ .config/ranger/luke_ranger_readme.md | 85 + .config/ranger/rc.conf | 508 ++++ .config/ranger/rifle.conf | 237 ++ .config/ranger/scope.sh | 120 + .config/ranger/shortcuts.conf | 47 + .config/sxhkd/sxhkdrc | 157 ++ .config/tmux/.tmux.conf | 56 + .config/zathura/zathurarc | 12 + .dmrc | 2 + .gitconfig | 2 + .gitignore | 27 + .gitmodules | 3 + .inputrc | 26 + .local/bin | 1 + .profile | 48 + .tmux.conf | 1 + .vim | 1 + .vimrc | 1 + .xinitrc | 21 + .xonshrc | 17 + .xprofile | 1 + .xsession | 1 + .zprofile | 1 + LICENSE | 674 +++++ README.md | 15 + 71 files changed, 10369 insertions(+) create mode 120000 .Xdefaults create mode 100644 .Xresources create mode 100644 .bash_logout create mode 120000 .bash_profile create mode 100644 .bashrc create mode 100644 .config/.gitignore create mode 100644 .config/README.md create mode 100644 .config/aliasrc create mode 100644 .config/aliasrc_a create mode 100644 .config/bmdirs create mode 100644 .config/bmfiles create mode 100644 .config/compton/compton.conf create mode 100644 .config/dunst/dunstrc create mode 100755 .config/fontconfig/fonts.conf create mode 100644 .config/htop/htoprc create mode 100644 .config/i3/config create mode 100644 .config/ncmpcpp/bindings create mode 100644 .config/ncmpcpp/config create mode 100644 .config/ncmpcpp/error.log create mode 100644 .config/neofetch/config.conf create mode 120000 .config/nvim/autoload/pathogen.vim create mode 100644 .config/nvim/autoload/plug.vim create mode 120000 .config/nvim/bundle/neovim-latex-previewer/doc/neovim-latex-previewer.txt create mode 120000 .config/nvim/bundle/neovim-latex-previewer/ftplugin/tex/neovim-latex-previewer.vim create mode 120000 .config/nvim/doc/neovim-latex-previewer.txt create mode 100644 .config/nvim/ftplugin/tex.vim create mode 100644 .config/nvim/init.vim create mode 160000 .config/nvim/plugged/goyo.vim create mode 160000 .config/nvim/plugged/i3-vim-syntax create mode 160000 .config/nvim/plugged/nerdtree create mode 160000 .config/nvim/plugged/vim-airline create mode 160000 .config/nvim/plugged/vim-commentary create mode 160000 .config/nvim/plugged/vim-surround create mode 160000 .config/nvim/plugged/vimagit create mode 160000 .config/nvim/plugged/vimling create mode 160000 .config/nvim/plugged/vimwiki create mode 100644 .config/polybar/config create mode 100755 .config/polybar/launch.sh create mode 100644 .config/qutebrowser/.gitignore create mode 100644 .config/qutebrowser/autoconfig.yml create mode 100644 .config/qutebrowser/config.py create mode 100644 .config/qutebrowser/config.yml create mode 100644 .config/qutebrowser/defaults.py create mode 100644 .config/qutebrowser/qsettings/QtProject.conf create mode 100644 .config/qutebrowser/quickmarks create mode 100755 .config/ranger/commands.py create mode 100644 .config/ranger/luke_ranger_readme.md create mode 100644 .config/ranger/rc.conf create mode 100644 .config/ranger/rifle.conf create mode 100755 .config/ranger/scope.sh create mode 100644 .config/ranger/shortcuts.conf create mode 100644 .config/sxhkd/sxhkdrc create mode 100644 .config/tmux/.tmux.conf create mode 100644 .config/zathura/zathurarc create mode 100644 .dmrc create mode 100644 .gitconfig create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .inputrc create mode 160000 .local/bin create mode 100644 .profile create mode 120000 .tmux.conf create mode 120000 .vim create mode 120000 .vimrc create mode 100755 .xinitrc create mode 100644 .xonshrc create mode 120000 .xprofile create mode 120000 .xsession create mode 120000 .zprofile create mode 100644 LICENSE create mode 100644 README.md diff --git a/.Xdefaults b/.Xdefaults new file mode 120000 index 0000000..70e956f --- /dev/null +++ b/.Xdefaults @@ -0,0 +1 @@ +.Xresources \ No newline at end of file diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..5d81725 --- /dev/null +++ b/.Xresources @@ -0,0 +1,132 @@ +!! kev: +*.font: Monospace:pixelsize=24:dpi:360:antialias:true:autohint:false:hinting:true; + +!! kev: +*dpi: 192 +Xft.dpi: 192 +Xft.antialias: true +Xft.autohint: false +Xft.hinting: true +Xft.hintstyle: hintfull +Xft.rgba: rgb + +!! Transparency (0-1): +!st.alpha: 0.92 +st.alpha: 0.80 + +!! Set a default font and font size as below: +!st.font: Monospace-11; + +! st.termname: st-256color +! st.borderpx: 2 + +/* !! gruvbox: */ +*.color0: #1d2021 +*.color1: #cc241d +*.color2: #98971a +*.color3: #d79921 +*.color4: #458588 +*.color5: #b16286 +*.color6: #689d6a +*.color7: #a89984 +*.color8: #928374 +*.color9: #fb4934 +*.color10: #b8bb26 +*.color11: #fabd2f +*.color12: #83a598 +*.color13: #d3869b +*.color14: #8ec07c +*.color15: #ebdbb2 + +/* !! gruvbox light: */ +/* *.color0: #fbf1c7 */ +/* *.color1: #cc241d */ +/* *.color2: #98971a */ +/* *.color3: #d79921 */ +/* *.color4: #458588 */ +/* *.color5: #b16286 */ +/* *.color6: #689d6a */ +/* *.color7: #7c6f64 */ +/* *.color8: #928374 */ +/* *.color9: #9d0006 */ +/* *.color10: #79740e */ +/* *.color11: #b57614 */ +/* *.color12: #076678 */ +/* *.color13: #8f3f71 */ +/* *.color14: #427b58 */ +/* *.color15: #3c3836 */ + +/* !! brogrammer: */ +/* *.foreground: #d6dbe5 */ +/* *.background: #131313 */ +/* *.color0: #1f1f1f */ +/* *.color8: #d6dbe5 */ +/* *.color1: #f81118 */ +/* *.color9: #de352e */ +/* *.color2: #2dc55e */ +/* *.color10: #1dd361 */ +/* *.color3: #ecba0f */ +/* *.color11: #f3bd09 */ +/* *.color4: #2a84d2 */ +/* *.color12: #1081d6 */ +/* *.color5: #4e5ab7 */ +/* *.color13: #5350b9 */ +/* *.color6: #1081d6 */ +/* *.color14: #0f7ddb */ +/* *.color7: #d6dbe5 */ +/* *.color15: #ffffff */ +/* *.colorBD: #d6dbe5 */ + +/* ! base16 */ +/* *.color0: #181818 */ +/* *.color1: #ab4642 */ +/* *.color2: #a1b56c */ +/* *.color3: #f7ca88 */ +/* *.color4: #7cafc2 */ +/* *.color5: #ba8baf */ +/* *.color6: #86c1b9 */ +/* *.color7: #d8d8d8 */ +/* *.color8: #585858 */ +/* *.color9: #ab4642 */ +/* *.color10: #a1b56c */ +/* *.color11: #f7ca88 */ +/* *.color12: #7cafc2 */ +/* *.color13: #ba8baf */ +/* *.color14: #86c1b9 */ +/* *.color15: #f8f8f8 */ + +/* !! solarized */ +/* *.color0: #073642 */ +/* *.color1: #dc322f */ +/* *.color2: #859900 */ +/* *.color3: #b58900 */ +/* *.color4: #268bd2 */ +/* *.color5: #d33682 */ +/* *.color6: #2aa198 */ +/* *.color7: #eee8d5 */ +/* *.color9: #cb4b16 */ +/* *.color8: #fdf6e3 */ +/* *.color10: #586e75 */ +/* *.color11: #657b83 */ +/* *.color12: #839496 */ +/* *.color13: #6c71c4 */ +/* *.color14: #93a1a1 */ +/* *.color15: #fdf6e3 */ + +/* !! xterm */ +/* *.color0: #000000 */ +/* *.color1: #cd0000 */ +/* *.color2: #00cd00 */ +/* *.color3: #cdcd00 */ +/* *.color4: #0000cd */ +/* *.color5: #cd00cd */ +/* *.color6: #00cdcd */ +/* *.color7: #e5e5e5 */ +/* *.color8: #4d4d4d */ +/* *.color9: #ff0000 */ +/* *.color10: #00ff00 */ +/* *.color11: #ffff00 */ +/* *.color12: #0000ff */ +/* *.color13: #ff00ff */ +/* *.color14: #00ffff */ +/* *.color15: #aabac8 */ diff --git a/.bash_logout b/.bash_logout new file mode 100644 index 0000000..0e4e4f1 --- /dev/null +++ b/.bash_logout @@ -0,0 +1,3 @@ +# +# ~/.bash_logout +# diff --git a/.bash_profile b/.bash_profile new file mode 120000 index 0000000..aa7da3a --- /dev/null +++ b/.bash_profile @@ -0,0 +1 @@ +.profile \ No newline at end of file diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..c210ebd --- /dev/null +++ b/.bashrc @@ -0,0 +1,41 @@ +#!/bin/bash +# __ __ +# / /_ ____ ______/ /_ +# / __ \/ __ `/ ___/ __ \ +# / /_/ / /_/ (__ ) / / / +# /_.___/\__,_/____/_/ /_/ +# bash runtime config file. + +stty -ixon # Disable ctrl-s and ctrl-q. +shopt -s autocd #Allows you to cd into directory merely by typing the directory name. +HISTSIZE= HISTFILESIZE= # Infinite history. +export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" + +[ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" # Load shortcut aliases +[ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" +[ -f "$HOME/.config/aliasrc_a" ] && source "$HOME/.config/aliasrc_a" # kev, load my own custom aliases + +export PATH="$HOME/.vim/bundle/vim-live-latex-preview/bin:$PATH" # kev, add vim-live-latex-preview bin +export PATH="$JAVA_HOME:$PATH" # kev, add JAVA_HOME to the PATH (make sure JAVA_HOME is set to a path first in /etc/profile/) + +echo 'adding aliases to ignore binutils upgrade from 2.30-5'; +pacman() { if [[ "${1:0:2}" == "-S" ]] ; then command pacman "$1" --ignore=binutils "${@:2}"; else command pacman "$@"; fi; } +yay() { if [[ "${1:0:2}" == "-S" ]] ; then command yay "$1" --ignore=binutils "${@:2}"; else command yay "$@"; fi; } +# downgrade: sudo pacman -U https://archive.archlinux.org/packages/b/binutils/binutils-2.30-5-x86_64.pkg.tar.xz + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/kev/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/kev/miniconda3/etc/profile.d/conda.sh" ]; then + . "/home/kev/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/home/kev/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +conda deactivate; +# <<< conda initialize <<< + diff --git a/.config/.gitignore b/.config/.gitignore new file mode 100644 index 0000000..1673c02 --- /dev/null +++ b/.config/.gitignore @@ -0,0 +1,30 @@ +# Ignore All: +* + +# Traverse Directories +!*/ + +# Whitelist: +!/compton/** +!/dunst/** +!/fontconfig/** +!/htop/** +!/i3/** +!/ncmpcpp/** +!/neofetch/** +!/nnn/** +!/nvim/** +!/polybar/** +!/qutebrowser/** +!/ranger/** +!/sxhkd/** +!/tmux/** +!/xonsh/** +!/zathura/** +!aliasrc +!aliasrc_a +!bmdirs +!bmfiles +!custom_aliasrc +!README.md +!.gitignore diff --git a/.config/README.md b/.config/README.md new file mode 100644 index 0000000..24bdb5f --- /dev/null +++ b/.config/README.md @@ -0,0 +1,9 @@ +Config Files for programs. + +Other than my rice for: + +* qutebrowser +* polybar + +There is nothing particularly unique here, mostly these config files are copies or slight modifications of existing config files written by [Luke Smith](https://github.com/LukeSmithxyz) and others. + diff --git a/.config/aliasrc b/.config/aliasrc new file mode 100644 index 0000000..309c2c4 --- /dev/null +++ b/.config/aliasrc @@ -0,0 +1,35 @@ +#!/bin/sh + +alias ka="killall" \ + mkd="mkdir -pv" \ + mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" \ + calcurse="calcurse -D ~/.config/calcurse" \ + magit="nvim -c Magit" \ + p="sudo pacman" \ + SS="sudo systemctl" \ + f="$FILE" \ + g="git" \ + trem="transmission-remote" \ + e="$EDITOR" \ + v="$EDITOR" \ + x="sxiv -ft *" \ + sdn="sudo shutdown -h now" \ + gua="git remote | xargs -L1 git push --all" \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ccat="highlight --out-format=ansi" \ + yt="youtube-dl --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'" \ + yta="yt -x -f bestaudio/best" \ + YT="youtube-viewer" \ + ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ + upc="sudo pacman -Syu; pkill -RTMIN+8 i3blocks" \ + lsp="pacman -Qett --color=always | less" \ + ffmpeg="ffmpeg -hide_banner" + +command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present. + +shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;} +se() { du -a ~/.local/bin/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;} +sv() { vcopy "$(du -a ~/.local/bin/* ~/.config/* | awk '{print $2}' | fzf)" ;} +vf() { fzf | xargs -r -I % $EDITOR % ;} diff --git a/.config/aliasrc_a b/.config/aliasrc_a new file mode 100644 index 0000000..b963d9a --- /dev/null +++ b/.config/aliasrc_a @@ -0,0 +1,36 @@ +#!/bin/sh + +# Useful aliases from Oh-My-Zsh +alias gsb="git status -sb" \ + gss="git status -s" \ + gst="git status" \ + gl="git pull" \ + ga="git add" \ + grm="git rm" \ + gcmsg="git commit -m"; + +# Homemade aliases +alias c="clear" \ + l="ls -lahN --color=auto --group-directories-first" \ + i="htop -t" \ + yps="yay -Ps" \ + yys="yay -Syu" \ + yyf="yay -Syyu" \ + yls="yay -Ql" \ + ycl="yay -Yc && paccache -r" \ + car="conda activate" \ + cdr="conda deactivate" \ + cup="conda update conda pip" \ + cua="conda update --all" \ + ccl="conda clean --yes --all" \ + gpp="git pull && git push origin master" \ + lamp="ps -u $(whoami)" \ + kamp="killall -u $(whoami)" \ + nv="nvidia-smi" \ + nvw="watch -n 2 nvidia-smi" \ + lptl="sudo lsof -i -P -n | grep LISTEN" \ + appsync="rsync -avxP" \ + mirsync="rsync -avxP --delete" \ + jup="jupyter notebook --ip=127.0.0.1 --port=8888"; # Need to explicitly set ip and port to use jupyter with nordvpn + +alias cl="ycl && ccl"; # Clear all caches diff --git a/.config/bmdirs b/.config/bmdirs new file mode 100644 index 0000000..f10b957 --- /dev/null +++ b/.config/bmdirs @@ -0,0 +1,12 @@ +# You can add comments to these files with # +h ~/ +qc ~/crunch +qt ~/crunch-thesis +d ~/Documents +D ~/Downloads +m ~/Music +pp ~/Pictures +vv ~/Videos +cf ~/.config +sc ~/.local/bin +mn /mnt diff --git a/.config/bmfiles b/.config/bmfiles new file mode 100644 index 0000000..418bab8 --- /dev/null +++ b/.config/bmfiles @@ -0,0 +1,3 @@ +bf ~/.config/bmfiles +bd ~/.config/bmdirs +cfa ~/.config/aliasrc diff --git a/.config/compton/compton.conf b/.config/compton/compton.conf new file mode 100644 index 0000000..f52b77a --- /dev/null +++ b/.config/compton/compton.conf @@ -0,0 +1,22 @@ +# __ +# _________ ____ ___ ____ / /_____ ____ +# / ___/ __ \/ __ `__ \/ __ \/ __/ __ \/ __ \ +# / /__/ /_/ / / / / / / /_/ / /_/ /_/ / / / / +# \___/\____/_/ /_/ /_/ .___/\__/\____/_/ /_/ +# /_/ +# compton compositor runtime config. + +# Shadow +shadow = false; + +# Fade +fading = true; +#fade-delta = 30; +fade-in-step = 0.1; +fade-out-step = 0.1; + +# Other +backend = "glx"; +#backend = "xrender"; +vsync = true; # Reduces single monitor tearing +#vsync = "opengl-oml"; # Also reduces single monitor tearing diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..abf5586 --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,152 @@ +[global] + monitor = 0 + follow = keyboard + geometry = "350x5-0+24" + indicate_hidden = yes + shrink = yes + transparency = 20 + notification_height = 0 + separator_height = 2 + padding = 0 + horizontal_padding = 8 + frame_width = 3 + frame_color = "#282828" + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = frame + + # Sort messages by urgency. + sort = yes + + idle_threshold = 120 + font = Monospace 14 + line_height = 0 + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b" + + alignment = left + show_age_threshold = 60 + word_wrap = yes + ellipsize = middle + ignore_newline = no + stack_duplicates = true + hide_duplicate_count = true + show_indicators = yes + icon_position = left + max_icon_size = 40 + #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/ + sticky_history = yes + history_length = 20 + dmenu = /usr/bin/dmenu -p dunst: + browser = /usr/bin/firefox -new-tab + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + title = Dunst + class = Dunst + startup_notification = false + force_xinerama = false +[experimental] + per_monitor_dpi = false + +[shortcuts] + close = ctrl+space + close_all = ctrl+shift+space + history = ctrl+grave + context = ctrl+shift+period + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#282828" + foreground = "#928374" + timeout = 5 + # Icon for notifications with low urgency, uncomment to enable + #icon = /path/to/icon + +[urgency_normal] + background = "#458588" + foreground = "#ebdbb2" + timeout = 5 + +[urgency_critical] + background = "#cc2421" + foreground = "#ebdbb2" + frame_color = "#fabd2f" + timeout = 0 + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# Messages can be matched by "appname", "summary", "body", "icon", "category", +# "msg_urgency" and you can override the "timeout", "urgency", "foreground", +# "background", "new_icon" and "format". +# Shell-like globbing will get expanded. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: if you don't want a notification to be displayed, set the format +# to "". +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# format = "" + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +# vim: ft=cfg diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf new file mode 100755 index 0000000..6a78c25 --- /dev/null +++ b/.config/fontconfig/fonts.conf @@ -0,0 +1,30 @@ + + + + + + serif + Linux Libertine + + + sans-serif + Linux Biolinum + + + sans + Linux Biolinum + + + monospace + Inconsolata + + + + + monospace + Symbola + + + + + diff --git a/.config/htop/htoprc b/.config/htop/htoprc new file mode 100644 index 0000000..cb526ed --- /dev/null +++ b/.config/htop/htoprc @@ -0,0 +1,26 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +fields=0 48 17 18 38 39 40 2 46 47 49 1 +sort_key=46 +sort_direction=1 +hide_threads=0 +hide_kernel_threads=1 +hide_userland_threads=0 +shadow_other_users=0 +show_thread_names=0 +show_program_path=1 +highlight_base_name=0 +highlight_megabytes=1 +highlight_threads=1 +tree_view=1 +header_margin=1 +detailed_cpu_time=0 +cpu_count_from_zero=0 +update_process_names=0 +account_guest_in_cpu_meter=0 +color_scheme=0 +delay=15 +left_meters=LeftCPUs2 Memory Swap CPU +left_meter_modes=1 1 1 1 +right_meters=RightCPUs2 Tasks LoadAverage Uptime +right_meter_modes=1 2 2 2 diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..d2ac4e6 --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,193 @@ +# vim: filetype=i3 +# _ _____ +# (_)__ / +# / / /_ < +# / /___/ / +# /_//____/ +# i3 config file. +# Modified from Luke Smith +# +# This config file uses environmental variables such as $BROWSER and $TERMINAL. +# You can set these variables in ~/.profile or ~/.bash_profile if you have it as below: +# +# export FILE="ranger" +# export TERMINAL="st" +exec_always --no-startup-id $HOME/.config/polybar/launch.sh + +# #---Basic Definitions---# # +for_window [class="^.*"] border pixel 2 +gaps inner 5 +#gaps outer 15 +set $term --no-startup-id $TERMINAL +set $mod Mod4 + +# #---Dropdown Windows---# # +# General dropdown window traits. The order can matter. +for_window [instance="dropdown_*"] floating enable +for_window [instance="dropdown_*"] move scratchpad +for_window [instance="dropdown_*"] sticky enable +for_window [instance="dropdown_*"] scratchpad show +for_window [instance="dropdown_tmuxdd"] resize set 625 450 +for_window [instance="dropdown_dropdowncalc"] resize set 800 300 +for_window [instance="dropdown_xonsh"] resize set 1280 720 +for_window [instance="dropdown_tmuxdd"] border pixel 3 +for_window [instance="dropdown_dropdowncalc"] border pixel 2 +for_window [instance="dropdown_xonsh"] border pixel 2 +for_window [instance="dropdown_*"] move position center + +# #---Basic Bindings---# # +bindsym $mod+Shift+Return exec --no-startup-id samedir + +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle + +bindsym $mod+Escape workspace prev +bindsym $mod+Shift+Escape exec --no-startup-id prompt "Exit i3?" "i3-msg exit" + +#STOP/HIDE EVERYTHING: +bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e $FILE + +# #---Letter Key Bindings---# # +bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill +bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] exec --no-startup-id kill -9 `xdotool getwindowfocus getwindowpid` + +#bindsym $mod+Shift+r exec --no-startup-id winresize + +bindsym $mod+t split toggle +#bindsym $mod+Shift+t gaps inner current set 15; gaps outer current set 15 + +bindsym $mod+Shift+y exec --no-startup-id i3resize left + +bindsym $mod+u exec --no-startup-id ddspawn tmuxdd +bindsym $mod+Shift+u exec --no-startup-id i3resize down + +bindsym $mod+Shift+i exec --no-startup-id i3resize up + +bindsym $mod+o sticky toggle +bindsym $mod+Shift+o exec --no-startup-id i3resize right + +#bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 +bindsym $mod+Shift+a exec --no-startup-id cabl + +bindsym $mod+s gaps inner current plus 5 +bindsym $mod+Shift+s gaps inner current minus 5 + +bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0 + +set $freeze Distraction-free mode (super+shift+f to reactivate bindings) +mode "$freeze" { bindsym $mod+Shift+f mode "default" +} + +bindsym $mod+f fullscreen toggle +bindsym $mod+Shift+f mode "$freeze" ;; exec --no-startup-id notify-send "Distraction-free mode activated." "Press Super+Shift+f to return." + +bindsym $mod+g workspace prev + +bindsym $mod+h focus left +bindsym $mod+Shift+h move left 30 + +bindsym $mod+j focus down +bindsym $mod+Shift+j move down 30 + +bindsym $mod+k focus up +bindsym $mod+Shift+k move up 30 + +bindsym $mod+l focus right +bindsym $mod+Shift+l move right 30 + +bindsym $mod+z gaps outer current plus 5 +bindsym $mod+Shift+z gaps outer current minus 5 + +bindsym $mod+x exec --no-startup-id winresize + +#bindsym $mod+c exec --no-startup-id cabl +bindsym $mod+c exec --no-startup-id ddspawn xonsh + +bindsym $mod+v exec --no-startup-id $term -e $EDITOR -c "VimwikiIndex" + +bindsym $mod+b bar mode toggle +bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id hover left + +bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right + +# #---Workspace Bindings---# # +bindsym $mod+Home workspace $ws1 +bindsym $mod+Shift+Home move container to workspace $ws1 +bindsym $mod+End workspace $ws10 +bindsym $mod+Shift+End move container to workspace $ws10 +bindsym $mod+Prior workspace prev +bindsym $mod+Shift+Prior move container to workspace prev +bindsym $mod+Next workspace next +bindsym $mod+Shift+Next move container to workspace next +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+XF86Back workspace prev +bindsym $mod+Shift+XF86Back move container to workspace prev +bindsym $mod+XF86Forward workspace next +bindsym $mod+Shift+XF86Forward move container to workspace next +bindsym $mod+semicolon workspace next +bindsym $mod+apostrophe split horizontal ;; exec $term +bindsym $mod+slash split vertical ;; exec $term +bindsym $mod+Shift+slash kill +bindsym $mod+backslash workspace back_and_forth + +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + +for_window [class="Pinentry"] sticky enable +for_window [class="sent"] border pixel 0px +for_window [title="GIMP Startup"] move workspace $ws5 +for_window [class="Gimp"] move workspace $ws5 +for_window [window_role="GtkFileChooserDialog"] resize set 800 600 +for_window [window_role="GtkFileChooserDialog"] move position center +for_window [title="Default - Wine desktop"] floating enable + +# Bindings to make the webcam float and stick. +for_window [title="mpvfloat"] floating enable +for_window [title="mpvfloat"] sticky enable +for_window [title="mpvfloat"] border pixel 0 +no_focus [title="mpvfloat"] + +# #---Function Buttons---# # +bindsym $mod+F2 restart + +# #---Arrow Keys---# # +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right diff --git a/.config/ncmpcpp/bindings b/.config/ncmpcpp/bindings new file mode 100644 index 0000000..20efd7b --- /dev/null +++ b/.config/ncmpcpp/bindings @@ -0,0 +1,634 @@ +############################################################## +## This is the example bindings file. Copy it to ## +## ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings ## +## and set up your preferences ## +############################################################## +## ____ _________ ___ ____ _________ ____ +## / __ \/ ___/ __ `__ \/ __ \/ ___/ __ \/ __ \ +## / / / / /__/ / / / / / /_/ / /__/ /_/ / /_/ / +## /_/ /_/\___/_/ /_/ /_/ .___/\___/ .___/ .___/ +## /_/ /_/ /_/ +## n-curses music player client++ bindings file. +## +##### General rules ##### +## +## 1) Because each action has runtime checks whether it's +## ok to run it, a few actions can be bound to one key. +## Actions will be bound in order given in configuration +## file. When a key is pressed, first action in order +## will test itself whether it's possible to run it. If +## test succeeds, action is executed and other actions +## bound to this key are ignored. If it doesn't, next +## action in order tests itself etc. +## +## 2) It's possible to bind more that one action at once +## to a key. It can be done using the following syntax: +## +## def_key "key" +## action1 +## action2 +## ... +## +## This creates a chain of actions. When such chain is +## executed, each action in chain is run until the end of +## chain is reached or one of its actions fails to execute +## due to its requirements not being met. If multiple actions +## and/or chains are bound to the same key, they will be +## consecutively run until one of them gets fully executed. +## +## 3) When ncmpcpp starts, bindings configuration file is +## parsed and then ncmpcpp provides "missing pieces" +## of default keybindings. If you want to disable some +## bindings, there is a special action called 'dummy' +## for that purpose. Eg. if you want to disable ability +## to crop playlists, you need to put the following +## into configuration file: +## +## def_key "C" +## dummy +## +## After that ncmpcpp will not bind any default action +## to this key. +## +## 4) To let you write simple macros, the following special +## actions are provided: +## +## - push_character "character" - pushes given special +## character into input queue, so it will be immediately +## picked by ncmpcpp upon next call to readKey function. +## Accepted values: mouse, up, down, page_up, page_down, +## home, end, space, enter, insert, delete, left, right, +## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\, +## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace. +## In addition, most of these names can be prefixed with +## alt-/ctrl-/shift- to be recognized with the appropriate +## modifier key(s). +## +## - push_characters "string" - pushes given string into +## input queue. +## +## - require_runnable "action" - checks whether given action +## is runnable and fails if it isn't. This is especially +## useful when mixed with previous two functions. Consider +## the following macro definition: +## +## def_key "key" +## push_characters "custom_filter" +## apply_filter +## +## If apply_filter can't be currently run, we end up with +## sequence of characters in input queue which will be +## treated just as we typed them. This may lead to unexpected +## results (in this case 'c' will most likely clear current +## playlist, 'u' will trigger database update, 's' will stop +## playback etc.). To prevent such thing from happening, we +## need to change above definition to this one: +## +## def_key "key" +## require_runnable "apply_filter" +## push_characters "custom_filter" +## apply_filter +## +## Here, first we test whether apply_filter can be actually run +## before we stuff characters into input queue, so if condition +## is not met, whole chain is aborted and we're fine. +## +## - require_screen "screen" - checks whether given screen is +## currently active. accepted values: browser, clock, help, +## media_library, outputs, playlist, playlist_editor, +## search_engine, tag_editor, visualizer, last_fm, lyrics, +## selected_items_adder, server_info, song_info, +## sort_playlist_dialog, tiny_tag_editor. +## +## - run_external_command "command" - runs given command using +## system() function. +## +## 5) In addition to binding to a key, you can also bind actions +## or chains of actions to a command. If it comes to commands, +## syntax is very similar to defining keys. Here goes example +## definition of a command: +## +## def_command "quit" [deferred] +## stop +## quit +## +## If you execute the above command (which can be done by +## invoking action execute_command, typing 'quit' and pressing +## enter), ncmpcpp will stop the player and then quit. Note the +## presence of word 'deferred' enclosed in square brackets. It +## tells ncmpcpp to wait for confirmation (ie. pressing enter) +## after you typed quit. Instead of 'deferred', 'immediate' +## could be used. Then ncmpcpp will not wait for confirmation +## (enter) and will execute the command the moment it sees it. +## +## Note: while command chains are executed, internal environment +## update (which includes current window refresh and mpd status +## update) is not performed for performance reasons. However, it +## may be desirable to do so in some situration. Therefore it's +## possible to invoke by hand by performing 'update enviroment' +## action. +## +## Note: There is a difference between: +## +## def_key "key" +## action1 +## +## def_key "key" +## action2 +## +## and +## +## def_key "key" +## action1 +## action2 +## +## First one binds two single actions to the same key whilst +## second one defines a chain of actions. The behavior of +## these two is different and is described in (1) and (2). +## +## Note: Function def_key accepts non-ascii characters. +## +##### List of unbound actions ##### +## +## The following actions are not bound to any key/command: +## +## - set_volume +## +# +#def_key "mouse" +# mouse_event +# +#def_key "up" +# scroll_up +# +#def_key "shift-up" +# select_item +# scroll_up +# +#def_key "down" +# scroll_down +# +#def_key "shift-down" +# select_item +# scroll_down +# +#def_key "[" +# scroll_up_album +# +#def_key "]" +# scroll_down_album +# +#def_key "{" +# scroll_up_artist +# +#def_key "}" +# scroll_down_artist +# +#def_key "page_up" +# page_up +# +#def_key "page_down" +# page_down +# +#def_key "home" +# move_home +# +#def_key "end" +# move_end +# +#def_key "insert" +# select_item +# +#def_key "enter" +# enter_directory +# +#def_key "enter" +# toggle_output +# +#def_key "enter" +# run_action +# +#def_key "enter" +# play_item +# +#def_key "space" +# add_item_to_playlist +# +#def_key "space" +# toggle_lyrics_update_on_song_change +# +#def_key "space" +# toggle_visualization_type +# +#def_key "delete" +# delete_playlist_items +# +#def_key "delete" +# delete_browser_items +# +#def_key "delete" +# delete_stored_playlist +# +#def_key "right" +# next_column +# +#def_key "right" +# slave_screen +# +#def_key "right" +# volume_up +# +#def_key "+" +# volume_up +# +#def_key "left" +# previous_column +# +#def_key "left" +# master_screen +# +#def_key "left" +# volume_down +# +#def_key "-" +# volume_down +# +#def_key ":" +# execute_command +# +#def_key "tab" +# next_screen +# +#def_key "shift-tab" +# previous_screen +# +#def_key "f1" +# show_help +# +#def_key "1" +# show_playlist +# +#def_key "2" +# show_browser +# +#def_key "2" +# change_browse_mode +# +#def_key "3" +# show_search_engine +# +#def_key "3" +# reset_search_engine +# +#def_key "4" +# show_media_library +# +#def_key "4" +# toggle_media_library_columns_mode +# +#def_key "5" +# show_playlist_editor +# +#def_key "6" +# show_tag_editor +# +#def_key "7" +# show_outputs +# +#def_key "8" +# show_visualizer +# +#def_key "=" +# show_clock +# +#def_key "@" +# show_server_info +# +#def_key "s" +# stop +# +#def_key "p" +# pause +# +#def_key ">" +# next +# +#def_key "<" +# previous +# +#def_key "ctrl-h" +# jump_to_parent_directory +# +#def_key "ctrl-h" +# replay_song +# +#def_key "backspace" +# jump_to_parent_directory +# +#def_key "backspace" +# replay_song +# +#def_key "f" +# seek_forward +# +#def_key "b" +# seek_backward +# +#def_key "r" +# toggle_repeat +# +#def_key "z" +# toggle_random +# +#def_key "y" +# save_tag_changes +# +#def_key "y" +# start_searching +# +#def_key "y" +# toggle_single +# +#def_key "R" +# toggle_consume +# +#def_key "Y" +# toggle_replay_gain_mode +# +#def_key "T" +# toggle_add_mode +# +#def_key "|" +# toggle_mouse +# +#def_key "#" +# toggle_bitrate_visibility +# +#def_key "Z" +# shuffle +# +#def_key "x" +# toggle_crossfade +# +#def_key "X" +# set_crossfade +# +#def_key "u" +# update_database +# +#def_key "ctrl-s" +# sort_playlist +# +#def_key "ctrl-s" +# toggle_browser_sort_mode +# +#def_key "ctrl-s" +# toggle_media_library_sort_mode +# +#def_key "ctrl-r" +# reverse_playlist +# +#def_key "ctrl-f" +# apply_filter +# +#def_key "ctrl-_" +# select_found_items +# +#def_key "/" +# find +# +#def_key "/" +# find_item_forward +# +#def_key "?" +# find +# +#def_key "?" +# find_item_backward +# +#def_key "." +# next_found_item +# +#def_key "," +# previous_found_item +# +#def_key "w" +# toggle_find_mode +# +#def_key "e" +# edit_song +# +#def_key "e" +# edit_library_tag +# +#def_key "e" +# edit_library_album +# +#def_key "e" +# edit_directory_name +# +#def_key "e" +# edit_playlist_name +# +#def_key "e" +# edit_lyrics +# +#def_key "i" +# show_song_info +# +#def_key "I" +# show_artist_info +# +#def_key "g" +# jump_to_position_in_song +# +#def_key "l" +# show_lyrics +# +#def_key "ctrl-v" +# select_range +# +#def_key "v" +# reverse_selection +# +#def_key "V" +# remove_selection +# +#def_key "B" +# select_album +# +#def_key "a" +# add_selected_items +# +#def_key "c" +# clear_playlist +# +#def_key "c" +# clear_main_playlist +# +#def_key "C" +# crop_playlist +# +#def_key "C" +# crop_main_playlist +# +#def_key "m" +# move_sort_order_up +# +#def_key "m" +# move_selected_items_up +# +#def_key "n" +# move_sort_order_down +# +#def_key "n" +# move_selected_items_down +# +#def_key "M" +# move_selected_items_to +# +#def_key "A" +# add +# +#def_key "S" +# save_playlist +# +#def_key "o" +# jump_to_playing_song +# +#def_key "G" +# jump_to_browser +# +#def_key "G" +# jump_to_playlist_editor +# +#def_key "~" +# jump_to_media_library +# +#def_key "E" +# jump_to_tag_editor +# +#def_key "U" +# toggle_playing_song_centering +# +#def_key "P" +# toggle_display_mode +# +#def_key "\\" +# toggle_interface +# +#def_key "!" +# toggle_separators_between_albums +# +#def_key "L" +# toggle_lyrics_fetcher +# +#def_key "F" +# fetch_lyrics_in_background +# +#def_key "alt-l" +# toggle_fetching_lyrics_in_background +# +#def_key "ctrl-l" +# toggle_screen_lock +# +#def_key "`" +# toggle_library_tag_type +# +#def_key "`" +# refetch_lyrics +# +#def_key "`" +# add_random_items +# +#def_key "ctrl-p" +# set_selected_items_priority +# +#def_key "q" +# quit +# +# +#def_key "f" +# find +#def_key "f" +# find_item_forward + +def_key "+" + show_clock +def_key "=" + volume_up +def_key "-" + volume_down + +def_key "h" + previous_column +def_key "j" + scroll_down +def_key "k" + scroll_up +def_key "l" + next_column + +def_key "ctrl-u" + page_up +#push_characters "kkkkkkkkkkkkkkk" +def_key "ctrl-d" + page_down +#push_characters "jjjjjjjjjjjjjjj" +def_key "u" + page_up +#push_characters "kkkkkkkkkkkkkkk" +def_key "d" + page_down +#push_characters "jjjjjjjjjjjjjjj" + +def_key "b" + seek_backward +def_key "n" + seek_forward + +#def_key "n" +# next_found_item +def_key "N" + previous_found_item + +# not used but bound +def_key "J" + move_sort_order_down +def_key "K" + move_sort_order_up +def_key "h" + jump_to_parent_directory +def_key "l" + enter_directory +def_key "l" + run_action +def_key "l" + play_item +def_key "m" + show_media_library +def_key "m" + toggle_media_library_columns_mode +def_key "t" + show_tag_editor +def_key "v" + show_visualizer +def_key "G" + move_end +def_key "g" + move_home +#jump_to_position_in_song +def_key "U" + update_database +def_key "s" + reset_search_engine +def_key "s" + show_search_engine +def_key "f" + show_browser +def_key "f" + change_browse_mode +def_key "x" + delete_playlist_items +def_key "P" + show_playlist diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config new file mode 100644 index 0000000..4c02cb4 --- /dev/null +++ b/.config/ncmpcpp/config @@ -0,0 +1,551 @@ +############################################################################## +## This is the example configuration file. Copy it to $HOME/.ncmpcpp/config ## +## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences. ## +############################################################################## +## ____ _________ ___ ____ _________ ____ +## / __ \/ ___/ __ `__ \/ __ \/ ___/ __ \/ __ \ +## / / / / /__/ / / / / / /_/ / /__/ /_/ / /_/ / +## /_/ /_/\___/_/ /_/ /_/ .___/\___/ .___/ .___/ +## /_/ /_/ /_/ +## n-curses music player client++ config file. +## +##### directories ###### +## +## Directory for storing ncmpcpp related files. Changing it is useful if you +## want to store everything somewhere else and provide command line setting for +## alternative location to config file which defines that while launching +## ncmpcpp. +## +# +ncmpcpp_directory = ~/.config/ncmpcpp +# +## +## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other +## MPD clients (eg. ncmpc) also use that location. +## +# +lyrics_directory = ~/.config/lyrics +# +##### connection settings ##### +# +#mpd_host = localhost +# +#mpd_port = 6600 +# +#mpd_connection_timeout = 5 +# +## Needed for tag editor and file operations to work. +## +mpd_music_dir = "~/Music" +# +#mpd_crossfade_time = 5 +# +##### music visualizer ##### +## +## Note: In order to make music visualizer work you'll need to use mpd fifo +## output, whose format parameter has to be set to 44100:16:1 for mono +## visualization or 44100:16:2 for stereo visualization. Example configuration +## (it has to be put into mpd.conf): +## +## audio_output { +## type "fifo" +## name "Visualizer feed" +## path "/tmp/mpd.fifo" +## format "44100:16:2" +## } +## +# +#visualizer_fifo_path = /tmp/mpd.fifo +# +## +## Note: Below parameter is needed for ncmpcpp to determine which output +## provides data for visualizer and thus allow syncing between visualization and +## sound as currently there are some problems with it. +## +# +#visualizer_output_name = Visualizer feed +# +## +## If you set format to 44100:16:2, make it 'yes'. +## +#visualizer_in_stereo = yes +# +## +## Note: Below parameter defines how often ncmpcpp has to "synchronize" +## visualizer and audio outputs. 30 seconds is optimal value, but if you +## experience synchronization problems, set it to lower value. Keep in mind +## that sane values start with >=10. +## +# +#visualizer_sync_interval = 30 +# +## +## Note: To enable spectrum frequency visualization you need to compile ncmpcpp +## with fftw3 support. +## +# +## Available values: spectrum, wave, wave_filled, ellipse. +## +visualizer_type = spectrum +# +#visualizer_look = ●卐 +#visualizer_look = 卐 +# +#visualizer_color = blue, cyan, green, yellow, magenta, red +# +## Alternative subset of 256 colors for terminals that support it. +## +#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161 +# +##### system encoding ##### +## +## ncmpcpp should detect your charset encoding but if it failed to do so, you +## can specify charset encoding you are using here. +## +## Note: You can see whether your ncmpcpp build supports charset detection by +## checking output of `ncmpcpp --version`. +## +## Note: Since MPD uses UTF-8 by default, setting this option makes sense only +## if your encoding is different. +## +# +#system_encoding = "" +# +##### delays ##### +# +## Time of inactivity (in seconds) after playlist highlighting will be disabled +## (0 = always on). +## +#playlist_disable_highlight_delay = 5 +# +## Defines how long messages are supposed to be visible. +## +message_delay_time = 1 +# +##### song format ##### +## +## For a song format you can use: +## +## %l - length +## %f - filename +## %D - directory +## %a - artist +## %A - album artist +## %t - title +## %b - album +## %y - date +## %n - track number (01/12 -> 01) +## %N - full track info (01/12 -> 01/12) +## %g - genre +## %c - composer +## %p - performer +## %d - disc +## %C - comment +## %P - priority +## $R - begin right alignment +## +## If you want to make sure that a part of the format is displayed only when +## certain tags are present, you can archieve it by grouping them with brackets, +## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are +## present or '' otherwise. It is also possible to define a list of +## alternatives by providing several groups and separating them with '|', +## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is +## not present. +## +## Note: If you want to set limit on maximal length of a tag, just put the +## appropriate number between % and character that defines tag type, e.g. to +## make album take max. 20 terminal cells, use '%20b'. +## +## In addition, formats support markers used for text attributes. They are +## followed by character '$'. After that you can put: +## +## - 0 - default window color (discards all other colors) +## - 1 - black +## - 2 - red +## - 3 - green +## - 4 - yellow +## - 5 - blue +## - 6 - magenta +## - 7 - cyan +## - 8 - white +## - 9 - end of current color +## - b - bold text +## - u - underline text +## - r - reverse colors +## - a - use alternative character set +## +## If you don't want to use a non-color attribute anymore, just put it again, +## but this time insert character '/' between '$' and attribute character, +## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with +## reversed colors. +## +## If you want to use 256 colors and/or background colors in formats (the naming +## scheme is described below in section about color definitions), it can be done +## with the syntax $(COLOR), e.g. to set the artist tag to one of the +## non-standard colors and make it have yellow background, you need to write +## $(197_yellow)%a$(end). Note that for standard colors this is interchangable +## with attributes listed above. +## +## Note: colors can be nested. +## +# +song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} +# +song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f} +# +song_library_format = {%n - }{%t}|{%f} +# +alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b +# +alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} +# +current_item_prefix = $(cyan)$r$b +# +current_item_suffix = $/r$(end)$/b +# +current_item_inactive_column_prefix = $(magenta)$r +# +current_item_inactive_column_suffix = $/r$(end) +# +#now_playing_prefix = $b +# +#now_playing_suffix = $/b +# +#browser_playlist_prefix = "$2playlist$9 " +# +#selected_item_prefix = $6 +# +#selected_item_suffix = $9 +# +#modified_item_prefix = $3> $9 +# +## +## Note: attributes are not supported for the following variables. +## +#song_window_title_format = {%a - }{%t}|{%f} +## +## Note: Below variables are used for sorting songs in browser. The sort mode +## determines how songs are sorted, and can be used in combination with a sort +## format to specify a custom sorting format. Available values for +## browser_sort_mode are "name", "mtime", "format" and "noop". +## +# +#browser_sort_mode = name +# +#browser_sort_format = {%a - }{%t}|{%f} {(%l)} +# +##### columns settings ##### +## +## syntax of song columns list format is "column column etc." +## +## - syntax for each column is: +## +## (width of the column)[color of the column]{displayed tag} +## +## Note: Width is by default in %, if you want a column to have fixed size, add +## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of +## screen (so the real width will depend on actual screen size), whereas +## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen +## is. +## +## - color is optional (if you want the default one, leave the field empty). +## +## Note: You can give a column additional attributes by putting appropriate +## character after displayed tag character. Available attributes are: +## +## - r - column will be right aligned +## - E - if tag is empty, empty tag marker won't be displayed +## +## You can also: +## +## - give a column custom name by putting it after attributes, separated with +## character ':', e.g. {lr:Length} gives you right aligned column of lengths +## named "Length". +## +## - define sequence of tags, that have to be displayed in case predecessor is +## empty in a way similar to the one in classic song format, i.e. using '|' +## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to +## display artist tag and then composer and performer if previous ones are not +## available. +## +# +#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l} +# +##### various settings ##### +# +## +## Note: Custom command that will be executed each time song changes. Useful for +## notifications etc. +## +#execute_on_song_change = "" +# +## +## Note: Custom command that will be executed each time player state +## changes. The environment variable MPD_PLAYER_STATE is set to the current +## state (either unknown, play, pause, or stop) for its duration. +## +# +#execute_on_player_state_change = "" +# +#playlist_show_mpd_host = no +# +#playlist_show_remaining_time = no +# +#playlist_shorten_total_times = no +# +#playlist_separate_albums = no +# +## +## Note: Possible display modes: classic, columns. +## +playlist_display_mode = columns +# +browser_display_mode = columns +# +#search_engine_display_mode = classic +# +#playlist_editor_display_mode = classic +# +#discard_colors_if_item_is_selected = yes +# +#show_duplicate_tags = true +# +#incremental_seeking = yes +# +#seek_time = 1 +# +#volume_change_step = 2 +# +#autocenter_mode = no +# +#centered_cursor = no +# +## +## Note: You can specify third character which will be used to build 'empty' +## part of progressbar. +## +progressbar_look = -> +# +## Available values: database, playlist. +## +#default_place_to_search_in = database +# +## Available values: classic, alternative. +## +#user_interface = classic +# +#data_fetching_delay = yes +# +## Available values: artist, album_artist, date, genre, composer, performer. +## +media_library_primary_tag = album_artist +# +media_library_albums_split_by_date = no +# +## Available values: wrapped, normal. +## +#default_find_mode = wrapped +# +#default_tag_editor_pattern = %n - %t +# +#header_visibility = yes +# +#statusbar_visibility = yes +# +#titles_visibility = yes +# +#header_text_scrolling = yes +# +#cyclic_scrolling = no +# +#lines_scrolled = 2 +# +#lyrics_fetchers = lyricwiki, azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet +# +#follow_now_playing_lyrics = no +# +#fetch_lyrics_for_current_song_in_background = no +# +#store_lyrics_in_song_dir = no +# +#generate_win32_compatible_filenames = yes +# +#allow_for_physical_item_deletion = no +# +## +## Note: If you set this variable, ncmpcpp will try to get info from last.fm in +## language you set and if it fails, it will fall back to english. Otherwise it +## will use english the first time. +## +## Note: Language has to be expressed as an ISO 639 alpha-2 code. +## +#lastfm_preferred_language = en +# +#space_add_mode = add_remove +# +#show_hidden_files_in_local_browser = no +# +## +## How shall screen switcher work? +## +## - "previous" - switch between the current and previous screen. +## - "screen1,...,screenN" - switch between given sequence of screens. +## +## Screens available for use: help, playlist, browser, search_engine, +## media_library, playlist_editor, tag_editor, outputs, visualizer, clock, +## lyrics, last_fm. +## +#screen_switcher_mode = playlist, browser +# +## +## Note: You can define startup screen by choosing screen from the list above. +## +startup_screen = media_library +# +## +## Note: You can define startup slave screen by choosing screen from the list +## above or an empty value for no slave screen. +## +#startup_slave_screen = "" +# +#startup_slave_screen_focus = no +# +## +## Default width of locked screen (in %). Acceptable values are from 20 to 80. +## +# +#locked_screen_width_part = 50 +# +#ask_for_locked_screen_width_part = yes +# +#jump_to_now_playing_song_at_start = yes +# +#ask_before_clearing_playlists = yes +# +#clock_display_seconds = no +# +display_volume_level = no +# +#display_bitrate = no +# +#display_remaining_time = no +# +## Available values: none, basic, extended, perl. +## +#regular_expressions = perl +# +## +## Note: if below is enabled, ncmpcpp will ignore leading "The" word while +## sorting items in browser, tags in media library, etc. +## +ignore_leading_the = yes +# +## +## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and +## filtering lists. This takes an effect only if boost was compiled with ICU +## support. +## +#ignore_diacritics = no +# +#block_search_constraints_change_if_items_found = yes +# +#mouse_support = yes +# +#mouse_list_scroll_whole_page = yes +# +#empty_tag_marker = +# +#tags_separator = " | " +# +#tag_editor_extended_numeration = no +# +#media_library_sort_by_mtime = no +# +#enable_window_title = yes +# +## +## Note: You can choose default search mode for search engine. Available modes +## are: +## +## - 1 - use mpd built-in searching (no regexes, pattern matching) +## +## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but +## if your mpd is on a remote machine, downloading big database to process +## it can take a while +## +## - 3 - match only exact values (this mode uses mpd function for searching in +## database and local one for searching in current playlist) +## +# +#search_engine_default_search_mode = 1 +# +external_editor = vim +# +## Note: set to yes if external editor is a console application. +## +use_console_editor = yes +# +##### colors definitions ##### +## +## It is possible to set a background color by setting a color value +## "_", e.g. red_black will set foregound color to red +## and background color to black. +## +## In addition, for terminals that support 256 colors it is possible to set one +## of them by using a number in range [1, 256] instead of color name, +## e.g. numerical value corresponding to red_black is 2_1. To find out if the +## terminal supports 256 colors, run ncmpcpp and check out the bottom of the +## help screen for list of available colors and their numerical values. +## +## What is more, there are two special values for the background color: +## "transparent" and "current". The first one explicitly sets the background to +## be transparent, while the second one allows you to preserve current +## background color and change only the foreground one. It's used implicitly +## when background color is not specified. +## +## Moreover, it is possible to attach format information to selected color +## variables by appending to their end a colon followed by one or more format +## flags, e.g. black:b or red:ur. The following variables support this syntax: +## visualizer_color, color1, color2, empty_tag_color, volume_color, +## state_line_color, state_flags_color, progressbar_color, +## progressbar_elapsed_color, player_state_color, statusbar_time_color, +## alternative_ui_separator_color. +## +## Note: due to technical limitations of older ncurses version, if 256 colors +## are used there is a possibility that you'll be able to use only colors with +## transparent background. +# +#colors_enabled = yes +# +empty_tag_color = magenta +# +#header_window_color = magenta +# +#volume_color = default +# +#state_line_color = default +# +#state_flags_color = default:b +# +main_window_color = white +# +#color1 = white +# +#color2 = green +# +progressbar_color = black:b +# +progressbar_elapsed_color = blue:b +# +statusbar_color = red +# +statusbar_time_color = cyan:b +# +#player_state_color = default:b +# +#alternative_ui_separator_color = black:b +# +#window_border_color = green +# +#active_window_border = red +# diff --git a/.config/ncmpcpp/error.log b/.config/ncmpcpp/error.log new file mode 100644 index 0000000..e69de29 diff --git a/.config/neofetch/config.conf b/.config/neofetch/config.conf new file mode 100644 index 0000000..8f7127d --- /dev/null +++ b/.config/neofetch/config.conf @@ -0,0 +1,761 @@ +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +print_info() { + info title + info underline + + info "OS" distro + info "Host" model + info "Kernel" kernel + info "Uptime" uptime + info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wm_theme + info "Theme" theme + info "Icons" icons + info "Terminal" term + info "Terminal Font" term_font + info "CPU" cpu + info "GPU" gpu + info "Memory" memory + + info "GPU Driver" gpu_driver # Linux/macOS only # kev + # info "CPU Usage" cpu_usage + # info "Disk" disk + # info "Battery" battery + # info "Font" font + # info "Song" song + # [[ $player ]] && prin "Music Player" "$player" + # info "Local IP" local_ip + # info "Public IP" public_ip + # info "Users" users + # info "Locale" locale # This only works on glibc systems. + + info cols +} + + +# Kernel + + +# Shorten the output of the kernel function. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --kernel_shorthand +# Supports: Everything except *BSDs (except PacBSD and PC-BSD) +# +# Example: +# on: '4.8.9-1-ARCH' +# off: 'Linux 4.8.9-1-ARCH' +kernel_shorthand="on" + + +# Distro + + +# Shorten the output of the distro function +# +# Default: 'off' +# Values: 'on', 'off', 'tiny' +# Flag: --distro_shorthand +# Supports: Everything except Windows and Haiku +distro_shorthand="off" + +# Show/Hide OS Architecture. +# Show 'x86_64', 'x86' and etc in 'Distro:' output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --os_arch +# +# Example: +# on: 'Arch Linux x86_64' +# off: 'Arch Linux' +os_arch="on" + + +# Uptime + + +# Shorten the output of the uptime function +# +# Default: 'on' +# Values: 'on', 'off', 'tiny' +# Flag: --uptime_shorthand +# +# Example: +# on: '2 days, 10 hours, 3 mins' +# off: '2 days, 10 hours, 3 minutes' +# tiny: '2d 10h 3m' +uptime_shorthand="on" + + +# Memory + + +# Show memory pecentage in output. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --memory_percent +# +# Example: +# on: '1801MiB / 7881MiB (22%)' +# off: '1801MiB / 7881MiB' +memory_percent="off" + + +# Packages + + +# Show/Hide Package Manager names. +# +# Default: 'tiny' +# Values: 'on', 'tiny' 'off' +# Flag: --package_managers +# +# Example: +# on: '998 (pacman), 8 (flatpak), 4 (snap)' +# tiny: '908 (pacman, flatpak, snap)' +# off: '908' +package_managers="on" + + +# Shell + + +# Show the path to $SHELL +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --shell_path +# +# Example: +# on: '/bin/bash' +# off: 'bash' +shell_path="off" + +# Show $SHELL version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --shell_version +# +# Example: +# on: 'bash 4.4.5' +# off: 'bash' +shell_version="on" + + +# CPU + + +# CPU speed type +# +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. +# Flag: --speed_type +# Supports: Linux with 'cpufreq' +# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. +speed_type="bios_limit" + +# CPU speed shorthand +# +# Default: 'off' +# Values: 'on', 'off'. +# Flag: --speed_shorthand +# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz +# +# Example: +# on: 'i7-6500U (4) @ 3.1GHz' +# off: 'i7-6500U (4) @ 3.100GHz' +speed_shorthand="off" + +# Enable/Disable CPU brand in output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +# +# Example: +# on: 'Intel i7-6500U' +# off: 'i7-6500U (4)' +cpu_brand="on" + +# CPU Speed +# Hide/Show CPU speed. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_speed +# +# Example: +# on: 'Intel i7-6500U (4) @ 3.1GHz' +# off: 'Intel i7-6500U (4)' +cpu_speed="on" + +# CPU Cores +# Display CPU cores in output +# +# Default: 'logical' +# Values: 'logical', 'physical', 'off' +# Flag: --cpu_cores +# Support: 'physical' doesn't work on BSD. +# +# Example: +# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) +# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) +# off: 'Intel i7-6500U @ 3.1GHz' +cpu_cores="logical" + +# CPU Temperature +# Hide/Show CPU temperature. +# Note the temperature is added to the regular CPU function. +# +# Default: 'off' +# Values: 'C', 'F', 'off' +# Flag: --cpu_temp +# Supports: Linux, BSD +# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable +# coretemp kernel module. This only supports newer Intel processors. +# +# Example: +# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' +# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' +# off: 'Intel i7-6500U (4) @ 3.1GHz' +cpu_temp="off" + + +# GPU + + +# Enable/Disable GPU Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +# +# Example: +# on: 'AMD HD 7950' +# off: 'HD 7950' +gpu_brand="on" + +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# Supports: Linux +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" + + +# Resolution + + +# Display refresh rate next to each monitor +# Default: 'off' +# Values: 'on', 'off' +# Flag: --refresh_rate +# Supports: Doesn't work on Windows. +# +# Example: +# on: '1920x1080 @ 60Hz' +# off: '1920x1080' +refresh_rate="on" + + +# Gtk Theme / Icons / Font + + +# Shorten output of GTK Theme / Icons / Font +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --gtk_shorthand +# +# Example: +# on: 'Numix, Adwaita' +# off: 'Numix [GTK2], Adwaita [GTK3]' +gtk_shorthand="off" + + +# Enable/Disable gtk2 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk2 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Adwaita [GTK3]' +gtk2="on" + +# Enable/Disable gtk3 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk3 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Numix [GTK2]' +gtk3="on" + + +# IP Address + + +# Website to ping for the public IP +# +# Default: 'http://ident.me' +# Values: 'url' +# Flag: --ip_host +public_ip_host="http://ident.me" + +# Public IP timeout. +# +# Default: '2' +# Values: 'int' +# Flag: --ip_timeout +public_ip_timeout=2 + + +# Disk + + +# Which disks to display. +# The values can be any /dev/sdXX, mount point or directory. +# NOTE: By default we only show the disk info for '/'. +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +# +# Example: +# disk_show=('/' '/dev/sdb1'): +# 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 823G / 893G (93%)' +# +# disk_show=('/'): +# 'Disk (/): 74G / 118G (66%)' +# +disk_show=('/') + +# Disk subtitle. +# What to append to the Disk subtitle. +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir' +# Flag: --disk_subtitle +# +# Example: +# name: 'Disk (/dev/sda1): 74G / 118G (66%)' +# 'Disk (/dev/sdb2): 74G / 118G (66%)' +# +# mount: 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 74G / 118G (66%)' +# +# dir: 'Disk (/): 74G / 118G (66%)' +# 'Disk (Local Disk): 74G / 118G (66%)' +# 'Disk (Videos): 74G / 118G (66%)' +disk_subtitle="mount" + + +# Song + + +# Manually specify a music player. +# +# Default: 'auto' +# Values: 'auto', 'player-name' +# Flag: --music_player +# +# Available values for 'player-name': +# +# amarok +# audacious +# banshee +# bluemindo +# clementine +# cmus +# deadbeef +# deepin-music +# dragon +# elisa +# exaile +# gnome-music +# gmusicbrowser +# guayadeque +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# netease-cloud-music +# pogo +# pragha +# qmmp +# quodlibet +# rhythmbox +# sayonara +# smplayer +# spotify +# tomahawk +# vlc +# xmms2d +# yarock +music_player="auto" + +# Format to display song information. +# +# Default: '%artist% - %album% - %title%' +# Values: '%artist%', '%album%', '%title%' +# Flag: --song_format +# +# Example: +# default: 'Song: Jet - Get Born - Sgt Major' +song_format="%artist% - %album% - %title%" + +# Print the Artist, Album and Title on separate lines +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --song_shorthand +# +# Example: +# on: 'Artist: The Fratellis' +# 'Album: Costello Music' +# 'Song: Chelsea Dagger' +# +# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' +song_shorthand="off" + +# 'mpc' arguments (specify a host, password etc). +# +# Default: '' +# Example: mpc_args=(-h HOST -P PASSWORD) +mpc_args=() + + +# Text Colors + + +# Text Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --colors +# +# Each number represents a different part of the text in +# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' +# +# Example: +# colors=(distro) - Text is colored based on Distro colors. +# colors=(4 6 1 8 8 6) - Text is colored in the order above. +colors=(distro) + + +# Text Options + + +# Toggle bold text +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bold +bold="on" + +# Enable/Disable Underline +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --underline +underline_enabled="on" + +# Underline character +# +# Default: '-' +# Values: 'string' +# Flag: --underline_char +underline_char="-" + + +# Info Separator +# Replace the default separator with the specified string. +# +# Default: ':' +# Flag: --separator +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": 'WM = dwm' +separator=":" + + +# Color Blocks + + +# Color block range +# The range of colors to print. +# +# Default: '0', '7' +# Values: 'num' +# Flag: --block_range +# +# Example: +# +# Display colors 0-7 in the blocks. (8 colors) +# neofetch --block_range 0 7 +# +# Display colors 0-15 in the blocks. (16 colors) +# neofetch --block_range 0 15 +block_range=(0 7) + +# Toggle color blocks +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --color_blocks +color_blocks="on" + +# Color block width in spaces +# +# Default: '3' +# Values: 'num' +# Flag: --block_width +block_width=3 + +# Color block height in lines +# +# Default: '1' +# Values: 'num' +# Flag: --block_height +block_height=1 + + +# Progress Bars + + +# Bar characters +# +# Default: '-', '=' +# Values: 'string', 'string' +# Flag: --bar_char +# +# Example: +# neofetch --bar_char 'elapsed' 'total' +# neofetch --bar_char '-' '=' +bar_char_elapsed="-" +bar_char_total="=" + +# Toggle Bar border +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bar_border +bar_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# +# Default: '15' +# Values: 'num' +# Flag: --bar_length +bar_length=15 + +# Progress bar colors +# When set to distro, uses your distro's logo colors. +# +# Default: 'distro', 'distro' +# Values: 'distro', 'num' +# Flag: --bar_colors +# +# Example: +# neofetch --bar_colors 3 4 +# neofetch --bar_colors distro 5 +bar_color_elapsed="distro" +bar_color_total="distro" + + +# Info display +# Display a bar with the info. +# +# Default: 'off' +# Values: 'bar', 'infobar', 'barinfo', 'off' +# Flags: --cpu_display +# --memory_display +# --battery_display +# --disk_display +# +# Example: +# bar: '[---=======]' +# infobar: 'info [---=======]' +# barinfo: '[---=======] info' +# off: 'info' +cpu_display="off" +memory_display="off" +battery_display="off" +disk_display="off" + + +# Backend Settings + + +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +image_backend="ascii" + +# Image Source +# +# Which image or ascii file to display. +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' +# Flag: --source +# +# NOTE: 'auto' will pick the best image source for whatever image backend is used. +# In ascii mode, distro ascii art will be used and in an image mode, your +# wallpaper will be used. +image_source="auto" + + +# Ascii Options + + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# +# NOTE: Arch and Ubuntu have 'old' logo variants. +# Change this to 'arch_old' or 'ubuntu_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors. +# NOTE: Arch, Crux and Gentoo have a smaller logo variant. +# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos. +ascii_distro="auto" + +# Ascii Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +# +# Example: +# ascii_colors=(distro) - Ascii is colored based on Distro colors. +# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. +ascii_colors=(distro) + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + + +# Image Options + + +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + +# Thumbnail directory +# +# Default: '~/.cache/thumbnails/neofetch' +# Values: 'dir' +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" + +# Crop mode +# +# Default: 'normal' +# Values: 'normal', 'fit', 'fill' +# Flag: --crop_mode +# +# See this wiki page to learn about the fit and fill options. +# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F +crop_mode="normal" + +# Crop offset +# Note: Only affects 'normal' crop mode. +# +# Default: 'center' +# Values: 'northwest', 'north', 'northeast', 'west', 'center' +# 'east', 'southwest', 'south', 'southeast' +# Flag: --crop_offset +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# +# Default: 'auto' +# Values: 'auto', '00px', '00%', 'none' +# Flags: --image_size +# --size +image_size="auto" + +# Gap between image and text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=3 + +# Image offsets +# Only works with the w3m backend. +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=0 + +# Image background color +# Only works with the w3m backend. +# +# Default: '' +# Values: 'color', 'blue' +# Flag: --bg_color +background_color= + + +# Misc Options + +# Stdout mode +# Turn off all colors and disables image backend (ASCII/Image). +# Useful for piping into another command. +# Default: 'off' +# Values: 'on', 'off' +stdout="off" diff --git a/.config/nvim/autoload/pathogen.vim b/.config/nvim/autoload/pathogen.vim new file mode 120000 index 0000000..c05e13f --- /dev/null +++ b/.config/nvim/autoload/pathogen.vim @@ -0,0 +1 @@ +/usr/share/vim/vimfiles/autoload/pathogen.vim \ No newline at end of file diff --git a/.config/nvim/autoload/plug.vim b/.config/nvim/autoload/plug.vim new file mode 100644 index 0000000..ace33a8 --- /dev/null +++ b/.config/nvim/autoload/plug.vim @@ -0,0 +1,2465 @@ +" More information: https://github.com/junegunn/vim-plug +" +" Copyright (c) 2017 Junegunn Choi +" +" MIT License +" +" Permission is hereby granted, free of charge, to any person obtaining +" a copy of this software and associated documentation files (the +" "Software"), to deal in the Software without restriction, including +" without limitation the rights to use, copy, modify, merge, publish, +" distribute, sublicense, and/or sell copies of the Software, and to +" permit persons to whom the Software is furnished to do so, subject to +" the following conditions: +" +" The above copyright notice and this permission notice shall be +" included in all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if exists('g:loaded_plug') + finish +endif +let g:loaded_plug = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let s:plug_src = 'https://github.com/junegunn/vim-plug.git' +let s:plug_tab = get(s:, 'plug_tab', -1) +let s:plug_buf = get(s:, 'plug_buf', -1) +let s:mac_gui = has('gui_macvim') && has('gui_running') +let s:is_win = has('win32') +let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) +let s:vim8 = has('patch-8.0.0039') && exists('*job_start') +let s:me = resolve(expand(':p')) +let s:base_spec = { 'branch': 'master', 'frozen': 0 } +let s:TYPE = { +\ 'string': type(''), +\ 'list': type([]), +\ 'dict': type({}), +\ 'funcref': type(function('call')) +\ } +let s:loaded = get(s:, 'loaded', {}) +let s:triggers = get(s:, 'triggers', {}) + +function! plug#begin(...) + if a:0 > 0 + let s:plug_home_org = a:1 + let home = s:path(fnamemodify(expand(a:1), ':p')) + elseif exists('g:plug_home') + let home = s:path(g:plug_home) + elseif !empty(&rtp) + let home = s:path(split(&rtp, ',')[0]) . '/plugged' + else + return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') + endif + if fnamemodify(home, ':t') ==# 'plugin' && fnamemodify(home, ':h') ==# s:first_rtp + return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') + endif + + let g:plug_home = home + let g:plugs = {} + let g:plugs_order = [] + let s:triggers = {} + + call s:define_commands() + return 1 +endfunction + +function! s:define_commands() + command! -nargs=+ -bar Plug call plug#() + if !executable('git') + return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') + endif + command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) + command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) + command! -nargs=0 -bar -bang PlugClean call s:clean(0) + command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif + command! -nargs=0 -bar PlugStatus call s:status() + command! -nargs=0 -bar PlugDiff call s:diff() + command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) +endfunction + +function! s:to_a(v) + return type(a:v) == s:TYPE.list ? a:v : [a:v] +endfunction + +function! s:to_s(v) + return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" +endfunction + +function! s:glob(from, pattern) + return s:lines(globpath(a:from, a:pattern)) +endfunction + +function! s:source(from, ...) + let found = 0 + for pattern in a:000 + for vim in s:glob(a:from, pattern) + execute 'source' s:esc(vim) + let found = 1 + endfor + endfor + return found +endfunction + +function! s:assoc(dict, key, val) + let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) +endfunction + +function! s:ask(message, ...) + call inputsave() + echohl WarningMsg + let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) + echohl None + call inputrestore() + echo "\r" + return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 +endfunction + +function! s:ask_no_interrupt(...) + try + return call('s:ask', a:000) + catch + return 0 + endtry +endfunction + +function! s:lazy(plug, opt) + return has_key(a:plug, a:opt) && + \ (empty(s:to_a(a:plug[a:opt])) || + \ !isdirectory(a:plug.dir) || + \ len(s:glob(s:rtp(a:plug), 'plugin')) || + \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) +endfunction + +function! plug#end() + if !exists('g:plugs') + return s:err('Call plug#begin() first') + endif + + if exists('#PlugLOD') + augroup PlugLOD + autocmd! + augroup END + augroup! PlugLOD + endif + let lod = { 'ft': {}, 'map': {}, 'cmd': {} } + + if exists('g:did_load_filetypes') + filetype off + endif + for name in g:plugs_order + if !has_key(g:plugs, name) + continue + endif + let plug = g:plugs[name] + if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') + let s:loaded[name] = 1 + continue + endif + + if has_key(plug, 'on') + let s:triggers[name] = { 'map': [], 'cmd': [] } + for cmd in s:to_a(plug.on) + if cmd =~? '^.\+' + if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) + call s:assoc(lod.map, cmd, name) + endif + call add(s:triggers[name].map, cmd) + elseif cmd =~# '^[A-Z]' + let cmd = substitute(cmd, '!*$', '', '') + if exists(':'.cmd) != 2 + call s:assoc(lod.cmd, cmd, name) + endif + call add(s:triggers[name].cmd, cmd) + else + call s:err('Invalid `on` option: '.cmd. + \ '. Should start with an uppercase letter or ``.') + endif + endfor + endif + + if has_key(plug, 'for') + let types = s:to_a(plug.for) + if !empty(types) + augroup filetypedetect + call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') + augroup END + endif + for type in types + call s:assoc(lod.ft, type, name) + endfor + endif + endfor + + for [cmd, names] in items(lod.cmd) + execute printf( + \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', + \ cmd, string(cmd), string(names)) + endfor + + for [map, names] in items(lod.map) + for [mode, map_prefix, key_prefix] in + \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] + execute printf( + \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', + \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) + endfor + endfor + + for [ft, names] in items(lod.ft) + augroup PlugLOD + execute printf('autocmd FileType %s call lod_ft(%s, %s)', + \ ft, string(ft), string(names)) + augroup END + endfor + + call s:reorg_rtp() + filetype plugin indent on + if has('vim_starting') + if has('syntax') && !exists('g:syntax_on') + syntax enable + end + else + call s:reload_plugins() + endif +endfunction + +function! s:loaded_names() + return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') +endfunction + +function! s:load_plugin(spec) + call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') +endfunction + +function! s:reload_plugins() + for name in s:loaded_names() + call s:load_plugin(g:plugs[name]) + endfor +endfunction + +function! s:trim(str) + return substitute(a:str, '[\/]\+$', '', '') +endfunction + +function! s:version_requirement(val, min) + for idx in range(0, len(a:min) - 1) + let v = get(a:val, idx, 0) + if v < a:min[idx] | return 0 + elseif v > a:min[idx] | return 1 + endif + endfor + return 1 +endfunction + +function! s:git_version_requirement(...) + if !exists('s:git_version') + let s:git_version = map(split(split(s:system('git --version'))[2], '\.'), 'str2nr(v:val)') + endif + return s:version_requirement(s:git_version, a:000) +endfunction + +function! s:progress_opt(base) + return a:base && !s:is_win && + \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' +endfunction + +if s:is_win + function! s:rtp(spec) + return s:path(a:spec.dir . get(a:spec, 'rtp', '')) + endfunction + + function! s:path(path) + return s:trim(substitute(a:path, '/', '\', 'g')) + endfunction + + function! s:dirpath(path) + return s:path(a:path) . '\' + endfunction + + function! s:is_local_plug(repo) + return a:repo =~? '^[a-z]:\|^[%~]' + endfunction +else + function! s:rtp(spec) + return s:dirpath(a:spec.dir . get(a:spec, 'rtp', '')) + endfunction + + function! s:path(path) + return s:trim(a:path) + endfunction + + function! s:dirpath(path) + return substitute(a:path, '[/\\]*$', '/', '') + endfunction + + function! s:is_local_plug(repo) + return a:repo[0] =~ '[/$~]' + endfunction +endif + +function! s:err(msg) + echohl ErrorMsg + echom '[vim-plug] '.a:msg + echohl None +endfunction + +function! s:warn(cmd, msg) + echohl WarningMsg + execute a:cmd 'a:msg' + echohl None +endfunction + +function! s:esc(path) + return escape(a:path, ' ') +endfunction + +function! s:escrtp(path) + return escape(a:path, ' ,') +endfunction + +function! s:remove_rtp() + for name in s:loaded_names() + let rtp = s:rtp(g:plugs[name]) + execute 'set rtp-='.s:escrtp(rtp) + let after = globpath(rtp, 'after') + if isdirectory(after) + execute 'set rtp-='.s:escrtp(after) + endif + endfor +endfunction + +function! s:reorg_rtp() + if !empty(s:first_rtp) + execute 'set rtp-='.s:first_rtp + execute 'set rtp-='.s:last_rtp + endif + + " &rtp is modified from outside + if exists('s:prtp') && s:prtp !=# &rtp + call s:remove_rtp() + unlet! s:middle + endif + + let s:middle = get(s:, 'middle', &rtp) + let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') + let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') + let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') + \ . ','.s:middle.',' + \ . join(map(afters, 'escape(v:val, ",")'), ',') + let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') + let s:prtp = &rtp + + if !empty(s:first_rtp) + execute 'set rtp^='.s:first_rtp + execute 'set rtp+='.s:last_rtp + endif +endfunction + +function! s:doautocmd(...) + if exists('#'.join(a:000, '#')) + execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) + endif +endfunction + +function! s:dobufread(names) + for name in a:names + let path = s:rtp(g:plugs[name]).'/**' + for dir in ['ftdetect', 'ftplugin'] + if len(finddir(dir, path)) + if exists('#BufRead') + doautocmd BufRead + endif + return + endif + endfor + endfor +endfunction + +function! plug#load(...) + if a:0 == 0 + return s:err('Argument missing: plugin name(s) required') + endif + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 + let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') + if !empty(unknowns) + let s = len(unknowns) > 1 ? 's' : '' + return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) + end + let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') + if !empty(unloaded) + for name in unloaded + call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + endfor + call s:dobufread(unloaded) + return 1 + end + return 0 +endfunction + +function! s:remove_triggers(name) + if !has_key(s:triggers, a:name) + return + endif + for cmd in s:triggers[a:name].cmd + execute 'silent! delc' cmd + endfor + for map in s:triggers[a:name].map + execute 'silent! unmap' map + execute 'silent! iunmap' map + endfor + call remove(s:triggers, a:name) +endfunction + +function! s:lod(names, types, ...) + for name in a:names + call s:remove_triggers(name) + let s:loaded[name] = 1 + endfor + call s:reorg_rtp() + + for name in a:names + let rtp = s:rtp(g:plugs[name]) + for dir in a:types + call s:source(rtp, dir.'/**/*.vim') + endfor + if a:0 + if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) + execute 'runtime' a:1 + endif + call s:source(rtp, a:2) + endif + call s:doautocmd('User', name) + endfor +endfunction + +function! s:lod_ft(pat, names) + let syn = 'syntax/'.a:pat.'.vim' + call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) + execute 'autocmd! PlugLOD FileType' a:pat + call s:doautocmd('filetypeplugin', 'FileType') + call s:doautocmd('filetypeindent', 'FileType') +endfunction + +function! s:lod_cmd(cmd, bang, l1, l2, args, names) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) +endfunction + +function! s:lod_map(map, names, with_prefix, prefix) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + let extra = '' + while 1 + let c = getchar(0) + if c == 0 + break + endif + let extra .= nr2char(c) + endwhile + + if a:with_prefix + let prefix = v:count ? v:count : '' + let prefix .= '"'.v:register.a:prefix + if mode(1) == 'no' + if v:operator == 'c' + let prefix = "\" . prefix + endif + let prefix .= v:operator + endif + call feedkeys(prefix, 'n') + endif + call feedkeys(substitute(a:map, '^', "\", '') . extra) +endfunction + +function! plug#(repo, ...) + if a:0 > 1 + return s:err('Invalid number of arguments (1..2)') + endif + + try + let repo = s:trim(a:repo) + let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec + let name = get(opts, 'as', fnamemodify(repo, ':t:s?\.git$??')) + let spec = extend(s:infer_properties(name, repo), opts) + if !has_key(g:plugs, name) + call add(g:plugs_order, name) + endif + let g:plugs[name] = spec + let s:loaded[name] = get(s:loaded, name, 0) + catch + return s:err(v:exception) + endtry +endfunction + +function! s:parse_options(arg) + let opts = copy(s:base_spec) + let type = type(a:arg) + if type == s:TYPE.string + let opts.tag = a:arg + elseif type == s:TYPE.dict + call extend(opts, a:arg) + if has_key(opts, 'dir') + let opts.dir = s:dirpath(expand(opts.dir)) + endif + else + throw 'Invalid argument type (expected: string or dictionary)' + endif + return opts +endfunction + +function! s:infer_properties(name, repo) + let repo = a:repo + if s:is_local_plug(repo) + return { 'dir': s:dirpath(expand(repo)) } + else + if repo =~ ':' + let uri = repo + else + if repo !~ '/' + throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) + endif + let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') + let uri = printf(fmt, repo) + endif + return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } + endif +endfunction + +function! s:install(force, names) + call s:update_impl(0, a:force, a:names) +endfunction + +function! s:update(force, names) + call s:update_impl(1, a:force, a:names) +endfunction + +function! plug#helptags() + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + for spec in values(g:plugs) + let docd = join([s:rtp(spec), 'doc'], '/') + if isdirectory(docd) + silent! execute 'helptags' s:esc(docd) + endif + endfor + return 1 +endfunction + +function! s:syntax() + syntax clear + syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber + syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX + syn match plugNumber /[0-9]\+[0-9.]*/ contained + syn match plugBracket /[[\]]/ contained + syn match plugX /x/ contained + syn match plugDash /^-/ + syn match plugPlus /^+/ + syn match plugStar /^*/ + syn match plugMessage /\(^- \)\@<=.*/ + syn match plugName /\(^- \)\@<=[^ ]*:/ + syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ + syn match plugTag /(tag: [^)]\+)/ + syn match plugInstall /\(^+ \)\@<=[^:]*/ + syn match plugUpdate /\(^* \)\@<=[^:]*/ + syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag + syn match plugEdge /^ \X\+$/ + syn match plugEdge /^ \X*/ contained nextgroup=plugSha + syn match plugSha /[0-9a-f]\{7,9}/ contained + syn match plugRelDate /([^)]*)$/ contained + syn match plugNotLoaded /(not loaded)$/ + syn match plugError /^x.*/ + syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ + syn match plugH2 /^.*:\n-\+$/ + syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean + hi def link plug1 Title + hi def link plug2 Repeat + hi def link plugH2 Type + hi def link plugX Exception + hi def link plugBracket Structure + hi def link plugNumber Number + + hi def link plugDash Special + hi def link plugPlus Constant + hi def link plugStar Boolean + + hi def link plugMessage Function + hi def link plugName Label + hi def link plugInstall Function + hi def link plugUpdate Type + + hi def link plugError Error + hi def link plugDeleted Ignore + hi def link plugRelDate Comment + hi def link plugEdge PreProc + hi def link plugSha Identifier + hi def link plugTag Constant + + hi def link plugNotLoaded Comment +endfunction + +function! s:lpad(str, len) + return a:str . repeat(' ', a:len - len(a:str)) +endfunction + +function! s:lines(msg) + return split(a:msg, "[\r\n]") +endfunction + +function! s:lastline(msg) + return get(s:lines(a:msg), -1, '') +endfunction + +function! s:new_window() + execute get(g:, 'plug_window', 'vertical topleft new') +endfunction + +function! s:plug_window_exists() + let buflist = tabpagebuflist(s:plug_tab) + return !empty(buflist) && index(buflist, s:plug_buf) >= 0 +endfunction + +function! s:switch_in() + if !s:plug_window_exists() + return 0 + endif + + if winbufnr(0) != s:plug_buf + let s:pos = [tabpagenr(), winnr(), winsaveview()] + execute 'normal!' s:plug_tab.'gt' + let winnr = bufwinnr(s:plug_buf) + execute winnr.'wincmd w' + call add(s:pos, winsaveview()) + else + let s:pos = [winsaveview()] + endif + + setlocal modifiable + return 1 +endfunction + +function! s:switch_out(...) + call winrestview(s:pos[-1]) + setlocal nomodifiable + if a:0 > 0 + execute a:1 + endif + + if len(s:pos) > 1 + execute 'normal!' s:pos[0].'gt' + execute s:pos[1] 'wincmd w' + call winrestview(s:pos[2]) + endif +endfunction + +function! s:finish_bindings() + nnoremap R :call retry() + nnoremap D :PlugDiff + nnoremap S :PlugStatus + nnoremap U :call status_update() + xnoremap U :call status_update() + nnoremap ]] :silent! call section('') + nnoremap [[ :silent! call section('b') +endfunction + +function! s:prepare(...) + if empty(getcwd()) + throw 'Invalid current working directory. Cannot proceed.' + endif + + for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] + if exists(evar) + throw evar.' detected. Cannot proceed.' + endif + endfor + + call s:job_abort() + if s:switch_in() + if b:plug_preview == 1 + pc + endif + enew + else + call s:new_window() + endif + + nnoremap q :if b:plug_preview==1pcendifbd + if a:0 == 0 + call s:finish_bindings() + endif + let b:plug_preview = -1 + let s:plug_tab = tabpagenr() + let s:plug_buf = winbufnr(0) + call s:assign_name() + + for k in ['', 'L', 'o', 'X', 'd', 'dd'] + execute 'silent! unmap ' k + endfor + setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell + if exists('+colorcolumn') + setlocal colorcolumn= + endif + setf vim-plug + if exists('g:syntax_on') + call s:syntax() + endif +endfunction + +function! s:assign_name() + " Assign buffer name + let prefix = '[Plugins]' + let name = prefix + let idx = 2 + while bufexists(name) + let name = printf('%s (%s)', prefix, idx) + let idx = idx + 1 + endwhile + silent! execute 'f' fnameescape(name) +endfunction + +function! s:chsh(swap) + let prev = [&shell, &shellcmdflag, &shellredir] + if s:is_win + set shell=cmd.exe shellcmdflag=/c shellredir=>%s\ 2>&1 + elseif a:swap + set shell=sh shellredir=>%s\ 2>&1 + endif + return prev +endfunction + +function! s:bang(cmd, ...) + try + let [sh, shellcmdflag, shrd] = s:chsh(a:0) + " FIXME: Escaping is incomplete. We could use shellescape with eval, + " but it won't work on Windows. + let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd + if s:is_win + let batchfile = tempname().'.bat' + call writefile(["@echo off\r", cmd . "\r"], batchfile) + let cmd = batchfile + endif + let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') + execute "normal! :execute g:_plug_bang\\" + finally + unlet g:_plug_bang + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win + call delete(batchfile) + endif + endtry + return v:shell_error ? 'Exit status: ' . v:shell_error : '' +endfunction + +function! s:regress_bar() + let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') + call s:progress_bar(2, bar, len(bar)) +endfunction + +function! s:is_updated(dir) + return !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', a:dir)) +endfunction + +function! s:do(pull, force, todo) + for [name, spec] in items(a:todo) + if !isdirectory(spec.dir) + continue + endif + let installed = has_key(s:update.new, name) + let updated = installed ? 0 : + \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) + if a:force || installed || updated + execute 'cd' s:esc(spec.dir) + call append(3, '- Post-update hook for '. name .' ... ') + let error = '' + let type = type(spec.do) + if type == s:TYPE.string + if spec.do[0] == ':' + if !get(s:loaded, name, 0) + let s:loaded[name] = 1 + call s:reorg_rtp() + endif + call s:load_plugin(spec) + try + execute spec.do[1:] + catch + let error = v:exception + endtry + if !s:plug_window_exists() + cd - + throw 'Warning: vim-plug was terminated by the post-update hook of '.name + endif + else + let error = s:bang(spec.do) + endif + elseif type == s:TYPE.funcref + try + let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') + call spec.do({ 'name': name, 'status': status, 'force': a:force }) + catch + let error = v:exception + endtry + else + let error = 'Invalid hook type' + endif + call s:switch_in() + call setline(4, empty(error) ? (getline(4) . 'OK') + \ : ('x' . getline(4)[1:] . error)) + if !empty(error) + call add(s:update.errors, name) + call s:regress_bar() + endif + cd - + endif + endfor +endfunction + +function! s:hash_match(a, b) + return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 +endfunction + +function! s:checkout(spec) + let sha = a:spec.commit + let output = s:system('git rev-parse HEAD', a:spec.dir) + if !v:shell_error && !s:hash_match(sha, s:lines(output)[0]) + let output = s:system( + \ 'git fetch --depth 999999 && git checkout '.s:esc(sha).' --', a:spec.dir) + endif + return output +endfunction + +function! s:finish(pull) + let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) + if new_frozen + let s = new_frozen > 1 ? 's' : '' + call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) + endif + call append(3, '- Finishing ... ') | 4 + redraw + call plug#helptags() + call plug#end() + call setline(4, getline(4) . 'Done!') + redraw + let msgs = [] + if !empty(s:update.errors) + call add(msgs, "Press 'R' to retry.") + endif + if a:pull && len(s:update.new) < len(filter(getline(5, '$'), + \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) + call add(msgs, "Press 'D' to see the updated changes.") + endif + echo join(msgs, ' ') + call s:finish_bindings() +endfunction + +function! s:retry() + if empty(s:update.errors) + return + endif + echo + call s:update_impl(s:update.pull, s:update.force, + \ extend(copy(s:update.errors), [s:update.threads])) +endfunction + +function! s:is_managed(name) + return has_key(g:plugs[a:name], 'uri') +endfunction + +function! s:names(...) + return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) +endfunction + +function! s:check_ruby() + silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") + if !exists('g:plug_ruby') + redraw! + return s:warn('echom', 'Warning: Ruby interface is broken') + endif + let ruby_version = split(g:plug_ruby, '\.') + unlet g:plug_ruby + return s:version_requirement(ruby_version, [1, 8, 7]) +endfunction + +function! s:update_impl(pull, force, args) abort + let sync = index(a:args, '--sync') >= 0 || has('vim_starting') + let args = filter(copy(a:args), 'v:val != "--sync"') + let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? + \ remove(args, -1) : get(g:, 'plug_threads', 16) + + let managed = filter(copy(g:plugs), 's:is_managed(v:key)') + let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : + \ filter(managed, 'index(args, v:key) >= 0') + + if empty(todo) + return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) + endif + + if !s:is_win && s:git_version_requirement(2, 3) + let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' + let $GIT_TERMINAL_PROMPT = 0 + for plug in values(todo) + let plug.uri = substitute(plug.uri, + \ '^https://git::@github\.com', 'https://github.com', '') + endfor + endif + + if !isdirectory(g:plug_home) + try + call mkdir(g:plug_home, 'p') + catch + return s:err(printf('Invalid plug directory: %s. '. + \ 'Try to call plug#begin with a valid directory', g:plug_home)) + endtry + endif + + if has('nvim') && !exists('*jobwait') && threads > 1 + call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') + endif + + let use_job = s:nvim || s:vim8 + let python = (has('python') || has('python3')) && !use_job + let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() + + let s:update = { + \ 'start': reltime(), + \ 'all': todo, + \ 'todo': copy(todo), + \ 'errors': [], + \ 'pull': a:pull, + \ 'force': a:force, + \ 'new': {}, + \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, + \ 'bar': '', + \ 'fin': 0 + \ } + + call s:prepare(1) + call append(0, ['', '']) + normal! 2G + silent! redraw + + let s:clone_opt = get(g:, 'plug_shallow', 1) ? + \ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : '' + + if has('win32unix') + let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input' + endif + + let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' + + " Python version requirement (>= 2.7) + if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 + redir => pyv + silent python import platform; print platform.python_version() + redir END + let python = s:version_requirement( + \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) + endif + + if (python || ruby) && s:update.threads > 1 + try + let imd = &imd + if s:mac_gui + set noimd + endif + if ruby + call s:update_ruby() + else + call s:update_python() + endif + catch + let lines = getline(4, '$') + let printed = {} + silent! 4,$d _ + for line in lines + let name = s:extract_name(line, '.', '') + if empty(name) || !has_key(printed, name) + call append('$', line) + if !empty(name) + let printed[name] = 1 + if line[0] == 'x' && index(s:update.errors, name) < 0 + call add(s:update.errors, name) + end + endif + endif + endfor + finally + let &imd = imd + call s:update_finish() + endtry + else + call s:update_vim() + while use_job && sync + sleep 100m + if s:update.fin + break + endif + endwhile + endif +endfunction + +function! s:log4(name, msg) + call setline(4, printf('- %s (%s)', a:msg, a:name)) + redraw +endfunction + +function! s:update_finish() + if exists('s:git_terminal_prompt') + let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt + endif + if s:switch_in() + call append(3, '- Updating ...') | 4 + for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) + let [pos, _] = s:logpos(name) + if !pos + continue + endif + if has_key(spec, 'commit') + call s:log4(name, 'Checking out '.spec.commit) + let out = s:checkout(spec) + elseif has_key(spec, 'tag') + let tag = spec.tag + if tag =~ '\*' + let tags = s:lines(s:system('git tag --list '.s:shellesc(tag).' --sort -version:refname 2>&1', spec.dir)) + if !v:shell_error && !empty(tags) + let tag = tags[0] + call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) + call append(3, '') + endif + endif + call s:log4(name, 'Checking out '.tag) + let out = s:system('git checkout -q '.s:esc(tag).' -- 2>&1', spec.dir) + else + let branch = s:esc(get(spec, 'branch', 'master')) + call s:log4(name, 'Merging origin/'.branch) + let out = s:system('git checkout -q '.branch.' -- 2>&1' + \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir) + endif + if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && + \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) + call s:log4(name, 'Updating submodules. This may take a while.') + let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) + endif + let msg = s:format_message(v:shell_error ? 'x': '-', name, out) + if v:shell_error + call add(s:update.errors, name) + call s:regress_bar() + silent execute pos 'd _' + call append(4, msg) | 4 + elseif !empty(out) + call setline(pos, msg[0]) + endif + redraw + endfor + silent 4 d _ + try + call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) + catch + call s:warn('echom', v:exception) + call s:warn('echo', '') + return + endtry + call s:finish(s:update.pull) + call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') + call s:switch_out('normal! gg') + endif +endfunction + +function! s:job_abort() + if (!s:nvim && !s:vim8) || !exists('s:jobs') + return + endif + + for [name, j] in items(s:jobs) + if s:nvim + silent! call jobstop(j.jobid) + elseif s:vim8 + silent! call job_stop(j.jobid) + endif + if j.new + call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir)) + endif + endfor + let s:jobs = {} +endfunction + +function! s:last_non_empty_line(lines) + let len = len(a:lines) + for idx in range(len) + let line = a:lines[len-idx-1] + if !empty(line) + return line + endif + endfor + return '' +endfunction + +function! s:job_out_cb(self, data) abort + let self = a:self + let data = remove(self.lines, -1) . a:data + let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') + call extend(self.lines, lines) + " To reduce the number of buffer updates + let self.tick = get(self, 'tick', -1) + 1 + if !self.running || self.tick % len(s:jobs) == 0 + let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') + let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) + call s:log(bullet, self.name, result) + endif +endfunction + +function! s:job_exit_cb(self, data) abort + let a:self.running = 0 + let a:self.error = a:data != 0 + call s:reap(a:self.name) + call s:tick() +endfunction + +function! s:job_cb(fn, job, ch, data) + if !s:plug_window_exists() " plug window closed + return s:job_abort() + endif + call call(a:fn, [a:job, a:data]) +endfunction + +function! s:nvim_cb(job_id, data, event) dict abort + return a:event == 'stdout' ? + \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : + \ s:job_cb('s:job_exit_cb', self, 0, a:data) +endfunction + +function! s:spawn(name, cmd, opts) + let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], + \ 'batchfile': (s:is_win && (s:nvim || s:vim8)) ? tempname().'.bat' : '', + \ 'new': get(a:opts, 'new', 0) } + let s:jobs[a:name] = job + let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd + if !empty(job.batchfile) + call writefile(["@echo off\r", cmd . "\r"], job.batchfile) + let cmd = job.batchfile + endif + let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd) + + if s:nvim + call extend(job, { + \ 'on_stdout': function('s:nvim_cb'), + \ 'on_exit': function('s:nvim_cb'), + \ }) + let jid = jobstart(argv, job) + if jid > 0 + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = [jid < 0 ? argv[0].' is not executable' : + \ 'Invalid arguments (or job table is full)'] + endif + elseif s:vim8 + let jid = job_start(s:is_win ? join(argv, ' ') : argv, { + \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), + \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), + \ 'out_mode': 'raw' + \}) + if job_status(jid) == 'run' + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = ['Failed to start job'] + endif + else + let job.lines = s:lines(call('s:system', [cmd])) + let job.error = v:shell_error != 0 + let job.running = 0 + endif +endfunction + +function! s:reap(name) + let job = s:jobs[a:name] + if job.error + call add(s:update.errors, a:name) + elseif get(job, 'new', 0) + let s:update.new[a:name] = 1 + endif + let s:update.bar .= job.error ? 'x' : '=' + + let bullet = job.error ? 'x' : '-' + let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) + call s:log(bullet, a:name, empty(result) ? 'OK' : result) + call s:bar() + + if has_key(job, 'batchfile') && !empty(job.batchfile) + call delete(job.batchfile) + endif + call remove(s:jobs, a:name) +endfunction + +function! s:bar() + if s:switch_in() + let total = len(s:update.all) + call setline(1, (s:update.pull ? 'Updating' : 'Installing'). + \ ' plugins ('.len(s:update.bar).'/'.total.')') + call s:progress_bar(2, s:update.bar, total) + call s:switch_out() + endif +endfunction + +function! s:logpos(name) + for i in range(4, line('$')) + if getline(i) =~# '^[-+x*] '.a:name.':' + for j in range(i + 1, line('$')) + if getline(j) !~ '^ ' + return [i, j - 1] + endif + endfor + return [i, i] + endif + endfor + return [0, 0] +endfunction + +function! s:log(bullet, name, lines) + if s:switch_in() + let [b, e] = s:logpos(a:name) + if b > 0 + silent execute printf('%d,%d d _', b, e) + if b > winheight('.') + let b = 4 + endif + else + let b = 4 + endif + " FIXME For some reason, nomodifiable is set after :d in vim8 + setlocal modifiable + call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) + call s:switch_out() + endif +endfunction + +function! s:update_vim() + let s:jobs = {} + + call s:bar() + call s:tick() +endfunction + +function! s:tick() + let pull = s:update.pull + let prog = s:progress_opt(s:nvim || s:vim8) +while 1 " Without TCO, Vim stack is bound to explode + if empty(s:update.todo) + if empty(s:jobs) && !s:update.fin + call s:update_finish() + let s:update.fin = 1 + endif + return + endif + + let name = keys(s:update.todo)[0] + let spec = remove(s:update.todo, name) + let new = empty(globpath(spec.dir, '.git', 1)) + + call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') + redraw + + let has_tag = has_key(spec, 'tag') + if !new + let [error, _] = s:git_validate(spec, 0) + if empty(error) + if pull + let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : '' + call s:spawn(name, printf('git fetch %s %s 2>&1', fetch_opt, prog), { 'dir': spec.dir }) + else + let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } + endif + else + let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } + endif + else + call s:spawn(name, + \ printf('git clone %s %s %s %s 2>&1', + \ has_tag ? '' : s:clone_opt, + \ prog, + \ s:shellesc(spec.uri), + \ s:shellesc(s:trim(spec.dir))), { 'new': 1 }) + endif + + if !s:jobs[name].running + call s:reap(name) + endif + if len(s:jobs) >= s:update.threads + break + endif +endwhile +endfunction + +function! s:update_python() +let py_exe = has('python') ? 'python' : 'python3' +execute py_exe "<< EOF" +import datetime +import functools +import os +try: + import queue +except ImportError: + import Queue as queue +import random +import re +import shutil +import signal +import subprocess +import tempfile +import threading as thr +import time +import traceback +import vim + +G_NVIM = vim.eval("has('nvim')") == '1' +G_PULL = vim.eval('s:update.pull') == '1' +G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 +G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) +G_CLONE_OPT = vim.eval('s:clone_opt') +G_PROGRESS = vim.eval('s:progress_opt(1)') +G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) +G_STOP = thr.Event() +G_IS_WIN = vim.eval('s:is_win') == '1' + +class PlugError(Exception): + def __init__(self, msg): + self.msg = msg +class CmdTimedOut(PlugError): + pass +class CmdFailed(PlugError): + pass +class InvalidURI(PlugError): + pass +class Action(object): + INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] + +class Buffer(object): + def __init__(self, lock, num_plugs, is_pull): + self.bar = '' + self.event = 'Updating' if is_pull else 'Installing' + self.lock = lock + self.maxy = int(vim.eval('winheight(".")')) + self.num_plugs = num_plugs + + def __where(self, name): + """ Find first line with name in current buffer. Return line num. """ + found, lnum = False, 0 + matcher = re.compile('^[-+x*] {0}:'.format(name)) + for line in vim.current.buffer: + if matcher.search(line) is not None: + found = True + break + lnum += 1 + + if not found: + lnum = -1 + return lnum + + def header(self): + curbuf = vim.current.buffer + curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) + + num_spaces = self.num_plugs - len(self.bar) + curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') + + with self.lock: + vim.command('normal! 2G') + vim.command('redraw') + + def write(self, action, name, lines): + first, rest = lines[0], lines[1:] + msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] + msg.extend([' ' + line for line in rest]) + + try: + if action == Action.ERROR: + self.bar += 'x' + vim.command("call add(s:update.errors, '{0}')".format(name)) + elif action == Action.DONE: + self.bar += '=' + + curbuf = vim.current.buffer + lnum = self.__where(name) + if lnum != -1: # Found matching line num + del curbuf[lnum] + if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): + lnum = 3 + else: + lnum = 3 + curbuf.append(msg, lnum) + + self.header() + except vim.error: + pass + +class Command(object): + CD = 'cd /d' if G_IS_WIN else 'cd' + + def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): + self.cmd = cmd + if cmd_dir: + self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) + self.timeout = timeout + self.callback = cb if cb else (lambda msg: None) + self.clean = clean if clean else (lambda: None) + self.proc = None + + @property + def alive(self): + """ Returns true only if command still running. """ + return self.proc and self.proc.poll() is None + + def execute(self, ntries=3): + """ Execute the command with ntries if CmdTimedOut. + Returns the output of the command if no Exception. + """ + attempt, finished, limit = 0, False, self.timeout + + while not finished: + try: + attempt += 1 + result = self.try_command() + finished = True + return result + except CmdTimedOut: + if attempt != ntries: + self.notify_retry() + self.timeout += limit + else: + raise + + def notify_retry(self): + """ Retry required for command, notify user. """ + for count in range(3, 0, -1): + if G_STOP.is_set(): + raise KeyboardInterrupt + msg = 'Timeout. Will retry in {0} second{1} ...'.format( + count, 's' if count != 1 else '') + self.callback([msg]) + time.sleep(1) + self.callback(['Retrying ...']) + + def try_command(self): + """ Execute a cmd & poll for callback. Returns list of output. + Raises CmdFailed -> return code for Popen isn't 0 + Raises CmdTimedOut -> command exceeded timeout without new output + """ + first_line = True + + try: + tfile = tempfile.NamedTemporaryFile(mode='w+b') + preexec_fn = not G_IS_WIN and os.setsid or None + self.proc = subprocess.Popen(self.cmd, stdout=tfile, + stderr=subprocess.STDOUT, + stdin=subprocess.PIPE, shell=True, + preexec_fn=preexec_fn) + thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) + thrd.start() + + thread_not_started = True + while thread_not_started: + try: + thrd.join(0.1) + thread_not_started = False + except RuntimeError: + pass + + while self.alive: + if G_STOP.is_set(): + raise KeyboardInterrupt + + if first_line or random.random() < G_LOG_PROB: + first_line = False + line = '' if G_IS_WIN else nonblock_read(tfile.name) + if line: + self.callback([line]) + + time_diff = time.time() - os.path.getmtime(tfile.name) + if time_diff > self.timeout: + raise CmdTimedOut(['Timeout!']) + + thrd.join(0.5) + + tfile.seek(0) + result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] + + if self.proc.returncode != 0: + raise CmdFailed([''] + result) + + return result + except: + self.terminate() + raise + + def terminate(self): + """ Terminate process and cleanup. """ + if self.alive: + if G_IS_WIN: + os.kill(self.proc.pid, signal.SIGINT) + else: + os.killpg(self.proc.pid, signal.SIGTERM) + self.clean() + +class Plugin(object): + def __init__(self, name, args, buf_q, lock): + self.name = name + self.args = args + self.buf_q = buf_q + self.lock = lock + self.tag = args.get('tag', 0) + + def manage(self): + try: + if os.path.exists(self.args['dir']): + self.update() + else: + self.install() + with self.lock: + thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) + except PlugError as exc: + self.write(Action.ERROR, self.name, exc.msg) + except KeyboardInterrupt: + G_STOP.set() + self.write(Action.ERROR, self.name, ['Interrupted!']) + except: + # Any exception except those above print stack trace + msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) + self.write(Action.ERROR, self.name, msg.split('\n')) + raise + + def install(self): + target = self.args['dir'] + if target[-1] == '\\': + target = target[0:-1] + + def clean(target): + def _clean(): + try: + shutil.rmtree(target) + except OSError: + pass + return _clean + + self.write(Action.INSTALL, self.name, ['Installing ...']) + callback = functools.partial(self.write, Action.INSTALL, self.name) + cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( + '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], + esc(target)) + com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + + def repo_uri(self): + cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' + command = Command(cmd, self.args['dir'], G_TIMEOUT,) + result = command.execute(G_RETRIES) + return result[-1] + + def update(self): + actual_uri = self.repo_uri() + expect_uri = self.args['uri'] + regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') + ma = regex.match(actual_uri) + mb = regex.match(expect_uri) + if ma is None or mb is None or ma.groups() != mb.groups(): + msg = ['', + 'Invalid URI: {0}'.format(actual_uri), + 'Expected {0}'.format(expect_uri), + 'PlugClean required.'] + raise InvalidURI(msg) + + if G_PULL: + self.write(Action.UPDATE, self.name, ['Updating ...']) + callback = functools.partial(self.write, Action.UPDATE, self.name) + fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' + cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) + com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + else: + self.write(Action.DONE, self.name, ['Already installed']) + + def write(self, action, name, msg): + self.buf_q.put((action, name, msg)) + +class PlugThread(thr.Thread): + def __init__(self, tname, args): + super(PlugThread, self).__init__() + self.tname = tname + self.args = args + + def run(self): + thr.current_thread().name = self.tname + buf_q, work_q, lock = self.args + + try: + while not G_STOP.is_set(): + name, args = work_q.get_nowait() + plug = Plugin(name, args, buf_q, lock) + plug.manage() + work_q.task_done() + except queue.Empty: + pass + +class RefreshThread(thr.Thread): + def __init__(self, lock): + super(RefreshThread, self).__init__() + self.lock = lock + self.running = True + + def run(self): + while self.running: + with self.lock: + thread_vim_command('noautocmd normal! a') + time.sleep(0.33) + + def stop(self): + self.running = False + +if G_NVIM: + def thread_vim_command(cmd): + vim.session.threadsafe_call(lambda: vim.command(cmd)) +else: + def thread_vim_command(cmd): + vim.command(cmd) + +def esc(name): + return '"' + name.replace('"', '\"') + '"' + +def nonblock_read(fname): + """ Read a file with nonblock flag. Return the last line. """ + fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) + buf = os.read(fread, 100000).decode('utf-8', 'replace') + os.close(fread) + + line = buf.rstrip('\r\n') + left = max(line.rfind('\r'), line.rfind('\n')) + if left != -1: + left += 1 + line = line[left:] + + return line + +def main(): + thr.current_thread().name = 'main' + nthreads = int(vim.eval('s:update.threads')) + plugs = vim.eval('s:update.todo') + mac_gui = vim.eval('s:mac_gui') == '1' + + lock = thr.Lock() + buf = Buffer(lock, len(plugs), G_PULL) + buf_q, work_q = queue.Queue(), queue.Queue() + for work in plugs.items(): + work_q.put(work) + + start_cnt = thr.active_count() + for num in range(nthreads): + tname = 'PlugT-{0:02}'.format(num) + thread = PlugThread(tname, (buf_q, work_q, lock)) + thread.start() + if mac_gui: + rthread = RefreshThread(lock) + rthread.start() + + while not buf_q.empty() or thr.active_count() != start_cnt: + try: + action, name, msg = buf_q.get(True, 0.25) + buf.write(action, name, ['OK'] if not msg else msg) + buf_q.task_done() + except queue.Empty: + pass + except KeyboardInterrupt: + G_STOP.set() + + if mac_gui: + rthread.stop() + rthread.join() + +main() +EOF +endfunction + +function! s:update_ruby() + ruby << EOF + module PlugStream + SEP = ["\r", "\n", nil] + def get_line + buffer = '' + loop do + char = readchar rescue return + if SEP.include? char.chr + buffer << $/ + break + else + buffer << char + end + end + buffer + end + end unless defined?(PlugStream) + + def esc arg + %["#{arg.gsub('"', '\"')}"] + end + + def killall pid + pids = [pid] + if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM + pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } + else + unless `which pgrep 2> /dev/null`.empty? + children = pids + until children.empty? + children = children.map { |pid| + `pgrep -P #{pid}`.lines.map { |l| l.chomp } + }.flatten + pids += children + end + end + pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } + end + end + + def compare_git_uri a, b + regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} + regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) + end + + require 'thread' + require 'fileutils' + require 'timeout' + running = true + iswin = VIM::evaluate('s:is_win').to_i == 1 + pull = VIM::evaluate('s:update.pull').to_i == 1 + base = VIM::evaluate('g:plug_home') + all = VIM::evaluate('s:update.todo') + limit = VIM::evaluate('get(g:, "plug_timeout", 60)') + tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 + nthr = VIM::evaluate('s:update.threads').to_i + maxy = VIM::evaluate('winheight(".")').to_i + vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ + cd = iswin ? 'cd /d' : 'cd' + tot = VIM::evaluate('len(s:update.todo)') || 0 + bar = '' + skip = 'Already installed' + mtx = Mutex.new + take1 = proc { mtx.synchronize { running && all.shift } } + logh = proc { + cnt = bar.length + $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" + $curbuf[2] = '[' + bar.ljust(tot) + ']' + VIM::command('normal! 2G') + VIM::command('redraw') + } + where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } + log = proc { |name, result, type| + mtx.synchronize do + ing = ![true, false].include?(type) + bar += type ? '=' : 'x' unless ing + b = case type + when :install then '+' when :update then '*' + when true, nil then '-' else + VIM::command("call add(s:update.errors, '#{name}')") + 'x' + end + result = + if type || type.nil? + ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] + elsif result =~ /^Interrupted|^Timeout/ + ["#{b} #{name}: #{result}"] + else + ["#{b} #{name}"] + result.lines.map { |l| " " << l } + end + if lnum = where.call(name) + $curbuf.delete lnum + lnum = 4 if ing && lnum > maxy + end + result.each_with_index do |line, offset| + $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) + end + logh.call + end + } + bt = proc { |cmd, name, type, cleanup| + tried = timeout = 0 + begin + tried += 1 + timeout += limit + fd = nil + data = '' + if iswin + Timeout::timeout(timeout) do + tmp = VIM::evaluate('tempname()') + system("(#{cmd}) > #{tmp}") + data = File.read(tmp).chomp + File.unlink tmp rescue nil + end + else + fd = IO.popen(cmd).extend(PlugStream) + first_line = true + log_prob = 1.0 / nthr + while line = Timeout::timeout(timeout) { fd.get_line } + data << line + log.call name, line.chomp, type if name && (first_line || rand < log_prob) + first_line = false + end + fd.close + end + [$? == 0, data.chomp] + rescue Timeout::Error, Interrupt => e + if fd && !fd.closed? + killall fd.pid + fd.close + end + cleanup.call if cleanup + if e.is_a?(Timeout::Error) && tried < tries + 3.downto(1) do |countdown| + s = countdown > 1 ? 's' : '' + log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type + sleep 1 + end + log.call name, 'Retrying ...', type + retry + end + [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] + end + } + main = Thread.current + threads = [] + watcher = Thread.new { + if vim7 + while VIM::evaluate('getchar(1)') + sleep 0.1 + end + else + require 'io/console' # >= Ruby 1.9 + nil until IO.console.getch == 3.chr + end + mtx.synchronize do + running = false + threads.each { |t| t.raise Interrupt } unless vim7 + end + threads.each { |t| t.join rescue nil } + main.kill + } + refresh = Thread.new { + while true + mtx.synchronize do + break unless running + VIM::command('noautocmd normal! a') + end + sleep 0.2 + end + } if VIM::evaluate('s:mac_gui') == 1 + + clone_opt = VIM::evaluate('s:clone_opt') + progress = VIM::evaluate('s:progress_opt(1)') + nthr.times do + mtx.synchronize do + threads << Thread.new { + while pair = take1.call + name = pair.first + dir, uri, tag = pair.last.values_at *%w[dir uri tag] + exists = File.directory? dir + ok, result = + if exists + chdir = "#{cd} #{iswin ? dir : esc(dir)}" + ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil + current_uri = data.lines.to_a.last + if !ret + if data =~ /^Interrupted|^Timeout/ + [false, data] + else + [false, [data.chomp, "PlugClean required."].join($/)] + end + elsif !compare_git_uri(current_uri, uri) + [false, ["Invalid URI: #{current_uri}", + "Expected: #{uri}", + "PlugClean required."].join($/)] + else + if pull + log.call name, 'Updating ...', :update + fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' + bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil + else + [true, skip] + end + end + else + d = esc dir.sub(%r{[\\/]+$}, '') + log.call name, 'Installing ...', :install + bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { + FileUtils.rm_rf dir + } + end + mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok + log.call name, result, ok + end + } if running + end + end + threads.each { |t| t.join rescue nil } + logh.call + refresh.kill if refresh + watcher.kill +EOF +endfunction + +function! s:shellesc_cmd(arg) + let escaped = substitute(a:arg, '[&|<>()@^]', '^&', 'g') + let escaped = substitute(escaped, '%', '%%', 'g') + let escaped = substitute(escaped, '"', '\\^&', 'g') + let escaped = substitute(escaped, '\(\\\+\)\(\\^\)', '\1\1\2', 'g') + return '^"'.substitute(escaped, '\(\\\+\)$', '\1\1', '').'^"' +endfunction + +function! s:shellesc(arg) + if &shell =~# 'cmd.exe$' + return s:shellesc_cmd(a:arg) + endif + return shellescape(a:arg) +endfunction + +function! s:glob_dir(path) + return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') +endfunction + +function! s:progress_bar(line, bar, total) + call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') +endfunction + +function! s:compare_git_uri(a, b) + " See `git help clone' + " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] + " [git@] github.com[:port] : junegunn/vim-plug [.git] + " file:// / junegunn/vim-plug [/] + " / junegunn/vim-plug [/] + let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' + let ma = matchlist(a:a, pat) + let mb = matchlist(a:b, pat) + return ma[1:2] ==# mb[1:2] +endfunction + +function! s:format_message(bullet, name, message) + if a:bullet != 'x' + return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] + else + let lines = map(s:lines(a:message), '" ".v:val') + return extend([printf('x %s:', a:name)], lines) + endif +endfunction + +function! s:with_cd(cmd, dir) + return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd) +endfunction + +function! s:system(cmd, ...) + try + let [sh, shellcmdflag, shrd] = s:chsh(1) + let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd + if s:is_win + let batchfile = tempname().'.bat' + call writefile(["@echo off\r", cmd . "\r"], batchfile) + let cmd = batchfile + endif + return system(s:is_win ? '('.cmd.')' : cmd) + finally + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win + call delete(batchfile) + endif + endtry +endfunction + +function! s:system_chomp(...) + let ret = call('s:system', a:000) + return v:shell_error ? '' : substitute(ret, '\n$', '', '') +endfunction + +function! s:git_validate(spec, check_branch) + let err = '' + if isdirectory(a:spec.dir) + let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir)) + let remote = result[-1] + if v:shell_error + let err = join([remote, 'PlugClean required.'], "\n") + elseif !s:compare_git_uri(remote, a:spec.uri) + let err = join(['Invalid URI: '.remote, + \ 'Expected: '.a:spec.uri, + \ 'PlugClean required.'], "\n") + elseif a:check_branch && has_key(a:spec, 'commit') + let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir)) + let sha = result[-1] + if v:shell_error + let err = join(add(result, 'PlugClean required.'), "\n") + elseif !s:hash_match(sha, a:spec.commit) + let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', + \ a:spec.commit[:6], sha[:6]), + \ 'PlugUpdate required.'], "\n") + endif + elseif a:check_branch + let branch = result[0] + " Check tag + if has_key(a:spec, 'tag') + let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) + if a:spec.tag !=# tag && a:spec.tag !~ '\*' + let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', + \ (empty(tag) ? 'N/A' : tag), a:spec.tag) + endif + " Check branch + elseif a:spec.branch !=# branch + let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', + \ branch, a:spec.branch) + endif + if empty(err) + let [ahead, behind] = split(s:lastline(s:system(printf( + \ 'git rev-list --count --left-right HEAD...origin/%s', + \ a:spec.branch), a:spec.dir)), '\t') + if !v:shell_error && ahead + if behind + " Only mention PlugClean if diverged, otherwise it's likely to be + " pushable (and probably not that messed up). + let err = printf( + \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" + \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind) + else + let err = printf("Ahead of origin/%s by %d commit(s).\n" + \ .'Cannot update until local changes are pushed.', + \ a:spec.branch, ahead) + endif + endif + endif + endif + else + let err = 'Not found' + endif + return [err, err =~# 'PlugClean'] +endfunction + +function! s:rm_rf(dir) + if isdirectory(a:dir) + call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir)) + endif +endfunction + +function! s:clean(force) + call s:prepare() + call append(0, 'Searching for invalid plugins in '.g:plug_home) + call append(1, '') + + " List of valid directories + let dirs = [] + let errs = {} + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + if !s:is_managed(name) + call add(dirs, spec.dir) + else + let [err, clean] = s:git_validate(spec, 1) + if clean + let errs[spec.dir] = s:lines(err)[0] + else + call add(dirs, spec.dir) + endif + endif + let cnt += 1 + call s:progress_bar(2, repeat('=', cnt), total) + normal! 2G + redraw + endfor + + let allowed = {} + for dir in dirs + let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1 + let allowed[dir] = 1 + for child in s:glob_dir(dir) + let allowed[child] = 1 + endfor + endfor + + let todo = [] + let found = sort(s:glob_dir(g:plug_home)) + while !empty(found) + let f = remove(found, 0) + if !has_key(allowed, f) && isdirectory(f) + call add(todo, f) + call append(line('$'), '- ' . f) + if has_key(errs, f) + call append(line('$'), ' ' . errs[f]) + endif + let found = filter(found, 'stridx(v:val, f) != 0') + end + endwhile + + 4 + redraw + if empty(todo) + call append(line('$'), 'Already clean.') + else + let s:clean_count = 0 + call append(3, ['Directories to delete:', '']) + redraw! + if a:force || s:ask_no_interrupt('Delete all directories?') + call s:delete([6, line('$')], 1) + else + call setline(4, 'Cancelled.') + nnoremap d :set opfunc=delete_opg@ + nmap dd d_ + xnoremap d :call delete_op(visualmode(), 1) + echo 'Delete the lines (d{motion}) to delete the corresponding directories' + endif + endif + 4 + setlocal nomodifiable +endfunction + +function! s:delete_op(type, ...) + call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) +endfunction + +function! s:delete(range, force) + let [l1, l2] = a:range + let force = a:force + while l1 <= l2 + let line = getline(l1) + if line =~ '^- ' && isdirectory(line[2:]) + execute l1 + redraw! + let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) + let force = force || answer > 1 + if answer + call s:rm_rf(line[2:]) + setlocal modifiable + call setline(l1, '~'.line[1:]) + let s:clean_count += 1 + call setline(4, printf('Removed %d directories.', s:clean_count)) + setlocal nomodifiable + endif + endif + let l1 += 1 + endwhile +endfunction + +function! s:upgrade() + echo 'Downloading the latest version of vim-plug' + redraw + let tmp = tempname() + let new = tmp . '/plug.vim' + + try + let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp)) + if v:shell_error + return s:err('Error upgrading vim-plug: '. out) + endif + + if readfile(s:me) ==# readfile(new) + echo 'vim-plug is already up-to-date' + return 0 + else + call rename(s:me, s:me . '.old') + call rename(new, s:me) + unlet g:loaded_plug + echo 'vim-plug has been upgraded' + return 1 + endif + finally + silent! call s:rm_rf(tmp) + endtry +endfunction + +function! s:upgrade_specs() + for spec in values(g:plugs) + let spec.frozen = get(spec, 'frozen', 0) + endfor +endfunction + +function! s:status() + call s:prepare() + call append(0, 'Checking plugins') + call append(1, '') + + let ecnt = 0 + let unloaded = 0 + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + let is_dir = isdirectory(spec.dir) + if has_key(spec, 'uri') + if is_dir + let [err, _] = s:git_validate(spec, 1) + let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] + else + let [valid, msg] = [0, 'Not found. Try PlugInstall.'] + endif + else + if is_dir + let [valid, msg] = [1, 'OK'] + else + let [valid, msg] = [0, 'Not found.'] + endif + endif + let cnt += 1 + let ecnt += !valid + " `s:loaded` entry can be missing if PlugUpgraded + if is_dir && get(s:loaded, name, -1) == 0 + let unloaded = 1 + let msg .= ' (not loaded)' + endif + call s:progress_bar(2, repeat('=', cnt), total) + call append(3, s:format_message(valid ? '-' : 'x', name, msg)) + normal! 2G + redraw + endfor + call setline(1, 'Finished. '.ecnt.' error(s).') + normal! gg + setlocal nomodifiable + if unloaded + echo "Press 'L' on each line to load plugin, or 'U' to update" + nnoremap L :call status_load(line('.')) + xnoremap L :call status_load(line('.')) + end +endfunction + +function! s:extract_name(str, prefix, suffix) + return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') +endfunction + +function! s:status_load(lnum) + let line = getline(a:lnum) + let name = s:extract_name(line, '-', '(not loaded)') + if !empty(name) + call plug#load(name) + setlocal modifiable + call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) + setlocal nomodifiable + endif +endfunction + +function! s:status_update() range + let lines = getline(a:firstline, a:lastline) + let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') + if !empty(names) + echo + execute 'PlugUpdate' join(names) + endif +endfunction + +function! s:is_preview_window_open() + silent! wincmd P + if &previewwindow + wincmd p + return 1 + endif +endfunction + +function! s:find_name(lnum) + for lnum in reverse(range(1, a:lnum)) + let line = getline(lnum) + if empty(line) + return '' + endif + let name = s:extract_name(line, '-', '') + if !empty(name) + return name + endif + endfor + return '' +endfunction + +function! s:preview_commit() + if b:plug_preview < 0 + let b:plug_preview = !s:is_preview_window_open() + endif + + let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') + if empty(sha) + return + endif + + let name = s:find_name(line('.')) + if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) + return + endif + + if exists('g:plug_pwindow') && !s:is_preview_window_open() + execute g:plug_pwindow + execute 'e' sha + else + execute 'pedit' sha + wincmd P + endif + setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable + try + let [sh, shellcmdflag, shrd] = s:chsh(1) + let cmd = 'cd '.s:shellesc(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha + if s:is_win + let batchfile = tempname().'.bat' + call writefile(["@echo off\r", cmd . "\r"], batchfile) + let cmd = batchfile + endif + execute 'silent %!' cmd + finally + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win + call delete(batchfile) + endif + endtry + setlocal nomodifiable + nnoremap q :q + wincmd p +endfunction + +function! s:section(flags) + call search('\(^[x-] \)\@<=[^:]\+:', a:flags) +endfunction + +function! s:format_git_log(line) + let indent = ' ' + let tokens = split(a:line, nr2char(1)) + if len(tokens) != 5 + return indent.substitute(a:line, '\s*$', '', '') + endif + let [graph, sha, refs, subject, date] = tokens + let tag = matchstr(refs, 'tag: [^,)]\+') + let tag = empty(tag) ? ' ' : ' ('.tag.') ' + return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) +endfunction + +function! s:append_ul(lnum, text) + call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) +endfunction + +function! s:diff() + call s:prepare() + call append(0, ['Collecting changes ...', '']) + let cnts = [0, 0] + let bar = '' + let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') + call s:progress_bar(2, bar, len(total)) + for origin in [1, 0] + let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) + if empty(plugs) + continue + endif + call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') + for [k, v] in plugs + let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' + let cmd = 'git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')) + if has_key(v, 'rtp') + let cmd .= ' -- '.s:shellesc(v.rtp) + endif + let diff = s:system_chomp(cmd, v.dir) + if !empty(diff) + let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' + call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) + let cnts[origin] += 1 + endif + let bar .= '=' + call s:progress_bar(2, bar, len(total)) + normal! 2G + redraw + endfor + if !cnts[origin] + call append(5, ['', 'N/A']) + endif + endfor + call setline(1, printf('%d plugin(s) updated.', cnts[0]) + \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) + + if cnts[0] || cnts[1] + nnoremap (plug-preview) :silent! call preview_commit() + if empty(maparg("\", 'n')) + nmap (plug-preview) + endif + if empty(maparg('o', 'n')) + nmap o (plug-preview) + endif + endif + if cnts[0] + nnoremap X :call revert() + echo "Press 'X' on each block to revert the update" + endif + normal! gg + setlocal nomodifiable +endfunction + +function! s:revert() + if search('^Pending updates', 'bnW') + return + endif + + let name = s:find_name(line('.')) + if empty(name) || !has_key(g:plugs, name) || + \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' + return + endif + + call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch).' --', g:plugs[name].dir) + setlocal modifiable + normal! "_dap + setlocal nomodifiable + echo 'Reverted' +endfunction + +function! s:snapshot(force, ...) abort + call s:prepare() + setf vim + call append(0, ['" Generated by vim-plug', + \ '" '.strftime("%c"), + \ '" :source this file in vim to restore the snapshot', + \ '" or execute: vim -S snapshot.vim', + \ '', '', 'PlugUpdate!']) + 1 + let anchor = line('$') - 3 + let names = sort(keys(filter(copy(g:plugs), + \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) + for name in reverse(names) + let sha = s:system_chomp('git rev-parse --short HEAD', g:plugs[name].dir) + if !empty(sha) + call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) + redraw + endif + endfor + + if a:0 > 0 + let fn = expand(a:1) + if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) + return + endif + call writefile(getline(1, '$'), fn) + echo 'Saved as '.a:1 + silent execute 'e' s:esc(fn) + setf vim + endif +endfunction + +function! s:split_rtp() + return split(&rtp, '\\\@ p :LatexPreviewToggle +nmap [ :PrevLatexPreviewMode +nmap ] :NextLatexPreviewMode diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..57a44cb --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,251 @@ +""" _ +""" ____ ___ ____ _ __(_)___ ___ +""" / __ \/ _ \/ __ \ | / / / __ `__ \ +""" / / / / __/ /_/ / |/ / / / / / / / +""" /_/ /_/\___/\____/|___/_/_/ /_/ /_/ +""" neovim runtime config file. +let mapleader ="," + +""" Pathogen (vim plugin manager): +execute pathogen#infect() +syntax on +filetype plugin indent on + +call plug#begin('~/.config/nvim/plugged') +Plug 'tpope/vim-surround' +Plug 'scrooloose/nerdtree' +Plug 'junegunn/goyo.vim' +Plug 'PotatoesMaster/i3-vim-syntax' +Plug 'jreybert/vimagit' +Plug 'LukeSmithxyz/vimling' +Plug 'vimwiki/vimwiki' +Plug 'bling/vim-airline' +Plug 'tpope/vim-commentary' +call plug#end() + +set bg=light +set mouse=a +set nohlsearch +set clipboard=unnamedplus +" Some basics: + set nocompatible + filetype plugin on + syntax on + set encoding=utf-8 + set number relativenumber +" Enable autocompletion: + set wildmode=longest,list,full +" Disables automatic commenting on newline: + autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + +" Goyo plugin makes text more readable when writing prose: + map f :Goyo \| set bg=light \| set linebreak + +" Spell-check set to o, 'o' for 'orthography': + map o :setlocal spell! spelllang=en_us + +" Splits open at the bottom and right, which is non-retarded, unlike vim defaults. + set splitbelow splitright + +" Nerd tree + map :NERDTreeToggle + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + +" vimling: + nm d :call ToggleDeadKeys() + imap d :call ToggleDeadKeys()a + nm i :call ToggleIPA() + imap i :call ToggleIPA()a + nm q :call ToggleProse() + +" Shortcutting split navigation, saving a keypress: + map h + map j + map k + map l + +" Check file in shellcheck: + map s :!clear && shellcheck % + +" Open my bibliography file in split + map b :vsp$BIB + map r :vsp$REFER + +" Replace all is aliased to S. + nnoremap S :%s//g + +" Compile document, be it groff/LaTeX/markdown/etc. + map c :w! \| !compiler % + +" Open corresponding .pdf/.html or preview + map p :!opout % + +" Runs a script that cleans out tex build files whenever I close out of a .tex file. + autocmd VimLeave *.tex !texclear % + +" Ensure files are read as what I want: + let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} + let g:vimwiki_list = [{'path': '~/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] + autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown + autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff + autocmd BufRead,BufNewFile *.tex set filetype=tex + +" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed): + vnoremap "+y + map "+P + +" Enable Goyo by default for mutt writting + " Goyo's width will be the line limit in mutt. + autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 + autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo \| set bg=light + +" Automatically deletes all trailing whitespace on save. + autocmd BufWritePre * %s/\s\+$//e + +" When shortcut files are updated, renew bash and ranger configs with new material: + autocmd BufWritePost ~/.config/bmdirs,~/.config/bmfiles !shortcuts + +" Automatically recompile suckless program configs: + autocmd BufWritePost config.h,config.def.h !sudo make install + +" Run xrdb whenever Xdefaults or Xresources are updated. + autocmd BufWritePost *Xresources,*Xdefaults !xrdb % + +" Navigating with guides + inoremap /<++>"_c4l + vnoremap /<++>"_c4l + map /<++>"_c4l + +"""GLOBAL +"""Show whitespace characters: + autocmd FileType * set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< + autocmd FileType * set list +"""Hard enable tabs everywhere: + autocmd FileType * set noexpandtab + +"""LATEX + " Word count: + autocmd FileType tex map w :w !detex \| wc -w + " Code snippets + autocmd FileType tex inoremap ,fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i + autocmd FileType tex inoremap ,fi \begin{fitch}\end{fitch}<++>3kA + autocmd FileType tex inoremap ,exe \begin{exe}\ex\end{exe}<++>3kA + autocmd FileType tex inoremap ,em \emph{}<++>T{i + autocmd FileType tex inoremap ,bf \textbf{}<++>T{i + autocmd FileType tex vnoremap , ``>2la}?\\{a + autocmd FileType tex inoremap ,it \textit{}<++>T{i + autocmd FileType tex inoremap ,ct \textcite{}<++>T{i + autocmd FileType tex inoremap ,cp \parencite{}<++>T{i + autocmd FileType tex inoremap ,glos {\gll<++>\\<++>\\\trans{``<++>''}}2k2bcw + autocmd FileType tex inoremap ,x \begin{xlist}\ex\end{xlist}kA + autocmd FileType tex inoremap ,ol \begin{enumerate}\end{enumerate}<++>3kA\item + autocmd FileType tex inoremap ,ul \begin{itemize}\end{itemize}<++>3kA\item + autocmd FileType tex inoremap ,li \item + autocmd FileType tex inoremap ,ref \ref{}<++>T{i + autocmd FileType tex inoremap ,tab \begin{tabular}<++>\end{tabular}<++>4kA{}i + autocmd FileType tex inoremap ,ot \begin{tableau}\inp{<++>}\const{<++>}<++><++>\end{tableau}<++>5kA{}i + autocmd FileType tex inoremap ,can \cand{}<++>T{i + autocmd FileType tex inoremap ,con \const{}<++>T{i + autocmd FileType tex inoremap ,v \vio{}<++>T{i + autocmd FileType tex inoremap ,a \href{}{<++>}<++>2T{i + autocmd FileType tex inoremap ,sc \textsc{}<++>T{i + autocmd FileType tex inoremap ,chap \chapter{}<++>2kf}i + autocmd FileType tex inoremap ,sec \section{}<++>2kf}i + autocmd FileType tex inoremap ,ssec \subsection{}<++>2kf}i + autocmd FileType tex inoremap ,sssec \subsubsection{}<++>2kf}i + autocmd FileType tex inoremap ,st F{i*f}i + autocmd FileType tex inoremap ,beg \begin{DELRN}<++>\end{DELRN}<++>4k0fR:MultipleCursorsFindDELRNc + autocmd FileType tex inoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex nnoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex inoremap ,tt \texttt{}<++>T{i + autocmd FileType tex inoremap ,bt {\blindtext} + autocmd FileType tex inoremap ,nu $\varnothing$ + autocmd FileType tex inoremap ,col \begin{columns}[T]\begin{column}{.5\textwidth}\end{column}\begin{column}{.5\textwidth}<++>\end{column}\end{columns}5kA + autocmd FileType tex inoremap ,rn (\ref{})<++>F}i + +"""HTML + autocmd FileType html inoremap ,b <++>FbT>i + autocmd FileType html inoremap ,it <++>FeT>i + autocmd FileType html inoremap ,1

<++>2kf<++>2kf<++>2kf

<++>02kf>a + autocmd FileType html inoremap ,a href=""><++><++>14hi + autocmd FileType html inoremap ,e target="_blank"href=""><++><++>14hi + autocmd FileType html inoremap ,ul
<++>03kfo
  • F>a + autocmd FileType html inoremap ,ol
    <++>03kf<++>Fcf"a + autocmd FileType html inoremap ,td <++>Fdcit + autocmd FileType html inoremap ,tr <++>kf<++>Fhcit + autocmd FileType html inoremap ,tab
    O + autocmd FileType html inoremap ,gr F>a + autocmd FileType html inoremap ,rd F>a + autocmd FileType html inoremap ,yl F>a + autocmd FileType html inoremap ,dt
    <++>
    <++>2kcit + autocmd FileType html inoremap ,dl
    <++>3kcc + autocmd FileType html inoremap & & + autocmd FileType html inoremap á á + autocmd FileType html inoremap é é + autocmd FileType html inoremap í í + autocmd FileType html inoremap ó ó + autocmd FileType html inoremap ú ú + autocmd FileType html inoremap ä ä + autocmd FileType html inoremap ë ë + autocmd FileType html inoremap ï ï + autocmd FileType html inoremap ö ö + autocmd FileType html inoremap ü ü + autocmd FileType html inoremap ã ã + autocmd FileType html inoremap ẽ &etilde; + autocmd FileType html inoremap ĩ ĩ + autocmd FileType html inoremap õ õ + autocmd FileType html inoremap ũ ũ + autocmd FileType html inoremap ñ ñ + autocmd FileType html inoremap à à + autocmd FileType html inoremap è è + autocmd FileType html inoremap ì ì + autocmd FileType html inoremap ò ò + autocmd FileType html inoremap ù ù + + +""".bib + autocmd FileType bib inoremap ,a @article{author={<++>},year={<++>},title={<++>},journal={<++>},volume={<++>},pages={<++>},}<++>8kA,i + autocmd FileType bib inoremap ,b @book{author={<++>},year={<++>},title={<++>},publisher={<++>},}<++>6kA,i + autocmd FileType bib inoremap ,c @incollection{author={<++>},title={<++>},booktitle={<++>},editor={<++>},year={<++>},publisher={<++>},}<++>8kA,i + +"MARKDOWN + autocmd Filetype markdown,rmd map w yiWi[Ea](pa) + autocmd Filetype markdown,rmd inoremap ,n --- + autocmd Filetype markdown,rmd inoremap ,b ****<++>F*hi + autocmd Filetype markdown,rmd inoremap ,s ~~~~<++>F~hi + autocmd Filetype markdown,rmd inoremap ,e **<++>F*i + autocmd Filetype markdown,rmd inoremap ,h ====<++>F=hi + autocmd Filetype markdown,rmd inoremap ,i ![](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,1 #<++>kA + autocmd Filetype markdown,rmd inoremap ,2 ##<++>kA + autocmd Filetype markdown,rmd inoremap ,3 ###<++>kA + autocmd Filetype markdown,rmd inoremap ,l -------- + autocmd Filetype rmd inoremap ,r ```{r}```2kO + autocmd Filetype rmd inoremap ,p ```{python}```2kO + autocmd Filetype rmd inoremap ,c ``````2kO + +""".xml + autocmd FileType xml inoremap ,e <++>isPermaLink="false"><++>:put=strftime('%a, %d %b %Y %H:%M:%S %z')kJA<++>]]>?<enter>cit + autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci" + +"""python +"""Indentation options: + autocmd FileType python set autoindent + autocmd FileType python set smartindent + +"""bash/POSIX shell + + +"""rust + + +"""C++ + + diff --git a/.config/nvim/plugged/goyo.vim b/.config/nvim/plugged/goyo.vim new file mode 160000 index 0000000..5b8bd03 --- /dev/null +++ b/.config/nvim/plugged/goyo.vim @@ -0,0 +1 @@ +Subproject commit 5b8bd0378758c1d9550d8429bef24b3d6d78b592 diff --git a/.config/nvim/plugged/i3-vim-syntax b/.config/nvim/plugged/i3-vim-syntax new file mode 160000 index 0000000..affe37e --- /dev/null +++ b/.config/nvim/plugged/i3-vim-syntax @@ -0,0 +1 @@ +Subproject commit affe37e89911c47831cb5b87697ac70e48bb3e0f diff --git a/.config/nvim/plugged/nerdtree b/.config/nvim/plugged/nerdtree new file mode 160000 index 0000000..c05615f --- /dev/null +++ b/.config/nvim/plugged/nerdtree @@ -0,0 +1 @@ +Subproject commit c05615fd80141c3ab04459e75a42d2ed6f030e18 diff --git a/.config/nvim/plugged/vim-airline b/.config/nvim/plugged/vim-airline new file mode 160000 index 0000000..448aa43 --- /dev/null +++ b/.config/nvim/plugged/vim-airline @@ -0,0 +1 @@ +Subproject commit 448aa43ec4bb49dfb3f75c3e52aad41eec9ee2ce diff --git a/.config/nvim/plugged/vim-commentary b/.config/nvim/plugged/vim-commentary new file mode 160000 index 0000000..141d9d3 --- /dev/null +++ b/.config/nvim/plugged/vim-commentary @@ -0,0 +1 @@ +Subproject commit 141d9d32a9fb58fe474fcc89cd7221eb2dd57b3a diff --git a/.config/nvim/plugged/vim-surround b/.config/nvim/plugged/vim-surround new file mode 160000 index 0000000..5970688 --- /dev/null +++ b/.config/nvim/plugged/vim-surround @@ -0,0 +1 @@ +Subproject commit 597068870b8f093a8b2d11536c62ff31222ee8d0 diff --git a/.config/nvim/plugged/vimagit b/.config/nvim/plugged/vimagit new file mode 160000 index 0000000..91b947c --- /dev/null +++ b/.config/nvim/plugged/vimagit @@ -0,0 +1 @@ +Subproject commit 91b947cceb7f1c7d005f6b1941478802c4b096db diff --git a/.config/nvim/plugged/vimling b/.config/nvim/plugged/vimling new file mode 160000 index 0000000..d9bdc50 --- /dev/null +++ b/.config/nvim/plugged/vimling @@ -0,0 +1 @@ +Subproject commit d9bdc50a7efbc955fde72614ebf4ad19f17c226c diff --git a/.config/nvim/plugged/vimwiki b/.config/nvim/plugged/vimwiki new file mode 160000 index 0000000..417490f --- /dev/null +++ b/.config/nvim/plugged/vimwiki @@ -0,0 +1 @@ +Subproject commit 417490f30b3aaec600c19cfa59018cf2368dd87b diff --git a/.config/polybar/config b/.config/polybar/config new file mode 100644 index 0000000..803a3bf --- /dev/null +++ b/.config/polybar/config @@ -0,0 +1,335 @@ +; __ __ +; ____ ____ / /_ __/ /_ ____ ______ +; / __ \/ __ \/ / / / / __ \/ __ `/ ___/ +; / /_/ / /_/ / / /_/ / /_/ / /_/ / / +; / .___/\____/_/\__, /_.___/\__,_/_/ +; /_/ /____/ +; Polybar config file. +; Modified from WillemMe: https://github.com/WillemMe/dotFiles + + +;----------------; +; Polybar Global ; +;----------------; +[colors] +background = #00000000 +background-alt = #444 +foreground = #eee +foreground-alt = #555 +primary = #ffb52a +secondary = #e60053 +linecolor = #FFFFFF +linecolorDark = #cccccc + +;Top bar +[bar/main] + +;Location +;--------- +monitor = ${env:MONITOR:} +;Monitor is set in the launch.sh script because it detect second monitor; +;Normaly you would use something like monitor=eDP-1 + +;Size +;--------- +width = 100% +height = 30 + +;Suroundings +;-------------- +border-size = 0 +border-color = #00000000 +padding-left = 3 +padding-right = 3 +module-margin-left = 1 +module-margin-right = 1 + +;Fonts +;------------------ +font-0 = Hack Nerd Font:pixelsize=15;2 +font-1 = fixed:pixelsize=15;2 +font-2 = Siji:size=30;2 +font-3 = unifont:fontformat=truetype:size=12:antialias=false;2 +font-4 = Hack Nerd Font:pixelsize=20;4 +font-5 = Hack Nerd Font:pixelsize=33;6 +; Fonts are 1-indexed: use '%{T<idx>+1} to set the font +; Use '%{T-}' for the default font + +;Misc +;------------ +fixed-center = true +line-size = 3 +modules-left = airinfo weather ethprice +modules-center = i3 +modules-right = nordvpn network wlan date powermenu +tray-position = right +tray-padding = 1 + +;Color +;------------ +background = ${colors.background} +foreground = ${colors.foreground} +line-color = ${colors.linecolor} + +[bar/bottom] +inherit = bar/main +bottom=true +modules-left = battery backlight volume +modules-center = mpd +modules-right = temperature tempgpu tempcpu memory cpu + +[bar/secondary] +inherit = bar/main +monitor = ${env:MONITOR:} +; Second bar to use on second monitor + + +;Misc +;------------ +fixed-center = true +line-size = 3 +modules-left = +modules-center = i3 +modules-right = date powermenu +tray-position = right +tray-padding = 1 + + +;-----------------; +; Builtin Modules ; +;-----------------; +[module/i3] +type = internal/i3 +pin-workspaces = true +strip-wsnumbers = false +enable-scroll = false +ws-icon-0 = 1;%{T5}1%{T-} +ws-icon-1 = 2;%{T5}2%{T-} +ws-icon-2 = 3;%{T5}3%{T-} +ws-icon-3 = 4;%{T5}4%{T-} +ws-icon-4 = 5;%{T5}5%{T-} +ws-icon-5 = 6;%{T5}6%{T-} +ws-icon-6 = 7;%{T5}7%{T-} +ws-icon-7 = 8;%{T5}8%{T-} +ws-icon-8 = 9;%{T5}9%{T-} +label-focused = %icon% +label-focused-foreground = ${colors.linecolor} +label-focused-padding = 1 +label-unfocused = %icon% +label-unfocused-foreground = ${colors.linecolorDark} +label-unfocused-padding = 1 +label-visible = %icon% +label-visible-foreground = ${colors.linecolorDark} +label-visible-padding = 1 +label-separator = | +label-separator-padding = 0.6 + + +[module/date] +type = internal/date +date = %a, %b %d %Y +date-alt = %m-%d-%Y% +time = %l:%M %p +time-alt = %l:%M %p +format = <label> +label = %time% %date% + + +[module/battery] +type = internal/battery +battery = BAT0 +poll-interval = 10 +full-at = 99 +label-discharging = %percentage%% +label-charging = %percentage%% +label-full = %percentage%% +format-discharging = %{T5}<ramp-capacity>%{T-} <label-discharging> +format-full = %{T5}<ramp-capacity>%{T-} <label-full> +format-charging =  <label-charging> +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  +ramp-capacity-5 =  +ramp-capacity-6 =  +ramp-capacity-7 =  +ramp-capacity-8 =  +ramp-capacity-9 =  +ramp-capacity-10 =  + + +[module/volume] +type = internal/pulseaudio +format-volume = <ramp-volume> <label-volume> +format-muted = %{T5} 婢 %{T-} +ramp-volume-0 = %{T5}奄%{T-} +ramp-volume-1 = %{T5}奔%{T-} +ramp-volume-2 = %{T5}墳%{T-} +; + + +[module/mpd] +type = internal/mpd +label-offline = ﱙ mpd is offline +format-online = <label-song> <bar-progress> +format-offline = <label-offline> +host = 127.0.0.1 +port = 6600 +icon-prev =  +icon-stop =  +icon-play =  +icon-pause =  +icon-next =  +label-song = %title% - %artist% +label-song-maxlen = 70 +label-song-ellipsis = true +label-time = %elapsed% / %total% +bar-progress-width = 20 +bar-progress-indicator =┤ +bar-progress-fill = ─ +bar-progress-empty = ╌ +interval = 1 + + +[module/backlight] +type = internal/backlight +card = intel_backlight +format = %{T5}<ramp>%{T-} <label> +label = %percentage%% +ramp-0 =  +ramp-1 =  +ramp-2 =  +; Use `ls -1 /sys/class/backlight/` to list available cards + + +[module/wlan] +type = internal/network +interface = wlo1 +interval = 10 +label-connected =%{A1:$TERMINAL -e nmtui:}%{T5}直%{T-}%{A} +label-disconnected = %{A1:$TERMINAL -e nmtui:}%{T5}睊%{T-}%{A} + + +;[module/eth] +;type = internal/network +;interface = eth0 +;interval = 5 +;format-connected-prefix= " " +;label-connected = %local_ip% + + +[module/cpu] +type = internal/cpu +label =  %percentage%% + + +[module/memory] +type = internal/memory +label =  %gb_used% +click-left = notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" + + +[module/network] +type = internal/network +interface = wlo1 +label-connected =  %downspeed% |  %upspeed% + + +[module/temperature] +type = internal/temperature +thermal-zone = 0 +warn-temperature = 60 +label =%{T5}﨎%{T-} %temperature-c% +label-warn = %temperature-c% +label-warn-foreground = ${colors.secondary} +click-left = $TERMINAL -e watch sensors + + +[module/powermenu] +type = custom/menu +expand-right = true +format-spacing = 1 +label-open = %{T5}襤%{T-} +label-open-foreground = ${colors.linecolor} +label-close = %{T5}窱%{T-} cancel +label-close-foreground = ${colors.secondary} +label-separator = | +label-separator-foreground = ${colors.foreground-alt} +menu-0-0 = logout +menu-0-0-exec = $HOME/.local/bin/gfxtools/logoutldm +menu-0-1 = reboot +menu-0-1-exec = sudo -A reboot +menu-0-2 = shutdown +menu-0-2-exec = sudo -A shutdown -h now + + +;----------------; +; Custom Modules ; +;----------------; +[module/nordvpn] +type = custom/script +click-left = $HOME/.local/bin/polybar/nordvpn-toggle.sh +exec = $HOME/.local/bin/polybar/nordvpn.sh +interval = 10 +label = %{T5}%output%%{T-} + + +[module/tempcpu] +type = custom/script +click-left = notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" +exec = $HOME/.local/bin/polybar/temp-cpu.sh +interval = 10 +label = %output% + + +[module/tempgpu] +type = custom/script +click-left = $TERMINAL -e watch nvidia-smi +exec = $HOME/.local/bin/polybar/temp-gpu.sh +interval = 30 +label = %output% + + +;[module/bluetooth] +;type = custom/script +;click-left = $HOME/.local/bin/polybar/bluetooth-toggle.sh +;exec = $HOME/.local/bin/polybar/bluetooth.sh +;interval = 30 +;label = %{T5}%output%%{T5} + + +;[module/torrent] +;type = custom/script +;click-left = $TERMINAL -e transmission-remote-cli +;exec = $HOME/.local/bin/polybar/torrent.sh +;interval = 30 +;label = %{T5}%output%%{T5} + + +[module/ethprice] +type = custom/script +click-left=$HOME/.local/bin/polybar/ethprice.sh +exec=$HOME/.local/bin/polybar/ethprice.sh +interval = 300 +label = %{T-}%{T-} %output% + + +[module/airinfo] +type = custom/script +#click-left = $TERMINAL -e less -S +exec = $HOME/.local/bin/polybar/airinfo.sh +interval = 600 +label = %{T-}%{T-} %output% + + +[module/weather] +type = custom/script +click-left = $TERMINAL -e less -S "$HOME/.local/share/weatherreport" +exec = $HOME/.local/bin/polybar/weather.sh +interval = 18000 +#label = %{T5}%output%%{T5} +label = %output% + + +; vim:ft=dosini diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh new file mode 100755 index 0000000..dd409c9 --- /dev/null +++ b/.config/polybar/launch.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# __ __ +# ____ ____ / /_ __/ /_ ____ ______ +# / __ \/ __ \/ / / / / __ \/ __ `/ ___/ +# / /_/ / /_/ / / /_/ / /_/ / /_/ / / +# / .___/\____/_/\__, /_.___/\__,_/_/ +# /_/ /____/ +# Polybar launch script. +# Modified from WillemMe: https://github.com/WillemMe/dotFiles + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +DP_ACTIVE=$(xrandr | grep ' connected' | grep 'DP-0' | awk '{print $1}' | xargs); +HDMI_ACTIVE=$(xrandr | grep ' connected' | grep 'HDMI-0' | awk '{print $1}' | xargs); +GPU_MODE=$(optimus-manager --print-mode | awk '{print $NF}' | xargs); + +if [ "$GPU_MODE" = 'nvidia' ] && [ -n "$DP_ACTIVE" ] || [ -n "$HDMI_ACTIVE" ] ; then + if [ -n "$DP_ACTIVE" ] ; then monitors="$DP_ACTIVE"; + elif [ -n "$HDMI_ACTIVE" ] ; then monitors="$HDMI_ACTIVE"; + fi; +else + monitors=$(xrandr --query | grep "^eDP" | grep " connected" | cut -d" " -f1); +fi; + +# Single monitor only because no solution to multi-monitor screen-tear prevention on my machine +MONITOR="${monitors[0]}" polybar main & +MONITOR="${monitors[0]}" polybar bottom & + + +# Multi-monitor handling +#if type "xrandr"; then +# #Get monitors +# monitors=$(xrandr --query | grep " connected" | cut -d" " -f1) +# +# #If only 1 montor set it as default +# if [ ${#monitors[@]} == "0" ]; then +# MONITOR="${monitors[0]}" polybar main & +# MONITOR="${monitors[0]}" polybar bottom & +# else #with more screen set the "bigger" as main +# for m in $monitors; do +# if [ $m == "eDP-1" ]; then +# MONITOR=$m polybar secondary & +# else +# MONITOR=$m polybar main & +# MONITOR=$m polybar bottom & +# fi +# done +# fi +#fi + diff --git a/.config/qutebrowser/.gitignore b/.config/qutebrowser/.gitignore new file mode 100644 index 0000000..643593a --- /dev/null +++ b/.config/qutebrowser/.gitignore @@ -0,0 +1,2 @@ +bookmarks/ + diff --git a/.config/qutebrowser/autoconfig.yml b/.config/qutebrowser/autoconfig.yml new file mode 100644 index 0000000..e09b319 --- /dev/null +++ b/.config/qutebrowser/autoconfig.yml @@ -0,0 +1,7 @@ +# DO NOT edit this file by hand, qutebrowser will overwrite it. +# Instead, create a config.py - see :help for details. + +config_version: 2 +settings: + content.notifications: + https://smutty.com: false diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py new file mode 100644 index 0000000..dfec986 --- /dev/null +++ b/.config/qutebrowser/config.py @@ -0,0 +1,293 @@ +import yaml +import subprocess + + +def qb_config(): + """ + Top level config function. + Set options from config.yml, find defaults in defaults.py (:config-write-py -d defaults.py to refresh). + + Uses the Base16 color scheme format, schemes can be loaded from .Xresources or config.yml files via 'custom.base16.chosen' option, + uses the default qutebrowser color scheme if this option is null or empty. + """ + with (config.configdir / 'config.yml').open() as f: + yaml_data = yaml.safe_load(f) + + # STANDARD + for k, v in filter(lambda i: not i[0].startswith('custom.'), yaml_data.items()): + config.set(k, v) + + # CUSTOM + ## KEYBINDS + for key, action in yaml_data['custom.keybinds'].items(): + config.bind(key, action) + + ## BASE16 + chosen = yaml_data['custom.base16.chosen'] + if (chosen): + if (chosen == '.Xresources'): + xpfx = '*.' + xcolors = dict(filter(lambda i: 'color' in i[0], read_xresources(xpfx).items())) + colors = {'base0{}'.format(hex(int(k.strip(xpfx+'color')))[2:].upper()): v for k, v in xcolors.items()} + else: + scheme = 'custom.base16.schemes.{}'.format(chosen) + if (scheme not in yaml_data): + raise ValueError("'{}' base16 scheme not defined in config.yml".format(chosen)) + else: + colors = yaml_data[scheme] + qb_config_base16_load(colors) + +def read_xresources(prefix): + """ + Get ~/.Xresources file properties. + Source: https://www.qutebrowser.org/doc/help/configuring.html + """ + props = {} + x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE) + lines = x.stdout.decode().split('\n') + for line in filter(lambda l : l.startswith(prefix), lines): + prop, _, value = line.partition(':\t') + props[prop] = value + return props + +def qb_config_base16_load(colors): + """ + Set qutebrowser colors via base16 dictionary + Base16 qb Template by theova: https://github.com/theova/base16-qutebrowser + + Args: + colors (dict): dictionary of base16 hex colors + + Returns: + None + """ + # Text color of the completion widget. May be a single color to use for + # all columns or a list of three colors, one for each column. + c.colors.completion.fg = colors['base05'] + + # Background color of the completion widget for odd rows. + c.colors.completion.odd.bg = colors['base03'] + + # Background color of the completion widget for even rows. + c.colors.completion.even.bg = colors['base00'] + + # Foreground color of completion widget category headers. + c.colors.completion.category.fg = colors['base0A'] + + # Background color of the completion widget category headers. + c.colors.completion.category.bg = colors['base00'] + + # Top border color of the completion widget category headers. + c.colors.completion.category.border.top = colors['base00'] + + # Bottom border color of the completion widget category headers. + c.colors.completion.category.border.bottom = colors['base00'] + + # Foreground color of the selected completion item. + c.colors.completion.item.selected.fg = colors['base01'] + + # Background color of the selected completion item. + c.colors.completion.item.selected.bg = colors['base0A'] + + # Top border color of the completion widget category headers. + c.colors.completion.item.selected.border.top = colors['base0A'] + + # Bottom border color of the selected completion item. + c.colors.completion.item.selected.border.bottom = colors['base0A'] + + # Foreground color of the matched text in the completion. + c.colors.completion.match.fg = colors['base0B'] + + # Color of the scrollbar handle in the completion view. + c.colors.completion.scrollbar.fg = colors['base05'] + + # Color of the scrollbar in the completion view. + c.colors.completion.scrollbar.bg = colors['base00'] + + # Background color for the download bar. + c.colors.downloads.bar.bg = colors['base00'] + + # Color gradient start for download text. + c.colors.downloads.start.fg = colors['base00'] + + # Color gradient start for download backgrounds. + c.colors.downloads.start.bg = colors['base0D'] + + # Color gradient end for download text. + c.colors.downloads.stop.fg = colors['base00'] + + # Color gradient stop for download backgrounds. + c.colors.downloads.stop.bg = colors['base0C'] + + # Foreground color for downloads with errors. + c.colors.downloads.error.fg = colors['base08'] + + # Font color for hints. + c.colors.hints.fg = colors['base00'] + + # Background color for hints. Note that you can use a `rgba(...)` value for transparency. + c.colors.hints.bg = colors['base0A'] + + # Font color for the matched part of hints. + c.colors.hints.match.fg = colors['base05'] + + # Text color for the keyhint widget. + c.colors.keyhint.fg = colors['base05'] + + # Highlight color for keys to complete the current keychain. + c.colors.keyhint.suffix.fg = colors['base05'] + + # Background color of the keyhint widget. + c.colors.keyhint.bg = colors['base00'] + + # Foreground color of an error message. + c.colors.messages.error.fg = colors['base00'] + + # Background color of an error message. + c.colors.messages.error.bg = colors['base08'] + + # Border color of an error message. + c.colors.messages.error.border = colors['base08'] + + # Foreground color of a warning message. + c.colors.messages.warning.fg = colors['base00'] + + # Background color of a warning message. + c.colors.messages.warning.bg = colors['base0E'] + + # Border color of a warning message. + c.colors.messages.warning.border = colors['base0E'] + + # Foreground color of an info message. + c.colors.messages.info.fg = colors['base05'] + + # Background color of an info message. + c.colors.messages.info.bg = colors['base00'] + + # Border color of an info message. + c.colors.messages.info.border = colors['base00'] + + # Foreground color for prompts. + c.colors.prompts.fg = colors['base05'] + + # Border used around UI elements in prompts. + c.colors.prompts.border = colors['base00'] + + # Background color for prompts. + c.colors.prompts.bg = colors['base00'] + + # Background color for the selected item in filename prompts. + c.colors.prompts.selected.bg = colors['base0A'] + + # Foreground color of the statusbar. + c.colors.statusbar.normal.fg = colors['base0B'] + + # Background color of the statusbar. + c.colors.statusbar.normal.bg = colors['base00'] + + # Foreground color of the statusbar in insert mode. + c.colors.statusbar.insert.fg = colors['base00'] + + # Background color of the statusbar in insert mode. + c.colors.statusbar.insert.bg = colors['base0D'] + + # Foreground color of the statusbar in passthrough mode. + c.colors.statusbar.passthrough.fg = colors['base00'] + + # Background color of the statusbar in passthrough mode. + c.colors.statusbar.passthrough.bg = colors['base0C'] + + # Foreground color of the statusbar in private browsing mode. + c.colors.statusbar.private.fg = colors['base00'] + + # Background color of the statusbar in private browsing mode. + c.colors.statusbar.private.bg = colors['base03'] + + # Foreground color of the statusbar in command mode. + c.colors.statusbar.command.fg = colors['base05'] + + # Background color of the statusbar in command mode. + c.colors.statusbar.command.bg = colors['base00'] + + # Foreground color of the statusbar in private browsing + command mode. + c.colors.statusbar.command.private.fg = colors['base05'] + + # Background color of the statusbar in private browsing + command mode. + c.colors.statusbar.command.private.bg = colors['base00'] + + # Foreground color of the statusbar in caret mode. + c.colors.statusbar.caret.fg = colors['base00'] + + # Background color of the statusbar in caret mode. + c.colors.statusbar.caret.bg = colors['base0E'] + + # Foreground color of the statusbar in caret mode with a selection. + c.colors.statusbar.caret.selection.fg = colors['base00'] + + # Background color of the statusbar in caret mode with a selection. + c.colors.statusbar.caret.selection.bg = colors['base0D'] + + # Background color of the progress bar. + c.colors.statusbar.progress.bg = colors['base0D'] + + # Default foreground color of the URL in the statusbar. + c.colors.statusbar.url.fg = colors['base05'] + + # Foreground color of the URL in the statusbar on error. + c.colors.statusbar.url.error.fg = colors['base08'] + + # Foreground color of the URL in the statusbar for hovered links. + c.colors.statusbar.url.hover.fg = colors['base05'] + + # Foreground color of the URL in the statusbar on successful load + # (http). + c.colors.statusbar.url.success.http.fg = colors['base0C'] + + # Foreground color of the URL in the statusbar on successful load + # (https). + c.colors.statusbar.url.success.https.fg = colors['base0B'] + + # Foreground color of the URL in the statusbar when there's a warning. + c.colors.statusbar.url.warn.fg = colors['base0E'] + + # Background color of the tab bar. + c.colors.tabs.bar.bg = colors['base00'] + + # Color gradient start for the tab indicator. + c.colors.tabs.indicator.start = colors['base0D'] + + # Color gradient end for the tab indicator. + c.colors.tabs.indicator.stop = colors['base0C'] + + # Color for the tab indicator on errors. + c.colors.tabs.indicator.error = colors['base08'] + + # Foreground color of unselected odd tabs. + c.colors.tabs.odd.fg = colors['base05'] + + # Background color of unselected odd tabs. + c.colors.tabs.odd.bg = colors['base03'] + + # Foreground color of unselected even tabs. + c.colors.tabs.even.fg = colors['base05'] + + # Background color of unselected even tabs. + c.colors.tabs.even.bg = colors['base00'] + + # Foreground color of selected odd tabs. + c.colors.tabs.selected.odd.fg = colors['base00'] + + # Background color of selected odd tabs. + c.colors.tabs.selected.odd.bg = colors['base05'] + + # Foreground color of selected even tabs. + c.colors.tabs.selected.even.fg = colors['base00'] + + # Background color of selected even tabs. + c.colors.tabs.selected.even.bg = colors['base05'] + + # Background color for webpages if unset (or empty to use the theme's color). + # c.colors.webpage.bg = colors['base00'] + + +qb_config() diff --git a/.config/qutebrowser/config.yml b/.config/qutebrowser/config.yml new file mode 100644 index 0000000..b043901 --- /dev/null +++ b/.config/qutebrowser/config.yml @@ -0,0 +1,112 @@ +# STANDARD +## GENERAL +backend: 'webengine' +auto_save.session: True +confirm_quit: ['downloads'] + +## CONTENT +content.autoplay: False +content.dns_prefetch: False +content.headers.do_not_track: True +content.webgl: True + +## DOWNLOADS +downloads.position: 'bottom' +downloads.remove_finished: 5000 + +## HINTING +hints.chars: 'asdfghjklqwertyuiopzcvbnm' +hints.find_implementation: 'python' + +## TABS +tabs.last_close: 'close' +tabs.position: 'bottom' +tabs.show: 'multiple' +tabs.title.format: '[{index}] {current_title}' +tabs.title.format_pinned: '[{index}]' + +## URL +url.searchengines: { + # General + 'DEFAULT': 'https://duckduckgo.com/?q={}', + 'ddg': 'https://duckduckgo.com/?q={}', + 'wiki': 'https://en.wikipedia.org/?search={}', + + # Social + 'yt': 'https://www.youtube.com/results?search_query={}', + 'sex': 'https://stackexchange.com/search?q={}', + 'ghub': 'https://github.com/search?q={}', + 'glab': 'https://gitlab.com/search?search={}', + + # Commerce + 'ebay': 'https://www.ebay.com/sch/?_nkw={}', + 'amzn': 'https://www.amazon.com/s?k={}', + + # Linux + 'man': 'https://www.die.net/search/?q={}&sa=Search', + + # Arch Linux + 'arch': 'https://wiki.archlinux.org/?search={}', + 'pacman': 'https://www.archlinux.org/packages/?q={}', + 'aur': 'https://aur.archlinux.org/packages/?O=0&K={}', + + # Alpine Linux + 'apk': 'https://pkgs.alpinelinux.org/packages?name={}&branch=edge&arch=armhf', + + # Void Linux + 'void': 'https://wiki.voidlinux.org/?search={}', + + # Python Docs + 'py3': 'https://docs.python.org/3/search.html?q={}', + 'conda': 'https://anaconda.org/search?q={}', + 'pip': 'https://pypi.org/search/?q={}', + 'pd': 'https://pandas.pydata.org/pandas-docs/stable/search.html?q={}', + 'np': 'https://docs.scipy.org/doc/numpy/search.html?q={}', + 'pyt': 'https://pytorch.org/docs/stable/search.html?q={}', + + # Rust Docs + 'rust': 'https://doc.rust-lang.org/reference/index.html?search={}', + 'rstd': 'https://doc.rust-lang.org/std/?search={}', + 'cargo': 'https://crates.io/search?q={}' +} + +## WINDOW +window.hide_decoration: True + +## ZOOM +zoom.default: '150%' + +# CUSTOM +## KEYBINDS +custom.keybinds: { + 'D': 'tab-close -o', + 'H': 'tab-prev', + 'J': 'back', + 'K': 'forward', + 'L': 'tab-next', + 'd': 'tab-close' +} + +## BASE16 +custom.base16.chosen: 'gruvbox.dark_soft' + +### GRUVBOX - by Dawid Kurek: (https://github.com/morhetz/gruvbox) +#### DARK SOFT +custom.base16.schemes.gruvbox.dark_soft: { + 'base00': "#32302f", + 'base01': "#3c3836", + 'base02': "#504945", + 'base03': "#665c54", + 'base04': "#bdae93", + 'base05': "#d5c4a1", + 'base06': "#ebdbb2", + 'base07': "#fbf1c7", + 'base08': "#fb4934", + 'base09': "#fe8019", + 'base0A': "#fabd2f", + 'base0B': "#b8bb26", + 'base0C': "#8ec07c", + 'base0D': "#83a598", + 'base0E': "#d3869b", + 'base0F': "#d65d0e" +} diff --git a/.config/qutebrowser/defaults.py b/.config/qutebrowser/defaults.py new file mode 100644 index 0000000..27fa999 --- /dev/null +++ b/.config/qutebrowser/defaults.py @@ -0,0 +1,1873 @@ +## Autogenerated config.py +## Documentation: +## qute://help/configuring.html +## qute://help/settings.html + +## This is here so configs done via the GUI are still loaded. +## Remove it to not load settings done via the GUI. +# config.load_autoconfig() + +## Aliases for commands. The keys of the given dictionary are the +## aliases, while the values are the commands they map to. +## Type: Dict +# c.aliases = {'w': 'session-save', 'q': 'close', 'qa': 'quit', 'wq': 'quit --save', 'wqa': 'quit --save'} + +## Time interval (in milliseconds) between auto-saves of +## config/cookies/etc. +## Type: Int +# c.auto_save.interval = 15000 + +## Always restore open sites when qutebrowser is reopened. +## Type: Bool +# c.auto_save.session = False + +## Backend to use to display websites. qutebrowser supports two different +## web rendering engines / backends, QtWebKit and QtWebEngine. QtWebKit +## was discontinued by the Qt project with Qt 5.6, but picked up as a +## well maintained fork: https://github.com/annulen/webkit/wiki - +## qutebrowser only supports the fork. QtWebEngine is Qt's official +## successor to QtWebKit. It's slightly more resource hungry than +## QtWebKit and has a couple of missing features in qutebrowser, but is +## generally the preferred choice. +## Type: String +## Valid values: +## - webengine: Use QtWebEngine (based on Chromium). +## - webkit: Use QtWebKit (based on WebKit, similar to Safari). +# c.backend = 'webengine' + +## This setting can be used to map keys to other keys. When the key used +## as dictionary-key is pressed, the binding for the key used as +## dictionary-value is invoked instead. This is useful for global +## remappings of keys, for example to map Ctrl-[ to Escape. Note that +## when a key is bound (via `bindings.default` or `bindings.commands`), +## the mapping is ignored. +## Type: Dict +# c.bindings.key_mappings = {'<Ctrl-[>': '<Escape>', '<Ctrl-6>': '<Ctrl-^>', '<Ctrl-M>': '<Return>', '<Ctrl-J>': '<Return>', '<Shift-Return>': '<Return>', '<Enter>': '<Return>', '<Shift-Enter>': '<Return>', '<Ctrl-Enter>': '<Ctrl-Return>'} + +## Background color of the completion widget category headers. +## Type: QssColor +# c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)' + +## Bottom border color of the completion widget category headers. +## Type: QssColor +# c.colors.completion.category.border.bottom = 'black' + +## Top border color of the completion widget category headers. +## Type: QssColor +# c.colors.completion.category.border.top = 'black' + +## Foreground color of completion widget category headers. +## Type: QtColor +# c.colors.completion.category.fg = 'white' + +## Background color of the completion widget for even rows. +## Type: QssColor +# c.colors.completion.even.bg = '#333333' + +## Text color of the completion widget. May be a single color to use for +## all columns or a list of three colors, one for each column. +## Type: List of QtColor, or QtColor +# c.colors.completion.fg = ['white', 'white', 'white'] + +## Background color of the selected completion item. +## Type: QssColor +# c.colors.completion.item.selected.bg = '#e8c000' + +## Bottom border color of the selected completion item. +## Type: QssColor +# c.colors.completion.item.selected.border.bottom = '#bbbb00' + +## Top border color of the selected completion item. +## Type: QssColor +# c.colors.completion.item.selected.border.top = '#bbbb00' + +## Foreground color of the selected completion item. +## Type: QtColor +# c.colors.completion.item.selected.fg = 'black' + +## Foreground color of the matched text in the selected completion item. +## Type: QtColor +# c.colors.completion.item.selected.match.fg = '#ff4444' + +## Foreground color of the matched text in the completion. +## Type: QtColor +# c.colors.completion.match.fg = '#ff4444' + +## Background color of the completion widget for odd rows. +## Type: QssColor +# c.colors.completion.odd.bg = '#444444' + +## Color of the scrollbar in the completion view. +## Type: QssColor +# c.colors.completion.scrollbar.bg = '#333333' + +## Color of the scrollbar handle in the completion view. +## Type: QssColor +# c.colors.completion.scrollbar.fg = 'white' + +## Background color for the download bar. +## Type: QssColor +# c.colors.downloads.bar.bg = 'black' + +## Background color for downloads with errors. +## Type: QtColor +# c.colors.downloads.error.bg = 'red' + +## Foreground color for downloads with errors. +## Type: QtColor +# c.colors.downloads.error.fg = 'white' + +## Color gradient start for download backgrounds. +## Type: QtColor +# c.colors.downloads.start.bg = '#0000aa' + +## Color gradient start for download text. +## Type: QtColor +# c.colors.downloads.start.fg = 'white' + +## Color gradient stop for download backgrounds. +## Type: QtColor +# c.colors.downloads.stop.bg = '#00aa00' + +## Color gradient end for download text. +## Type: QtColor +# c.colors.downloads.stop.fg = 'white' + +## Color gradient interpolation system for download backgrounds. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +# c.colors.downloads.system.bg = 'rgb' + +## Color gradient interpolation system for download text. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +# c.colors.downloads.system.fg = 'rgb' + +## Background color for hints. Note that you can use a `rgba(...)` value +## for transparency. +## Type: QssColor +# c.colors.hints.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8))' + +## Font color for hints. +## Type: QssColor +# c.colors.hints.fg = 'black' + +## Font color for the matched part of hints. +## Type: QtColor +# c.colors.hints.match.fg = 'green' + +## Background color of the keyhint widget. +## Type: QssColor +# c.colors.keyhint.bg = 'rgba(0, 0, 0, 80%)' + +## Text color for the keyhint widget. +## Type: QssColor +# c.colors.keyhint.fg = '#FFFFFF' + +## Highlight color for keys to complete the current keychain. +## Type: QssColor +# c.colors.keyhint.suffix.fg = '#FFFF00' + +## Background color of an error message. +## Type: QssColor +# c.colors.messages.error.bg = 'red' + +## Border color of an error message. +## Type: QssColor +# c.colors.messages.error.border = '#bb0000' + +## Foreground color of an error message. +## Type: QssColor +# c.colors.messages.error.fg = 'white' + +## Background color of an info message. +## Type: QssColor +# c.colors.messages.info.bg = 'black' + +## Border color of an info message. +## Type: QssColor +# c.colors.messages.info.border = '#333333' + +## Foreground color of an info message. +## Type: QssColor +# c.colors.messages.info.fg = 'white' + +## Background color of a warning message. +## Type: QssColor +# c.colors.messages.warning.bg = 'darkorange' + +## Border color of a warning message. +## Type: QssColor +# c.colors.messages.warning.border = '#d47300' + +## Foreground color of a warning message. +## Type: QssColor +# c.colors.messages.warning.fg = 'white' + +## Background color for prompts. +## Type: QssColor +# c.colors.prompts.bg = '#444444' + +## Border used around UI elements in prompts. +## Type: String +# c.colors.prompts.border = '1px solid gray' + +## Foreground color for prompts. +## Type: QssColor +# c.colors.prompts.fg = 'white' + +## Background color for the selected item in filename prompts. +## Type: QssColor +# c.colors.prompts.selected.bg = 'grey' + +## Background color of the statusbar in caret mode. +## Type: QssColor +# c.colors.statusbar.caret.bg = 'purple' + +## Foreground color of the statusbar in caret mode. +## Type: QssColor +# c.colors.statusbar.caret.fg = 'white' + +## Background color of the statusbar in caret mode with a selection. +## Type: QssColor +# c.colors.statusbar.caret.selection.bg = '#a12dff' + +## Foreground color of the statusbar in caret mode with a selection. +## Type: QssColor +# c.colors.statusbar.caret.selection.fg = 'white' + +## Background color of the statusbar in command mode. +## Type: QssColor +# c.colors.statusbar.command.bg = 'black' + +## Foreground color of the statusbar in command mode. +## Type: QssColor +# c.colors.statusbar.command.fg = 'white' + +## Background color of the statusbar in private browsing + command mode. +## Type: QssColor +# c.colors.statusbar.command.private.bg = 'grey' + +## Foreground color of the statusbar in private browsing + command mode. +## Type: QssColor +# c.colors.statusbar.command.private.fg = 'white' + +## Background color of the statusbar in insert mode. +## Type: QssColor +# c.colors.statusbar.insert.bg = 'darkgreen' + +## Foreground color of the statusbar in insert mode. +## Type: QssColor +# c.colors.statusbar.insert.fg = 'white' + +## Background color of the statusbar. +## Type: QssColor +# c.colors.statusbar.normal.bg = 'black' + +## Foreground color of the statusbar. +## Type: QssColor +# c.colors.statusbar.normal.fg = 'white' + +## Background color of the statusbar in passthrough mode. +## Type: QssColor +# c.colors.statusbar.passthrough.bg = 'darkblue' + +## Foreground color of the statusbar in passthrough mode. +## Type: QssColor +# c.colors.statusbar.passthrough.fg = 'white' + +## Background color of the statusbar in private browsing mode. +## Type: QssColor +# c.colors.statusbar.private.bg = '#666666' + +## Foreground color of the statusbar in private browsing mode. +## Type: QssColor +# c.colors.statusbar.private.fg = 'white' + +## Background color of the progress bar. +## Type: QssColor +# c.colors.statusbar.progress.bg = 'white' + +## Foreground color of the URL in the statusbar on error. +## Type: QssColor +# c.colors.statusbar.url.error.fg = 'orange' + +## Default foreground color of the URL in the statusbar. +## Type: QssColor +# c.colors.statusbar.url.fg = 'white' + +## Foreground color of the URL in the statusbar for hovered links. +## Type: QssColor +# c.colors.statusbar.url.hover.fg = 'aqua' + +## Foreground color of the URL in the statusbar on successful load +## (http). +## Type: QssColor +# c.colors.statusbar.url.success.http.fg = 'white' + +## Foreground color of the URL in the statusbar on successful load +## (https). +## Type: QssColor +# c.colors.statusbar.url.success.https.fg = 'lime' + +## Foreground color of the URL in the statusbar when there's a warning. +## Type: QssColor +# c.colors.statusbar.url.warn.fg = 'yellow' + +## Background color of the tab bar. +## Type: QssColor +# c.colors.tabs.bar.bg = '#555555' + +## Background color of unselected even tabs. +## Type: QtColor +# c.colors.tabs.even.bg = 'darkgrey' + +## Foreground color of unselected even tabs. +## Type: QtColor +# c.colors.tabs.even.fg = 'white' + +## Color for the tab indicator on errors. +## Type: QtColor +# c.colors.tabs.indicator.error = '#ff0000' + +## Color gradient start for the tab indicator. +## Type: QtColor +# c.colors.tabs.indicator.start = '#0000aa' + +## Color gradient end for the tab indicator. +## Type: QtColor +# c.colors.tabs.indicator.stop = '#00aa00' + +## Color gradient interpolation system for the tab indicator. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +# c.colors.tabs.indicator.system = 'rgb' + +## Background color of unselected odd tabs. +## Type: QtColor +# c.colors.tabs.odd.bg = 'grey' + +## Foreground color of unselected odd tabs. +## Type: QtColor +# c.colors.tabs.odd.fg = 'white' + +## Background color of pinned unselected even tabs. +## Type: QtColor +# c.colors.tabs.pinned.even.bg = 'darkseagreen' + +## Foreground color of pinned unselected even tabs. +## Type: QtColor +# c.colors.tabs.pinned.even.fg = 'white' + +## Background color of pinned unselected odd tabs. +## Type: QtColor +# c.colors.tabs.pinned.odd.bg = 'seagreen' + +## Foreground color of pinned unselected odd tabs. +## Type: QtColor +# c.colors.tabs.pinned.odd.fg = 'white' + +## Background color of pinned selected even tabs. +## Type: QtColor +# c.colors.tabs.pinned.selected.even.bg = 'black' + +## Foreground color of pinned selected even tabs. +## Type: QtColor +# c.colors.tabs.pinned.selected.even.fg = 'white' + +## Background color of pinned selected odd tabs. +## Type: QtColor +# c.colors.tabs.pinned.selected.odd.bg = 'black' + +## Foreground color of pinned selected odd tabs. +## Type: QtColor +# c.colors.tabs.pinned.selected.odd.fg = 'white' + +## Background color of selected even tabs. +## Type: QtColor +# c.colors.tabs.selected.even.bg = 'black' + +## Foreground color of selected even tabs. +## Type: QtColor +# c.colors.tabs.selected.even.fg = 'white' + +## Background color of selected odd tabs. +## Type: QtColor +# c.colors.tabs.selected.odd.bg = 'black' + +## Foreground color of selected odd tabs. +## Type: QtColor +# c.colors.tabs.selected.odd.fg = 'white' + +## Background color for webpages if unset (or empty to use the theme's +## color). +## Type: QtColor +# c.colors.webpage.bg = 'white' + +## Number of commands to save in the command history. 0: no history / -1: +## unlimited +## Type: Int +# c.completion.cmd_history_max_items = 100 + +## Delay (in milliseconds) before updating completions after typing a +## character. +## Type: Int +# c.completion.delay = 0 + +## Height (in pixels or as percentage of the window) of the completion. +## Type: PercOrInt +# c.completion.height = '50%' + +## Minimum amount of characters needed to update completions. +## Type: Int +# c.completion.min_chars = 1 + +## Which categories to show (in which order) in the :open completion. +## Type: FlagList +## Valid values: +## - searchengines +## - quickmarks +## - bookmarks +## - history +# c.completion.open_categories = ['searchengines', 'quickmarks', 'bookmarks', 'history'] + +## Move on to the next part when there's only one possible completion +## left. +## Type: Bool +# c.completion.quick = True + +## Padding (in pixels) of the scrollbar handle in the completion window. +## Type: Int +# c.completion.scrollbar.padding = 2 + +## Width (in pixels) of the scrollbar in the completion window. +## Type: Int +# c.completion.scrollbar.width = 12 + +## When to show the autocompletion window. +## Type: String +## Valid values: +## - always: Whenever a completion is available. +## - auto: Whenever a completion is requested. +## - never: Never. +# c.completion.show = 'always' + +## Shrink the completion to be smaller than the configured size if there +## are no scrollbars. +## Type: Bool +# c.completion.shrink = False + +## Format of timestamps (e.g. for the history completion). See +## https://sqlite.org/lang_datefunc.html for allowed substitutions. +## Type: String +# c.completion.timestamp_format = '%Y-%m-%d' + +## Execute the best-matching command on a partial match. +## Type: Bool +# c.completion.use_best_match = False + +## A list of patterns which should not be shown in the history. This only +## affects the completion. Matching URLs are still saved in the history +## (and visible on the qute://history page), but hidden in the +## completion. Changing this setting will cause the completion history to +## be regenerated on the next start, which will take a short while. +## Type: List of UrlPattern +# c.completion.web_history.exclude = [] + +## Number of URLs to show in the web history. 0: no history / -1: +## unlimited +## Type: Int +# c.completion.web_history.max_items = -1 + +## Require a confirmation before quitting the application. +## Type: ConfirmQuit +## Valid values: +## - always: Always show a confirmation. +## - multiple-tabs: Show a confirmation if multiple tabs are opened. +## - downloads: Show a confirmation if downloads are running +## - never: Never show a confirmation. +# c.confirm_quit = ['never'] + +## Automatically start playing `<video>` elements. Note: On Qt < 5.11, +## this option needs a restart and does not support URL patterns. +## Type: Bool +# c.content.autoplay = True + +## Enable support for the HTML 5 web application cache feature. An +## application cache acts like an HTTP cache in some sense. For documents +## that use the application cache via JavaScript, the loader engine will +## first ask the application cache for the contents, before hitting the +## network. +## Type: Bool +# c.content.cache.appcache = True + +## Maximum number of pages to hold in the global memory page cache. The +## page cache allows for a nicer user experience when navigating forth or +## back to pages in the forward/back history, by pausing and resuming up +## to _n_ pages. For more information about the feature, please refer to: +## http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ +## Type: Int +# c.content.cache.maximum_pages = 0 + +## Size (in bytes) of the HTTP network cache. Null to use the default +## value. With QtWebEngine, the maximum supported value is 2147483647 (~2 +## GB). +## Type: Int +# c.content.cache.size = None + +## Allow websites to read canvas elements. Note this is needed for some +## websites to work properly. +## Type: Bool +# c.content.canvas_reading = True + +## Which cookies to accept. +## Type: String +## Valid values: +## - all: Accept all cookies. +## - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. +## - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. +## - never: Don't accept cookies at all. +# c.content.cookies.accept = 'all' + +## Store cookies. Note this option needs a restart with QtWebEngine on Qt +## < 5.9. +## Type: Bool +# c.content.cookies.store = True + +## Default encoding to use for websites. The encoding must be a string +## describing an encoding such as _utf-8_, _iso-8859-1_, etc. +## Type: String +# c.content.default_encoding = 'iso-8859-1' + +## Allow websites to share screen content. On Qt < 5.10, a dialog box is +## always displayed, even if this is set to "true". +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.desktop_capture = 'ask' + +## Try to pre-fetch DNS entries to speed up browsing. +## Type: Bool +# c.content.dns_prefetch = False + +## Expand each subframe to its contents. This will flatten all the frames +## to become one scrollable page. +## Type: Bool +# c.content.frame_flattening = False + +## Allow websites to request geolocations. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.geolocation = 'ask' + +## Value to send in the `Accept-Language` header. Note that the value +## read from JavaScript is always the global value. +## Type: String +# c.content.headers.accept_language = 'en-US,en' + +## Custom headers for qutebrowser HTTP requests. +## Type: Dict +# c.content.headers.custom = {} + +## Value to send in the `DNT` header. When this is set to true, +## qutebrowser asks websites to not track your identity. If set to null, +## the DNT header is not sent at all. +## Type: Bool +# c.content.headers.do_not_track = True + +## When to send the Referer header. The Referer header tells websites +## from which website you were coming from when visiting them. No restart +## is needed with QtWebKit. +## Type: String +## Valid values: +## - always: Always send the Referer. +## - never: Never send the Referer. This is not recommended, as some sites may break. +## - same-domain: Only send the Referer for the same domain. This will still protect your privacy, but shouldn't break any sites. With QtWebEngine, the referer will still be sent for other domains, but with stripped path information. +# c.content.headers.referer = 'same-domain' + +## User agent to send. Unset to send the default. Note that the value +## read from JavaScript is always the global value. +## Type: String +# c.content.headers.user_agent = None + +## Enable host blocking. +## Type: Bool +# c.content.host_blocking.enabled = True + +## List of URLs of lists which contain hosts to block. The file can be +## in one of the following formats: - An `/etc/hosts`-like file - One +## host per line - A zip-file of any of the above, with either only one +## file, or a file named `hosts` (with any extension). It's also +## possible to add a local file or directory via a `file://` URL. In case +## of a directory, all files in the directory are read as adblock lists. +## The file `~/.config/qutebrowser/blocked-hosts` is always read if it +## exists. +## Type: List of Url +# c.content.host_blocking.lists = ['https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'] + +## A list of patterns that should always be loaded, despite being ad- +## blocked. Note this whitelists blocked hosts, not first-party URLs. As +## an example, if `example.org` loads an ad from `ads.example.org`, the +## whitelisted host should be `ads.example.org`. If you want to disable +## the adblocker on a given page, use the `content.host_blocking.enabled` +## setting with a URL pattern instead. Local domains are always exempt +## from hostblocking. +## Type: List of UrlPattern +# c.content.host_blocking.whitelist = ['piwik.org'] + +## Enable hyperlink auditing (`<a ping>`). +## Type: Bool +# c.content.hyperlink_auditing = False + +## Load images automatically in web pages. +## Type: Bool +# c.content.images = True + +## Show javascript alerts. +## Type: Bool +# c.content.javascript.alert = True + +## Allow JavaScript to read from or write to the clipboard. With +## QtWebEngine, writing the clipboard as response to a user interaction +## is always allowed. +## Type: Bool +# c.content.javascript.can_access_clipboard = False + +## Allow JavaScript to close tabs. +## Type: Bool +# c.content.javascript.can_close_tabs = False + +## Allow JavaScript to open new tabs without user interaction. +## Type: Bool +# c.content.javascript.can_open_tabs_automatically = False + +## Enable JavaScript. +## Type: Bool +# c.content.javascript.enabled = True + +## Log levels to use for JavaScript console logging messages. When a +## JavaScript message with the level given in the dictionary key is +## logged, the corresponding dictionary value selects the qutebrowser +## logger to use. On QtWebKit, the "unknown" setting is always used. +## Type: Dict +# c.content.javascript.log = {'unknown': 'debug', 'info': 'debug', 'warning': 'debug', 'error': 'debug'} + +## Use the standard JavaScript modal dialog for `alert()` and +## `confirm()`. +## Type: Bool +# c.content.javascript.modal_dialog = False + +## Show javascript prompts. +## Type: Bool +# c.content.javascript.prompt = True + +## Allow locally loaded documents to access other local URLs. +## Type: Bool +# c.content.local_content_can_access_file_urls = True + +## Allow locally loaded documents to access remote URLs. +## Type: Bool +# c.content.local_content_can_access_remote_urls = False + +## Enable support for HTML 5 local storage and Web SQL. +## Type: Bool +# c.content.local_storage = True + +## Allow websites to record audio/video. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.media_capture = 'ask' + +## Allow websites to lock your mouse pointer. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.mouse_lock = 'ask' + +## Automatically mute tabs. Note that if the `:tab-mute` command is used, +## the mute status for the affected tab is now controlled manually, and +## this setting doesn't have any effect. +## Type: Bool +# c.content.mute = False + +## Netrc-file for HTTP authentication. If unset, `~/.netrc` is used. +## Type: File +# c.content.netrc_file = None + +## Allow websites to show notifications. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.notifications = 'ask' + +## Allow pdf.js to view PDF files in the browser. Note that the files can +## still be downloaded by clicking the download button in the pdf.js +## viewer. +## Type: Bool +# c.content.pdfjs = False + +## Allow websites to request persistent storage quota via +## `navigator.webkitPersistentStorage.requestQuota`. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.persistent_storage = 'ask' + +## Enable plugins in Web pages. +## Type: Bool +# c.content.plugins = False + +## Draw the background color and images also when the page is printed. +## Type: Bool +# c.content.print_element_backgrounds = True + +## Open new windows in private browsing mode which does not record +## visited pages. +## Type: Bool +# c.content.private_browsing = False + +## Proxy to use. In addition to the listed values, you can use a +## `socks://...` or `http://...` URL. +## Type: Proxy +## Valid values: +## - system: Use the system wide proxy. +## - none: Don't use any proxy +# c.content.proxy = 'system' + +## Send DNS requests over the configured proxy. +## Type: Bool +# c.content.proxy_dns_requests = True + +## Allow websites to register protocol handlers via +## `navigator.registerProtocolHandler`. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.register_protocol_handler = 'ask' + +## Validate SSL handshakes. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +# c.content.ssl_strict = 'ask' + +## List of user stylesheet filenames to use. +## Type: List of File, or File +# c.content.user_stylesheets = [] + +## Enable WebGL. +## Type: Bool +# c.content.webgl = True + +## Which interfaces to expose via WebRTC. On Qt 5.10, this option doesn't +## work because of a Qt bug. +## Type: String +## Valid values: +## - all-interfaces: WebRTC has the right to enumerate all interfaces and bind them to discover public interfaces. +## - default-public-and-private-interfaces: WebRTC should only use the default route used by http. This also exposes the associated default private address. Default route is the route chosen by the OS on a multi-homed endpoint. +## - default-public-interface-only: WebRTC should only use the default route used by http. This doesn't expose any local addresses. +## - disable-non-proxied-udp: WebRTC should only use TCP to contact peers or servers unless the proxy server supports UDP. This doesn't expose any local addresses either. +# c.content.webrtc_ip_handling_policy = 'all-interfaces' + +## Limit fullscreen to the browser window (does not expand to fill the +## screen). +## Type: Bool +# c.content.windowed_fullscreen = False + +## Monitor load requests for cross-site scripting attempts. Suspicious +## scripts will be blocked and reported in the inspector's JavaScript +## console. +## Type: Bool +# c.content.xss_auditing = True + +## Directory to save downloads to. If unset, a sensible OS-specific +## default is used. +## Type: Directory +# c.downloads.location.directory = None + +## Prompt the user for the download location. If set to false, +## `downloads.location.directory` will be used. +## Type: Bool +# c.downloads.location.prompt = True + +## Remember the last used download directory. +## Type: Bool +# c.downloads.location.remember = True + +## What to display in the download filename input. +## Type: String +## Valid values: +## - path: Show only the download path. +## - filename: Show only download filename. +## - both: Show download path and filename. +# c.downloads.location.suggestion = 'path' + +## Default program used to open downloads. If null, the default internal +## handler is used. Any `{}` in the string will be expanded to the +## filename, else the filename will be appended. +## Type: String +# c.downloads.open_dispatcher = None + +## Where to show the downloaded files. +## Type: VerticalPosition +## Valid values: +## - top +## - bottom +# c.downloads.position = 'top' + +## Duration (in milliseconds) to wait before removing finished downloads. +## If set to -1, downloads are never removed. +## Type: Int +# c.downloads.remove_finished = -1 + +## Editor (and arguments) to use for the `open-editor` command. The +## following placeholders are defined: * `{file}`: Filename of the file +## to be edited. * `{line}`: Line in which the caret is found in the +## text. * `{column}`: Column in which the caret is found in the text. * +## `{line0}`: Same as `{line}`, but starting from index 0. * `{column0}`: +## Same as `{column}`, but starting from index 0. +## Type: ShellCommand +# c.editor.command = ['gvim', '-f', '{file}', '-c', 'normal {line}G{column0}l'] + +## Encoding to use for the editor. +## Type: Encoding +# c.editor.encoding = 'utf-8' + +## Font used in the completion categories. +## Type: Font +# c.fonts.completion.category = 'bold 10pt monospace' + +## Font used in the completion widget. +## Type: Font +# c.fonts.completion.entry = '10pt monospace' + +## Font used for the debugging console. +## Type: QtFont +# c.fonts.debug_console = '10pt monospace' + +## Font used for the downloadbar. +## Type: Font +# c.fonts.downloads = '10pt monospace' + +## Font used for the hints. +## Type: Font +# c.fonts.hints = 'bold 10pt monospace' + +## Font used in the keyhint widget. +## Type: Font +# c.fonts.keyhint = '10pt monospace' + +## Font used for error messages. +## Type: Font +# c.fonts.messages.error = '10pt monospace' + +## Font used for info messages. +## Type: Font +# c.fonts.messages.info = '10pt monospace' + +## Font used for warning messages. +## Type: Font +# c.fonts.messages.warning = '10pt monospace' + +## Default monospace fonts. Whenever "monospace" is used in a font +## setting, it's replaced with the fonts listed here. +## Type: Font +# c.fonts.monospace = '"xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal' + +## Font used for prompts. +## Type: Font +# c.fonts.prompts = '10pt sans-serif' + +## Font used in the statusbar. +## Type: Font +# c.fonts.statusbar = '10pt monospace' + +## Font used in the tab bar. +## Type: QtFont +# c.fonts.tabs = '10pt monospace' + +## Font family for cursive fonts. +## Type: FontFamily +# c.fonts.web.family.cursive = '' + +## Font family for fantasy fonts. +## Type: FontFamily +# c.fonts.web.family.fantasy = '' + +## Font family for fixed fonts. +## Type: FontFamily +# c.fonts.web.family.fixed = '' + +## Font family for sans-serif fonts. +## Type: FontFamily +# c.fonts.web.family.sans_serif = '' + +## Font family for serif fonts. +## Type: FontFamily +# c.fonts.web.family.serif = '' + +## Font family for standard fonts. +## Type: FontFamily +# c.fonts.web.family.standard = '' + +## Default font size (in pixels) for regular text. +## Type: Int +# c.fonts.web.size.default = 16 + +## Default font size (in pixels) for fixed-pitch text. +## Type: Int +# c.fonts.web.size.default_fixed = 13 + +## Hard minimum font size (in pixels). +## Type: Int +# c.fonts.web.size.minimum = 0 + +## Minimum logical font size (in pixels) that is applied when zooming +## out. +## Type: Int +# c.fonts.web.size.minimum_logical = 6 + +## When a hint can be automatically followed without pressing Enter. +## Type: String +## Valid values: +## - always: Auto-follow whenever there is only a single hint on a page. +## - unique-match: Auto-follow whenever there is a unique non-empty match in either the hint string (word mode) or filter (number mode). +## - full-match: Follow the hint when the user typed the whole hint (letter, word or number mode) or the element's text (only in number mode). +## - never: The user will always need to press Enter to follow a hint. +# c.hints.auto_follow = 'unique-match' + +## Duration (in milliseconds) to ignore normal-mode key bindings after a +## successful auto-follow. +## Type: Int +# c.hints.auto_follow_timeout = 0 + +## CSS border value for hints. +## Type: String +# c.hints.border = '1px solid #E3BE23' + +## Characters used for hint strings. +## Type: UniqueCharString +# c.hints.chars = 'asdfghjkl' + +## Dictionary file to be used by the word hints. +## Type: File +# c.hints.dictionary = '/usr/share/dict/words' + +## Which implementation to use to find elements to hint. +## Type: String +## Valid values: +## - javascript: Better but slower +## - python: Slightly worse but faster +# c.hints.find_implementation = 'python' + +## Hide unmatched hints in rapid mode. +## Type: Bool +# c.hints.hide_unmatched_rapid_hints = True + +## Leave hint mode when starting a new page load. +## Type: Bool +# c.hints.leave_on_load = True + +## Minimum number of characters used for hint strings. +## Type: Int +# c.hints.min_chars = 1 + +## Mode to use for hints. +## Type: String +## Valid values: +## - number: Use numeric hints. (In this mode you can also type letters from the hinted element to filter and reduce the number of elements that are hinted.) +## - letter: Use the characters in the `hints.chars` setting. +## - word: Use hints words based on the html elements and the extra words. +# c.hints.mode = 'letter' + +## Comma-separated list of regular expressions to use for 'next' links. +## Type: List of Regex +# c.hints.next_regexes = ['\\bnext\\b', '\\bmore\\b', '\\bnewer\\b', '\\b[>→≫]\\b', '\\b(>>|»)\\b', '\\bcontinue\\b'] + +## Comma-separated list of regular expressions to use for 'prev' links. +## Type: List of Regex +# c.hints.prev_regexes = ['\\bprev(ious)?\\b', '\\bback\\b', '\\bolder\\b', '\\b[<←≪]\\b', '\\b(<<|«)\\b'] + +## Scatter hint key chains (like Vimium) or not (like dwb). Ignored for +## number hints. +## Type: Bool +# c.hints.scatter = True + +## CSS selectors used to determine which elements on a page should have +## hints. +## Type: Dict +# c.hints.selectors = {'all': ['a', 'area', 'textarea', 'select', 'input:not([type="hidden"])', 'button', 'frame', 'iframe', 'img', 'link', 'summary', '[onclick]', '[onmousedown]', '[role="link"]', '[role="option"]', '[role="button"]', '[ng-click]', '[ngClick]', '[data-ng-click]', '[x-ng-click]', '[tabindex]'], 'links': ['a[href]', 'area[href]', 'link[href]', '[role="link"][href]'], 'images': ['img'], 'media': ['audio', 'img', 'video'], 'url': ['[src]', '[href]'], 'inputs': ['input[type="text"]', 'input[type="date"]', 'input[type="datetime-local"]', 'input[type="email"]', 'input[type="month"]', 'input[type="number"]', 'input[type="password"]', 'input[type="search"]', 'input[type="tel"]', 'input[type="time"]', 'input[type="url"]', 'input[type="week"]', 'input:not([type])', 'textarea']} + +## Make characters in hint strings uppercase. +## Type: Bool +# c.hints.uppercase = False + +## Maximum time (in minutes) between two history items for them to be +## considered being from the same browsing session. Items with less time +## between them are grouped when being displayed in `:history`. Use -1 to +## disable separation. +## Type: Int +# c.history_gap_interval = 30 + +## Allow Escape to quit the crash reporter. +## Type: Bool +# c.input.escape_quits_reporter = True + +## Which unbound keys to forward to the webview in normal mode. +## Type: String +## Valid values: +## - all: Forward all unbound keys. +## - auto: Forward unbound non-alphanumeric keys. +## - none: Don't forward any keys. +# c.input.forward_unbound_keys = 'auto' + +## Enter insert mode if an editable element is clicked. +## Type: Bool +# c.input.insert_mode.auto_enter = True + +## Leave insert mode if a non-editable element is clicked. +## Type: Bool +# c.input.insert_mode.auto_leave = True + +## Automatically enter insert mode if an editable element is focused +## after loading the page. +## Type: Bool +# c.input.insert_mode.auto_load = False + +## Leave insert mode when starting a new page load. Patterns may be +## unreliable on this setting, and they may match the url you are +## navigating to, or the URL you are navigating from. +## Type: Bool +# c.input.insert_mode.leave_on_load = True + +## Switch to insert mode when clicking flash and other plugins. +## Type: Bool +# c.input.insert_mode.plugins = False + +## Include hyperlinks in the keyboard focus chain when tabbing. +## Type: Bool +# c.input.links_included_in_focus_chain = True + +## Timeout (in milliseconds) for partially typed key bindings. If the +## current input forms only partial matches, the keystring will be +## cleared after this time. +## Type: Int +# c.input.partial_timeout = 5000 + +## Enable Opera-like mouse rocker gestures. This disables the context +## menu. +## Type: Bool +# c.input.rocker_gestures = False + +## Enable spatial navigation. Spatial navigation consists in the ability +## to navigate between focusable elements in a Web page, such as +## hyperlinks and form controls, by using Left, Right, Up and Down arrow +## keys. For example, if the user presses the Right key, heuristics +## determine whether there is an element he might be trying to reach +## towards the right and which element he probably wants. +## Type: Bool +# c.input.spatial_navigation = False + +## Keychains that shouldn't be shown in the keyhint dialog. Globs are +## supported, so `;*` will blacklist all keychains starting with `;`. Use +## `*` to disable keyhints. +## Type: List of String +# c.keyhint.blacklist = [] + +## Time (in milliseconds) from pressing a key to seeing the keyhint +## dialog. +## Type: Int +# c.keyhint.delay = 500 + +## Rounding radius (in pixels) for the edges of the keyhint dialog. +## Type: Int +# c.keyhint.radius = 6 + +## Duration (in milliseconds) to show messages in the statusbar for. Set +## to 0 to never clear messages. +## Type: Int +# c.messages.timeout = 2000 + +## How to open links in an existing instance if a new one is launched. +## This happens when e.g. opening a link from a terminal. See +## `new_instance_open_target_window` to customize in which window the +## link is opened in. +## Type: String +## Valid values: +## - tab: Open a new tab in the existing window and activate the window. +## - tab-bg: Open a new background tab in the existing window and activate the window. +## - tab-silent: Open a new tab in the existing window without activating the window. +## - tab-bg-silent: Open a new background tab in the existing window without activating the window. +## - window: Open in a new window. +# c.new_instance_open_target = 'tab' + +## Which window to choose when opening links as new tabs. When +## `new_instance_open_target` is set to `window`, this is ignored. +## Type: String +## Valid values: +## - first-opened: Open new tabs in the first (oldest) opened window. +## - last-opened: Open new tabs in the last (newest) opened window. +## - last-focused: Open new tabs in the most recently focused window. +## - last-visible: Open new tabs in the most recently visible window. +# c.new_instance_open_target_window = 'last-focused' + +## Show a filebrowser in upload/download prompts. +## Type: Bool +# c.prompt.filebrowser = True + +## Rounding radius (in pixels) for the edges of prompts. +## Type: Int +# c.prompt.radius = 8 + +## Additional arguments to pass to Qt, without leading `--`. With +## QtWebEngine, some Chromium arguments (see +## https://peter.sh/experiments/chromium-command-line-switches/ for a +## list) will work. +## Type: List of String +# c.qt.args = [] + +## Force a Qt platform to use. This sets the `QT_QPA_PLATFORM` +## environment variable and is useful to force using the XCB plugin when +## running QtWebEngine on Wayland. +## Type: String +# c.qt.force_platform = None + +## Force software rendering for QtWebEngine. This is needed for +## QtWebEngine to work with Nouveau drivers and can be useful in other +## scenarios related to graphic issues. +## Type: String +## Valid values: +## - software-opengl: Tell LibGL to use a software implementation of GL (`LIBGL_ALWAYS_SOFTWARE` / `QT_XCB_FORCE_SOFTWARE_OPENGL`) +## - qt-quick: Tell Qt Quick to use a software renderer instead of OpenGL. (`QT_QUICK_BACKEND=software`) +## - chromium: Tell Chromium to disable GPU support and use Skia software rendering instead. (`--disable-gpu`) +## - none: Don't force software rendering. +# c.qt.force_software_rendering = 'none' + +## Turn on Qt HighDPI scaling. This is equivalent to setting +## QT_AUTO_SCREEN_SCALE_FACTOR=1 in the environment. It's off by default +## as it can cause issues with some bitmap fonts. As an alternative to +## this, it's possible to set font sizes and the `zoom.default` setting. +## Type: Bool +# c.qt.highdpi = False + +## When to use Chromium's low-end device mode. This improves the RAM +## usage of renderer processes, at the expense of performance. +## Type: String +## Valid values: +## - always: Always use low-end device mode. +## - auto: Decide automatically (uses low-end mode with < 1 GB available RAM). +## - never: Never use low-end device mode. +# c.qt.low_end_device_mode = 'auto' + +## Which Chromium process model to use. Alternative process models use +## less resources, but decrease security and robustness. See the +## following pages for more details: - +## https://www.chromium.org/developers/design-documents/process-models +## - https://doc.qt.io/qt-5/qtwebengine-features.html#process-models +## Type: String +## Valid values: +## - process-per-site-instance: Pages from separate sites are put into separate processes and separate visits to the same site are also isolated. +## - process-per-site: Pages from separate sites are put into separate processes. Unlike Process per Site Instance, all visits to the same site will share an OS process. The benefit of this model is reduced memory consumption, because more web pages will share processes. The drawbacks include reduced security, robustness, and responsiveness. +## - single-process: Run all tabs in a single process. This should be used for debugging purposes only, and it disables `:open --private`. +# c.qt.process_model = 'process-per-site-instance' + +## When to show the scrollbar. +## Type: String +## Valid values: +## - always: Always show the scrollbar. +## - never: Never show the scrollbar. +## - when-searching: Show the scrollbar when searching for text in the webpage. With the QtWebKit backend, this is equal to `never`. +# c.scrolling.bar = 'when-searching' + +## Enable smooth scrolling for web pages. Note smooth scrolling does not +## work with the `:scroll-px` command. +## Type: Bool +# c.scrolling.smooth = False + +## When to find text on a page case-insensitively. +## Type: IgnoreCase +## Valid values: +## - always: Search case-insensitively. +## - never: Search case-sensitively. +## - smart: Search case-sensitively if there are capital characters. +# c.search.ignore_case = 'smart' + +## Find text on a page incrementally, renewing the search for each typed +## character. +## Type: Bool +# c.search.incremental = True + +## Name of the session to save by default. If this is set to null, the +## session which was last loaded is saved. +## Type: SessionName +# c.session.default_name = None + +## Load a restored tab as soon as it takes focus. +## Type: Bool +# c.session.lazy_restore = False + +## Languages to use for spell checking. You can check for available +## languages and install dictionaries using scripts/dictcli.py. Run the +## script with -h/--help for instructions. +## Type: List of String +## Valid values: +## - af-ZA: Afrikaans (South Africa) +## - bg-BG: Bulgarian (Bulgaria) +## - ca-ES: Catalan (Spain) +## - cs-CZ: Czech (Czech Republic) +## - da-DK: Danish (Denmark) +## - de-DE: German (Germany) +## - el-GR: Greek (Greece) +## - en-AU: English (Australia) +## - en-CA: English (Canada) +## - en-GB: English (United Kingdom) +## - en-US: English (United States) +## - es-ES: Spanish (Spain) +## - et-EE: Estonian (Estonia) +## - fa-IR: Farsi (Iran) +## - fo-FO: Faroese (Faroe Islands) +## - fr-FR: French (France) +## - he-IL: Hebrew (Israel) +## - hi-IN: Hindi (India) +## - hr-HR: Croatian (Croatia) +## - hu-HU: Hungarian (Hungary) +## - id-ID: Indonesian (Indonesia) +## - it-IT: Italian (Italy) +## - ko: Korean +## - lt-LT: Lithuanian (Lithuania) +## - lv-LV: Latvian (Latvia) +## - nb-NO: Norwegian (Norway) +## - nl-NL: Dutch (Netherlands) +## - pl-PL: Polish (Poland) +## - pt-BR: Portuguese (Brazil) +## - pt-PT: Portuguese (Portugal) +## - ro-RO: Romanian (Romania) +## - ru-RU: Russian (Russia) +## - sh: Serbo-Croatian +## - sk-SK: Slovak (Slovakia) +## - sl-SI: Slovenian (Slovenia) +## - sq: Albanian +## - sr: Serbian +## - sv-SE: Swedish (Sweden) +## - ta-IN: Tamil (India) +## - tg-TG: Tajik (Tajikistan) +## - tr-TR: Turkish (Turkey) +## - uk-UA: Ukrainian (Ukraine) +## - vi-VN: Vietnamese (Viet Nam) +# c.spellcheck.languages = [] + +## Hide the statusbar unless a message is shown. +## Type: Bool +# c.statusbar.hide = False + +## Padding (in pixels) for the statusbar. +## Type: Padding +# c.statusbar.padding = {'top': 1, 'bottom': 1, 'left': 0, 'right': 0} + +## Position of the status bar. +## Type: VerticalPosition +## Valid values: +## - top +## - bottom +# c.statusbar.position = 'bottom' + +## List of widgets displayed in the statusbar. +## Type: List of String +## Valid values: +## - url: Current page URL. +## - scroll: Percentage of the current page position like `10%`. +## - scroll_raw: Raw percentage of the current page position like `10`. +## - history: Display an arrow when possible to go back/forward in history. +## - tabs: Current active tab, e.g. `2`. +## - keypress: Display pressed keys when composing a vi command. +## - progress: Progress bar for the current page loading. +# c.statusbar.widgets = ['keypress', 'url', 'scroll', 'history', 'tabs', 'progress'] + +## Open new tabs (middleclick/ctrl+click) in the background. +## Type: Bool +# c.tabs.background = False + +## Mouse button with which to close tabs. +## Type: String +## Valid values: +## - right: Close tabs on right-click. +## - middle: Close tabs on middle-click. +## - none: Don't close tabs using the mouse. +# c.tabs.close_mouse_button = 'middle' + +## How to behave when the close mouse button is pressed on the tab bar. +## Type: String +## Valid values: +## - new-tab: Open a new tab. +## - close-current: Close the current tab. +## - close-last: Close the last tab. +## - ignore: Don't do anything. +# c.tabs.close_mouse_button_on_bar = 'new-tab' + +## Scaling factor for favicons in the tab bar. The tab size is unchanged, +## so big favicons also require extra `tabs.padding`. +## Type: Float +# c.tabs.favicons.scale = 1.0 + +## When to show favicons in the tab bar. +## Type: String +## Valid values: +## - always: Always show favicons. +## - never: Always hide favicons. +## - pinned: Show favicons only on pinned tabs. +# c.tabs.favicons.show = 'always' + +## Padding (in pixels) for tab indicators. +## Type: Padding +# c.tabs.indicator.padding = {'top': 2, 'bottom': 2, 'left': 0, 'right': 4} + +## Width (in pixels) of the progress indicator (0 to disable). +## Type: Int +# c.tabs.indicator.width = 3 + +## How to behave when the last tab is closed. +## Type: String +## Valid values: +## - ignore: Don't do anything. +## - blank: Load a blank page. +## - startpage: Load the start page. +## - default-page: Load the default page. +## - close: Close the window. +# c.tabs.last_close = 'ignore' + +## Maximum width (in pixels) of tabs (-1 for no maximum). This setting +## only applies when tabs are horizontal. This setting does not apply to +## pinned tabs, unless `tabs.pinned.shrink` is False. This setting may +## not apply properly if max_width is smaller than the minimum size of +## tab contents, or smaller than tabs.min_width. +## Type: Int +# c.tabs.max_width = -1 + +## Minimum width (in pixels) of tabs (-1 for the default minimum size +## behavior). This setting only applies when tabs are horizontal. This +## setting does not apply to pinned tabs, unless `tabs.pinned.shrink` is +## False. +## Type: Int +# c.tabs.min_width = -1 + +## When switching tabs, what input mode is applied. +## Type: String +## Valid values: +## - persist: Retain the current mode. +## - restore: Restore previously saved mode. +## - normal: Always revert to normal mode. +# c.tabs.mode_on_change = 'normal' + +## Switch between tabs using the mouse wheel. +## Type: Bool +# c.tabs.mousewheel_switching = True + +## Position of new tabs opened from another tab. See +## `tabs.new_position.stacking` for controlling stacking behavior. +## Type: NewTabPosition +## Valid values: +## - prev: Before the current tab. +## - next: After the current tab. +## - first: At the beginning. +## - last: At the end. +# c.tabs.new_position.related = 'next' + +## Stack related tabs on top of each other when opened consecutively. +## Only applies for `next` and `prev` values of +## `tabs.new_position.related` and `tabs.new_position.unrelated`. +## Type: Bool +# c.tabs.new_position.stacking = True + +## Position of new tabs which are not opened from another tab. See +## `tabs.new_position.stacking` for controlling stacking behavior. +## Type: NewTabPosition +## Valid values: +## - prev: Before the current tab. +## - next: After the current tab. +## - first: At the beginning. +## - last: At the end. +# c.tabs.new_position.unrelated = 'last' + +## Padding (in pixels) around text for tabs. +## Type: Padding +# c.tabs.padding = {'top': 0, 'bottom': 0, 'left': 5, 'right': 5} + +## Force pinned tabs to stay at fixed URL. +## Type: Bool +# c.tabs.pinned.frozen = True + +## Shrink pinned tabs down to their contents. +## Type: Bool +# c.tabs.pinned.shrink = True + +## Position of the tab bar. +## Type: Position +## Valid values: +## - top +## - bottom +## - left +## - right +# c.tabs.position = 'top' + +## Which tab to select when the focused tab is removed. +## Type: SelectOnRemove +## Valid values: +## - prev: Select the tab which came before the closed one (left in horizontal, above in vertical). +## - next: Select the tab which came after the closed one (right in horizontal, below in vertical). +## - last-used: Select the previously selected tab. +# c.tabs.select_on_remove = 'next' + +## When to show the tab bar. +## Type: String +## Valid values: +## - always: Always show the tab bar. +## - never: Always hide the tab bar. +## - multiple: Hide the tab bar if only one tab is open. +## - switching: Show the tab bar when switching tabs. +# c.tabs.show = 'always' + +## Duration (in milliseconds) to show the tab bar before hiding it when +## tabs.show is set to 'switching'. +## Type: Int +# c.tabs.show_switching_delay = 800 + +## Open a new window for every tab. +## Type: Bool +# c.tabs.tabs_are_windows = False + +## Alignment of the text inside of tabs. +## Type: TextAlignment +## Valid values: +## - left +## - right +## - center +# c.tabs.title.alignment = 'left' + +## Format to use for the tab title. The following placeholders are +## defined: * `{perc}`: Percentage as a string like `[10%]`. * +## `{perc_raw}`: Raw percentage, e.g. `10`. * `{current_title}`: Title of +## the current web page. * `{title_sep}`: The string ` - ` if a title is +## set, empty otherwise. * `{index}`: Index of this tab. * `{id}`: +## Internal tab ID of this tab. * `{scroll_pos}`: Page scroll position. * +## `{host}`: Host of the current web page. * `{backend}`: Either +## ''webkit'' or ''webengine'' * `{private}`: Indicates when private mode +## is enabled. * `{current_url}`: URL of the current web page. * +## `{protocol}`: Protocol (http/https/...) of the current web page. * +## `{audio}`: Indicator for audio/mute status. +## Type: FormatString +# c.tabs.title.format = '{audio}{index}: {current_title}' + +## Format to use for the tab title for pinned tabs. The same placeholders +## like for `tabs.title.format` are defined. +## Type: FormatString +# c.tabs.title.format_pinned = '{index}' + +## Number of close tab actions to remember, per window (-1 for no +## maximum). +## Type: Int +# c.tabs.undo_stack_size = 100 + +## Width (in pixels or as percentage of the window) of the tab bar if +## it's vertical. +## Type: PercOrInt +# c.tabs.width = '20%' + +## Wrap when changing tabs. +## Type: Bool +# c.tabs.wrap = True + +## What search to start when something else than a URL is entered. +## Type: String +## Valid values: +## - naive: Use simple/naive check. +## - dns: Use DNS requests (might be slow!). +## - never: Never search automatically. +# c.url.auto_search = 'naive' + +## Page to open if :open -t/-b/-w is used without URL. Use `about:blank` +## for a blank page. +## Type: FuzzyUrl +# c.url.default_page = 'https://start.duckduckgo.com/' + +## URL segments where `:navigate increment/decrement` will search for a +## number. +## Type: FlagList +## Valid values: +## - host +## - port +## - path +## - query +## - anchor +# c.url.incdec_segments = ['path', 'query'] + +## Open base URL of the searchengine if a searchengine shortcut is +## invoked without parameters. +## Type: Bool +# c.url.open_base_url = False + +## Search engines which can be used via the address bar. Maps a search +## engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` +## placeholder. The placeholder will be replaced by the search term, use +## `{{` and `}}` for literal `{`/`}` signs. The search engine named +## `DEFAULT` is used when `url.auto_search` is turned on and something +## else than a URL was entered to be opened. Other search engines can be +## used by prepending the search engine name to the search term, e.g. +## `:open google qutebrowser`. +## Type: Dict +# c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?q={}'} + +## Page(s) to open at the start. +## Type: List of FuzzyUrl, or FuzzyUrl +# c.url.start_pages = ['https://start.duckduckgo.com'] + +## URL parameters to strip with `:yank url`. +## Type: List of String +# c.url.yank_ignored_parameters = ['ref', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'] + +## Hide the window decoration. This setting requires a restart on +## Wayland. +## Type: Bool +# c.window.hide_decoration = False + +## Format to use for the window title. The same placeholders like for +## `tabs.title.format` are defined. +## Type: FormatString +# c.window.title_format = '{perc}{current_title}{title_sep}qutebrowser' + +## Default zoom level. +## Type: Perc +# c.zoom.default = '100%' + +## Available zoom levels. +## Type: List of Perc +# c.zoom.levels = ['25%', '33%', '50%', '67%', '75%', '90%', '100%', '110%', '125%', '150%', '175%', '200%', '250%', '300%', '400%', '500%'] + +## Number of zoom increments to divide the mouse wheel movements to. +## Type: Int +# c.zoom.mouse_divider = 512 + +## Apply the zoom factor on a frame only to the text or to all content. +## Type: Bool +# c.zoom.text_only = False + +## Bindings for normal mode +# config.bind("'", 'enter-mode jump_mark') +# config.bind('+', 'zoom-in') +# config.bind('-', 'zoom-out') +# config.bind('.', 'repeat-command') +# config.bind('/', 'set-cmd-text /') +# config.bind(':', 'set-cmd-text :') +# config.bind(';I', 'hint images tab') +# config.bind(';O', 'hint links fill :open -t -r {hint-url}') +# config.bind(';R', 'hint --rapid links window') +# config.bind(';Y', 'hint links yank-primary') +# config.bind(';b', 'hint all tab-bg') +# config.bind(';d', 'hint links download') +# config.bind(';f', 'hint all tab-fg') +# config.bind(';h', 'hint all hover') +# config.bind(';i', 'hint images') +# config.bind(';o', 'hint links fill :open {hint-url}') +# config.bind(';r', 'hint --rapid links tab-bg') +# config.bind(';t', 'hint inputs') +# config.bind(';y', 'hint links yank') +# config.bind('<Alt-1>', 'tab-focus 1') +# config.bind('<Alt-2>', 'tab-focus 2') +# config.bind('<Alt-3>', 'tab-focus 3') +# config.bind('<Alt-4>', 'tab-focus 4') +# config.bind('<Alt-5>', 'tab-focus 5') +# config.bind('<Alt-6>', 'tab-focus 6') +# config.bind('<Alt-7>', 'tab-focus 7') +# config.bind('<Alt-8>', 'tab-focus 8') +# config.bind('<Alt-9>', 'tab-focus -1') +# config.bind('<Alt-m>', 'tab-mute') +# config.bind('<Ctrl-A>', 'navigate increment') +# config.bind('<Ctrl-Alt-p>', 'print') +# config.bind('<Ctrl-B>', 'scroll-page 0 -1') +# config.bind('<Ctrl-D>', 'scroll-page 0 0.5') +# config.bind('<Ctrl-F5>', 'reload -f') +# config.bind('<Ctrl-F>', 'scroll-page 0 1') +# config.bind('<Ctrl-N>', 'open -w') +# config.bind('<Ctrl-PgDown>', 'tab-next') +# config.bind('<Ctrl-PgUp>', 'tab-prev') +# config.bind('<Ctrl-Q>', 'quit') +# config.bind('<Ctrl-Return>', 'follow-selected -t') +# config.bind('<Ctrl-Shift-N>', 'open -p') +# config.bind('<Ctrl-Shift-T>', 'undo') +# config.bind('<Ctrl-Shift-Tab>', 'nop') +# config.bind('<Ctrl-Shift-W>', 'close') +# config.bind('<Ctrl-T>', 'open -t') +# config.bind('<Ctrl-Tab>', 'tab-focus last') +# config.bind('<Ctrl-U>', 'scroll-page 0 -0.5') +# config.bind('<Ctrl-V>', 'enter-mode passthrough') +# config.bind('<Ctrl-W>', 'tab-close') +# config.bind('<Ctrl-X>', 'navigate decrement') +# config.bind('<Ctrl-^>', 'tab-focus last') +# config.bind('<Ctrl-h>', 'home') +# config.bind('<Ctrl-p>', 'tab-pin') +# config.bind('<Ctrl-s>', 'stop') +# config.bind('<Escape>', 'clear-keychain ;; search ;; fullscreen --leave') +# config.bind('<F11>', 'fullscreen') +# config.bind('<F5>', 'reload') +# config.bind('<Return>', 'follow-selected') +# config.bind('<back>', 'back') +# config.bind('<forward>', 'forward') +# config.bind('=', 'zoom') +# config.bind('?', 'set-cmd-text ?') +# config.bind('@', 'run-macro') +# config.bind('B', 'set-cmd-text -s :quickmark-load -t') +# config.bind('D', 'tab-close -o') +# config.bind('F', 'hint all tab') +# config.bind('G', 'scroll-to-perc') +# config.bind('H', 'back') +# config.bind('J', 'tab-next') +# config.bind('K', 'tab-prev') +# config.bind('L', 'forward') +# config.bind('M', 'bookmark-add') +# config.bind('N', 'search-prev') +# config.bind('O', 'set-cmd-text -s :open -t') +# config.bind('PP', 'open -t -- {primary}') +# config.bind('Pp', 'open -t -- {clipboard}') +# config.bind('R', 'reload -f') +# config.bind('Sb', 'open qute://bookmarks#bookmarks') +# config.bind('Sh', 'open qute://history') +# config.bind('Sq', 'open qute://bookmarks') +# config.bind('Ss', 'open qute://settings') +# config.bind('T', 'tab-focus') +# config.bind('ZQ', 'quit') +# config.bind('ZZ', 'quit --save') +# config.bind('[[', 'navigate prev') +# config.bind(']]', 'navigate next') +# config.bind('`', 'enter-mode set_mark') +# config.bind('ad', 'download-cancel') +# config.bind('b', 'set-cmd-text -s :quickmark-load') +# config.bind('cd', 'download-clear') +# config.bind('co', 'tab-only') +# config.bind('d', 'tab-close') +# config.bind('f', 'hint') +# config.bind('g$', 'tab-focus -1') +# config.bind('g0', 'tab-focus 1') +# config.bind('gB', 'set-cmd-text -s :bookmark-load -t') +# config.bind('gC', 'tab-clone') +# config.bind('gD', 'tab-give') +# config.bind('gO', 'set-cmd-text :open -t -r {url:pretty}') +# config.bind('gU', 'navigate up -t') +# config.bind('g^', 'tab-focus 1') +# config.bind('ga', 'open -t') +# config.bind('gb', 'set-cmd-text -s :bookmark-load') +# config.bind('gd', 'download') +# config.bind('gf', 'view-source') +# config.bind('gg', 'scroll-to-perc 0') +# config.bind('gi', 'hint inputs --first') +# config.bind('gl', 'tab-move -') +# config.bind('gm', 'tab-move') +# config.bind('go', 'set-cmd-text :open {url:pretty}') +# config.bind('gr', 'tab-move +') +# config.bind('gt', 'set-cmd-text -s :buffer') +# config.bind('gu', 'navigate up') +# config.bind('h', 'scroll left') +# config.bind('i', 'enter-mode insert') +# config.bind('j', 'scroll down') +# config.bind('k', 'scroll up') +# config.bind('l', 'scroll right') +# config.bind('m', 'quickmark-save') +# config.bind('n', 'search-next') +# config.bind('o', 'set-cmd-text -s :open') +# config.bind('pP', 'open -- {primary}') +# config.bind('pp', 'open -- {clipboard}') +# config.bind('q', 'record-macro') +# config.bind('r', 'reload') +# config.bind('sf', 'save') +# config.bind('sk', 'set-cmd-text -s :bind') +# config.bind('sl', 'set-cmd-text -s :set -t') +# config.bind('ss', 'set-cmd-text -s :set') +# config.bind('tIH', 'config-cycle -p -u *://*.{url:host}/* content.images ;; reload') +# config.bind('tIh', 'config-cycle -p -u *://{url:host}/* content.images ;; reload') +# config.bind('tIu', 'config-cycle -p -u {url} content.images ;; reload') +# config.bind('tPH', 'config-cycle -p -u *://*.{url:host}/* content.plugins ;; reload') +# config.bind('tPh', 'config-cycle -p -u *://{url:host}/* content.plugins ;; reload') +# config.bind('tPu', 'config-cycle -p -u {url} content.plugins ;; reload') +# config.bind('tSH', 'config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload') +# config.bind('tSh', 'config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload') +# config.bind('tSu', 'config-cycle -p -u {url} content.javascript.enabled ;; reload') +# config.bind('th', 'back -t') +# config.bind('tiH', 'config-cycle -p -t -u *://*.{url:host}/* content.images ;; reload') +# config.bind('tih', 'config-cycle -p -t -u *://{url:host}/* content.images ;; reload') +# config.bind('tiu', 'config-cycle -p -t -u {url} content.images ;; reload') +# config.bind('tl', 'forward -t') +# config.bind('tpH', 'config-cycle -p -t -u *://*.{url:host}/* content.plugins ;; reload') +# config.bind('tph', 'config-cycle -p -t -u *://{url:host}/* content.plugins ;; reload') +# config.bind('tpu', 'config-cycle -p -t -u {url} content.plugins ;; reload') +# config.bind('tsH', 'config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload') +# config.bind('tsh', 'config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload') +# config.bind('tsu', 'config-cycle -p -t -u {url} content.javascript.enabled ;; reload') +# config.bind('u', 'undo') +# config.bind('v', 'enter-mode caret') +# config.bind('wB', 'set-cmd-text -s :bookmark-load -w') +# config.bind('wO', 'set-cmd-text :open -w {url:pretty}') +# config.bind('wP', 'open -w -- {primary}') +# config.bind('wb', 'set-cmd-text -s :quickmark-load -w') +# config.bind('wf', 'hint all window') +# config.bind('wh', 'back -w') +# config.bind('wi', 'inspector') +# config.bind('wl', 'forward -w') +# config.bind('wo', 'set-cmd-text -s :open -w') +# config.bind('wp', 'open -w -- {clipboard}') +# config.bind('xO', 'set-cmd-text :open -b -r {url:pretty}') +# config.bind('xo', 'set-cmd-text -s :open -b') +# config.bind('yD', 'yank domain -s') +# config.bind('yM', 'yank inline [{title}]({url}) -s') +# config.bind('yP', 'yank pretty-url -s') +# config.bind('yT', 'yank title -s') +# config.bind('yY', 'yank -s') +# config.bind('yd', 'yank domain') +# config.bind('ym', 'yank inline [{title}]({url})') +# config.bind('yp', 'yank pretty-url') +# config.bind('yt', 'yank title') +# config.bind('yy', 'yank') +# config.bind('{{', 'navigate prev -t') +# config.bind('}}', 'navigate next -t') + +## Bindings for caret mode +# config.bind('$', 'move-to-end-of-line', mode='caret') +# config.bind('0', 'move-to-start-of-line', mode='caret') +# config.bind('<Ctrl-Space>', 'drop-selection', mode='caret') +# config.bind('<Escape>', 'leave-mode', mode='caret') +# config.bind('<Return>', 'yank selection', mode='caret') +# config.bind('<Space>', 'toggle-selection', mode='caret') +# config.bind('G', 'move-to-end-of-document', mode='caret') +# config.bind('H', 'scroll left', mode='caret') +# config.bind('J', 'scroll down', mode='caret') +# config.bind('K', 'scroll up', mode='caret') +# config.bind('L', 'scroll right', mode='caret') +# config.bind('Y', 'yank selection -s', mode='caret') +# config.bind('[', 'move-to-start-of-prev-block', mode='caret') +# config.bind(']', 'move-to-start-of-next-block', mode='caret') +# config.bind('b', 'move-to-prev-word', mode='caret') +# config.bind('c', 'enter-mode normal', mode='caret') +# config.bind('e', 'move-to-end-of-word', mode='caret') +# config.bind('gg', 'move-to-start-of-document', mode='caret') +# config.bind('h', 'move-to-prev-char', mode='caret') +# config.bind('j', 'move-to-next-line', mode='caret') +# config.bind('k', 'move-to-prev-line', mode='caret') +# config.bind('l', 'move-to-next-char', mode='caret') +# config.bind('o', 'reverse-selection', mode='caret') +# config.bind('v', 'toggle-selection', mode='caret') +# config.bind('w', 'move-to-next-word', mode='caret') +# config.bind('y', 'yank selection', mode='caret') +# config.bind('{', 'move-to-end-of-prev-block', mode='caret') +# config.bind('}', 'move-to-end-of-next-block', mode='caret') + +## Bindings for command mode +# config.bind('<Alt-B>', 'rl-backward-word', mode='command') +# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command') +# config.bind('<Alt-D>', 'rl-kill-word', mode='command') +# config.bind('<Alt-F>', 'rl-forward-word', mode='command') +# config.bind('<Ctrl-?>', 'rl-delete-char', mode='command') +# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command') +# config.bind('<Ctrl-B>', 'rl-backward-char', mode='command') +# config.bind('<Ctrl-C>', 'completion-item-yank', mode='command') +# config.bind('<Ctrl-D>', 'completion-item-del', mode='command') +# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command') +# config.bind('<Ctrl-F>', 'rl-forward-char', mode='command') +# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='command') +# config.bind('<Ctrl-K>', 'rl-kill-line', mode='command') +# config.bind('<Ctrl-N>', 'command-history-next', mode='command') +# config.bind('<Ctrl-P>', 'command-history-prev', mode='command') +# config.bind('<Ctrl-Return>', 'command-accept --rapid', mode='command') +# config.bind('<Ctrl-Shift-C>', 'completion-item-yank --sel', mode='command') +# config.bind('<Ctrl-Shift-Tab>', 'completion-item-focus prev-category', mode='command') +# config.bind('<Ctrl-Tab>', 'completion-item-focus next-category', mode='command') +# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='command') +# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command') +# config.bind('<Ctrl-Y>', 'rl-yank', mode='command') +# config.bind('<Down>', 'completion-item-focus --history next', mode='command') +# config.bind('<Escape>', 'leave-mode', mode='command') +# config.bind('<Return>', 'command-accept', mode='command') +# config.bind('<Shift-Delete>', 'completion-item-del', mode='command') +# config.bind('<Shift-Tab>', 'completion-item-focus prev', mode='command') +# config.bind('<Tab>', 'completion-item-focus next', mode='command') +# config.bind('<Up>', 'completion-item-focus --history prev', mode='command') + +## Bindings for hint mode +# config.bind('<Ctrl-B>', 'hint all tab-bg', mode='hint') +# config.bind('<Ctrl-F>', 'hint links', mode='hint') +# config.bind('<Ctrl-R>', 'hint --rapid links tab-bg', mode='hint') +# config.bind('<Escape>', 'leave-mode', mode='hint') +# config.bind('<Return>', 'follow-hint', mode='hint') + +## Bindings for insert mode +# config.bind('<Ctrl-E>', 'open-editor', mode='insert') +# config.bind('<Escape>', 'leave-mode', mode='insert') +# config.bind('<Shift-Ins>', 'insert-text {primary}', mode='insert') + +## Bindings for passthrough mode +# config.bind('<Shift-Escape>', 'leave-mode', mode='passthrough') + +## Bindings for prompt mode +# config.bind('<Alt-B>', 'rl-backward-word', mode='prompt') +# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='prompt') +# config.bind('<Alt-D>', 'rl-kill-word', mode='prompt') +# config.bind('<Alt-F>', 'rl-forward-word', mode='prompt') +# config.bind('<Alt-Shift-Y>', 'prompt-yank --sel', mode='prompt') +# config.bind('<Alt-Y>', 'prompt-yank', mode='prompt') +# config.bind('<Ctrl-?>', 'rl-delete-char', mode='prompt') +# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='prompt') +# config.bind('<Ctrl-B>', 'rl-backward-char', mode='prompt') +# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='prompt') +# config.bind('<Ctrl-F>', 'rl-forward-char', mode='prompt') +# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='prompt') +# config.bind('<Ctrl-K>', 'rl-kill-line', mode='prompt') +# config.bind('<Ctrl-P>', 'prompt-open-download --pdfjs', mode='prompt') +# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='prompt') +# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='prompt') +# config.bind('<Ctrl-X>', 'prompt-open-download', mode='prompt') +# config.bind('<Ctrl-Y>', 'rl-yank', mode='prompt') +# config.bind('<Down>', 'prompt-item-focus next', mode='prompt') +# config.bind('<Escape>', 'leave-mode', mode='prompt') +# config.bind('<Return>', 'prompt-accept', mode='prompt') +# config.bind('<Shift-Tab>', 'prompt-item-focus prev', mode='prompt') +# config.bind('<Tab>', 'prompt-item-focus next', mode='prompt') +# config.bind('<Up>', 'prompt-item-focus prev', mode='prompt') + +## Bindings for register mode +# config.bind('<Escape>', 'leave-mode', mode='register') + +## Bindings for yesno mode +# config.bind('<Alt-Shift-Y>', 'prompt-yank --sel', mode='yesno') +# config.bind('<Alt-Y>', 'prompt-yank', mode='yesno') +# config.bind('<Escape>', 'leave-mode', mode='yesno') +# config.bind('<Return>', 'prompt-accept', mode='yesno') +# config.bind('N', 'prompt-accept --save no', mode='yesno') +# config.bind('Y', 'prompt-accept --save yes', mode='yesno') +# config.bind('n', 'prompt-accept no', mode='yesno') +# config.bind('y', 'prompt-accept yes', mode='yesno') diff --git a/.config/qutebrowser/qsettings/QtProject.conf b/.config/qutebrowser/qsettings/QtProject.conf new file mode 100644 index 0000000..f1b0cd8 --- /dev/null +++ b/.config/qutebrowser/qsettings/QtProject.conf @@ -0,0 +1,8 @@ +[FileDialog] +history=file:///home/kev/Documents, file:///home/kev/Downloads, file:///home/kev/Pictures/wallpapers +lastVisited=file:///home/kev/Downloads +qtVersion=5.13.0 +shortcuts=file:, file:///home/kev +sidebarWidth=138 +treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x3\xb6\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\x1\xcb\0\0\0\x1\0\0\0\0\0\0\0\x9f\0\0\0\x1\0\0\0\0\0\0\0\x9f\0\0\0\x1\0\0\0\0\0\0\0\xad\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff) +viewMode=Detail diff --git a/.config/qutebrowser/quickmarks b/.config/qutebrowser/quickmarks new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.config/qutebrowser/quickmarks @@ -0,0 +1 @@ + diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py new file mode 100755 index 0000000..8c5e748 --- /dev/null +++ b/.config/ranger/commands.py @@ -0,0 +1,216 @@ +# This is a sample commands.py. You can add your own commands here. +# +# Please refer to commands_full.py for all the default commands and a complete +# documentation. Do NOT add them all here, or you may end up with defunct +# commands when upgrading ranger. + +# You always need to import ranger.api.commands here to get the Command class: +from ranger.api.commands import * + +# A simple command for demonstration purposes follows. +#------------------------------------------------------------------------------ + +# You can import any python module as needed. +import os + +# Any class that is a subclass of "Command" will be integrated into ranger as a +# command. Try typing ":my_edit<ENTER>" in ranger! +class my_edit(Command): + # The so-called doc-string of the class will be visible in the built-in + # help that is accessible by typing "?c" inside ranger. + """:my_edit <filename> + + A sample command for demonstration purposes that opens a file in an editor. + """ + + # The execute method is called when you run this command in ranger. + def execute(self): + # self.arg(1) is the first (space-separated) argument to the function. + # This way you can write ":my_edit somefilename<ENTER>". + if self.arg(1): + # self.rest(1) contains self.arg(1) and everything that follows + target_filename = self.rest(1) + else: + # self.fm is a ranger.core.filemanager.FileManager object and gives + # you access to internals of ranger. + # self.fm.thisfile is a ranger.container.file.File object and is a + # reference to the currently selected file. + target_filename = self.fm.thisfile.path + + # This is a generic function to print text in ranger. + self.fm.notify("Let's edit the file " + target_filename + "!") + + # Using bad=True in fm.notify allows you to print error messages: + if not os.path.exists(target_filename): + self.fm.notify("The given file does not exist!", bad=True) + return + + # This executes a function from ranger.core.acitons, a module with a + # variety of subroutines that can help you construct commands. + # Check out the source, or run "pydoc ranger.core.actions" for a list. + self.fm.edit_file(target_filename) + + # The tab method is called when you press tab, and should return a list of + # suggestions that the user will tab through. + def tab(self): + # This is a generic tab-completion function that iterates through the + # content of the current directory. + return self._tab_directory_content() + + +# https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf +# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map <C-f> fzf_select +class fzf_select(Command): + """ + :fzf_select + + Find a file using fzf. + + With a prefix argument select only directories. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + # match only directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + else: + # match files and directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) +# fzf_locate +class fzf_locate(Command): + """ + :fzf_locate + + Find a file using fzf. + + With a prefix argument select only directories. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + command="locate home media | fzf -e -i" + else: + command="locate home media | fzf -e -i" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) + +class fzf_bring(Command): + """ + :fzf_bring + + Find a file using fzf and bring it to the current directory. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + # match only directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + else: + # match files and directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) + + +import os +from ranger.core.loader import CommandLoader + +class compress(Command): + def execute(self): + """ Compress marked files to current directory """ + cwd = self.fm.thisdir + marked_files = cwd.get_selection() + + if not marked_files: + return + + def refresh(_): + cwd = self.fm.get_directory(original_path) + cwd.load_content() + + original_path = cwd.path + parts = self.line.split() + au_flags = parts[1:] + + descr = "compressing files in: " + os.path.basename(parts[1]) + obj = CommandLoader(args=['apack'] + au_flags + \ + [os.path.relpath(f.path, cwd.path) for f in marked_files], descr=descr) + + obj.signal_bind('after', refresh) + self.fm.loader.add(obj) + + def tab(self): + """ Complete with current folder name """ + + extension = ['.zip', '.tar.gz', '.rar', '.7z'] + return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension] + + + + +import os +from ranger.core.loader import CommandLoader + +class extracthere(Command): + def execute(self): + """ Extract copied files to current directory """ + copied_files = tuple(self.fm.copy_buffer) + + if not copied_files: + return + + def refresh(_): + cwd = self.fm.get_directory(original_path) + cwd.load_content() + + one_file = copied_files[0] + cwd = self.fm.thisdir + original_path = cwd.path + au_flags = ['-X', cwd.path] + au_flags += self.line.split()[1:] + au_flags += ['-e'] + + self.fm.copy_buffer.clear() + self.fm.cut_buffer = False + if len(copied_files) == 1: + descr = "extracting: " + os.path.basename(one_file.path) + else: + descr = "extracting files from: " + os.path.basename(one_file.dirname) + obj = CommandLoader(args=['aunpack'] + au_flags \ + + [f.path for f in copied_files], descr=descr) + + obj.signal_bind('after', refresh) + self.fm.loader.add(obj) + + + diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/luke_ranger_readme.md new file mode 100644 index 0000000..51c5dd1 --- /dev/null +++ b/.config/ranger/luke_ranger_readme.md @@ -0,0 +1,85 @@ +# Luke's ranger setup + +## Basic Ranger shortcuts + +These are the basic key binds in ranger, even outside of my configs. Note that they are mostly vim-based. + ++ h/j/k/l -- Move left/down/up/right (where left moves up in the directory structure, right moves into a folder) ++ Space -- select/highlight file ++ dd -- cut selected files ++ yy -- copy/yank selected files ++ pp -- paste/move cut/copied files ++ / -- search, when (n/N) next/previos result ++ zh or CTRL-h -- show hidden files ++ Renaming files: + + cw -- rename file from scratch + + A -- rename file adding to the end + + aa -- rename file appending before the extension + + I -- rename file adding at the beginning + +## Shortcuts + +As I say in the main readme, there are shortcut commands generated for ranger +based on what bookmarked directories and files you give it. For directory +shortcuts, here are the "verbs": + ++ g -- "go or cd" ++ t -- "new tab" ++ m -- "move file" ++ Y -- "yank or copy file" + +These "verbs" take "nouns" or "arguments," like these: + ++ d -- "~/Documents" ++ D -- "~/Downloads" ++ cf -- "~/.config" ++ And many others, including those you add to `~/.bmdirs`. + +Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in ~/.config, etc. etc. + +## Many little additions! + ++ Basic additions: + + V -- Make a new file and edit it in vim + + cW -- rename *all* selected files, editing in your text editor + + mkd -- Make a directory/folder + + sc -- Makes a link/shortcut (ln -sT) + + D -- delete selected file + + X -- Extract a zip/rar/tar.gz, whatever. Runs a script that picks the right command for the right archive. + + Z -- zips a folder up into a .tar.gz archive. + + CTRL-f -- Fuzzy find a file + + CTRL-l -- Fuzzy locate a file ++ Document manipulation: + + p1s -- print this file on the default printer, one-sided (lpr) + + p2s -- print this file on the default printer, double-sided (lpr) + + MP -- convert to a .pdf with pandoc (I use this to convert markdown, etc.) + + MX -- compile selected document in XeLaTeX + + ML -- compile selected document in LaTeX + + TC -- clear all non-visible TeX build files in this directory + + Txa -- copy article template to new file + + Txs -- copy slideshow/beamer template to new file + + Txh -- copy handout template to new file ++ Image commands: + + bg -- (for i3 users) makes an image your background (assuming i3 is looking at ~/.config/wall.png for your background) + + bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it. + + C -- rotates an image (requires imagemagick) + + F -- flips an image (requires imagemagick) + + TR -- add transparency to image file ++ mpd/mpc shortcuts + + MS -- Start mpd + + MK -- kill mpd + + MN -- Start playing selected song/folder now + + Ma -- Enqueue selected song/folder + + Mp -- Pause + + Mn -- Next track + + Mb -- Previous track + + Mo -- Restart track ++ Audio tagging with eye3D: + + Ta -- change artist name + + TA -- change album name + + Tb -- change album artist + + Tt -- change title + + Tn -- change track number ++ Downloading: + + ytv -- Download online video (paste in url) (requires youtube-dl) + + yta -- Download audio of online video (paste in url) (requires youtube-dl) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf new file mode 100644 index 0000000..8db456d --- /dev/null +++ b/.config/ranger/rc.conf @@ -0,0 +1,508 @@ +###SETTINGS### + +set column_ratios 1,3,4 +#set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ +set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ +set show_hidden true +set confirm_on_delete multiple +set preview_script ~/.config/ranger/scope.sh +set use_preview_script true +set automatically_count_files true +set open_all_images true +set vcs_aware false +set vcs_backend_git enabled +set vcs_backend_hg disabled +set vcs_backend_bzr disabled +set preview_images true +set preview_images_method w3m +set unicode_ellipsis false +set show_hidden_bookmarks false +set colorscheme default +set preview_files true +set preview_directories true +set collapse_preview true +set save_console_history false +set status_bar_on_top false +set draw_progress_bar_in_status_bar true +set draw_borders true +set dirname_in_tabs true +set mouse_enabled true +set display_size_in_main_column true +set display_size_in_status_bar true +set display_tags_in_all_columns true +set update_title false +set update_tmux_title true +set shorten_title 3 +set tilde_in_titlebar true +set max_history_size 20 +set max_console_history_size 50 +set scroll_offset 8 +set flushinput true +set padding_right true +set autosave_bookmarks false +set autoupdate_cumulative_size false +set show_cursor false +set sort natural +set sort_reverse false +set sort_case_insensitive true +set sort_directories_first true +set sort_unicode false +set xterm_alt_key false +set cd_bookmarks false +set preview_max_size 0 +set show_selection_in_titlebar true +set idle_delay 2000 +set metadata_deep_search false + +###ALIASES### +alias e edit +alias q quit +alias q! quitall +alias qa quitall +alias qall quitall +alias setl setlocal + +alias filter scout -prt +alias find scout -aeit +alias mark scout -mr +alias unmark scout -Mr +alias search scout -rs +alias search_inc scout -rts +alias travel scout -aefiklst + +###BASIC KEYS### + +#BASIC +map Q quit! +map q quit +copymap q ZZ ZQ + +#map R reload_cwd +map <C-r> reset +#map <C-l> redraw_window +map <C-c> abort +map <esc> change_mode normal + +map i display_file +map ? help +#map W display_log +map w taskview_open +map S shell $SHELL + +map : console +map ; console +map ! console shell%space +map @ console -p6 shell %s +map # console shell -p%space +#map s console shell%space +map r chain draw_possible_programs; console open_with%%space +map f console find%space +map cd console cd%space + +# Change the line mode +#map Mf linemode filename +#map Mi linemode fileinfo +#map Mp linemode permissions +#map Mt linemode metatitle + +#moc +#map Mc shell mocp -c +#map Ma shell mocp -a %s +#map Ms shell mocp -p +#map MS shell mocp -S +#map Mp shell mocp -G +#map Mn shell mocp -f +#map Mb shell mocp -r +#map MN shell mocp -s && mocp -c && mocp -a %s && mocp -p +#map Mo shell mocp -j 0%% +#map MK shell killall mocp + +# Tagging / Marking +map at tag_toggle +map ut tag_remove +map "<any> tag_toggle tag=%any +map <Space> mark_files toggle=True +map va mark_files all=True toggle=True +map uv mark_files all=True val=False +map vs toggle_visual_mode +map uV toggle_visual_mode reverse=True + +# For the nostalgics: Midnight Commander bindings +map <F1> help +map <F3> display_file +map <F4> edit +map <F5> copy +map <F5> console shell echo "require(rmarkdown); render_site()" | R --vanilla +map <F6> cut +map <F7> console mkdir%space +map <F8> console delete +map <F10> exit + +# In case you work on a keyboard with dvorak layout +map <UP> move up=1 +map <DOWN> move down=1 +map <LEFT> move left=1 +map <RIGHT> move right=1 +map <HOME> move to=0 +map <END> move to=-1 +map <PAGEDOWN> move down=1 pages=True +map <PAGEUP> move up=1 pages=True +map <CR> move right=1 +map <DELETE> console delete +map <INSERT> console touch%space + +# VIM-like +copymap <UP> k +copymap <DOWN> j +copymap <LEFT> h +copymap <RIGHT> l +copymap <HOME> gg +copymap <END> G +copymap <PAGEDOWN> <C-F> +copymap <PAGEUP> <C-B> + +map J move down=0.5 pages=True +map K move up=0.5 pages=True +copymap J <C-D> +copymap K <C-U> + +# Jumping around +map H history_go -1 +map L history_go 1 +map ] move_parent 1 +map [ move_parent -1 +map } traverse + +#DEFAULT MOVEMENT +map ge cd /etc +map gu cd /usr +#map gl cd -r . +map gL cd -r %f +#map gv cd /var +map gM cd /mnt +map gr cd / +map gR eval fm.cd(ranger.RANGERDIR) +map g? cd /usr/share/doc/ranger + +# Tabs +map <C-n> tab_new ~ +map <C-w> tab_close +map <TAB> tab_move 1 +map <S-TAB> tab_move -1 +map <A-Right> tab_move 1 +map <A-Left> tab_move -1 +#map gt tab_move 1 +#map gT tab_move -1 +map gn tab_new ~ +#map gc tab_close +map tt tab_close +map uq tab_restore +map <a-1> tab_open 1 +map <a-2> tab_open 2 +map <a-3> tab_open 3 +map <a-4> tab_open 4 +map <a-5> tab_open 5 +map <a-6> tab_open 6 +map <a-7> tab_open 7 +map <a-8> tab_open 8 +map <a-9> tab_open 9 + + +# External Programs +map E edit +map du shell -p du --max-depth=1 -h --apparent-size +map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh +map yp shell -f echo -n %%d/%%f | xsel -i; xsel -o | xsel -i -b +map yd shell -f echo -n %%d | xsel -i; xsel -o | xsel -i -b +map yn shell -f echo -n %%f | xsel -i; xsel -o | xsel -i -b + + +# Filesystem Operations +map = chmod +map cw console rename%space +map aa rename_append +map A eval fm.open_console('rename ' + fm.thisfile.relative_path) +map I eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7) +map pp paste +map po paste overwrite=True +map pP paste append=True +map pO paste overwrite=True append=True +map pl paste_symlink relative=False +map pL paste_symlink relative=True +map phl paste_hardlink +map pht paste_hardlinked_subtree + +map dD console delete + +map dd cut +map ud uncut +map da cut mode=add +map dr cut mode=remove + +map yy copy +map uy uncut +map ya copy mode=add +map yr copy mode=remove + + +# Temporary workarounds +map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) +map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) +map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) +map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) +map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) +map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) +map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) +map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) + + +# Searching +map / console search%space +map n search_next +map N search_next forward=False +map ct search_next order=tag +map cs search_next order=size +map ci search_next order=mimetype +map cc search_next order=ctime +map cm search_next order=mtime +map ca search_next order=atime + + +# Sorting +map or toggle_option sort_reverse +map oz set sort=random +map os chain set sort=size; set sort_reverse=False +map ob chain set sort=basename; set sort_reverse=False +map on chain set sort=natural; set sort_reverse=False +map om chain set sort=mtime; set sort_reverse=False +map oc chain set sort=ctime; set sort_reverse=False +map oa chain set sort=atime; set sort_reverse=False +map ot chain set sort=type; set sort_reverse=False +map oe chain set sort=extension; set sort_reverse=False + +map oS chain set sort=size; set sort_reverse=True +map oB chain set sort=basename; set sort_reverse=True +map oN chain set sort=natural; set sort_reverse=True +map oM chain set sort=mtime; set sort_reverse=True +map oC chain set sort=ctime; set sort_reverse=True +map oA chain set sort=atime; set sort_reverse=True +map oT chain set sort=type; set sort_reverse=True +map oE chain set sort=extension; set sort_reverse=True + +map dc get_cumulative_size + + +# Settings +map zc toggle_option collapse_preview +map zd toggle_option sort_directories_first +map zh toggle_option show_hidden +map <C-h> toggle_option show_hidden +map zi toggle_option flushinput +map zm toggle_option mouse_enabled +map zp toggle_option preview_files +map zP toggle_option preview_directories +map zs toggle_option sort_case_insensitive +map zu toggle_option autoupdate_cumulative_size +map zv toggle_option use_preview_script +map zf console filter%space + + +# Bookmarks +#map `<any> enter_bookmark %any +#map '<any> enter_bookmark %any +#map mm<any> set_bookmark %any +#map um<any> unset_bookmark %any + +#map m<bg> draw_bookmarks +#copymap m<bg> um<bg> `<bg> '<bg> + + +# Generate all the chmod bindings with some python help: +eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) + +eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) + + +###CONSOLE KEYS### +# Basic +cmap <tab> eval fm.ui.console.tab() +cmap <s-tab> eval fm.ui.console.tab(-1) +cmap <ESC> eval fm.ui.console.close() +cmap <CR> eval fm.ui.console.execute() +#cmap <C-l> redraw_window + +copycmap <ESC> <C-c> +copycmap <CR> <C-j> + + +# Move around +cmap <up> eval fm.ui.console.history_move(-1) +cmap <down> eval fm.ui.console.history_move(1) +cmap <left> eval fm.ui.console.move(left=1) +cmap <right> eval fm.ui.console.move(right=1) +cmap <home> eval fm.ui.console.move(right=0, absolute=True) +cmap <end> eval fm.ui.console.move(right=-1, absolute=True) + + +# Line Editing +cmap <backspace> eval fm.ui.console.delete(-1) +cmap <delete> eval fm.ui.console.delete(0) +cmap <C-w> eval fm.ui.console.delete_word() +cmap <A-d> eval fm.ui.console.delete_word(backward=False) +cmap <C-k> eval fm.ui.console.delete_rest(1) +cmap <C-u> eval fm.ui.console.delete_rest(-1) +cmap <C-y> eval fm.ui.console.paste() + +# And of course the emacs way +#copycmap <up> <C-p> +#copycmap <down> <C-n> +#copycmap <left> <C-b> +#copycmap <right> <C-f> +#copycmap <home> <C-a> +#copycmap <end> <C-e> +#copycmap <delete> <C-d> +#copycmap <backspace> <C-h> + + +# Note: There are multiple ways to express backspaces. <backspace> (code 263) +# and <backspace2> (code 127). To be sure, use both. +copycmap <backspace> <backspace2> + +# This special expression allows typing in numerals: +cmap <allow_quantifiers> false + + + +###PAGER KEYS### +# Movement +pmap <down> pager_move down=1 +pmap <up> pager_move up=1 +pmap <left> pager_move left=4 +pmap <right> pager_move right=4 +pmap <home> pager_move to=0 +pmap <end> pager_move to=-1 +pmap <pagedown> pager_move down=1.0 pages=True +pmap <pageup> pager_move up=1.0 pages=True +pmap <C-d> pager_move down=0.5 pages=True +pmap <C-u> pager_move up=0.5 pages=True + +copypmap <UP> k <C-p> +copypmap <DOWN> j <C-n> <CR> +copypmap <LEFT> h +copypmap <RIGHT> l +copypmap <HOME> g +copypmap <END> G +copypmap <C-d> d +copypmap <C-u> u +copypmap <PAGEDOWN> n f <C-F> <Space> +copypmap <PAGEUP> p b <C-B> + + +# Basic +#pmap <C-l> redraw_window +pmap <ESC> pager_close +copypmap <ESC> q Q i <F3> +pmap E edit_file + +# =================================================================== +# == Taskview Keybindings +# =================================================================== + +# Movement +tmap <up> taskview_move up=1 +tmap <down> taskview_move down=1 +tmap <home> taskview_move to=0 +tmap <end> taskview_move to=-1 +tmap <pagedown> taskview_move down=1.0 pages=True +tmap <pageup> taskview_move up=1.0 pages=True +tmap <C-d> taskview_move down=0.5 pages=True +tmap <C-u> taskview_move up=0.5 pages=True + +copytmap <UP> k <C-p> +copytmap <DOWN> j <C-n> <CR> +copytmap <HOME> g +copytmap <END> G +copytmap <C-u> u +copytmap <PAGEDOWN> n f <C-F> <Space> +copytmap <PAGEUP> p b <C-B> + +# Changing priority and deleting tasks +tmap J eval -q fm.ui.taskview.task_move(-1) +tmap K eval -q fm.ui.taskview.task_move(0) +tmap dd eval -q fm.ui.taskview.task_remove() +tmap <pagedown> eval -q fm.ui.taskview.task_move(-1) +tmap <pageup> eval -q fm.ui.taskview.task_move(0) +tmap <delete> eval -q fm.ui.taskview.task_remove() + +# Basic +#tmap <C-l> redraw_window +tmap <ESC> taskview_close +copytmap <ESC> q Q w <C-c> + + +map sp console shell bash speedvid.sh %f%space +map x shell chmod -x %s + +#General +map V console shell vim%space +map cW bulkrename %s +map mkd console mkdir%space +map sc console shell ln -sT%space +map D console delete +map X shell extract %f +map Z shell tar -cvzf %f.tar.gz %s +map <C-f> fzf_select +map <C-l> fzf_locate + +#Document Manipulation +map p1s shell lpr -o sides=one-sided %f +map p2s shell lpr -o sides=two-sided-long-edge %f +map MP shell pandoc %f -o %f.pdf +map MX shell xelatex %f +map ML shell latex %f +map TC shell texclear +map Txa console shell cp ~/Documents/LaTeX/article.tex%space +map Txs console shell cp ~/Documents/LaTeX/beamer.tex%space +map Txh console shell cp ~/Documents/LaTeX/handout.tex%space + +#Image commands +map bg shell setbg %f +map bw shell wal -i %f && cp %f ~/.config/wall.png +map C shell killall w3mimgdisplay && convert -rotate 90 %s %s +map F shell killall w3mimgdisplay && convert -flop %s %s +map bl shell killall w3mimgdisplay && convert %s -resize 1440x1080\> bl_%s +map TR shell convert %s -transparent white %s + +#Music (mpd) shortcuts +map MS shell mpd +map MK shell killall mpd +map Ma shell mpc add "%s" +map Ms shell mpc play +map Mp shell mpc toggle +map Mn shell mpc next +map Mb shell mpc prev +map MN shell mpc stop && mpc clear && mpc add "%s" +map Mo shell mpc seek 0% + +#Audio tagging (Requires eyeD3) +map Ta eval fm.open_console('shell eyeD3 -a ' + fm.thisfile.relative_path, position=15) +#Artist +map TA eval fm.open_console('shell eyeD3 -A ' + fm.thisfile.relative_path, position=15) +#Album +map Tb eval fm.open_console('shell eyeD3 -b ' + fm.thisfile.relative_path, position=15) +#Album artist +map Tt eval fm.open_console('shell eyeD3 -t "" ' + fm.thisfile.relative_path, position=16) +map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, position=16) + +#Downloading +map ytv console shell youtube-dl -ic%space +map yta console shell youtube-dl -xic%space +source ~/.config/ranger/shortcuts.conf diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf new file mode 100644 index 0000000..b2d5564 --- /dev/null +++ b/.config/ranger/rifle.conf @@ -0,0 +1,237 @@ +# vim: ft=cfg +# +# This is the configuration file of "rifle", ranger's file executor/opener. +# Each line consists of conditions and a command. For each line the conditions +# are checked and if they are met, the respective command is run. +# +# Syntax: +# <condition1> , <condition2> , ... = command +# +# The command can contain these environment variables: +# $1-$9 | The n-th selected file +# $@ | All selected files +# +# If you use the special command "ask", rifle will ask you what program to run. +# +# Prefixing a condition with "!" will negate its result. +# These conditions are currently supported: +# match <regexp> | The regexp matches $1 +# ext <regexp> | The regexp matches the extension of $1 +# mime <regexp> | The regexp matches the mime type of $1 +# name <regexp> | The regexp matches the basename of $1 +# path <regexp> | The regexp matches the absolute path of $1 +# has <program> | The program is installed (i.e. located in $PATH) +# env <variable> | The environment variable "variable" is non-empty +# file | $1 is a file +# directory | $1 is a directory +# number <n> | change the number of this command to n +# terminal | stdin, stderr and stdout are connected to a terminal +# X | $DISPLAY is not empty (i.e. Xorg runs) +# +# There are also pseudo-conditions which have a "side effect": +# flag <flags> | Change how the program is run. See below. +# label <label> | Assign a label or name to the command so it can +# | be started with :open_with <label> in ranger +# | or `rifle -p <label>` in the standalone executable. +# else | Always true. +# +# Flags are single characters which slightly transform the command: +# f | Fork the program, make it run in the background. +# | New command = setsid $command >& /dev/null & +# r | Execute the command with root permissions +# | New command = sudo $command +# t | Run the program in a new terminal. If $TERMCMD is not defined, +# | rifle will attempt to extract it from $TERM. +# | New command = $TERMCMD -e $command +# Note: The "New command" serves only as an illustration, the exact +# implementation may differ. +# Note: When using rifle in ranger, there is an additional flag "c" for +# only running the current file even if you have marked multiple files. + +#------------------------------------------- +# Websites +#------------------------------------------- +# Rarely installed browsers get higher priority; It is assumed that if you +# install a rare browser, you probably use it. Firefox/konqueror/w3m on the +# other hand are often only installed as fallback browsers. + +ext x?html?, has waterfox, X, flag f = waterfox -- "$@" +ext x?html?, has surf, X, flag f = surf -- file://"$1" +ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@" +ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@" +ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" +ext x?html?, has dwb, X, flag f = dwb -- "$@" +ext x?html?, has jumanji, X, flag f = jumanji -- "$@" +ext x?html?, has luakit, X, flag f = luakit -- "$@" +ext x?html?, has uzbl, X, flag f = uzbl -- "$@" +ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" +ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" +ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" +ext x?html?, has midori, X, flag f = midori -- "$@" +ext x?html?, has chromium, X, flag f = chromium -- "$@" +ext x?html?, has opera, X, flag f = opera -- "$@" +ext x?html?, has firefox, X, flag f = firefox -- "$@" +ext x?html?, has dillo, X, flag f = dillo -- "$@" +ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" +ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" +ext x?html?, has epiphany, X, flag f = epiphany -- "$@" +ext x?html?, has konqueror, X, flag f = konqueror -- "$@" +ext x?html?, has elinks, terminal = elinks "$@" +ext x?html?, has links2, terminal = links2 "$@" +ext x?html?, has links, terminal = links "$@" +ext x?html?, has lynx, terminal = lynx -- "$@" +ext x?html?, has w3m, terminal = w3m "$@" + + +#Spreadsheets for scim +ext sc|csv|sxc|xlsx?|xlt|xlw|gnm|gnumeric, = sc-im -- "$@" + +#------------------------------------------- +# Misc +#------------------------------------------- +# Define the "editor" for text files as first action +mime ^text, label editor = $EDITOR -- "$@" +mime ^text, label pager = "$PAGER" -- "$@" +!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" +!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" +label editor, ext json|csv = $EDITOR -- "$@" + +ext 1 = man "$1" +ext s[wmf]c, has zsnes, X = zsnes "$1" +ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1" +ext nes, has fceux, X = fceux "$1" +ext exe = wine "$1" +name ^[mM]akefile$ = make +ext asf, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" + +#-------------------------------------------- +# Code +#------------------------------------------- +ext py = python -- "$1" +ext pl = perl -- "$1" +ext rb = ruby -- "$1" +ext js = node -- "$1" +ext sh = sh -- "$1" +ext php = php -- "$1" + +#-------------------------------------------- +# Video/Audio with a GUI +#------------------------------------------- +mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" +mime ^video|audio, has smplayer, X, flag f = smplayer "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-video -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --fs -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --loop -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --title="obs" --autofit=1050x700 -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@" +# mime ^video|audio, has vlc, X, flag f = vlc -- "$@" +mime ^video|audio, has totem, X, flag f = totem -- "$@" +mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@" +#-------------------------------------------- +# Audio without X +#------------------------------------------- +mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" +mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-audio-display -- "$@" +mime ^audio|ogg$ = tag "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +ext midi?, terminal, has wildmidi = wildmidi -- "$@" + + +#-------------------------------------------- +# Video without X: +#------------------------------------------- +mime ^video, terminal, !X, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" +mime ^video, terminal, !X, has mplayer = mplayer -- "$@" + +#------------------------------------------- +# Documents +#------------------------------------------- +ext pdf, has llpp, X, flag f = llpp "$@" +ext pdf, has zathura, X, flag f = zathura -- "$@" +ext pdf, has mupdf, X, flag f = mupdf "$@" +ext pdf, has mupdf, X, flag f = mupdf -I "$@" +ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@" +ext pdf, has apvlv, X, flag f = apvlv -- "$@" +ext pdf, has xpdf, X, flag f = xpdf -- "$@" +ext pdf, has evince, X, flag f = evince -- "$@" +ext pdf, has atril, X, flag f = atril -- "$@" +ext pdf, has okular, X, flag f = okular -- "$@" +ext pdf, has epdfview, X, flag f = epdfview -- "$@" +ext pdf, has qpdfview, X, flag f = qpdfview "$@" + +ext epub, has zathura, X, flag f = zathura -- "$@" +ext epub, has mupdf, X, flag f = mupdf "$@" + +ext ps, has zathura, X, flag f = zathura -- "$@" + +ext docx, has abiword, X, flag f = abiword "$@" + +ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER" + +ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@" +ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@" + +ext djvu, has zathura,X, flag f = zathura -- "$@" +ext djvu, has evince, X, flag f = evince -- "$@" +ext djvu, has atril, X, flag f = atril -- "$@" + +#------------------------------------------- +# Image Viewing: +#------------------------------------------- +mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" +mime ^image/svg, has display, X, flag f = display -- "$@" +mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@" +mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@" + +ext xcf, X, flag f = gimp -- "$@" +mime ^image, has sxiv, X, flag f = sxiv -a -- "$@" +mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@" +mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@" +mime ^image, has mirage, X, flag f = mirage -- "$@" +mime ^image, has ristretto, X, flag f = ristretto "$@" +mime ^image, has eog, X, flag f = eog -- "$@" +mime ^image, has eom, X, flag f = eom -- "$@" +mime ^image, has gimp, X, flag f = gimp -- "$@" +mime ^image, has pinta, X, flag f = pinta -- "$@" +mime ^image, has mypaint, X, flag f = mypaint -- "$@" +mime ^image, has kolourpaint, X, flag f = kolourpaint -- "$@" + +#------------------------------------------- +# Archives +#------------------------------------------- +# This requires atool +ext jar = java -jar "$@" + +ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has als = als -- "$@" | "$PAGER" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -- "$@" | "$PAGER" +ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@" + +# Fallback: +ext tar|gz, has tar = tar vvtf "$@" | "$PAGER" +ext tar|gz, has tar = tar vvxf "$@" + +#------------------------------------------- +# Misc +#------------------------------------------- +label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1" +label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1" +label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" +label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" + +# Define the editor for non-text files + pager as last action + !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = ask +label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = $EDITOR -- "$@" +label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = "$PAGER" -- "$@" + +ext blend, has blender, X, flag f = blender -- "$@" +ext ms = $EDITOR -- "$@" diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh new file mode 100755 index 0000000..3fce18c --- /dev/null +++ b/.config/ranger/scope.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash +# ranger supports enhanced previews. If the option "use_preview_script" +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. + +# NOTES: This script is considered a configuration file. If you upgrade +# ranger, it will be left untouched. (You must update it yourself.) +# Also, ranger disables STDIN here, so interactive scripts won't work properly + +# Meanings of exit codes: +# code | meaning | action of ranger +# -----+------------+------------------------------------------- +# 0 | success | success. display stdout as preview +# 1 | no preview | failure. display no preview at all +# 2 | plain text | display the plain content of the file +# 3 | fix width | success. Don't reload when width changes +# 4 | fix height | success. Don't reload when height changes +# 5 | fix both | success. Don't ever reload +# 6 | image | success. display the image $cached points to as an image preview +# 7 | image | success. display the file directly as an image + +# Meaningful aliases for arguments: +path="$1" # Full path of the selected file +width="$2" # Width of the preview pane (number of fitting characters) +height="$3" # Height of the preview pane (number of fitting characters) +cached="$4" # Path that should be used to cache image previews +preview_images="$5" # "True" if image previews are enabled, "False" otherwise. + +maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln + +# Find out something about the file: +mimetype=$(file --mime-type -Lb "$path") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') + +# Functions: +# runs a command and saves its output into $output. Useful if you need +# the return value AND want to use the output in a pipe +try() { output=$(eval '"$@"'); } + +# writes the output of the previously used "try" command +dump() { /bin/echo "$output"; } + +# a common post-processing function used after most commands +trim() { head -n "$maxln"; } + +# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success +safepipe() { "$@"; test $? = 0 -o $? = 141; } + +# Image previews, if enabled in ranger. +if [ "$preview_images" = "True" ]; then + case "$mimetype" in + image/svg+xml) + convert "$path" "$cached" && exit 6 || exit 1;; + image/*) + exit 7;; + # Image preview for video, disabled by default.: + video/*) + ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; + esac +fi + +case "$extension" in + # Archive extensions: + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + try als "$path" && { dump | trim; exit 0; } + try acat "$path" && { dump | trim; exit 3; } + try bsdtar -lf "$path" && { dump | trim; exit 0; } + exit 1;; +# csv) # XXX - this case causes ranger to use 100% CPU and block +# sed "s/\(.*\".*\),\(.*\".*\)/\1~\2/;s/,/\t/g;s/~/,/g;s/\t\"/\t/g;s/\"\t/\t/g" "$path" && { dump| trim; exit 0; } || exit 1;; + rar) + # avoid password prompt by providing empty password + try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; + 7z) + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # PDF documents: + pdf) + try pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" && exit 6 || exit 1;; + #try pdftotext -l 10 -nopgbrk -q "$path" - && \ + #{ dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + # BitTorrent Files + torrent) + try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; + # ODT Files + odt|ods|odp|sxw) + try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; + # HTML Pages: + htm|html|xhtml) + try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + ;; # fall back to highlight/cat if the text browsers fail +esac + +case "$mimetype" in + # Syntax highlight for text files: + text/* | */json | */csv | */xml) + if [ "$(tput colors)" -ge 256 ]; then + pygmentize_format=terminal256 + highlight_format=ansi + else + pygmentize_format=terminal + highlight_format=ansi + fi + try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } + try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } + exit 2;; + # Ascii-previews of images: + image/*) + img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + exiftool "$path" && exit 5 + # Use sed to remove spaces so the output fits into the narrow window + try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; +esac + +exit 1 diff --git a/.config/ranger/shortcuts.conf b/.config/ranger/shortcuts.conf new file mode 100644 index 0000000..542528c --- /dev/null +++ b/.config/ranger/shortcuts.conf @@ -0,0 +1,47 @@ +map gh cd ~/ +map th tab_new ~/ +map mh shell mv -v %s ~/ +map Yh shell cp -rv %s ~/ +map gqc cd ~/crunch +map tqc tab_new ~/crunch +map mqc shell mv -v %s ~/crunch +map Yqc shell cp -rv %s ~/crunch +map gqt cd ~/crunch-thesis +map tqt tab_new ~/crunch-thesis +map mqt shell mv -v %s ~/crunch-thesis +map Yqt shell cp -rv %s ~/crunch-thesis +map gd cd ~/Documents +map td tab_new ~/Documents +map md shell mv -v %s ~/Documents +map Yd shell cp -rv %s ~/Documents +map gD cd ~/Downloads +map tD tab_new ~/Downloads +map mD shell mv -v %s ~/Downloads +map YD shell cp -rv %s ~/Downloads +map gm cd ~/Music +map tm tab_new ~/Music +map mm shell mv -v %s ~/Music +map Ym shell cp -rv %s ~/Music +map gpp cd ~/Pictures +map tpp tab_new ~/Pictures +map mpp shell mv -v %s ~/Pictures +map Ypp shell cp -rv %s ~/Pictures +map gvv cd ~/Videos +map tvv tab_new ~/Videos +map mvv shell mv -v %s ~/Videos +map Yvv shell cp -rv %s ~/Videos +map gcf cd ~/.config +map tcf tab_new ~/.config +map mcf shell mv -v %s ~/.config +map Ycf shell cp -rv %s ~/.config +map gsc cd ~/.local/bin +map tsc tab_new ~/.local/bin +map msc shell mv -v %s ~/.local/bin +map Ysc shell cp -rv %s ~/.local/bin +map gmn cd /mnt +map tmn tab_new /mnt +map mmn shell mv -v %s /mnt +map Ymn shell cp -rv %s /mnt +map bf shell $EDITOR ~/.config/bmfiles +map bd shell $EDITOR ~/.config/bmdirs +map cfa shell $EDITOR ~/.config/aliasrc diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..565a199 --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,157 @@ +# __ __ __ +# ______ __/ /_ / /______/ / +# / ___/ |/_/ __ \/ //_/ __ / +# (__ )> </ / / / ,< / /_/ / +# /____/_/|_/_/ /_/_/|_|\__,_/ +# sexy hotkey daemon runtime config. + +# Basic binds +super + Return + $TERMINAL +super + d + dmenu_run +super + r + $TERMINAL -e $FILE +#super + e +# $TERMINAL -e neomutt +super + m + $TERMINAL -e ncmpcpp +#super + n +# $TERMINAL -e newsboat +super + i + $TERMINAL -e htop +super + a + $TERMINAL -e pulsemixer +super + y + $TERMINAL -e calcurse +#super + shift + a +# $TERMINAL -e pulsemixer +#super + shift + c +# camtoggle +super + shift + c + $TERMINAL cht.sh --shell +#super + shift + e +# tutorialvids +super + shift + e + $TERMINAL -e neomutt +#super + w +# webby | xargs -r $BROWSER +super + shift + w + $BROWSER +super + shift + r + $TERMINAL -e newsboat +super + shift + t + $TERMINAL -e tremc +super + shift + g + gimp + +# Et cetera... +super + grave + dmenuunicode +super + Scroll_Lock + killall screenkey || screenkey +super + Insert + showclip +super + shift + x + prompt "Shutdown computer?" "sudo -A shutdown -h now" +super + shift + BackSpace + prompt "Reboot computer?" "sudo -A reboot" +super + x + mpc pause; pauseallmpv; i3lock -e -f -c 1d2021; xset dpms force off +XF86Launch1 + xset dpms force off + +# Recording +# Take screenshot +Print + maim pic-full-$(date '+%y%m%d-%H%M-%S').png +# Pick screenshot type +shift + Print + maimpick +# Record audio or video +#super + Print +# dmenurecord +# kill active recording +#super + Delete +# dmenurecord kill + +# Mute audio +super + shift + m + lmc mute +# Pause audio +super + {_,shift +} p + lmc {toggle,pause} +# Changes to next/previous tracks +super + {comma,period} + lmc {prev,next} +# Restart track +super + shift + less + lmc replay +# Increase volume +super + {equal,plus} + lmc up {5,15} +# Decrease volume +super {_,shift +} + minus + lmc down {5,15} +# Seek foward in song +super + {_,shift +} bracketright + lmc forward {10,120} +# Seek backward in song +super + {_,shift +} bracketleft + lmc back {10,120} +XF86AudioNext + lmc next +XF86AudioPlay + lmc toggle +XF86AudioPrev + lmc prev +XF86AudioStop + lmc toggle +XF86AudioRewind + lmc back 10 +XF86AudioForward + lmc forward 10 + +# Brightness +XF86MonBrightnessDown + light -U 15 +XF86MonBrightnessUp + light -A 15 + +# Function keys +# Show readme +super + F1 + groff -mom $HOME/.local/share/larbs/readme.mom -Tpdf | zathura - +# F2 is restart in i3 right now. +# Change display +super + F3 + displayselect +# Hibernate +super + F4 + prompt 'Hibernate computer?' 'sudo systemctl suspend' +# Restart/rescan wifi/eth networks +super + F5 + sudo -A systemctl restart NetworkManager +# Start torrent daemon/open interface +super + F6 + torwrap +# toggle torrent daemon +super + F7 + td-togggle +# sync email +super + F8 + mailsync +# Mount a USB drive or Android device +super + F9 + dmenumount +# Unmount a USB drive or Android device +super + F10 + dmenuumount +# Search with Duckduckgo +super + F11 + ducksearch +# Network Manager interface +super + F12 + $TERMINAL -e sudo -A nmtui + + diff --git a/.config/tmux/.tmux.conf b/.config/tmux/.tmux.conf new file mode 100644 index 0000000..2a6cda1 --- /dev/null +++ b/.config/tmux/.tmux.conf @@ -0,0 +1,56 @@ +set -g prefix C-a +setw -g mode-keys vi +setw -g mode-style bg=black +set-option -g default-terminal "xterm-256color" +set-option -g pane-active-border-style fg=green +set-window-option -g xterm-keys on # for vim +set-window-option -g mode-keys vi # vi key +set-window-option -g monitor-activity on +set-window-option -g window-status-current-style fg=white +setw -g window-status-current-style reverse +setw -g automatic-rename +set -g mouse on +set -g history-limit 30000 +set -g terminal-overrides 'xterm*:smcup@:rmcup@' +set-option -g status-justify right +set-option -g status-bg black # colour213 # pink +set-option -g status-fg cyan +set-option -g status-interval 5 +set-option -g status-left-length 30 +set-option -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]' +set-option -g status-right '#[fg=red,bold][[ #(git branch) branch ]] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]' +set-option -g visual-activity on +set-option -g set-titles on +set-option -g set-titles-string '#H:#S.#I.#P #W #T' +unbind j +unbind C-b # unbind default leader key +unbind '"' # unbind horizontal split +unbind % # unbind vertical split +bind-key r source-file ~/.tmux.conf +bind-key c split-window -v # split pane horizontally +bind-key v split-window -h # split pane vertically +bind-key Space list-panes +bind-key Enter break-pane +bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split +bind-key -n C-up prev +bind-key -n C-left prev +bind-key -n C-right next +bind-key -n C-down next +set-window-option -g window-status-current-style bg=red +bind C-j previous-window +bind C-k next-window +#bind-key C-a last-window # C-a C-a for last active window +bind A command-prompt "rename-window %%" +setw -g aggressive-resize on +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R +bind-key -r C-h resize-pane -L +bind-key -r C-j resize-pane -D +bind-key -r C-k resize-pane -U +bind-key -r C-l resize-pane -R +bind o select-layout "active-only" +bind M-- select-layout "even-vertical" +bind M-| select-layout "even-horizontal" +bind M-r rotate-window diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..9fa50ca --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1,12 @@ +set statusbar-h-padding 0 +set statusbar-v-padding 0 +set page-padding 1 +map u scroll half-up +map d scroll half-down +map D toggle_page_mode +map r reload +map R rotate +map K zoom in +map J zoom out +map i recolor +map p print diff --git a/.dmrc b/.dmrc new file mode 100644 index 0000000..22a9951 --- /dev/null +++ b/.dmrc @@ -0,0 +1,2 @@ +[Desktop] +Session=i3 diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..5a94055 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[color] + ui = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7f5085 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# Ignore All: +* + +# Whitelist: +!/.local/bin/ +!/.config/ +!.vim +!.bash_logout +!.bash_profile +!.bashrc +!.dmrc +!.gitconfig +!.inputrc +!.profile +!.tmux.conf +!.vimrc +!.Xdefaults +!.xinitrc +!.xonshrc +!.xprofile +!.Xresources +!.xsession +!.zprofile +!README.md +!LICENSE +!.gitignore +!.gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6881e42 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".local/bin"] + path = .local/bin + url = git@github.com:kpatel28/scripts.git diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..75c3c07 --- /dev/null +++ b/.inputrc @@ -0,0 +1,26 @@ +# _____ +# ________ ____ _____/ / (_)___ ___ +# / ___/ _ \/ __ `/ __ / / / __ \/ _ \ +# / / / __/ /_/ / /_/ / / / / / / __/ +# /_/ \___/\__,_/\__,_/_/_/_/ /_/\___/ +# readline runtime config file. + +$include /etc/inputrc +set editing-mode vi +$if mode=vi + +set show-mode-in-prompt on +set vi-ins-mode-string \1\e[6 q\2 +set vi-cmd-mode-string \1\e[2 q\2 + +set keymap vi-command +# these are for vi-command mode +Control-l: clear-screen +Control-a: beginning-of-line + +set keymap vi-insert +# these are for vi-insert mode +Control-l: clear-screen +Control-a: beginning-of-line + +$endif diff --git a/.local/bin b/.local/bin new file mode 160000 index 0000000..94ecb67 --- /dev/null +++ b/.local/bin @@ -0,0 +1 @@ +Subproject commit 94ecb67873fc3177a99b972edf932efa03d40374 diff --git a/.profile b/.profile new file mode 100644 index 0000000..55675de --- /dev/null +++ b/.profile @@ -0,0 +1,48 @@ +#!/bin/sh +# _____ __ +# ____ _________ / __(_) /__ +# / __ \/ ___/ __ \/ /_/ / / _ \ +# / /_/ / / / /_/ / __/ / / __/ +# / .___/_/ \____/_/ /_/_/\___/ +# /_/ +# Login shell profile config file. + +# Adds `~/.local/bin/` and all subdirectories to $PATH +BLACKLIST='/.git' # Add more items to blacklist with <item1>\|<item2>\|<item3>... +export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | grep -v "$BLACKLIST" | tr '\n' ':' | sed 's/:*$//')" +export EDITOR="nvim" +export TERMINAL="st" +export BROWSER="qutebrowser" +export READER="zathura" +export FILE="ranger" +export PAGER="less" +#export FILE="nnn -d" +export BIB="$HOME/Documents/LaTeX/uni.bib" +#export REFER="$HOME/.referbib" +export SUDO_ASKPASS="$HOME/.local/bin/tools/dmenupass" +#export PIX="$HOME/.pix/" + +# nnn file manager +export NNN_CONTEXT_COLORS='6464' +export NNN_USE_EDITOR=1 + +# less/man colors +export LESS=-R +export LESS_TERMCAP_mb="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_md="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_me="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_so="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_se="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_us="$(printf '%b' '')"; a="${a%_}" +export LESS_TERMCAP_ue="$(printf '%b' '')"; a="${a%_}" + +[ ! -f ~/.config/shortcutrc ] && shortcuts >/dev/null 2>&1 + +echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "$HOME/.bashrc" + +# Start graphical server if i3 not already running. +[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && exec startx + +# Switch escape and caps if tty: +sudo -n loadkeys ~/.local/bin/ttymaps.kmap 2>/dev/null + diff --git a/.tmux.conf b/.tmux.conf new file mode 120000 index 0000000..e920bb1 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1 @@ +.config/tmux/.tmux.conf \ No newline at end of file diff --git a/.vim b/.vim new file mode 120000 index 0000000..63c7159 --- /dev/null +++ b/.vim @@ -0,0 +1 @@ +.config/nvim/ \ No newline at end of file diff --git a/.vimrc b/.vimrc new file mode 120000 index 0000000..25b6a3b --- /dev/null +++ b/.vimrc @@ -0,0 +1 @@ +.config/nvim/init.vim \ No newline at end of file diff --git a/.xinitrc b/.xinitrc new file mode 100755 index 0000000..db6ef63 --- /dev/null +++ b/.xinitrc @@ -0,0 +1,21 @@ +#!/bin/sh +# _ _ __ +# _ __(_)___ (_) /_ +# | |/_/ / __ \/ / __/ +# _> </ / / / / / /_ +# /_/|_/_/_/ /_/_/\__/ +# Xorg runtime config file. + +displayset & # Set the display/background +sxhkd & # Bind keys +# Switch to US international with Caps as Mod/Escape +setxkbmap -option caps:super -variant altgr-intl && killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' & +# Properties button extra Mod/Escape +xmodmap -e 'keycode 135 = Super_R' & +xset r rate 300 50 & # Speed xrate up +unclutter & # Remove mouse when idle +compton --config "$HOME/.config/compton/compton.conf" & # compton for transparency and to reduce tearing +dunst & # dunst for notifications +mpdupdate & + +exec i3 diff --git a/.xonshrc b/.xonshrc new file mode 100644 index 0000000..ccf5742 --- /dev/null +++ b/.xonshrc @@ -0,0 +1,17 @@ +#!/bin/xonsh +# __ +# _ ______ ____ _____/ /_ +# | |/_/ __ \/ __ \/ ___/ __ \ +# _> </ /_/ / / / (__ ) / / / +# /_/|_|\____/_/ /_/____/_/ /_/ +# xonsh shell runtime config file. + +# XONSH WIZARD START +$AUTO_CD = '1' +$SHELL_TYPE = 'best' +$VI_MODE = '1' +$XONSH_AUTOPAIR = '1' +source-bash --overwrite-alias --login True "echo loading xonsh foreign shell" +xontrib load bashisms mpl +# XONSH WIZARD END + diff --git a/.xprofile b/.xprofile new file mode 120000 index 0000000..aa7da3a --- /dev/null +++ b/.xprofile @@ -0,0 +1 @@ +.profile \ No newline at end of file diff --git a/.xsession b/.xsession new file mode 120000 index 0000000..03280df --- /dev/null +++ b/.xsession @@ -0,0 +1 @@ +.xinitrc \ No newline at end of file diff --git a/.zprofile b/.zprofile new file mode 120000 index 0000000..aa7da3a --- /dev/null +++ b/.zprofile @@ -0,0 +1 @@ +.profile \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d7e795 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Kevin's Arch Rice (KAR) +My hard-hitting arch linux / i3-gaps / polybar rice. +Clone it and watch this bad boy go. + +## Dependies: + +* The latest version of [my scripts](https://github.com/kpatel28/scripts) as a git submodule dependency (built-in). +* API Keys from [Coinmarketcap](https://coinmarketcap.com/api) and [World Air Quality Index](http://aqicn.org/data-platform/token/#/) ([Instructions](https://github.com/kpatel28/scripts/blob/master/polybar/README.md)). +* The programs these dotfiles rice. + +## Big thanks to: + +* [Luke Smith](https://github.com/LukeSmithxyz) +* [WillMe](https://github.com/WillemMe) +