├── ranger ├── plugins │ ├── __init__.py │ └── __pycache__ │ │ ├── __init__.cpython-38.opt-1.pyc │ │ └── devicons_linemode.cpython-38.opt-1.pyc ├── __pycache__ │ └── devicons.cpython-38.opt-1.pyc ├── commands.py ├── scope.sh ├── rifle.conf └── rc.conf ├── nvim ├── plugins │ ├── rainbow.vim │ ├── lightline.vim │ ├── signify.vim │ ├── lang-config.vim │ ├── fzf.vim │ ├── markdown-preview.vim │ ├── coc.vim │ └── whichkey.vim ├── init.vim ├── vim │ ├── settings.vim │ ├── keybindings.vim │ ├── plugins.vim │ └── general.vim └── coc-settings.json ├── .gitignore ├── bsp-layout └── layoutrc ├── i3 ├── i3pwd.sh ├── polybar.sh └── config ├── scripts ├── camtoggle ├── mkscript ├── i3listen.py ├── start-agent ├── nerdfonts └── maven-clean ├── .gitmodules ├── polybar ├── launch.sh ├── config.ini └── modules.ini ├── .gitconfig ├── .clojure └── deps.edn ├── zsh ├── alias.sh ├── command-not-found.plugin.zsh └── ssh-agent.plugin.zsh ├── .profile ├── bspwm └── bspwmrc ├── .tmux.conf ├── deps.edn ├── .zshrc ├── sxhkd └── sxhkdrc ├── rofi └── embark.rasi ├── picom.conf └── alacritty └── alacritty.yml /ranger/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nvim/plugins/rainbow.vim: -------------------------------------------------------------------------------- 1 | let g:rainbow_active = 1 2 | 3 | -------------------------------------------------------------------------------- /nvim/plugins/lightline.vim: -------------------------------------------------------------------------------- 1 | let g:lightline = { 2 | \ 'colorscheme': 'embark' 3 | \} 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nvim/autoload/plugged/* 2 | nvim/.lsp/ 3 | nvim/.netrwhist 4 | .clj-kondo/ 5 | .cpcache/ 6 | .lsp/ 7 | -------------------------------------------------------------------------------- /bsp-layout/layoutrc: -------------------------------------------------------------------------------- 1 | # Tall layout config 2 | TALL_RATIO=0.6; 3 | 4 | # Wide layout config 5 | WIDE_RATIO=0.6; 6 | 7 | -------------------------------------------------------------------------------- /i3/i3pwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export WHEREAMI=$(cat /tmp/whereami) 3 | i3-sensible-terminal --working-directory="$WHEREAMI" 4 | -------------------------------------------------------------------------------- /scripts/camtoggle: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null /dev/video0 3 | -------------------------------------------------------------------------------- /ranger/__pycache__/devicons.cpython-38.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kelvin-mai/dotfiles/HEAD/ranger/__pycache__/devicons.cpython-38.opt-1.pyc -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | if exists('g:vscode') 2 | source $HOME/.config/nvim/vscode/settings.vim 3 | else 4 | source $HOME/.config/nvim/vim/settings.vim 5 | endif 6 | 7 | -------------------------------------------------------------------------------- /ranger/plugins/__pycache__/__init__.cpython-38.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kelvin-mai/dotfiles/HEAD/ranger/plugins/__pycache__/__init__.cpython-38.opt-1.pyc -------------------------------------------------------------------------------- /ranger/plugins/__pycache__/devicons_linemode.cpython-38.opt-1.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kelvin-mai/dotfiles/HEAD/ranger/plugins/__pycache__/devicons_linemode.cpython-38.opt-1.pyc -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ubuntu-font"] 2 | path = ubuntu-font 3 | url = https://github.com/mariomc/ubuntu-font 4 | [submodule "ranger/plugins/ranger_devicons"] 5 | path = ranger/plugins/ranger_devicons 6 | url = https://github.com/alexanderjeurissen/ranger_devicons 7 | -------------------------------------------------------------------------------- /scripts/mkscript: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_FILE="$HOME/scripts/$1" 4 | 5 | if [[ -f $SCRIPT_FILE ]]; then 6 | echo 'file already exists' 7 | else 8 | echo '#!/bin/bash' > $SCRIPT_FILE 9 | chmod +x $SCRIPT_FILE 10 | nvim $SCRIPT_FILE 11 | fi 12 | 13 | 14 | -------------------------------------------------------------------------------- /i3/polybar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | 6 | # Wait until the processes have been shut down 7 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 8 | 9 | # Launch 10 | polybar right & 11 | polybar left 12 | -------------------------------------------------------------------------------- /scripts/i3listen.py: -------------------------------------------------------------------------------- 1 | #!/bin/bash/env python3 2 | from i3ipc import Connection 3 | from subprocess import call 4 | 5 | i3 = Connection() 6 | 7 | def windownotify(i3, event): 8 | if event.container.fullscreen_mode == 0: 9 | call('polybar-msg cmd show'.split(' ')) 10 | else: 11 | call('polybar-msg cmd hide'.split(' ')) 12 | 13 | i3.on('window', windownotify) 14 | 15 | i3.main() 16 | -------------------------------------------------------------------------------- /polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Add this script to your wm startup file. 4 | 5 | DIR="$HOME/.config/polybar" 6 | 7 | # Terminate already running bar instances 8 | killall -q polybar 9 | 10 | # Wait until the processes have been shut down 11 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 12 | 13 | # Launch the bar 14 | polybar -q primary -c "$DIR"/config.ini & 15 | polybar -q secondary -c "$DIR"/config.ini & 16 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Kelvin Mai 3 | email = kelvin.mai002@gmail.com 4 | [credential] 5 | helper = store 6 | [pager] 7 | branch = false 8 | [core] 9 | editor = nvim 10 | [diff] 11 | tool = nvimdiff 12 | [merge] 13 | tool = nvimdiff 14 | [difftool "nvimdiff"] 15 | cmd = "nvim -d -u ~/.config/nvim/init.vim \"$LOCAL\" \"$REMOTE\"" 16 | [difftool] 17 | prompt = false 18 | [pull] 19 | rebase = false 20 | [init] 21 | defaultBranch = main 22 | -------------------------------------------------------------------------------- /.clojure/deps.edn: -------------------------------------------------------------------------------- 1 | {:aliases 2 | {:test {:extra-paths ["test"] 3 | :extra-deps {org.clojure/test.check {:mvn/version "RELEASE"}}} 4 | :outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}} 5 | :main-opts ["-m" "antq.core"]} 6 | :nrepl {:extra-paths ["dev"] 7 | :extra-deps {nrepl/nrepl {:mvn/version "RELEASE"} 8 | cider/cider-nrepl {:mvn/version "RELEASE"}} 9 | :main-opts ["-m" "nrepl.cmdline" 10 | "--middleware" "[cider.nrepl/cider-middleware]" 11 | "--interactive"]}}} 12 | -------------------------------------------------------------------------------- /nvim/vim/settings.vim: -------------------------------------------------------------------------------- 1 | " Plugins 2 | source $HOME/.config/nvim/vim/plugins.vim 3 | 4 | " User settings 5 | source $HOME/.config/nvim/vim/general.vim 6 | source $HOME/.config/nvim/vim/keybindings.vim 7 | 8 | " Plugin configurations 9 | source $HOME/.config/nvim/plugins/coc.vim 10 | source $HOME/.config/nvim/plugins/lightline.vim 11 | source $HOME/.config/nvim/plugins/rainbow.vim 12 | source $HOME/.config/nvim/plugins/fzf.vim 13 | source $HOME/.config/nvim/plugins/whichkey.vim 14 | source $HOME/.config/nvim/plugins/signify.vim 15 | source $HOME/.config/nvim/plugins/markdown-preview.vim 16 | source $HOME/.config/nvim/plugins/lang-config.vim 17 | 18 | -------------------------------------------------------------------------------- /nvim/vim/keybindings.vim: -------------------------------------------------------------------------------- 1 | " Redo 2 | nnoremap U 3 | 4 | " Visual block tabbing 5 | vnoremap < >gv 7 | 8 | " Quit 9 | nnoremap q :q 10 | 11 | " Tab navigation 12 | nnoremap :tabn 13 | nnoremap :tabp 14 | nnoremap :tabn 15 | 16 | " Window navigation 17 | nnoremap h 18 | nnoremap j 19 | nnoremap k 20 | nnoremap l 21 | 22 | " Window navigation OSX 23 | nnoremap ˙ h 24 | nnoremap ∆ j 25 | nnoremap ˚ k 26 | nnoremap ¬ l 27 | 28 | " Tab completion 29 | inoremap pumvisible() ? "\" : "\" 30 | 31 | " Conventional save file 32 | nnoremap :w 33 | -------------------------------------------------------------------------------- /zsh/alias.sh: -------------------------------------------------------------------------------- 1 | # utilities 2 | alias src='source $HOME/.zshrc' 3 | alias .zsh='vim $HOME/.zshrc' 4 | 5 | # Store current directory 6 | precmd() { eval "pwd > /tmp/whereami" } 7 | 8 | # enhancements 9 | alias ls='lsd -hA --group-dirs first' 10 | alias ll='lsd -lhA --group-dirs first' 11 | alias l='lsd -lhA --group-dirs first' 12 | alias vim='nvim' 13 | alias lg='lazygit' 14 | alias grep='grep --color=auto' 15 | alias ranger='source ranger' 16 | 17 | bindkey '^[[A' history-substring-search-up 18 | bindkey '^[[B' history-substring-search-down 19 | 20 | # shortcuts 21 | alias cdp='cd $HOME/Development/projects' 22 | alias cdt='cd $HOME/Development/tutorials' 23 | alias cdw='cd $HOME/Development/luminare' 24 | -------------------------------------------------------------------------------- /scripts/start-agent: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SSH_ENV="$HOME/.ssh/agent-environment" 4 | 5 | function start_agent { 6 | # echo "Initializing new SSH agent" 7 | /usr/bin/ssh-agent | sed 's/^echo/#echo' > "${SSH_ENV}" 8 | # echo succeeded 9 | chmod 600 "${SSH_ENV}" 10 | . "${SSH_ENV}" > /dev/null 11 | for possiblekey in $HOME/.ssh/id_*; do 12 | if grep -q PRIVATE "$possiblekey"; then 13 | # echo "Adding $possiblekey" 14 | # chmod 600 $possiblekey 15 | ssh-add "$possiblekey" 16 | fi 17 | done 18 | } 19 | 20 | if [ -f "${SSH_ENV}" ]; then 21 | . "${SSH_ENV}" > /dev/null 22 | ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null || { 23 | start_agent; 24 | } 25 | else 26 | start_agent; 27 | fi 28 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | # set PATH so it includes user's private bin if it exists 2 | if [ -d "$HOME/bin" ] ; then 3 | PATH="$HOME/bin:$PATH" 4 | fi 5 | 6 | # set PATH so it includes user's private bin if it exists 7 | if [ -d "$HOME/.local/bin" ] ; then 8 | PATH="$HOME/.local/bin:$PATH" 9 | fi 10 | 11 | ## Laptop settings 12 | # add natural scrolling to touchpad 13 | xinput set-prop 13 325 1 14 | 15 | # turn off disabled while typing 16 | # causes unresponsive touchpad bug when enabled 17 | xinput set-prop 13 342 0 18 | 19 | # fix disabled cursor UI 20 | xsetroot -cursor_name left_ptr 21 | 22 | # rebind caps lock as escape 23 | setxkbmap -option caps:escape 24 | 25 | # disable screen blanking 26 | xset s off -dpms 27 | 28 | export TERMINAL=/usr/bin/alacritty 29 | export BROWSER=/usr/bin/firefox 30 | export EDITOR=/usr/bin/nvim 31 | -------------------------------------------------------------------------------- /scripts/nerdfonts: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | declare -a fonts=( 4 | BitstreamVeraSansMono 5 | CodeNewRoman 6 | DroidSansMono 7 | FiraCode 8 | FiraMono 9 | Go-Mono 10 | Hack 11 | Hermit 12 | JetBrainsMono 13 | Meslo 14 | Noto 15 | Overpass 16 | ProggyClean 17 | RobotoMono 18 | SourceCodePro 19 | SpaceMono 20 | Ubuntu 21 | UbuntuMono 22 | ) 23 | 24 | version='2.1.0' 25 | fonts_dir="${HOME}/.local/share/fonts" 26 | 27 | if [[ ! -d "$fonts_dir" ]]; then 28 | mkdir -p "$fonts_dir" 29 | fi 30 | 31 | for font in "${fonts[@]}"; do 32 | zip_file="${font}.zip" 33 | download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}" 34 | echo "Downloading $download_url" 35 | wget "$download_url" 36 | unzip "$zip_file" -d "$fonts_dir" 37 | rm "$zip_file" 38 | done 39 | 40 | find "$fonts_dir" -name '*Windows Compatible*' -delete 41 | 42 | fc-cache -fv 43 | -------------------------------------------------------------------------------- /bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ## bootstrap 4 | echo "$HOME" > /tmp/whereami 5 | # nm-applet & 6 | nitrogen --restore & 7 | 8 | .config/polybar/launch.sh & 9 | picom --experimental-backends & 10 | lxpolkit & 11 | thunderbird & 12 | 13 | xsetroot -cursor_name left_ptr 14 | xset -dpms 15 | xset s off 16 | 17 | pgrep -x sxhkd > /dev/null || sxhkd -m -1 & 18 | 19 | bspc monitor HDMI-0 -d 1 2 3 4 5 20 | bspc monitor DP-3 -d 6 7 8 9 10 21 | 22 | bspc config border_width 2 23 | bspc config window_gap 12 24 | bspc config focused_border_color '#91DDFF' 25 | 26 | bspc config split_ratio 0.52 27 | bspc config borderless_monocle true 28 | bspc config gapless_monocle true 29 | 30 | bspc rule -a Gimp desktop='^8' state=floating follow=on 31 | # bspc rule -a Chromium desktop='^2' 32 | bspc rule -a Thunderbird desktop='^5' 33 | bspc rule -a mplayer2 state=floating 34 | bspc rule -a Kupfer.py focus=on 35 | bspc rule -a Screenkey manage=off 36 | 37 | -------------------------------------------------------------------------------- /nvim/plugins/signify.vim: -------------------------------------------------------------------------------- 1 | " Change these if you want 2 | " let g:signify_sign_add = '+' 3 | " let g:signify_sign_delete = '_' 4 | " let g:signify_sign_delete_first_line = '‾' 5 | " let g:signify_sign_change = '~' 6 | 7 | " I find the numbers disctracting 8 | let g:signify_sign_show_count = 0 9 | let g:signify_sign_show_text = 1 10 | 11 | " Jump though hunks 12 | " nmap gj (signify-next-hunk) 13 | " nmap gk (signify-prev-hunk) 14 | " nmap gJ 9999gJ 15 | " nmap gK 9999gk 16 | 17 | 18 | " If you like colors instead 19 | " highlight SignifySignAdd ctermbg=green guibg=#00ff00 20 | " highlight SignifySignDelete ctermfg=black ctermbg=red guifg=#ffffff guibg=#ff0000 21 | " highlight SignifySignChange ctermfg=black ctermbg=yellow guifg=#000000 guibg=#ffff00 22 | highlight SignifySignAdd guifg=#A1EFD3 23 | highlight SignifySignDelete guifg=#F48FB1 24 | highlight SignifySignChange guifg=#ffe6b3 25 | -------------------------------------------------------------------------------- /nvim/plugins/lang-config.vim: -------------------------------------------------------------------------------- 1 | " Language specific config 2 | 3 | " ClojureScript 4 | autocmd FileType clojure nnoremap cj :ConjureShadowSelect 5 | autocmd FileType clojure nnoremap cp :ConjureConnect 6 | " vertically align maps and vectors 7 | autocmd FileType clojure nnoremap a[ vi[$:EasyAlign\ g/^\S/gv= 8 | autocmd FileType clojure nnoremap a{ vi{$:EasyAlign\ g/^\S/gv= 9 | " disable auto pairs on ' and ` 10 | autocmd Filetype clojure let b:AutoPairs={'(':')', '[':']', '{':'}','"':'"'} 11 | " conjure configs 12 | let g:conjure_config = { 13 | \'mappings.doc-word': '', 14 | \'mappings.def-word': '' 15 | \} 16 | 17 | " Golang 18 | autocmd FileType go nmap b :call build_go_files() 19 | autocmd FileType go nmap r (go-run) 20 | autocmd FileType go nmap t (go-test) 21 | " auto imports on save 22 | autocmd BufWritePre *.go :silent call CocAction('runCommand', 'editor.action.organizeImport') 23 | 24 | " Markdown 25 | autocmd FileType markdown nnoremap p :MarkdownPreviewToggle 26 | 27 | " JSX 28 | " vim-jsx-pretty uses these filetypes for jsx files 29 | autocmd bufnewfile,bufread *.jsx set filetype=javascript.jsx 30 | autocmd bufnewfile,bufread *.tsx set filetype=typescript.tsx 31 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # Make it possible to send ESC as well as Meta for Evil 2 | set -g escape-time 0 3 | 4 | # ctrl-space for modifier 5 | unbind C-b 6 | set -g prefix C-Space 7 | bind C-Space send-prefix 8 | bind Escape copy-mode 9 | 10 | # have tmux remember more lines 11 | set -g history-limit 10000 12 | 13 | # See http://mutelight.org/articles/practical-tmux 14 | 15 | bind-key C-b last-window 16 | 17 | # Start windows and panes at 1, not 0 18 | set -g base-index 1 19 | setw -g pane-base-index 1 20 | 21 | # prefix hint 22 | set -g status-right ' #{?client_prefix,#[reverse]#[noreverse] ,}| %a %Y-%m-%d %H:%M' 23 | 24 | # Rather than constraining window size to the maximum size of any client 25 | # connected to the *session*, constrain window size to the maximum size of any 26 | # client connected to *that window*. Much more reasonable. 27 | setw -g aggressive-resize on 28 | set -g default-terminal "screen-256color" 29 | 30 | set -g default-terminal "xterm-256color" 31 | set-option -ga terminal-overrides ",xterm-256color:Tc" 32 | 33 | # Allows for faster key repetition 34 | #set-window-option -s escape-time 0 35 | 36 | # Highlight active window 37 | set -g status-style bg=colour235,fg=colour253 38 | set -g window-status-current-style bg=colour111,fg=colour235 39 | 40 | # fix scrolling 41 | set -g mouse on 42 | bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" 43 | bind -n WheelDownPane select-pane -t= \; send-keys -M 44 | 45 | -------------------------------------------------------------------------------- /ranger/commands.py: -------------------------------------------------------------------------------- 1 | from ranger.api.commands import Command 2 | 3 | 4 | class paste_as_root(Command): 5 | def execute(self): 6 | if self.fm.do_cut: 7 | self.fm.execute_console('shell sudo mv %c .') 8 | else: 9 | self.fm.execute_console('shell sudo cp -r %c .') 10 | 11 | 12 | class fzf_select(Command): 13 | """ 14 | :fzf_select 15 | 16 | Find a file using fzf. 17 | 18 | With a prefix argument select only directories. 19 | 20 | See: https://github.com/junegunn/fzf 21 | """ 22 | 23 | def execute(self): 24 | import subprocess 25 | import os.path 26 | if self.quantifier: 27 | # match only directories 28 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 29 | -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to file'" 30 | else: 31 | # match files and directories 32 | command = "find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ 33 | -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to filemap fzf_select'" 34 | fzf = self.fm.execute_command( 35 | command, universal_newlines=True, stdout=subprocess.PIPE) 36 | stdout, stderr = fzf.communicate() 37 | if fzf.returncode == 0: 38 | fzf_file = os.path.abspath(stdout.rstrip('\n')) 39 | if os.path.isdir(fzf_file): 40 | self.fm.cd(fzf_file) 41 | else: 42 | self.fm.select_file(fzf_file) 43 | 44 | -------------------------------------------------------------------------------- /nvim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "coc.preferences.formatOnSaveFiletypes": [ 3 | "css", 4 | "markdown", 5 | "graphql", 6 | "html", 7 | "yaml", 8 | "json", 9 | "python", 10 | "javascript", 11 | "typescript", 12 | "javascriptreact", 13 | "typescriptreact", 14 | "reason", 15 | "clojure", 16 | "go" 17 | ], 18 | "coc.preferences.extensionUpdateCheck": "daily", 19 | // explorer 20 | "explorer": { 21 | "file.showHiddenFiles": true, 22 | "icon.enableNerdfont": true, 23 | "previewAction.onHover": false, 24 | "keyMappings.global": { 25 | "D": "deleteForever", 26 | "v": "open:vsplit", 27 | "t": "open:tab" 28 | } 29 | }, 30 | // custom language servers 31 | "languageserver": { 32 | // clojure 33 | "clojure-lsp": { 34 | "command": "bash", 35 | "args": ["-c", "clojure-lsp"], 36 | "filetypes": ["clojure"], 37 | "rootPatterns": ["project.clj", "deps.edn"], 38 | "additionalSchemes": ["jar", "zipfile"], 39 | "trace.server": "verbose", 40 | "initializationOptions": { 41 | "ignore-classpath-directories": true 42 | } 43 | }, 44 | // terraform 45 | "terraform": { 46 | "command": "terraform-lsp", 47 | "filetypes": ["terraform", "tf"], 48 | "initializationOptions": {}, 49 | "settings": {} 50 | } 51 | }, 52 | // golang 53 | "go.goplsOptions": { 54 | "gofumpt": true 55 | }, 56 | // python config 57 | "python.linting.enabled": true, 58 | "python.linting.pylintEnabled": true, 59 | // javascript and typescript config 60 | "tsserver.enable": true, 61 | "tsserver.enableJavascript": true, 62 | // set postgresql as default sql 63 | "sql.database": "postgresql" 64 | } 65 | -------------------------------------------------------------------------------- /scripts/maven-clean: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | from os.path import isdir 4 | from os import listdir 5 | import re 6 | import shutil 7 | 8 | dry_run = False # change to True to get a log of what will be removed 9 | m2_path = '/home/kelvin/.m2/repository/' # here comes your repo path 10 | version_regex = '^\d[.\d]*$' 11 | 12 | 13 | def check_and_clean(path): 14 | files = listdir(path) 15 | for file in files: 16 | if not isdir('/'.join([path, file])): 17 | return 18 | last = check_if_versions(files) 19 | if last is None: 20 | for file in files: 21 | check_and_clean('/'.join([path, file])) 22 | elif len(files) == 1: 23 | return 24 | else: 25 | print('update ' + path.split(m2_path)[1]) 26 | for file in files: 27 | if file == last: 28 | continue 29 | print(file + ' (newer version: ' + last + ')') 30 | if not dry_run: 31 | shutil.rmtree('/'.join([path, file])) 32 | 33 | 34 | def check_if_versions(files): 35 | if len(files) == 0: 36 | return None 37 | last = '' 38 | for file in files: 39 | if re.match(version_regex, file): 40 | if last == '': 41 | last = file 42 | if len(last.split('.')) == len(file.split('.')): 43 | for (current, new) in zip(last.split('.'), file.split('.')): 44 | if int(new) > int(current): 45 | last = file 46 | break 47 | elif int(new) < int(current): 48 | break 49 | else: 50 | return None 51 | else: 52 | return None 53 | return last 54 | 55 | 56 | check_and_clean(m2_path) 57 | -------------------------------------------------------------------------------- /zsh/command-not-found.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Uses the command-not-found package zsh support 2 | # as seen in https://www.porcheron.info/command-not-found-for-zsh/ 3 | # this is installed in Ubuntu 4 | 5 | if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then 6 | function command_not_found_handler { 7 | # check because c-n-f could've been removed in the meantime 8 | if [ -x /usr/lib/command-not-found ]; then 9 | /usr/lib/command-not-found -- "$1" 10 | return $? 11 | elif [ -x /usr/share/command-not-found/command-not-found ]; then 12 | /usr/share/command-not-found/command-not-found -- "$1" 13 | return $? 14 | else 15 | printf "zsh: command not found: %s\n" "$1" >&2 16 | return 127 17 | fi 18 | return 0 19 | } 20 | fi 21 | 22 | # Arch Linux command-not-found support, you must have package pkgfile installed 23 | # https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook 24 | [[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh 25 | 26 | # Fedora command-not-found support 27 | if [ -f /usr/libexec/pk-command-not-found ]; then 28 | command_not_found_handler() { 29 | runcnf=1 30 | retval=127 31 | [ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0 32 | [ ! -x /usr/libexec/packagekitd ] && runcnf=0 33 | if [ $runcnf -eq 1 ]; then 34 | /usr/libexec/pk-command-not-found $@ 35 | retval=$? 36 | fi 37 | return $retval 38 | } 39 | fi 40 | 41 | # OSX command-not-found support 42 | # https://github.com/Homebrew/homebrew-command-not-found 43 | if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then 44 | source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' 45 | fi 46 | 47 | # NixOS command-not-found support 48 | if [ -x /run/current-system/sw/bin/command-not-found ]; then 49 | command_not_found_handler() { 50 | /run/current-system/sw/bin/command-not-found $@ 51 | } 52 | fi 53 | 54 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | ;; The deps.edn file describes the information needed to build a classpath. 2 | ;; 3 | ;; When using the `clojure` or `clj` script, there are several deps.edn files 4 | ;; that are combined: 5 | ;; - install-level 6 | ;; - user level (this file) 7 | ;; - project level (current directory when invoked) 8 | ;; 9 | ;; For all attributes other than :paths, these config files are merged left to right. 10 | ;; Only the last :paths is kept and others are dropped. 11 | 12 | { 13 | ;; Paths 14 | ;; Directories in the current project to include in the classpath 15 | 16 | ;; :paths ["src"] 17 | 18 | ;; External dependencies 19 | 20 | ;; :deps { 21 | ;; org.clojure/clojure {:mvn/version "1.10.1"} 22 | ;; } 23 | 24 | ;; Aliases 25 | ;; resolve-deps aliases (-R) affect dependency resolution, options: 26 | ;; :extra-deps - specifies extra deps to add to :deps 27 | ;; :override-deps - specifies a coordinate to use instead of that in :deps 28 | ;; :default-deps - specifies a coordinate to use for a lib if one isn't found 29 | ;; make-classpath aliases (-C) affect the classpath generation, options: 30 | ;; :extra-paths - vector of additional paths to add to the classpath 31 | ;; :classpath-overrides - map of lib to path that overrides the result of resolving deps 32 | 33 | :aliases { 34 | ;; - see https://github.com/liquidz/antq 35 | :outdated {:extra-deps {antq/antq {:mvn/version "RELEASE"}} 36 | :main-opts ["-m" "antq.core"]} 37 | 38 | ;; - nrepl used with conjure 39 | :nrepl {:extra-deps {nrepl/nrepl {:mvn/version "RELEASE"} 40 | cider/cider-nrepl {:mvn/version "RELEASE"}} 41 | :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]" "--interactive"]} 42 | ;; :deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.9.840"}}} 43 | ;; :test {:extra-paths ["test"]} 44 | } 45 | 46 | ;; Provider attributes 47 | 48 | ;; :mvn/repos { 49 | ;; "central" {:url "https://repo1.maven.org/maven2/"} 50 | ;; "clojars" {:url "https://repo.clojars.org/"} 51 | ;; } 52 | } 53 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # If not running interactively, don't do anything 2 | [[ $- != *i* ]] && return 3 | 4 | # Enable colors and change prompt: 5 | autoload -U colors && colors 6 | 7 | setopt histignorealldups sharehistory 8 | 9 | # History in cache directory: 10 | HISTSIZE=1000 11 | SAVEHIST=1000 12 | HISTFILE=~/.cache/zsh_history 13 | 14 | # ZSH Plugins 15 | export ZSHDIR=$HOME/.config/zsh 16 | source $ZSHDIR/ssh-agent.plugin.zsh 2>/dev/null 17 | source $ZSHDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh 2>/dev/null 18 | source $ZSHDIR/zsh-you-should-use/you-should-use.plugin.zsh 2>/dev/null 19 | source $ZSHDIR/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh 2>/dev/null 20 | source $ZSHDIR/command-not-found.plugin.zsh 2>/dev/null 21 | source $ZSHDIR/dracula/lib/async.zsh 2>/dev/null 22 | source $ZSHDIR/dracula/dracula.zsh-theme 2>/dev/null 23 | 24 | # Use modern completion system 25 | autoload -Uz compinit 26 | compinit 27 | 28 | zstyle ':completion:*' auto-description 'specify: %d' 29 | zstyle ':completion:*' completer _expand _complete _correct _approximate 30 | zstyle ':completion:*' format 'Completing %d' 31 | zstyle ':completion:*' group-name '' 32 | zstyle ':completion:*' menu select=2 33 | eval "$(dircolors -b)" 34 | zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 35 | zstyle ':completion:*' list-colors '' 36 | zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s 37 | zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' 38 | zstyle ':completion:*' menu select=long 39 | zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s 40 | zstyle ':completion:*' use-compctl false 41 | zstyle ':completion:*' verbose true 42 | 43 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' 44 | zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' 45 | 46 | zmodload zsh/complist 47 | compinit 48 | _comp_options+=(globdots) # Include hidden files. 49 | 50 | bindkey '^[OA' history-substring-search-up 51 | bindkey '^[OB' history-substring-search-down 52 | 53 | # Aliases 54 | source $ZSHDIR/alias.sh 2>/dev/null 55 | 56 | # PATHS 57 | # JAVA 58 | export JAVA_HOME=/opt/jdk-17+35 59 | export PATH=$PATH:$JAVA_HOME/bin 60 | 61 | # JavaScript 62 | export PATH=$PATH:$HOME/.npm-global/bin 63 | -------------------------------------------------------------------------------- /nvim/vim/plugins.vim: -------------------------------------------------------------------------------- 1 | call plug#begin('~/.config/nvim/autoload/plugged') 2 | 3 | " Syntax colorschemes 4 | Plug 'romgrk/doom-one.vim' " emacs doom theme 5 | Plug 'joshdick/onedark.vim' " atom one dark theme 6 | Plug 'haishanh/night-owl.vim' " night-owl theme 7 | Plug 'bluz71/vim-nightfly-guicolors' " nightfly theme 8 | Plug 'embark-theme/vim', { 'as': 'embark' } 9 | " Syntax highlighting 10 | Plug 'sheerun/vim-polyglot' " better default syntax 11 | Plug 'pangloss/vim-javascript' " javascript 12 | Plug 'leafgarland/typescript-vim' " typescript 13 | Plug 'maxmellon/vim-jsx-pretty' " jsx / tsx 14 | Plug 'jparise/vim-graphql' " graphql 15 | Plug 'Olical/conjure', {'tag': 'v3.3.0'} " clojure REPL integration 16 | Plug 'reasonml-editor/vim-reason-plus' " reasonml 17 | " Editor features 18 | Plug 'jiangmiao/auto-pairs' " automatic paren/quote completion 19 | Plug 'luochen1990/rainbow' " rainbow parens 20 | Plug 'tpope/vim-surround' " add command to create surrounding parens 21 | Plug 'tpope/vim-commentary' " comments 22 | Plug 'mhinz/vim-signify' " git gutter 23 | Plug 'tpope/vim-fugitive' " git integration 24 | Plug 'junegunn/vim-easy-align' " easy align 25 | Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } " markdown previewer 26 | " Fuzzy finder 27 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 28 | Plug 'junegunn/fzf.vim' 29 | Plug 'airblade/vim-rooter' 30 | " Intellisense 31 | Plug 'neoclide/coc.nvim', {'branch': 'release' } 32 | " Emacs which keys 33 | Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } 34 | " Status Line 35 | Plug 'itchyny/lightline.vim' 36 | Plug 'ryanoasis/vim-devicons' 37 | call plug#end() 38 | 39 | " Automatically install missing plugins on startup 40 | autocmd VimEnter * 41 | \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) 42 | \| PlugInstall --sync | q 43 | \| endif 44 | -------------------------------------------------------------------------------- /nvim/plugins/fzf.vim: -------------------------------------------------------------------------------- 1 | " This is the default extra key bindings 2 | let g:fzf_action = { 3 | \ 'ctrl-t': 'tab split', 4 | \ 'ctrl-x': 'split', 5 | \ 'ctrl-v': 'vsplit' } 6 | 7 | " Enable per-command history. 8 | " CTRL-N and CTRL-P will be automatically bound to next-history and 9 | " previous-history instead of down and up. If you don't like the change, 10 | " explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS. 11 | let g:fzf_history_dir = '~/.local/share/fzf-history' 12 | 13 | let g:fzf_tags_command = 'ctags -R' 14 | " Border color 15 | let g:fzf_layout = {'window': { 'width': 0.99, 'height': 0.4, 'xoffset': 1, 'yoffset': 1, 'border': 'horizontal' } } 16 | 17 | let $FZF_DEFAULT_OPTS = '--layout=reverse --info=inline' 18 | let $FZF_DEFAULT_COMMAND="rg --files --hidden" 19 | 20 | 21 | " Customize fzf colors to match your color scheme 22 | let g:fzf_colors = 23 | \ { 'fg': ['fg', 'Normal'], 24 | \ 'bg': ['bg', 'Normal'], 25 | \ 'hl': ['fg', 'Comment'], 26 | \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], 27 | \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], 28 | \ 'hl+': ['fg', 'Statement'], 29 | \ 'info': ['fg', 'PreProc'], 30 | \ 'border': ['fg', 'Ignore'], 31 | \ 'prompt': ['fg', 'Conditional'], 32 | \ 'pointer': ['fg', 'Exception'], 33 | \ 'marker': ['fg', 'Keyword'], 34 | \ 'spinner': ['fg', 'Label'], 35 | \ 'header': ['fg', 'Comment'] } 36 | 37 | "Get Files 38 | command! -bang -nargs=? -complete=dir Files 39 | \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) 40 | 41 | 42 | " Get text in files with Rg 43 | command! -bang -nargs=* Rg 44 | \ call fzf#vim#grep( 45 | \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, 46 | \ fzf#vim#with_preview(), 0) 47 | 48 | " Ripgrep advanced 49 | function! RipgrepFzf(query, fullscreen) 50 | let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' 51 | let initial_command = printf(command_fmt, shellescape(a:query)) 52 | let reload_command = printf(command_fmt, '{q}') 53 | let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} 54 | call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) 55 | endfunction 56 | 57 | command! -nargs=* -bang RG call RipgrepFzf(, 0) 58 | 59 | " Git grep 60 | command! -bang -nargs=* GGrep 61 | \ call fzf#vim#grep( 62 | \ 'git grep --line-number '.shellescape(), 0, 63 | \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) 64 | -------------------------------------------------------------------------------- /nvim/vim/general.vim: -------------------------------------------------------------------------------- 1 | " set leader key 2 | let g:mapleader = "\" 3 | " set vim true colors 4 | let $NVIM_TUI_ENABLE_TRUE_COLOR=1 5 | 6 | let g:embark_terminal_italics=1 7 | let g:gh_color="soft" 8 | let g:github_colors_soft=1 9 | 10 | syntax enable " Enables syntax highlighing 11 | set termguicolors " Enable vim colors 12 | colorscheme embark " Set colorscheme to nightfly 13 | filetype plugin indent on " Enable file type detection and do language-dependent indenting 14 | set hidden " Required to keep multiple buffers open multiple buffers 15 | set nowrap " Display long lines as just one line 16 | set encoding=utf-8 " The encoding displayed 17 | set pumheight=10 " Makes popup menu smaller 18 | set fileencoding=utf-8 " The encoding written to file 19 | set ruler " Show the cursor position all the time 20 | set cmdheight=1 " More space for displaying messages 21 | set iskeyword+=- " treat dash separated words as a word text object" 22 | set mouse=a " Enable your mouse 23 | set splitbelow " Horizontal splits will automatically be below 24 | set splitright " Vertical splits will automatically be to the right 25 | set t_Co=256 " Support 256 colors 26 | set conceallevel=0 " So that I can see `` in markdown files 27 | set tabstop=2 " Insert 2 spaces for a tab 28 | set shiftwidth=2 " Change the number of space characters inserted for indentation 29 | set smarttab " Makes tabbing smarter will realize you have 2 vs 4 30 | set expandtab " Converts tabs to spaces 31 | set smartindent " Makes indenting smart 32 | set autoindent " Good auto indent 33 | set laststatus=2 " Always display the status line 34 | set noshowmode " We don't need to see things like -- INSERT -- anymore 35 | set relativenumber " Line numbers 36 | set cursorline " Enable highlighting of the current line 37 | set background=dark " tell vim what the background color looks like 38 | set showtabline=2 " Always show tabs 39 | set nobackup " This is recommended by coc 40 | set nowritebackup " This is recommended by coc 41 | set updatetime=300 " Faster completion 42 | set timeoutlen=1000 " By default timeoutlen is 1000 ms 43 | set formatoptions-=cro " Stop newline continution of comments 44 | set clipboard=unnamedplus " Copy paste between vim and everything else 45 | "set autochdir " Your working directory will always be the same as your working directory 46 | 47 | au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC 48 | 49 | " You can't stop me 50 | cmap w!! w !sudo tee % 51 | 52 | " Don't load netrw 53 | let loaded_netrwPlugin = 1 54 | -------------------------------------------------------------------------------- /nvim/plugins/markdown-preview.vim: -------------------------------------------------------------------------------- 1 | " set to 1, nvim will open the preview window after entering the markdown buffer 2 | " default: 0 3 | let g:mkdp_auto_start = 0 4 | 5 | " set to 1, the nvim will auto close current preview window when change 6 | " from markdown buffer to another buffer 7 | " default: 1 8 | let g:mkdp_auto_close = 1 9 | 10 | " set to 1, the vim will refresh markdown when save the buffer or 11 | " leave from insert mode, default 0 is auto refresh markdown as you edit or 12 | " move the cursor 13 | " default: 0 14 | let g:mkdp_refresh_slow = 0 15 | 16 | " set to 1, the MarkdownPreview command can be use for all files, 17 | " by default it can be use in markdown file 18 | " default: 0 19 | let g:mkdp_command_for_global = 0 20 | 21 | " set to 1, preview server available to others in your network 22 | " by default, the server listens on localhost (127.0.0.1) 23 | " default: 0 24 | let g:mkdp_open_to_the_world = 0 25 | 26 | " use custom IP to open preview page 27 | " useful when you work in remote vim and preview on local browser 28 | " more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9 29 | " default empty 30 | let g:mkdp_open_ip = '' 31 | 32 | " specify browser to open preview page 33 | " default: '' 34 | let g:mkdp_browser = '' 35 | 36 | " set to 1, echo preview page url in command line when open preview page 37 | " default is 0 38 | let g:mkdp_echo_preview_url = 0 39 | 40 | " a custom vim function name to open preview page 41 | " this function will receive url as param 42 | " default is empty 43 | let g:mkdp_browserfunc = '' 44 | 45 | " options for markdown render 46 | " mkit: markdown-it options for render 47 | " katex: katex options for math 48 | " uml: markdown-it-plantuml options 49 | " maid: mermaid options 50 | " disable_sync_scroll: if disable sync scroll, default 0 51 | " sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle' 52 | " middle: mean the cursor position alway show at the middle of the preview page 53 | " top: mean the vim top viewport alway show at the top of the preview page 54 | " relative: mean the cursor position alway show at the relative positon of the preview page 55 | " hide_yaml_meta: if hide yaml metadata, default is 1 56 | " sequence_diagrams: js-sequence-diagrams options 57 | " content_editable: if enable content editable for preview page, default: v:false 58 | " disable_filename: if disable filename header for preview page, default: 0 59 | let g:mkdp_preview_options = { 60 | \ 'mkit': {}, 61 | \ 'katex': {}, 62 | \ 'uml': {}, 63 | \ 'maid': {}, 64 | \ 'disable_sync_scroll': 0, 65 | \ 'sync_scroll_type': 'middle', 66 | \ 'hide_yaml_meta': 1, 67 | \ 'sequence_diagrams': {}, 68 | \ 'flowchart_diagrams': {}, 69 | \ 'content_editable': v:false, 70 | \ 'disable_filename': 0 71 | \ } 72 | 73 | " use a custom markdown style must be absolute path 74 | " like '/Users/username/markdown.css' or expand('~/markdown.css') 75 | let g:mkdp_markdown_css = '' 76 | 77 | " use a custom highlight style must absolute path 78 | " like '/Users/username/highlight.css' or expand('~/highlight.css') 79 | let g:mkdp_highlight_css = '' 80 | 81 | " use a custom port to start server or random for empty 82 | let g:mkdp_port = '' 83 | 84 | " preview page title 85 | " ${name} will be replace with the file name 86 | let g:mkdp_page_title = '「${name}」' 87 | 88 | " recognized filetypes 89 | " these filetypes will have MarkdownPreview... commands 90 | let g:mkdp_filetypes = ['markdown'] 91 | -------------------------------------------------------------------------------- /zsh/ssh-agent.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Get the filename to store/lookup the environment from 2 | ssh_env_cache="$HOME/.ssh/environment-$SHORT_HOST" 3 | 4 | function _start_agent() { 5 | # Check if ssh-agent is already running 6 | if [[ -f "$ssh_env_cache" ]]; then 7 | . "$ssh_env_cache" > /dev/null 8 | 9 | { 10 | [[ "$USERNAME" = root ]] && command ps ax || command ps x 11 | } | command grep ssh-agent | command grep -q $SSH_AGENT_PID && return 0 12 | fi 13 | 14 | # Set a maximum lifetime for identities added to ssh-agent 15 | local lifetime 16 | zstyle -s :omz:plugins:ssh-agent lifetime lifetime 17 | 18 | # start ssh-agent and setup environment 19 | echo Starting ssh-agent... 20 | ssh-agent -s ${lifetime:+-t} ${lifetime} | sed '/^echo/d' >! "$ssh_env_cache" 21 | chmod 600 "$ssh_env_cache" 22 | . "$ssh_env_cache" > /dev/null 23 | } 24 | 25 | function _add_identities() { 26 | local id file line sig lines 27 | local -a identities loaded_sigs loaded_ids not_loaded 28 | zstyle -a :omz:plugins:ssh-agent identities identities 29 | 30 | # check for .ssh folder presence 31 | if [[ ! -d "$HOME/.ssh" ]]; then 32 | return 33 | fi 34 | 35 | # add default keys if no identities were set up via zstyle 36 | # this is to mimic the call to ssh-add with no identities 37 | if [[ ${#identities} -eq 0 ]]; then 38 | # key list found on `ssh-add` man page's DESCRIPTION section 39 | for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do 40 | # check if file exists 41 | [[ -f "$HOME/.ssh/$id" ]] && identities+=($id) 42 | done 43 | fi 44 | 45 | # get list of loaded identities' signatures and filenames 46 | if lines=$(ssh-add -l); then 47 | for line in ${(f)lines}; do 48 | loaded_sigs+=${${(z)line}[2]} 49 | loaded_ids+=${${(z)line}[3]} 50 | done 51 | fi 52 | 53 | # add identities if not already loaded 54 | for id in $identities; do 55 | # if id is an absolute path, make file equal to id 56 | [[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id" 57 | # check for filename match, otherwise try for signature match 58 | if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then 59 | sig="$(ssh-keygen -lf "$file" | awk '{print $2}')" 60 | [[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file") 61 | fi 62 | done 63 | 64 | # abort if no identities need to be loaded 65 | if [[ ${#not_loaded} -eq 0 ]]; then 66 | return 67 | fi 68 | 69 | # pass extra arguments to ssh-add 70 | local args 71 | zstyle -a :omz:plugins:ssh-agent ssh-add-args args 72 | 73 | # use user specified helper to ask for password (ksshaskpass, etc) 74 | local helper 75 | zstyle -s :omz:plugins:ssh-agent helper helper 76 | 77 | if [[ -n "$helper" ]]; then 78 | if [[ -z "${commands[$helper]}" ]]; then 79 | echo "ssh-agent: the helper '$helper' has not been found." 80 | else 81 | SSH_ASKPASS="$helper" ssh-add "${args[@]}" ${^not_loaded} < /dev/null 82 | return $? 83 | fi 84 | fi 85 | 86 | ssh-add "${args[@]}" ${^not_loaded} 87 | } 88 | 89 | # test if agent-forwarding is enabled 90 | zstyle -b :omz:plugins:ssh-agent agent-forwarding agent_forwarding 91 | 92 | # Add a nifty symlink for screen/tmux if agent forwarding 93 | if [[ $agent_forwarding = "yes" && -n "$SSH_AUTH_SOCK" && ! -L "$SSH_AUTH_SOCK" ]]; then 94 | ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen 95 | else 96 | _start_agent 97 | fi 98 | 99 | # Don't add identities if lazy-loading is enabled 100 | if ! zstyle -t :omz:plugins:ssh-agent lazy; then 101 | _add_identities 102 | fi 103 | 104 | unset agent_forwarding ssh_env_cache 105 | unfunction _start_agent _add_identities 106 | -------------------------------------------------------------------------------- /sxhkd/sxhkdrc: -------------------------------------------------------------------------------- 1 | # 2 | # application hotkeys 3 | # 4 | 5 | # terminal emulator 6 | super + Return 7 | $TERMINAL --working-directory $(cat /tmp/whereami) 8 | 9 | # browser 10 | super + shift + Return 11 | $BROWSER 12 | 13 | # program launcher 14 | super + d 15 | rofi -modi drun -show drun -theme embark 16 | 17 | # make sxhkd reload its configuration files: 18 | super + Escape 19 | pkill -USR1 -x sxhkd 20 | 21 | # 22 | # bspwm hotkeys 23 | # 24 | 25 | # restart bspwm 26 | super + shift + r 27 | bspc wm -r 28 | 29 | # quit bspwm / logout 30 | super + grave 31 | bspc quit 32 | 33 | # close and kill 34 | super + {_,shift + }q 35 | bspc node -{c,k} 36 | 37 | # alternate between the tiled and monocle layout 38 | # super + m 39 | # bspc desktop -l next 40 | 41 | # cycle bsp-layouts 42 | # requires bsp-layout, get using below command 43 | # curl https://raw.githubusercontent.com/phenax/bsp-layout/master/install.sh | bash -; 44 | super + m 45 | bsp-layout cycle --layouts tiled,tall,wide 46 | 47 | # send the newest marked node to the newest preselected node 48 | super + y 49 | bspc node newest.marked.local -n newest.!automatic.local 50 | 51 | # swap the current node and the biggest window 52 | super + g 53 | bspc node -s biggest.window 54 | 55 | # 56 | # state/flags 57 | # 58 | 59 | # set the window state 60 | super + {t,shift + t,s,f} 61 | bspc node -t {tiled,pseudo_tiled,floating,fullscreen} 62 | 63 | # set the node flags 64 | super + ctrl + {m,x,y,z} 65 | bspc node -g {marked,locked,sticky,private} 66 | 67 | # 68 | # focus/swap 69 | # 70 | 71 | # focus the node in the given direction 72 | super + {_,shift + }{h,j,k,l} 73 | bspc node -{f,s} {west,south,north,east} 74 | 75 | # with arrow keys too 76 | super + {_,shift + }{Left,Down,Up,Right} 77 | bspc node -{f,s} {west,south,north,east} 78 | 79 | # focus the node for the given path jump 80 | super + {p,b,comma,period} 81 | bspc node -f @{parent,brother,first,second} 82 | 83 | # focus the next/previous window in the current desktop 84 | super + {_,shift + }c 85 | bspc node -f {next,prev}.local.!hidden.window 86 | 87 | # focus the next/previous desktop in the current monitor 88 | super + bracket{left,right} 89 | bspc desktop -f {prev,next}.local 90 | 91 | # focus the last node/desktop 92 | super + {Tab,shift + Tab} 93 | bspc {node,desktop} -f last 94 | 95 | # focus the older or newer node in the focus history 96 | super + {o,i} 97 | bspc wm -h off; \ 98 | bspc node {older,newer} -f; \ 99 | bspc wm -h on 100 | 101 | # focus workspace 102 | super + {1-9,0} 103 | bspc desktop -f '^{1-9,10}' 104 | 105 | # move window to workspace and focus workspace 106 | super + shift + {1-9,0} 107 | id=$(bspc query -N -n); bspc node -d '^{1-9,10}'; bspc node -f ${id} 108 | 109 | # 110 | # preselect 111 | # 112 | 113 | # preselect the direction 114 | # super + ctrl + {h,j,k,l} 115 | # bspc node -p {west,south,north,east} 116 | 117 | # preselect the ratio 118 | # super + ctrl + {1-9} 119 | # bspc node -o 0.{1-9} 120 | 121 | # cancel the preselection for the focused node 122 | # super + ctrl + space 123 | # bspc node -p cancel 124 | 125 | # cancel the preselection for the focused desktop 126 | # super + ctrl + shift + space 127 | # bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel 128 | 129 | # 130 | # move/resize 131 | # 132 | 133 | # expand a window by moving one of its side outward 134 | super + alt + {h,j,k,l} 135 | bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} 136 | 137 | super + alt + {Left,Down,Up,Right} 138 | bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} 139 | 140 | # contract a window by moving one of its side inward 141 | super + alt + shift + {h,j,k,l} 142 | bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} 143 | 144 | super + alt + shift + {Left,Down,Up,Right} 145 | bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} 146 | 147 | # move a floating window 148 | # super + {Left,Down,Up,Right} 149 | # bspc node -v {-20 0,0 20,0 -20,20 0} 150 | -------------------------------------------------------------------------------- /rofi/embark.rasi: -------------------------------------------------------------------------------- 1 | /* RASI Theme */ 2 | 3 | 4 | * { 5 | background: #1e1c31; 6 | bordercolor: #585273; 7 | separatorcolor: #1e1c31; 8 | normal-background: #1e1c31; 9 | normal-foreground: #cbe3e7; 10 | alternate-normal-foreground: #1e1c31; 11 | selected-normal-background: #3e3859; 12 | selected-normal-foreground: #cbe3e7; 13 | active-background: #1e1c31; 14 | active-foreground: #65b2ff; 15 | alternate-active-background: #1e1c31; 16 | selected-active-background: #65b2ff; 17 | selected-active-foreground: #100e23; 18 | urgent-background: #1e1c31; 19 | urgent-foreground: #f02e6e; 20 | alternate-urgent-background: #1e1c31; 21 | selected-urgent-background: #f02e6e; 22 | selected-urgent-foreground: #100e23; 23 | alternate-normal-foreground: @normal-foreground; 24 | alternate-urgent-foreground: @urgent-foreground; 25 | alternate-active-foreground: @active-foreground; 26 | foreground: @normal-foreground; 27 | } 28 | 29 | * { 30 | spacing: 2; 31 | border-color: @foreground; 32 | background-color: transparent; 33 | } 34 | #window { 35 | border: 1; 36 | padding: 5; 37 | background-color: @background; 38 | } 39 | #mainbox { 40 | border: 0; 41 | padding: 0; 42 | } 43 | #message { 44 | border: 1px dash 0px 0px ; 45 | padding: 2px 0px 0px ; 46 | border-color: @separatorcolor; 47 | } 48 | #textbox { 49 | text-color: @foreground; 50 | } 51 | #listview { 52 | border-color: @separatorcolor; 53 | } 54 | #listview { 55 | fixed-height: 0; 56 | border: 2px dash 0px 0px ; 57 | padding: 2px 0px 0px ; 58 | } 59 | #element { 60 | border: 0; 61 | } 62 | #element normal.normal { 63 | text-color: @normal-foreground; 64 | background-color: @normal-background; 65 | } 66 | #element normal.urgent { 67 | text-color: @urgent-foreground; 68 | background-color: @urgent-background; 69 | } 70 | #element normal.active { 71 | text-color: @active-foreground; 72 | background-color: @active-background; 73 | } 74 | #element selected.normal { 75 | text-color: @selected-normal-foreground; 76 | background-color: @selected-normal-background; 77 | } 78 | #element selected.urgent { 79 | text-color: @selected-urgent-foreground; 80 | background-color: @selected-urgent-background; 81 | } 82 | #element selected.active { 83 | text-color: @selected-active-foreground; 84 | background-color: @selected-active-background; 85 | } 86 | #element alternate.normal { 87 | text-color: @alternate-normal-foreground; 88 | background-color: @alternate-normal-background; 89 | } 90 | #element alternate.urgent { 91 | text-color: @alternate-urgent-foreground; 92 | background-color: @alternate-urgent-background; 93 | } 94 | #element alternate.active { 95 | text-color: @alternate-active-foreground; 96 | background-color: @alternate-active-background; 97 | } 98 | #scrollbar { 99 | border: 0; 100 | width: 4px; 101 | padding: 0; 102 | handle-color: @normal-foreground; 103 | } 104 | #sidebar { 105 | border: 2px dash 0px 0px ; 106 | border-color: @separatorcolor; 107 | } 108 | #button selected { 109 | background-color: @selected-normal-background; 110 | text-color: @selected-normal-foreground; 111 | } 112 | #inputbar { 113 | spacing: 0; 114 | text-color: @normal-foreground; 115 | background-color: inherit; 116 | padding: 1px ; 117 | children: [prompt, textbox-prompt-colon, entry, case-indicator]; 118 | } 119 | #case-indicator { 120 | spacing: 0; 121 | text-color: @normal-background; 122 | } 123 | #entry { 124 | spacing: 0; 125 | text-color: @normal-foreground; 126 | } 127 | #prompt { 128 | spacing: 0; 129 | text-color: @normal-foreground; 130 | } 131 | #textbox-prompt-colon { 132 | expand: false; 133 | str: ":"; 134 | margin: 0px 0.3em 0em 0em; 135 | text-color: @normal-foreground; 136 | } 137 | -------------------------------------------------------------------------------- /nvim/plugins/coc.vim: -------------------------------------------------------------------------------- 1 | " TextEdit might fail if hidden is not set. 2 | set hidden 3 | 4 | " Some servers have issues with backup files, see #649. 5 | set nobackup 6 | set nowritebackup 7 | 8 | " Give more space for displaying messages. 9 | set cmdheight=1 10 | 11 | " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable 12 | " delays and poor user experience. 13 | set updatetime=300 14 | 15 | " Don't pass messages to |ins-completion-menu|. 16 | set shortmess+=c 17 | 18 | " Always show the signcolumn, otherwise it would shift the text each time 19 | " diagnostics appear/become resolved. 20 | set signcolumn=yes 21 | 22 | " Use tab for trigger completion with characters ahead and navigate. 23 | " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by 24 | " other plugin before putting this into your config. 25 | inoremap 26 | \ pumvisible() ? "\" : 27 | \ check_back_space() ? "\" : 28 | \ coc#refresh() 29 | inoremap pumvisible() ? "\" : "\" 30 | 31 | function! s:check_back_space() abort 32 | let col = col('.') - 1 33 | return !col || getline('.')[col - 1] =~# '\s' 34 | endfunction 35 | 36 | " Use to trigger completion. 37 | inoremap coc#refresh() 38 | 39 | " Use to confirm completion, `u` means break undo chain at current 40 | " position. Coc only does snippet and additional edit on confirm. 41 | " could be remapped by other vim plugin, try `:verbose imap `. 42 | if exists('*complete_info') 43 | inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" 44 | else 45 | inoremap pumvisible() ? "\" : "\u\" 46 | endif 47 | 48 | " Use `[g` and `]g` to navigate diagnostics 49 | nmap [g (coc-diagnostic-prev) 50 | nmap ]g (coc-diagnostic-next) 51 | 52 | " GoTo code navigation. 53 | nmap gd (coc-definition) 54 | nmap gy (coc-type-definition) 55 | nmap gi (coc-implementation) 56 | nmap gr (coc-references) 57 | 58 | " Use K to show documentation in preview window. 59 | nnoremap K :call show_documentation() 60 | 61 | function! s:show_documentation() 62 | if (index(['vim','help'], &filetype) >= 0) 63 | execute 'h '.expand('') 64 | else 65 | call CocAction('doHover') 66 | endif 67 | endfunction 68 | 69 | " Highlight the symbol and its references when holding the cursor. 70 | autocmd CursorHold * silent call CocActionAsync('highlight') 71 | 72 | augroup mygroup 73 | autocmd! 74 | " Setup formatexpr specified filetype(s). 75 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') 76 | " Update signature help on jump placeholder. 77 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') 78 | augroup end 79 | 80 | " Map function and class text objects 81 | " NOTE: Requires 'textDocument.documentSymbol' support from the language server. 82 | xmap if (coc-funcobj-i) 83 | omap if (coc-funcobj-i) 84 | xmap af (coc-funcobj-a) 85 | omap af (coc-funcobj-a) 86 | xmap ic (coc-classobj-i) 87 | omap ic (coc-classobj-i) 88 | xmap ac (coc-classobj-a) 89 | omap ac (coc-classobj-a) 90 | 91 | " Use CTRL-S for selections ranges. 92 | " Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver 93 | " nmap (coc-range-select) 94 | " xmap (coc-range-select) 95 | 96 | " Add `:Format` command to format current buffer. 97 | command! -nargs=0 Format :call CocAction('format') 98 | 99 | " Add `:Fold` command to fold current buffer. 100 | command! -nargs=? Fold :call CocAction('fold', ) 101 | 102 | " Add `:OR` command for organize imports of the current buffer. 103 | command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') 104 | 105 | " Add (Neo)Vim's native statusline support. 106 | " NOTE: Please see `:h coc-status` for integrations with external plugins that 107 | " provide custom statusline: lightline.vim, vim-airline. 108 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} 109 | 110 | " Add coc extensions here 111 | let g:coc_global_extensions = [ 112 | \ 'coc-css', 113 | \ 'coc-emmet', 114 | \ 'coc-explorer', 115 | \ 'coc-db', 116 | \ 'coc-go', 117 | \ 'coc-html', 118 | \ 'coc-html-css-support', 119 | \ 'coc-json', 120 | \ 'coc-omnisharp', 121 | \ 'coc-prettier', 122 | \ 'coc-python', 123 | \ 'coc-tailwindcss', 124 | \ 'coc-tsserver', 125 | \ 'coc-vimlsp' 126 | \] 127 | -------------------------------------------------------------------------------- /ranger/scope.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # ranger supports enhanced previews. If the option "use_preview_script" 3 | # is set to True and this file exists, this script will be called and its 4 | # output is displayed in ranger. ANSI color codes are supported. 5 | 6 | # NOTES: This script is considered a configuration file. If you upgrade 7 | # ranger, it will be left untouched. (You must update it yourself.) 8 | # Also, ranger disables STDIN here, so interactive scripts won't work properly 9 | 10 | # Meanings of exit codes: 11 | # code | meaning | action of ranger 12 | # -----+------------+------------------------------------------- 13 | # 0 | success | success. display stdout as preview 14 | # 1 | no preview | failure. display no preview at all 15 | # 2 | plain text | display the plain content of the file 16 | # 3 | fix width | success. Don't reload when width changes 17 | # 4 | fix height | success. Don't reload when height changes 18 | # 5 | fix both | success. Don't ever reload 19 | # 6 | image | success. display the image $cached points to as an image preview 20 | # 7 | image | success. display the file directly as an image 21 | 22 | # Meaningful aliases for arguments: 23 | path="$1" # Full path of the selected file 24 | width="$2" # Width of the preview pane (number of fitting characters) 25 | height="$3" # Height of the preview pane (number of fitting characters) 26 | cached="$4" # Path that should be used to cache image previews 27 | preview_images="$5" # "True" if image previews are enabled, "False" otherwise. 28 | 29 | maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln 30 | 31 | # Find out something about the file: 32 | mimetype=$(file --mime-type -Lb "$path") 33 | extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') 34 | 35 | # Functions: 36 | # runs a command and saves its output into $output. Useful if you need 37 | # the return value AND want to use the output in a pipe 38 | try() { output=$(eval '"$@"'); } 39 | 40 | # writes the output of the previously used "try" command 41 | dump() { /bin/echo "$output"; } 42 | 43 | # a common post-processing function used after most commands 44 | trim() { head -n "$maxln"; } 45 | 46 | # wraps highlight to treat exit code 141 (killed by SIGPIPE) as success 47 | safepipe() { "$@"; test $? = 0 -o $? = 141; } 48 | 49 | # Image previews, if enabled in ranger. 50 | if [ "$preview_images" = "True" ]; then 51 | case "$mimetype" in 52 | # Image previews for SVG files, disabled by default. 53 | image/svg+xml) 54 | convert "$path" "$cached" && exit 6 || exit 1;; 55 | # Image previews for image files. w3mimgdisplay will be called for all 56 | # image files (unless overriden as above), but might fail for 57 | # unsupported types. 58 | image/*) 59 | exit 7;; 60 | # Image preview for video, disabled by default.: 61 | video/*) 62 | ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; 63 | esac 64 | fi 65 | 66 | case "$extension" in 67 | # Archive extensions: 68 | a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ 69 | rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) 70 | try als "$path" && { dump | trim; exit 0; } 71 | try acat "$path" && { dump | trim; exit 3; } 72 | try bsdtar -lf "$path" && { dump | trim; exit 0; } 73 | exit 1;; 74 | rar) 75 | # avoid password prompt by providing empty password 76 | try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; 77 | 7z) 78 | # avoid password prompt by providing empty password 79 | try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; 80 | # PDF documents: 81 | pdf) 82 | try pdftotext -l 10 -nopgbrk -q "$path" - && \ 83 | { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; 84 | # BitTorrent Files 85 | torrent) 86 | try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; 87 | # ODT Files 88 | odt|ods|odp|sxw) 89 | try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; 90 | # HTML Pages: 91 | htm|html|xhtml) 92 | try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } 93 | try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } 94 | try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } 95 | ;; # fall back to highlight/cat if the text browsers fail 96 | esac 97 | 98 | case "$mimetype" in 99 | # Syntax highlight for text files: 100 | text/* | */xml) 101 | if [ "$(tput colors)" -ge 256 ]; then 102 | pygmentize_format=terminal256 103 | highlight_format=xterm256 104 | else 105 | pygmentize_format=terminal 106 | highlight_format=ansi 107 | fi 108 | try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } 109 | try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } 110 | exit 2;; 111 | # Ascii-previews of images: 112 | image/*) 113 | img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; 114 | # Display information about media files: 115 | video/* | audio/*) 116 | exiftool "$path" && exit 5 117 | # Use sed to remove spaces so the output fits into the narrow window 118 | try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; 119 | esac 120 | 121 | exit 1 122 | -------------------------------------------------------------------------------- /nvim/plugins/whichkey.vim: -------------------------------------------------------------------------------- 1 | " Map leader to which_key 2 | let g:mapleader = "\" 3 | let g:maplocalleader = ',' 4 | nnoremap :WhichKey '' 5 | nnoremap :WhichKey ',' 6 | 7 | " Create map to add keys to 8 | let g:which_key_map = {} 9 | " Define a separator 10 | let g:which_key_sep = '→' 11 | 12 | " Not a fan of floating windows for this 13 | let g:which_key_use_floating_win = 0 14 | 15 | " Change the colors if you want 16 | highlight default link WhichKey Operator 17 | highlight default link WhichKeySeperator DiffAdded 18 | highlight default link WhichKeyGroup Identifier 19 | highlight default link WhichKeyDesc Function 20 | 21 | " Hide status line 22 | autocmd! FileType which_key 23 | autocmd FileType which_key set laststatus=0 noshowmode noruler 24 | \| autocmd BufLeave set laststatus=2 noshowmode ruler 25 | " Single mappings 26 | let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ] 27 | let g:which_key_map['e'] = [ ':CocCommand explorer' , 'explorer' ] 28 | let g:which_key_map['q'] = [ 'q' , 'quit' ] 29 | let g:which_key_map['v'] = [ 'v' , 'split right'] 30 | let g:which_key_map['W'] = [ 'w' , 'write' ] 31 | 32 | " Group mappings 33 | 34 | " s is for search 35 | let g:which_key_map.s = { 36 | \ 'name' : '+search' , 37 | \ '/' : [':History/' , 'history'], 38 | \ ';' : [':Commands' , 'commands'], 39 | \ 'a' : [':Ag' , 'text Ag'], 40 | \ 'b' : [':BLines' , 'current buffer'], 41 | \ 'B' : [':Buffers' , 'open buffers'], 42 | \ 'c' : [':Commits' , 'commits'], 43 | \ 'C' : [':BCommits' , 'buffer commits'], 44 | \ 'f' : [':Files' , 'files'], 45 | \ 'g' : [':GFiles' , 'git files'], 46 | \ 'G' : [':GFiles?' , 'modified git files'], 47 | \ 'h' : [':History' , 'file history'], 48 | \ 'H' : [':History:' , 'command history'], 49 | \ 'l' : [':Lines' , 'lines'] , 50 | \ 'm' : [':Marks' , 'marks'] , 51 | \ 'M' : [':Maps' , 'normal maps'] , 52 | \ 'p' : [':Helptags' , 'help tags'] , 53 | \ 'P' : [':Tags' , 'project tags'], 54 | \ 's' : [':CocList snippets' , 'snippets'], 55 | \ 'S' : [':Colors' , 'color schemes'], 56 | \ 't' : [':Rg' , 'text Rg'], 57 | \ 'T' : [':BTags' , 'buffer tags'], 58 | \ 'w' : [':Windows' , 'search windows'], 59 | \ 'y' : [':Filetypes' , 'file types'], 60 | \ 'z' : [':FZF' , 'FZF'], 61 | \ } 62 | 63 | " l is for language server protocol 64 | let g:which_key_map.l = { 65 | \ 'name' : '+lsp' , 66 | \ '.' : [':CocConfig' , 'config'], 67 | \ ';' : ['(coc-refactor)' , 'refactor'], 68 | \ 'a' : ['(coc-codeaction)' , 'line action'], 69 | \ 'A' : ['(coc-codeaction-selected)' , 'selected action'], 70 | \ 'b' : [':CocNext' , 'next action'], 71 | \ 'B' : [':CocPrev' , 'prev action'], 72 | \ 'c' : [':CocList commands' , 'commands'], 73 | \ 'd' : ['(coc-definition)' , 'definition'], 74 | \ 'D' : ['(coc-declaration)' , 'declaration'], 75 | \ 'e' : [':CocList extensions' , 'extensions'], 76 | \ 'f' : ['(coc-format-selected)' , 'format selected'], 77 | \ 'F' : ['(coc-format)' , 'format'], 78 | \ 'h' : ['(coc-float-hide)' , 'hide'], 79 | \ 'i' : ['(coc-implementation)' , 'implementation'], 80 | \ 'I' : [':CocList diagnostics' , 'diagnostics'], 81 | \ 'j' : ['(coc-float-jump)' , 'float jump'], 82 | \ 'l' : ['(coc-codelens-action)' , 'code lens'], 83 | \ 'n' : ['(coc-diagnostic-next)' , 'next diagnostic'], 84 | \ 'N' : ['(coc-diagnostic-next-error)' , 'next error'], 85 | \ 'o' : ['(coc-openlink)' , 'open link'], 86 | \ 'O' : [':CocList outline' , 'outline'], 87 | \ 'p' : ['(coc-diagnostic-prev)' , 'prev diagnostic'], 88 | \ 'P' : ['(coc-diagnostic-prev-error)' , 'prev error'], 89 | \ 'q' : ['(coc-fix-current)' , 'quickfix'], 90 | \ 'r' : ['(coc-rename)' , 'rename'], 91 | \ 'R' : ['(coc-references)' , 'references'], 92 | \ 's' : [':CocList -I symbols' , 'references'], 93 | \ 'S' : [':CocList snippets' , 'snippets'], 94 | \ 't' : ['(coc-type-definition)' , 'type definition'], 95 | \ 'u' : [':CocListResume' , 'resume list'], 96 | \ 'U' : [':CocUpdate' , 'update CoC'], 97 | \ 'v' : [':Vista!!' , 'tag viewer'], 98 | \ 'z' : [':CocDisable' , 'disable CoC'], 99 | \ 'Z' : [':CocEnable' , 'enable CoC'], 100 | \ } 101 | 102 | " Register which key map 103 | autocmd! User vim-which-key call which_key#register('', 'g:which_key_map') 104 | -------------------------------------------------------------------------------- /picom.conf: -------------------------------------------------------------------------------- 1 | # Thank you code_nomad: http://9m.no/ꪯ鵞 2 | # and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton 3 | 4 | ################################# 5 | # 6 | # Backend 7 | # 8 | ################################# 9 | 10 | # Backend to use: "xrender" or "glx". 11 | # GLX backend is typically much faster but depends on a sane driver. 12 | backend = "glx"; 13 | 14 | ################################# 15 | # 16 | # GLX backend 17 | # 18 | ################################# 19 | 20 | glx-no-stencil = true; 21 | 22 | # GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. 23 | # My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, 24 | # but a 20% increase when only 1/4 is. 25 | # My tests on nouveau show terrible slowdown. 26 | glx-copy-from-front = false; 27 | 28 | # GLX backend: Use MESA_copy_sub_buffer to do partial screen update. 29 | # My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. 30 | # May break VSync and is not available on some drivers. 31 | # Overrides --glx-copy-from-front. 32 | # glx-use-copysubbuffermesa = true; 33 | 34 | # GLX backend: Avoid rebinding pixmap on window damage. 35 | # Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). 36 | # Recommended if it works. 37 | glx-no-rebind-pixmap = true; 38 | 39 | # GLX backend: GLX buffer swap method we assume. 40 | # Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). 41 | # undefined is the slowest and the safest, and the default value. 42 | # copy is fastest, but may fail on some drivers, 43 | # 2-6 are gradually slower but safer (6 is still faster than 0). 44 | # Usually, double buffer means 2, triple buffer means 3. 45 | # buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. 46 | # Useless with --glx-use-copysubbuffermesa. 47 | # Partially breaks --resize-damage. 48 | # Defaults to undefined. 49 | # glx-swap-method = "undefined"; 50 | use-damage = true; 51 | ################################# 52 | # 53 | # Shadows 54 | # 55 | ################################# 56 | 57 | # Enabled client-side shadows on windows. 58 | shadow = true; 59 | # The blur radius for shadows. (default 12) 60 | shadow-radius = 5; 61 | # The left offset for shadows. (default -15) 62 | shadow-offset-x = -5; 63 | # The top offset for shadows. (default -15) 64 | shadow-offset-y = -5; 65 | # The translucency for shadows. (default .75) 66 | shadow-opacity = 0.5; 67 | 68 | # Set if you want different colour shadows 69 | # shadow-red = 0.0; 70 | # shadow-green = 0.0; 71 | # shadow-blue = 0.0; 72 | 73 | # The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches 74 | # (most applications are fine, only apps that do weird things with xshapes or argb are affected). 75 | # This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. 76 | shadow-exclude = [ 77 | "! name~=''", 78 | "name = 'Notification'", 79 | "name = 'Plank'", 80 | "name = 'Docky'", 81 | "name = 'Kupfer'", 82 | "name = 'xfce4-notifyd'", 83 | "name *= 'VLC'", 84 | "name *= 'compton'", 85 | "name *= 'picom'", 86 | "name *= 'Chromium'", 87 | "name *= 'Chrome'", 88 | "class_g = 'Firefox' && argb", 89 | "class_g = 'Conky'", 90 | "class_g = 'Kupfer'", 91 | "class_g = 'Synapse'", 92 | "class_g ?= 'Notify-osd'", 93 | "class_g ?= 'Cairo-dock'", 94 | "class_g ?= 'Xfce4-notifyd'", 95 | "class_g ?= 'Xfce4-power-manager'", 96 | "_GTK_FRAME_EXTENTS@:c", 97 | "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" 98 | ]; 99 | # Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) 100 | shadow-ignore-shaped = false; 101 | 102 | ################################# 103 | # 104 | # Opacity 105 | # 106 | ################################# 107 | 108 | inactive-opacity = 1; 109 | active-opacity = 1; 110 | frame-opacity = 1; 111 | inactive-opacity-override = false; 112 | 113 | opacity-rule = [ 114 | "85:class_g = 'Alacritty'", 115 | "85:class_g = 'code-oss'", 116 | "70:class_g = 'Rofi'" 117 | ]; 118 | 119 | # Dim inactive windows. (0.0 - 1.0) 120 | # inactive-dim = 0.2; 121 | # Do not let dimness adjust based on window opacity. 122 | # inactive-dim-fixed = true; 123 | # Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. 124 | blur-method = "dual_kawase"; 125 | blur-background = true; 126 | blur-strength = 5; 127 | # Blur background of opaque windows with transparent frames as well. 128 | # blur-background-frame = true; 129 | # Do not let blur radius adjust based on window opacity. 130 | # blur-background-fixed = false; 131 | blur-background-exclude = [ 132 | "window_type = 'dock'", 133 | "window_type = 'desktop'" 134 | ]; 135 | 136 | ################################# 137 | # 138 | # Fading 139 | # 140 | ################################# 141 | 142 | # Fade windows during opacity changes. 143 | fading = true; 144 | # The time between steps in a fade in milliseconds. (default 10). 145 | fade-delta = 4; 146 | # Opacity change between steps while fading in. (default 0.028). 147 | fade-in-step = 0.03; 148 | # Opacity change between steps while fading out. (default 0.03). 149 | fade-out-step = 0.03; 150 | # Fade windows in/out when opening/closing 151 | # no-fading-openclose = true; 152 | 153 | # Specify a list of conditions of windows that should not be faded. 154 | fade-exclude = [ ]; 155 | 156 | ################################# 157 | # 158 | # Other 159 | # 160 | ################################# 161 | 162 | # Try to detect WM windows and mark them as active. 163 | mark-wmwin-focused = true; 164 | # Mark all non-WM but override-redirect windows active (e.g. menus). 165 | mark-ovredir-focused = true; 166 | # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. 167 | # Usually more reliable but depends on a EWMH-compliant WM. 168 | use-ewmh-active-win = true; 169 | # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. 170 | detect-rounded-corners = true; 171 | 172 | # Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. 173 | # This prevents opacity being ignored for some apps. 174 | # For example without this enabled my xfce4-notifyd is 100% opacity no matter what. 175 | detect-client-opacity = true; 176 | 177 | # Specify refresh rate of the screen. 178 | # If not specified or 0, picom will try detecting this with X RandR extension. 179 | refresh-rate = 0; 180 | 181 | # Vertical synchronization: match the refresh rate of the monitor 182 | vsync = true; 183 | 184 | # Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. 185 | # Reported to have no effect, though. 186 | dbe = false; 187 | 188 | # Limit picom to repaint at most once every 1 / refresh_rate second to boost performance. 189 | # This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, 190 | # unless you wish to specify a lower refresh rate than the actual value. 191 | #sw-opti = true; 192 | 193 | # Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. 194 | # Known to cause flickering when redirecting/unredirecting windows. 195 | unredir-if-possible = false; 196 | 197 | # Specify a list of conditions of windows that should always be considered focused. 198 | focus-exclude = [ ]; 199 | 200 | # Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. 201 | detect-transient = true; 202 | # Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. 203 | # WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. 204 | detect-client-leader = true; 205 | 206 | ################################# 207 | # 208 | # Window type settings 209 | # 210 | ################################# 211 | 212 | wintypes: 213 | { 214 | tooltip = 215 | { 216 | # fade: Fade the particular type of windows. 217 | fade = true; 218 | # shadow: Give those windows shadow 219 | shadow = false; 220 | # opacity: Default opacity for the type of windows. 221 | opacity = 0.85; 222 | # focus: Whether to always consider windows of this type focused. 223 | focus = true; 224 | }; 225 | }; 226 | 227 | ###################### 228 | # 229 | # XSync 230 | # See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d 231 | # 232 | ###################### 233 | 234 | # Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users. 235 | xrender-sync-fence = true; 236 | -------------------------------------------------------------------------------- /alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | # Configuration for Alacritty, the GPU enhanced terminal emulator. 2 | 3 | window: 4 | # Window dimensions (changes require restart) 5 | # 6 | # Specified in number of columns/lines, not pixels. 7 | # If both are `0`, this setting is ignored. 8 | dimensions: 9 | columns: 0 10 | lines: 0 11 | 12 | # Window padding (changes require restart) 13 | # 14 | # Blank space added around the window in pixels. This padding is scaled 15 | # by DPI and the specified value is always added at both opposing sides. 16 | padding: 17 | x: 0 18 | y: 0 19 | 20 | # Spread additional padding evenly around the terminal content. 21 | dynamic_padding: false 22 | 23 | # Window decorations 24 | # 25 | # Values for `decorations`: 26 | # - full: Borders and title bar 27 | # - none: Neither borders nor title bar 28 | # 29 | # Values for `decorations` (macOS only): 30 | # - transparent: Title bar, transparent background and title bar buttons 31 | # - buttonless: Title bar, transparent background, but no title bar buttons 32 | decorations: full 33 | 34 | # Startup Mode (changes require restart) 35 | # 36 | # Values for `startup_mode`: 37 | # - Windowed 38 | # - Maximized 39 | # - Fullscreen 40 | # 41 | # Values for `startup_mode` (macOS only): 42 | # - SimpleFullscreen 43 | startup_mode: Maximized 44 | 45 | scrolling: 46 | # Maximum number of lines in the scrollback buffer. 47 | # Specifying '0' will disable scrolling. 48 | history: 10000 49 | 50 | # Number of lines the viewport will move for every line scrolled when 51 | # scrollback is enabled (history > 0). 52 | multiplier: 3 53 | 54 | # Scroll to the bottom when new text is written to the terminal. 55 | # auto_scroll: true 56 | 57 | # Font configuration (changes require restart) 58 | font: 59 | # Normal (roman) font face 60 | normal: 61 | # Font family 62 | # 63 | # Default: 64 | # - (macOS) Menlo 65 | # - (Linux) monospace 66 | # - (Windows) Consolas 67 | family: UbuntuMono Nerd Font 68 | 69 | # The `style` can be specified to pick a specific face. 70 | #style: Regular 71 | 72 | # Bold font face 73 | #bold: 74 | # Font family 75 | # 76 | # If the bold family is not specified, it will fall back to the 77 | # value specified for the normal font. 78 | #family: monospace 79 | 80 | # The `style` can be specified to pick a specific face. 81 | #style: Bold 82 | 83 | # Italic font face 84 | #italic: 85 | # Font family 86 | # 87 | # If the italic family is not specified, it will fall back to the 88 | # value specified for the normal font. 89 | #family: monospace 90 | 91 | # The `style` can be specified to pick a specific face. 92 | #style: Italic 93 | 94 | # Point size 95 | size: 18.0 96 | 97 | # Offset is the extra space around each character. `offset.y` can be thought of 98 | # as modifying the line spacing, and `offset.x` as modifying the letter spacing. 99 | offset: 100 | x: 0 101 | y: 0 102 | 103 | # Glyph offset determines the locations of the glyphs within their cells with 104 | # the default being at the bottom. Increasing `x` moves the glyph to the right, 105 | # increasing `y` moves the glyph upwards. 106 | glyph_offset: 107 | x: 0 108 | y: 0 109 | 110 | # Thin stroke font rendering (macOS only) 111 | # 112 | # Thin strokes are suitable for retina displays, but for non-retina screens 113 | # it is recommended to set `use_thin_strokes` to `false` 114 | # 115 | # macOS >= 10.14.x: 116 | # 117 | # If the font quality on non-retina display looks bad then set 118 | # `use_thin_strokes` to `true` and enable font smoothing by running the 119 | # following command: 120 | # `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO` 121 | # 122 | # This is a global setting and will require a log out or restart to take 123 | # effect. 124 | use_thin_strokes: true 125 | 126 | # If `true`, bold text is drawn using the bright color variants. 127 | draw_bold_text_with_bright_colors: true 128 | 129 | schemes: 130 | embark: &embark 131 | primary: 132 | background: "0x1e1c31" 133 | foreground: "0xcbe3e7" 134 | cursor: 135 | text: "0x1e1c31" 136 | cursor: "0xa1efd3" 137 | normal: 138 | black: "0x1e1c31" 139 | red: "0xf48fb1" 140 | green: "0xa1efd3" 141 | yellow: "0xffe6b3" 142 | blue: "0x91ddff" 143 | magenta: "0xd4bfff" 144 | cyan: "0x87dfeb" 145 | white: "0xcbe3e7" 146 | bright: 147 | black: "0x585273" 148 | red: "0xf02e6e" 149 | green: "0x62d196" 150 | yellow: "0xf2b482" 151 | blue: "0x65b2ff" 152 | magenta: "0xa37acc" 153 | cyan: "0x63f2f1" 154 | white: "0x8a889d" 155 | 156 | colors: *embark 157 | 158 | # Colors (Nightfly) 159 | # colors: 160 | # # Default colors 161 | # primary: 162 | # background: "#011627" 163 | # foreground: "#acb4c2" 164 | # bright_foreground: "#eeeeee" 165 | 166 | # # Cursor colors 167 | # cursor: 168 | # text: "#080808" 169 | # cursor: "#9ca1aa" 170 | 171 | # # Selection colors 172 | # selection: 173 | # text: "#080808" 174 | # background: "#b2ceee" 175 | 176 | # # Normal colors 177 | # normal: 178 | # black: "#1d3b53" 179 | # red: "#fc514e" 180 | # green: "#a1cd5e" 181 | # yellow: "#e3d18a" 182 | # blue: "#82aaff" 183 | # magenta: "#c792ea" 184 | # cyan: "#7fdbca" 185 | # white: "#a1aab8" 186 | 187 | # # Bright colors 188 | # bright: 189 | # black: "#7c8f8f" 190 | # red: "#ff5874" 191 | # green: "#21c7a8" 192 | # yellow: "#ecc48d" 193 | # blue: "#82aaff" 194 | # magenta: "#ae81ff" 195 | # cyan: "#7fdbca" 196 | # white: "#d6deeb" 197 | 198 | # Mouse bindings 199 | # 200 | # Available fields: 201 | # - mouse 202 | # - action 203 | # - mods (optional) 204 | # 205 | # Values for `mouse`: 206 | # - Middle 207 | # - Left 208 | # - Right 209 | # - Numeric identifier such as `5` 210 | # 211 | # All available `mods` and `action` values are documented in the key binding 212 | # section. 213 | 214 | mouse_bindings: 215 | - { mouse: Middle, action: PasteSelection } 216 | 217 | mouse: 218 | # Click settings 219 | # 220 | # The `double_click` and `triple_click` settings control the time 221 | # alacritty should wait for accepting multiple clicks as one double 222 | # or triple click. 223 | double_click: { threshold: 300 } 224 | triple_click: { threshold: 300 } 225 | 226 | # If this is `true`, the cursor is temporarily hidden when typing. 227 | hide_when_typing: false 228 | 229 | selection: 230 | semantic_escape_chars: ',│`|:"'' ()[]{}<>' 231 | 232 | # When set to `true`, selected text will be copied to the primary clipboard. 233 | save_to_clipboard: false 234 | 235 | # Allow terminal applications to change Alacritty's window title. 236 | # dynamic_title: true 237 | 238 | cursor: 239 | # Cursor style 240 | # 241 | # Values for `style`: 242 | # - ▇ Block 243 | # - _ Underline 244 | # - | Beam 245 | style: Block 246 | 247 | # If this is `true`, the cursor will be rendered as a hollow box when the 248 | # window is not focused. 249 | unfocused_hollow: true 250 | 251 | # Live config reload (changes require restart) 252 | live_config_reload: true 253 | 254 | # Shell 255 | # 256 | # You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`. 257 | # Entries in `shell.args` are passed unmodified as arguments to the shell. 258 | # 259 | # Default: 260 | # - (macOS) /bin/bash --login 261 | # - (Linux) user login shell 262 | # - (Windows) powershell 263 | #shell: 264 | # program: /bin/bash 265 | # args: 266 | # - --login 267 | 268 | # Startup directory 269 | # 270 | # Directory the shell is started in. If this is unset, or `None`, the working 271 | # directory of the parent process will be used. 272 | # working_directory: None 273 | 274 | # Windows 10 ConPTY backend (Windows only) 275 | # 276 | # This will enable better color support and may resolve other issues, 277 | # however this API and its implementation is still young and so is 278 | # disabled by default, as stability may not be as good as the winpty 279 | # backend. 280 | # 281 | # Alacritty will fall back to the WinPTY automatically if the ConPTY 282 | # backend cannot be initialized. 283 | enable_experimental_conpty_backend: false 284 | 285 | # Send ESC (\x1b) before characters when alt is pressed. 286 | alt_send_esc: true 287 | 288 | debug: 289 | # Display the time it takes to redraw each frame. 290 | render_timer: false 291 | 292 | # Keep the log file after quitting Alacritty. 293 | persistent_logging: false 294 | 295 | # Log level 296 | # 297 | # Values for `log_level`: 298 | # - None 299 | # - Error 300 | # - Warn 301 | # - Info 302 | # - Debug 303 | # - Trace 304 | log_level: Warn 305 | 306 | # Print all received window events. 307 | print_events: false 308 | 309 | # Record all characters and escape sequences as test data. 310 | ref_test: false 311 | -------------------------------------------------------------------------------- /polybar/config.ini: -------------------------------------------------------------------------------- 1 | ;; ┌────────────────────────────────────────────────────────────┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀│ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░█░█▀▀░░█░░█░█│ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀│ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └────────────────────────────────────────────────────────────┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | [color] 11 | ;; main colors 12 | background = #2d2b40 13 | foreground = #cbe3e7 14 | foreground-alt = #555 15 | module-fg = #1F1F1F 16 | primary = #63f2f1 17 | secondary = #ffb86c 18 | alternate = #bd93f9 19 | 20 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 21 | 22 | ;; Global WM Settings 23 | 24 | [global/wm] 25 | ; Adjust the _NET_WM_STRUT_PARTIAL top value 26 | ; Used for top aligned bars 27 | margin-bottom = 0 28 | 29 | ; Adjust the _NET_WM_STRUT_PARTIAL bottom value 30 | ; Used for bottom aligned bars 31 | margin-top = 0 32 | 33 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 34 | 35 | ;; File Inclusion 36 | ; include an external file, like module file, etc. 37 | 38 | include-file = ~/.config/polybar/modules.ini 39 | 40 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 41 | 42 | ;; Bar Settings 43 | 44 | [bar/main] 45 | ; Use either of the following command to list available outputs: 46 | ; If unspecified, the application will pick the first one it finds. 47 | ; $ polybar -m | cut -d ':' -f 1 48 | ; $ xrandr -q | grep " connected" | cut -d ' ' -f1 49 | monitor = 50 | 51 | ; Use the specified monitor as a fallback if the main one is not found. 52 | monitor-fallback = 53 | 54 | ; Require the monitor to be in connected state 55 | ; XRandR sometimes reports my monitor as being disconnected (when in use) 56 | monitor-strict = false 57 | 58 | ; Tell the Window Manager not to configure the window. 59 | ; Use this to detach the bar if your WM is locking its size/position. 60 | override-redirect = false 61 | 62 | ; Put the bar at the bottom of the screen 63 | bottom = false 64 | 65 | ; Prefer fixed center position for the `modules-center` block 66 | ; When false, the center position will be based on the size of the other blocks. 67 | fixed-center = true 68 | 69 | ; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%), 70 | ; the percentage can optionally be extended with a pixel offset like so: 71 | ; 50%:-10, this will result in a width or height of 50% minus 10 pixels 72 | width = 98% 73 | height = 20 74 | 75 | ; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%) 76 | ; the percentage can optionally be extended with a pixel offset like so: 77 | ; 50%:-10, this will result in an offset in the x or y direction 78 | ; of 50% minus 10 pixels 79 | offset-x = 1% 80 | offset-y = 1% 81 | 82 | ; Background ARGB color (e.g. #f00, #ff992a, #ddff1023) 83 | background = ${color.background} 84 | 85 | ; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023) 86 | foreground = ${color.foreground} 87 | 88 | ; Background gradient (vertical steps) 89 | ; background-[0-9]+ = #aarrggbb 90 | ;;background-0 = 91 | 92 | ; Value used for drawing rounded corners 93 | ; Note: This shouldn't be used together with border-size because the border 94 | ; doesn't get rounded 95 | ; Individual top/bottom values can be defined using: 96 | ; radius-{top,bottom} 97 | radius-top = 0.0 98 | radius-bottom = 0.0 99 | 100 | ; Under-/overline pixel size and argb color 101 | ; Individual values can be defined using: 102 | ; {overline,underline}-size 103 | ; {overline,underline}-color 104 | line-size = 2 105 | line-color = ${color.primary} 106 | 107 | ; Values applied to all borders 108 | ; Individual side values can be defined using: 109 | ; border-{left,top,right,bottom}-size 110 | ; border-{left,top,right,bottom}-color 111 | ; The top and bottom borders are added to the bar height, so the effective 112 | ; window height is: 113 | ; height + border-top-size + border-bottom-size 114 | ; Meanwhile the effective window width is defined entirely by the width key and 115 | ; the border is placed withing this area. So you effectively only have the 116 | ; following horizontal space on the bar: 117 | ; width - border-right-size - border-left-size 118 | border-size = 3 119 | border-color = ${color.background} 120 | 121 | ; Number of spaces to add at the beginning/end of the bar 122 | ; Individual side values can be defined using: 123 | ; padding-{left,right} 124 | padding = 1 125 | 126 | ; Number of spaces to add before/after each module 127 | ; Individual side values can be defined using: 128 | ; module-margin-{left,right} 129 | module-margin-left = 1 130 | module-margin-right = 1 131 | 132 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 133 | 134 | ; Fonts are defined using ; 135 | ; Font names are specified using a fontconfig pattern. 136 | ; font-0 = NotoSans-Regular:size=8;2 137 | ; font-1 = MaterialIcons:size=10 138 | ; font-2 = Termsynu:size=8;-1 139 | ; font-3 = FontAwesome:size=10 140 | ; See the Fonts wiki page for more details 141 | 142 | font-0 = "Ubuntu Mono:pixelsize=10;2" 143 | font-1 = "Material\-Design\-Iconic\-Font:size=13;4" 144 | 145 | ; Modules are added to one of the available blocks 146 | ; modules-left = cpu ram 147 | ; modules-center = xwindow xbacklight 148 | ; modules-right = ipc clock 149 | 150 | ; modules-left = launcher workspaces term files browser settings 151 | ; modules-center = mpd 152 | ; modules-right = updates alsa battery network date sysmenu 153 | modules-left = workspaces 154 | ; modules-right = alsa battery date 155 | 156 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 157 | 158 | ; The separator will be inserted between the output of each module 159 | separator = 160 | 161 | ; Opacity value between 0.0 and 1.0 used on fade in/out 162 | dim-value = 1.0 163 | 164 | ; Value to be used to set the WM_NAME atom 165 | ; If the value is empty or undefined, the atom value 166 | ; will be created from the following template: polybar-[BAR]_[MONITOR] 167 | ; NOTE: The placeholders are not available for custom values 168 | wm-name = 169 | 170 | ; Locale used to localize various module data (e.g. date) 171 | ; Expects a valid libc locale, for example: sv_SE.UTF-8 172 | locale = 173 | 174 | ; Restack the bar window and put it above the 175 | ; selected window manager's root 176 | ; 177 | ; Fixes the issue where the bar is being drawn 178 | ; on top of fullscreen window's 179 | ; 180 | ; Currently supported WM's: 181 | ; bspwm 182 | ; i3 (requires: `override-redirect = true`) 183 | ;;wm-restack = 184 | 185 | ; Set a DPI values used when rendering text 186 | ; This only affects scalable fonts 187 | ; dpi = 188 | 189 | ; Enable support for inter-process messaging 190 | ; See the Messaging wiki page for more details. 191 | enable-ipc = true 192 | 193 | ; Fallback click handlers that will be called if 194 | ; there's no matching module handler found. 195 | click-left = 196 | click-middle = 197 | click-right = 198 | scroll-up = 199 | scroll-down = 200 | double-click-left = 201 | double-click-middle = 202 | double-click-right = 203 | 204 | ; Requires polybar to be built with xcursor support (xcb-util-cursor) 205 | ; Possible values are: 206 | ; - default : The default pointer as before, can also be an empty string (default) 207 | ; - pointer : Typically in the form of a hand 208 | ; - ns-resize : Up and down arrows, can be used to indicate scrolling 209 | cursor-click = 210 | cursor-scroll = 211 | 212 | ;; WM Workspace Specific 213 | 214 | ; bspwm 215 | ;;scroll-up = bspwm-desknext 216 | ;;scroll-down = bspwm-deskprev 217 | ;;scroll-up = bspc desktop -f prev.local 218 | ;;scroll-down = bspc desktop -f next.local 219 | 220 | ;i3 221 | ;;scroll-up = i3wm-wsnext 222 | ;;scroll-down = i3wm-wsprev 223 | ;;scroll-up = i3-msg workspace next_on_output 224 | ;;scroll-down = i3-msg workspace prev_on_output 225 | 226 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 227 | 228 | [bar/primary] 229 | inherit = bar/main 230 | monitor = HDMI-0 231 | 232 | modules-right = filesystem 233 | 234 | ; Position of the system tray window 235 | ; If empty or undefined, tray support will be disabled 236 | ; NOTE: A center aligned tray will cover center aligned modules 237 | ; 238 | ; Available positions: 239 | ; left 240 | ; center 241 | ; right 242 | ; none 243 | tray-position = right 244 | 245 | ; If true, the bar will not shift its 246 | ; contents when the tray changes 247 | tray-detached = false 248 | 249 | ; Tray icon max size 250 | tray-maxsize = 16 251 | 252 | ; Background color for the tray container 253 | ; ARGB color (e.g. #f00, #ff992a, #ddff1023) 254 | ; By default the tray container will use the bar 255 | ; background color. 256 | tray-background = ${color.background} 257 | 258 | ; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%) 259 | tray-offset-x = 0 260 | tray-offset-y = 0 261 | 262 | ; Pad the sides of each tray icon 263 | tray-padding = 0 264 | 265 | ; Scale factor for tray clients 266 | tray-scale = 1.0 267 | 268 | [bar/secondary] 269 | inherit = bar/main 270 | monitor = DP-3 271 | 272 | modules-right = date 273 | 274 | 275 | ;; Application Settings 276 | 277 | [settings] 278 | ; The throttle settings lets the eventloop swallow up til X events 279 | ; if they happen within Y millisecond after first event was received. 280 | ; This is done to prevent flood of update event. 281 | ; 282 | ; For example if 5 modules emit an update event at the same time, we really 283 | ; just care about the last one. But if we wait too long for events to swallow 284 | ; the bar would appear sluggish so we continue if timeout 285 | ; expires or limit is reached. 286 | throttle-output = 5 287 | throttle-output-for = 10 288 | 289 | ; Time in milliseconds that the input handler will wait between processing events 290 | ;throttle-input-for = 30 291 | 292 | ; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events 293 | screenchange-reload = false 294 | 295 | ; Compositing operators 296 | ; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t 297 | compositing-background = source 298 | compositing-foreground = over 299 | compositing-overline = over 300 | compositing-underline = over 301 | compositing-border = over 302 | 303 | ; Define fallback values used by all module formats 304 | ;format-foreground = 305 | ;format-background = 306 | ;format-underline = 307 | ;format-overline = 308 | ;format-spacing = 309 | ;format-padding = 310 | ;format-margin = 311 | ;format-offset = 312 | 313 | ; Enables pseudo-transparency for the bar 314 | ; If set to true the bar can be transparent without a compositor. 315 | pseudo-transparency = false 316 | 317 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 318 | -------------------------------------------------------------------------------- /ranger/rifle.conf: -------------------------------------------------------------------------------- 1 | # vim: ft=cfg 2 | # 3 | # This is the configuration file of "rifle", ranger's file executor/opener. 4 | # Each line consists of conditions and a command. For each line the conditions 5 | # are checked and if they are met, the respective command is run. 6 | # 7 | # Syntax: 8 | # , , ... = command 9 | # 10 | # The command can contain these environment variables: 11 | # $1-$9 | The n-th selected file 12 | # $@ | All selected files 13 | # 14 | # If you use the special command "ask", rifle will ask you what program to run. 15 | # 16 | # Prefixing a condition with "!" will negate its result. 17 | # These conditions are currently supported: 18 | # match | The regexp matches $1 19 | # ext | The regexp matches the extension of $1 20 | # mime | The regexp matches the mime type of $1 21 | # name | The regexp matches the basename of $1 22 | # path | The regexp matches the absolute path of $1 23 | # has | The program is installed (i.e. located in $PATH) 24 | # env | The environment variable "variable" is non-empty 25 | # file | $1 is a file 26 | # directory | $1 is a directory 27 | # number | change the number of this command to n 28 | # terminal | stdin, stderr and stdout are connected to a terminal 29 | # X | A graphical environment is available (darwin, Xorg, or Wayland) 30 | # 31 | # There are also pseudo-conditions which have a "side effect": 32 | # flag | Change how the program is run. See below. 33 | # label