├── .gitignore ├── .gitmodules ├── README.md ├── config.yaml ├── dotdrop.sh ├── home ├── applications │ ├── ff-github.desktop │ └── spotify.desktop ├── bin │ ├── app-launcher │ ├── brc │ ├── chbg │ ├── deskopen │ ├── ff-open │ ├── figlet-test │ ├── kautostart.sh │ ├── lch │ ├── lockscreen │ ├── ls-chars │ ├── post-hibernate.sh │ ├── powermenu │ ├── run-tabpage │ ├── scr │ ├── swal │ └── toggle-day-mode ├── config │ ├── bat │ │ └── config │ ├── dunst │ │ ├── dunstrc │ │ └── launch.sh │ ├── feh │ │ └── buttons │ ├── fish │ │ ├── completions │ │ │ ├── docker.fish │ │ │ ├── ev.fish │ │ │ ├── fisher.fish │ │ │ ├── git.fish │ │ │ ├── mkdir.fish │ │ │ ├── node.fish │ │ │ ├── nvim.fish │ │ │ └── vim.fish │ │ ├── conf.d │ │ │ ├── _abbr.fish │ │ │ ├── fzf_user_bindings.fish │ │ │ ├── pipr.fish │ │ │ └── plugins.fish │ │ ├── config.fish │ │ ├── functions │ │ │ ├── !!.fish │ │ │ ├── __fish_command_not_found_handler.fish │ │ │ ├── auri.fish │ │ │ ├── bak.fish │ │ │ ├── bg-func.fish │ │ │ ├── bt.fish │ │ │ ├── coln.fish │ │ │ ├── commit-msg.fish │ │ │ ├── conf.fish │ │ │ ├── dotenv.fish │ │ │ ├── dots.fish │ │ │ ├── exit.fish │ │ │ ├── fish_add_path.fish │ │ │ ├── fish_mode_prompt.fish │ │ │ ├── ga.fish │ │ │ ├── gac.fish │ │ │ ├── gc.fish │ │ │ ├── gcr.fish │ │ │ ├── getopts.fish │ │ │ ├── has.fish │ │ │ ├── kheme.fish │ │ │ ├── mc.fish │ │ │ ├── new.fish │ │ │ ├── pfetch.fish │ │ │ ├── print_fish_colors.fish │ │ │ ├── qemu-run.fish │ │ │ ├── restore.fish │ │ │ ├── split-file-ext.fish │ │ │ ├── src.fish │ │ │ ├── ssh_agent_init.fish │ │ │ ├── sv.fish │ │ │ ├── test │ │ │ ├── utils.fish │ │ │ ├── void.fish │ │ │ └── wexec.fish │ │ └── profile.fish │ ├── flashfocus │ │ └── flashfocus.yml │ ├── git │ │ └── config │ ├── gtk-3.0 │ │ ├── .gitignore │ │ ├── bookmarks │ │ └── settings.ini │ ├── i3 │ │ ├── config │ │ └── scripts │ │ │ ├── i3-alternate-layout │ │ │ ├── i3-swallow.py │ │ │ ├── move-to-ws.sh │ │ │ └── x-close-no-focus │ ├── kitty │ │ ├── keys.conf │ │ ├── kitty.conf │ │ ├── kitty.d │ │ │ └── keys.conf │ │ ├── themes │ │ │ ├── ayu.conf │ │ │ ├── dark.conf │ │ │ ├── fl-w.conf │ │ │ └── light.conf │ │ └── zoom_toggle.py │ ├── maven │ │ └── settings.xml │ ├── nvim │ │ ├── after │ │ │ ├── ftplugin │ │ │ │ ├── fish.vim │ │ │ │ ├── markdown.vim │ │ │ │ └── vim.vim │ │ │ └── plugin │ │ │ │ └── fern_renderer_devicons.vim │ │ ├── autoload │ │ │ ├── folws.vim │ │ │ ├── statusline.vim │ │ │ ├── utils.vim │ │ │ └── utils │ │ │ │ ├── color.vim │ │ │ │ ├── explorer.vim │ │ │ │ └── window.vim │ │ ├── clients │ │ │ ├── firenvim.vim │ │ │ ├── idea.vim │ │ │ └── vscode.vim │ │ ├── coc-settings.json │ │ ├── conf.d │ │ │ ├── abbr.vim │ │ │ ├── autocmd.vim │ │ │ ├── colorscheme.vim │ │ │ ├── kitty.vim │ │ │ ├── statusline.vim │ │ │ └── terminal.vim │ │ ├── init.vim │ │ ├── lua │ │ │ └── utils.lua │ │ ├── maps │ │ │ ├── keys.vim │ │ │ └── which-key.vim │ │ ├── plugins.d │ │ │ ├── FixCursorHold-nvim.vim │ │ │ ├── ale.vim │ │ │ ├── animate.vim │ │ │ ├── auto-pairs.vim │ │ │ ├── ayu-vim.vim │ │ │ ├── badwolf.vim │ │ │ ├── camelcasemotion.vim │ │ │ ├── clever-f.vim │ │ │ ├── coc-fzf.vim │ │ │ ├── coc.vim │ │ │ ├── dashboard-nvim.vim │ │ │ ├── defx.vim │ │ │ ├── echodoc.vim │ │ │ ├── fern.vim │ │ │ ├── fzf.vim │ │ │ ├── goyo.vim │ │ │ ├── gruvbox.vim │ │ │ ├── highlightedyank-vim.vim │ │ │ ├── indentline.vim │ │ │ ├── lens.vim │ │ │ ├── lightline.vim │ │ │ ├── markdown-auto-compile.vim │ │ │ ├── nerdcommenter.vim │ │ │ ├── nerdtree.vim │ │ │ ├── quick-scope.vim │ │ │ ├── ultisnips.vim │ │ │ ├── undotree.vim │ │ │ ├── vim-easy-align.vim │ │ │ ├── vim-easymotion.vim │ │ │ ├── vim-expand-region.vim │ │ │ ├── vim-highlightedyank.vim │ │ │ ├── vim-matchup.vim │ │ │ ├── vim-mergetool.vim │ │ │ ├── vim-obsession.vim │ │ │ ├── vim-rooter.vim │ │ │ ├── vim-signify.vim │ │ │ ├── vim-smoothie.vim │ │ │ ├── vim-startify.vim │ │ │ ├── vim-wintabs.vim │ │ │ ├── vimtex.vim │ │ │ ├── vista.vim │ │ │ └── wilder.vim │ │ ├── plugins.vim │ │ ├── settings.vim │ │ └── snippet │ │ │ └── javascript.snippets │ ├── picom │ │ ├── launch.sh │ │ └── picom.conf │ ├── polybar │ │ ├── config │ │ ├── fonts │ │ │ ├── Ubuntu-C.ttf │ │ │ └── icomoon-feather.ttf │ │ ├── launch.sh │ │ ├── modules.ini │ │ └── scripts │ │ │ ├── check-network │ │ │ ├── checkupdates │ │ │ ├── lupdates │ │ │ ├── updates │ │ │ └── windows │ ├── rg │ │ └── ripgreprc │ ├── rofi │ │ ├── config │ │ ├── config.rasi │ │ ├── scripts │ │ │ ├── app-launcher.sh │ │ │ ├── calc.sh │ │ │ ├── cycle-themes.sh │ │ │ └── powermenu.sh │ │ └── themes │ │ │ ├── colors │ │ │ ├── fallback.rasi │ │ │ └── test.css │ │ │ ├── main.colorscheme.rasi │ │ │ ├── main.modes-r.rasi │ │ │ ├── main.modes.rasi │ │ │ ├── main.rasi │ │ │ ├── main.sb-r.rasi │ │ │ ├── main.sb.rasi │ │ │ ├── powermenu-text.rasi │ │ │ └── powermenu.rasi │ ├── sh │ │ ├── aliases │ │ ├── bashrc │ │ └── profile │ ├── spicetify │ │ ├── Themes │ │ │ └── Pywal │ │ │ │ ├── color.ini │ │ │ │ └── user.css │ │ └── config.ini │ ├── sway │ │ └── config │ ├── user-dirs.dirs │ ├── wal │ │ ├── colorschemes │ │ │ └── dark │ │ │ │ └── default.rasi │ │ └── templates │ │ │ ├── colors-rofi-dark.rasi │ │ │ └── colors.Xresources │ ├── x │ │ ├── initrc │ │ ├── profile │ │ ├── resources │ │ └── xrandr │ │ │ ├── aset-layout │ │ │ ├── set-layout │ │ │ ├── xocw │ │ │ └── xocw.c │ └── zathura │ │ └── zathurarc ├── env └── opt │ ├── config.fish.local │ └── gitconfig.local ├── root ├── efi │ └── refind.conf └── etc │ ├── lightdm │ ├── Xsession │ └── lightdm-mini-greeter.conf │ ├── pacman.conf │ └── zzz.d │ └── resume │ └── resume.sh └── wallpapers ├── 0GxKbT0.png ├── 158579144128.png ├── 2_1585332720236.png ├── 3BIoeLR.jpg ├── 5qs6xdl7i5771.webp ├── 97506.jpg ├── 9cwlt8edjb261.jpg ├── HXaoMFb2NYsIcPTmbQeN3WRAVi3lLlYFPc3L0wdxb70.webp ├── J6g7XPZ.jpg ├── abstract-wow.jpg ├── alena-aenami-004-1k1.jpg ├── bboxzel7i5771.webp ├── bnbw200ng8571.png ├── c41aohicxml71.webp ├── clay-banks-u27Rrbs9Dwc-unsplash.jpg ├── clouds-9-1920×1080.jpg ├── dey56n6-cc262177-2961-4854-b61c-7d92ddba4678.jpg ├── dh0o8txg8c641.jpg ├── eagle-2560×1440.jpg ├── girl.png ├── i2n6jel7i5771.webp ├── jz1f2el7i5771.webp ├── lq1cjddeuj861.jpg ├── lqpn6am7i5771.webp ├── pink-sunset-1920×1080.jpg ├── q38ud32si5771.webp ├── tianshu-liu-aqZ3UAjs_M4-unsplash.jpg ├── vadim-bahryi-9.jpg ├── wDOzl.png ├── wallhaven-39go6v.jpg ├── wallhaven-39ykq6.jpg ├── wallhaven-6oqzgq.jpg ├── wallhaven-96kdzx.png ├── wallhaven-eyrpo8.jpg ├── wallhaven-eyv7xl.jpg ├── wallhaven-g7jg63.png ├── wallhaven-kw22p1.jpg ├── wallhaven-lm2rry.jpg ├── wallhaven-lmrvxr.jpg ├── wallhaven-p8gp83.jpg ├── wallhaven-pkz5r9.png └── xbb178yhi5771.webp /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore private files & redundant machine-specific config/meta files 2 | ## generated by the dotfiles. 3 | ## 4 | 5 | # machine local files 6 | **/*{.,-}local 7 | 8 | # .project-root 9 | **/.project-root 10 | 11 | # private files 12 | .private/ 13 | 14 | # virtual env 15 | .venv/ 16 | 17 | # local env file 18 | home/env 19 | 20 | # fish 21 | **/fish_variables 22 | **/fish/functions/fundle.fish 23 | **/functions/fzf_key_bindings.fish 24 | 25 | # ignore bash history 26 | **/*_history 27 | 28 | # kitty themes 29 | home/config/kitty/themes/*.conf 30 | 31 | 32 | # ctags 33 | tags{,.*} 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "root/efi/themes/rEFInd-minimal-dark"] 2 | path = root/efi/themes/rEFInd-minimal-dark 3 | url = https://github.com/fl-w/rEFInd-minimal-dark 4 | -------------------------------------------------------------------------------- /dotdrop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | type python3 > /dev/null || { echo "Executable \"python3\" not in PATH or installed, aborting." && exit 1; } 4 | 5 | odir="$(pwd)" 6 | ddir="$(dirname "$(readlink -f "${0}")")" 7 | 8 | cd "${ddir}" || { echo "Directory \"${ddir}\" does not exist, aborting." && exit 1; } 9 | 10 | if [[ ! -d ".venv" ]]; then 11 | echo "Creating virtual environment..." 12 | python3 -m venv .venv 13 | fi 14 | 15 | source .venv/bin/activate || { echo "Can not activate virtual environment, aborting." && exit 1; } 16 | 17 | if [[ ! -f ".venv/bin/dotdrop" ]]; then 18 | echo "Installing Dotdrop into virtual environment..." 19 | python3 -m pip install dotdrop 20 | fi 21 | 22 | dotdrop "$@" 23 | exit_code="$?" 24 | 25 | cd "${odir}" || { echo "Directory \"${odir}\" does not exist, aborting." && exit 1; } 26 | 27 | -------------------------------------------------------------------------------- /home/applications/ff-github.desktop: -------------------------------------------------------------------------------- 1 | Name=GitHub 2 | Exec=xdg-open https://github.com 3 | -------------------------------------------------------------------------------- /home/applications/spotify.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Spotify 3 | GenericName=Music Player 4 | Comment=Spotify streaming music client 5 | Icon=spotify-client 6 | Exec=spotify --force-device-scale-factor=1.3 %U 7 | TryExec=spotify 8 | Terminal=false 9 | Type=Application 10 | Categories=Audio;Music;Player;AudioVideo 11 | MimeType=x-scheme-handler/spotify 12 | -------------------------------------------------------------------------------- /home/bin/app-launcher: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -f ~/.config/rofi/scripts/app-launcher.sh ] && ~/.config/rofi/scripts/app-launcher.sh "$@" 4 | -------------------------------------------------------------------------------- /home/bin/brc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | # bluetooth-reset-connect 4 | -------------------------------------------------------------------------------- /home/bin/chbg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env fish 2 | 3 | function chbg_kitty --argument mode 4 | kitty @ set-colors -a -c $conf/kitty/themes/$mode.conf 5 | or return 1 6 | end 7 | 8 | function chbg_nvr --argument mode 9 | has nvr 10 | and nvr --serverlist | xargs -P12 -I'{}' nvr -s --nostart --servername '{}' -c "set bg=$mode | call colorscheme#refresh()" 11 | or echo 'neovim-remote required to update neovim colors\n\t\tpip install neovim-remote' 12 | end 13 | 14 | function chbg --argument mode 15 | not set -q mode 16 | or not string length -q -- "$mode" 17 | and set mode 'light' 18 | 19 | echo $mode 20 | chbg_kitty $mode 21 | chbg_nvr $mode 22 | end 23 | 24 | chbg $argv[1] 25 | -------------------------------------------------------------------------------- /home/bin/deskopen: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run .desktop files 3 | 4 | USAGE="Usage: desktopen " 5 | # ------------------------------------------------------------------ 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | echo $USAGE 10 | exit 1; 11 | fi 12 | 13 | function extractExec() { 14 | local exe=$(grep '^Exec' $1 | tail -1 | sed 's/^Exec=//' | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g' ) 15 | 16 | if [ ! -z $exe ]; then 17 | exec $exe & 18 | else 19 | echo 'Exec not found in' $1 20 | fi 21 | } 22 | 23 | for var in "$@" 24 | do 25 | if [ ! -f $var ]; then 26 | echo $var " is not a file" 27 | exit 1; 28 | fi 29 | 30 | extractExec $var 31 | done 32 | -------------------------------------------------------------------------------- /home/bin/ff-open: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ff= 4 | for f in firefox firefox-developer-edition; do 5 | if type $f &>/dev/null 6 | then 7 | ff=$f; break 8 | fi 9 | done 10 | 11 | [ ! -z "$ff" ] && $ff -new-tab "$1" 12 | -------------------------------------------------------------------------------- /home/bin/figlet-test: -------------------------------------------------------------------------------- 1 | #!/bin/env fish 2 | 3 | if not set -q argv[1] 4 | set cmd (basename (status -f)) 5 | echo "Usage: $cmd - test figlet fonts given a text." 6 | exit 1 7 | end 8 | 9 | for font in /usr/share/figlet/fonts/* 10 | set font (basename $font | sed 's/\.[^.]*$//') 11 | echo $font : 12 | figlet -f $font $argv[1] 13 | echo 14 | echo 15 | end 16 | -------------------------------------------------------------------------------- /home/bin/kautostart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # kautostart.sh - autostart applications for KDE plasma 3 | 4 | type krunner &>/dev/null || krunner -d 5 | -------------------------------------------------------------------------------- /home/bin/lch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 1 ]; then 4 | echo "Usage: $(basename "$0") [command options]" 5 | exit 1 6 | fi 7 | 8 | if [[ $1 == --process=* ]]; then 9 | process=${1:10} 10 | shift 11 | else 12 | process=`basename $1` 13 | fi 14 | 15 | # Terminate already running bar instances 16 | pkill -u "$USER" -x -f "$process" 17 | 18 | # Wait until the processes have been shut down 19 | while pgrep -u $UID -x -f "$process" >/dev/null; do sleep 1; done 20 | 21 | ("$@" &>/dev/null 2>&1) & 22 | -------------------------------------------------------------------------------- /home/bin/lockscreen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | with() { 4 | type "$1" &>/dev/null && exec "$@" 5 | } 6 | 7 | with swaylock -c 000000 \ 8 | || with i3lock-fancy-rapid 5 3 \ 9 | || notify-send "failed to lock screen" 10 | -------------------------------------------------------------------------------- /home/bin/ls-chars: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for range in $(fc-match --format='%{charset}\n' "$1"); do 3 | for n in $(seq "0x${range%-*}" "0x${range#*-}"); do 4 | printf "%04x\n" "$n" 5 | done 6 | done | while read -r n_hex; do 7 | count=$((count + 1)) 8 | printf "%-5s\U$n_hex\t" "$n_hex" 9 | [ $((count % 10)) = 0 ] && printf "\n" 10 | done 11 | printf "\n" 12 | -------------------------------------------------------------------------------- /home/bin/post-hibernate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo sv restart bluetoothd 4 | for i in r8169 psmouse; do 5 | sudo modprobe -r $i 6 | sudo modprobe $i 7 | done 8 | -------------------------------------------------------------------------------- /home/bin/powermenu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | : "${XDG_CONFIG_HOME:=.$HOME/.config}" 4 | [ -f $XDG_CONFIG_HOME/rofi/scripts/powermenu.sh ] && $XDG_CONFIG_HOME/rofi/scripts/powermenu.sh "$@" 5 | -------------------------------------------------------------------------------- /home/bin/run-tabpage: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | TABDIR="${XDG_DATA_HOME:-".local/share"}/tab" 4 | LOCKDIR="/tmp/tab-page-lock" 5 | 6 | function pull_lastest { 7 | if [ ! -d $TABDIR ]; then 8 | echo 'Cloning repo into ' $TABDIR && \ 9 | git clone https://github.com/folws/tab $TABDIR 10 | else 11 | if [ $(git -C $TABDIR log ..origin/master --oneline | wc -l) -gt 2 ]; then 12 | echo 'Pulling latest changes from remote' && \ 13 | git -C "$TABDIR" pull || return 1 14 | 15 | fi 16 | fi 17 | } 18 | 19 | #Remove the lock directory 20 | function remove_lock { 21 | if rmdir $LOCKDIR; then 22 | echo "Finished" 23 | else 24 | echo "Failed to remove lock directory '$LOCKDIR'" 25 | exit 1 26 | fi 27 | } 28 | 29 | if [ -z "$PORT" ]; then 30 | PORT=8000 31 | fi 32 | 33 | pull_lastest || { 34 | echo 'failed to pull lastest' 35 | exit 1 36 | } 37 | 38 | # Acquire the lock and serve page 39 | if mkdir $LOCKDIR; then 40 | #Ensure that if we "grabbed a lock", we release it 41 | #Works for SIGTERM and SIGINT(Ctrl-C) 42 | trap "remove_lock" EXIT 43 | 44 | echo "Acquired lock" 45 | 46 | # Serve tabpage 47 | python -m http.server $PORT -d $TABDIR > /dev/null 2>&1 || \ 48 | echo -e "Failed to start python http server..." 49 | else 50 | echo "Could not create lock directory '$LOCKDIR'" 51 | exit 1 52 | fi 53 | -------------------------------------------------------------------------------- /home/bin/scr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | 4 | : "${SCR_DIR:=$HOME/pics/scr}" 5 | : "${SCR_PREFIX:=scr}" 6 | 7 | scr() { 8 | scr_file="$1" 9 | 10 | shift 11 | case "$XDG_SESSION_TYPE" in 12 | 'x11') 13 | maim -o -u "$scr_file" "$@" 2> /dev/null \ 14 | && ( xclip -selection clipboard -t image/png "$scr_file" & ) 15 | ;; 16 | *) 17 | return 1 18 | ;; 19 | esac 20 | 21 | } 22 | 23 | mkdir -p "$SCR_DIR" 24 | scr_file="$SCR_DIR/${SCR_PREFIX}_$(date +%y%m%d_%H%M%S).png" 25 | 26 | if scr "$scr_file" "$@"; then 27 | notify-send "scr saved as $scr_file" 28 | else 29 | notify-send "failed to take screenshot" 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /home/bin/swal: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shitty wallpaper 4 | # https://github.com/folws 5 | # TODO: update bad script 6 | 7 | PREV_NAME=.fehbg.prev 8 | PROGRAM_NAME=$(basename "$0") 9 | VERBOSE=0 10 | 11 | : "${COLOR_BG:=#06070a}" 12 | : "${ALPHA:=55}" 13 | : "${WALLPAPERS:=$HOME/opt/wallpapers}" 14 | 15 | # colors 16 | CLEAR='\033[0m' 17 | RED='\033[0;31m' 18 | 19 | # ===================== 20 | is_valid_hex() { 21 | case $1 in 22 | *[!0-9A-Fa-f]* | "" ) return 1 ;; 23 | *) 24 | case ${#1} in 25 | 32 | 40 ) return 0 ;; 26 | * ) return 1 ;; 27 | esac 28 | esac 29 | } 30 | 31 | set_prev() { 32 | if [ -z "$1" ]; then 33 | show_help "specify a valid file name for the previous .fehbg: --prev " 34 | fi 35 | 36 | PREV_NAME=$1 37 | } 38 | 39 | set_background() { 40 | local color=$1 41 | if [ ! -z color ]; then 42 | is_valid_hex color 43 | 44 | if [ $? == 1 ]; then 45 | COLOR_BG=$color 46 | return 0 47 | fi 48 | else 49 | color="color" 50 | fi 51 | 52 | show_help "specify a valid background color code: --bg <$color>" 53 | exit 1 54 | } 55 | 56 | find_prev() { 57 | # check ~ ~/.config ~/.config/feh for previous fehbg 58 | dirs=( 59 | $HOME 60 | $HOME/.config 61 | $HOME/.config/feh 62 | ) 63 | 64 | for dir in $dirs; do 65 | local file=$dir/$PREV_NAME 66 | if [ -f "$file" ]; then 67 | echo $(sed -e "s/^'//" -e "s/'$//" <<<"$(cat "$file" | grep feh | cut -d ' ' -f 4)") 68 | rm $file 69 | break 70 | fi 71 | done 72 | } 73 | 74 | show_help() { 75 | if [ -n "$1" ]; then 76 | echo -e "${RED}👉 $1${CLEAR}\n"; 77 | fi 78 | 79 | # Display Help 80 | echo "Shitty wallpaper setter" >&2 81 | echo 82 | echo "Usage: $PROGRAM_NAME [...options] [next|prev|]" 83 | echo "options:" 84 | echo " -b, --bg the pywal bg color" 85 | echo " -a, --alpha the pywal color alpha" 86 | echo " -p, --prev the file name of the prev .fehbg" 87 | echo " -r, --refresh refresh the colors from the curr wal" 88 | echo " -h, --help show this help text" 89 | echo " -v --verbose run in verbose mode." 90 | echo 91 | } 92 | 93 | parse_args() { 94 | NEXT=-1 95 | while [[ "$#" > 0 ]]; do case $1 in 96 | n|next) NEXT=1; break;; 97 | p|prev) NEXT=0; break;; 98 | -b|--bg) set_background $2; shift;; 99 | -a|--ALPHA) ALPHA="$2"; shift;; 100 | -p|--prev) set_prev $2; shift;; 101 | -R|--refresh) [ $NEXT -lt 0 ] && { NEXT=0; PREV_NAME='.fehbg'; } || { show_help "Cannot pass --refresh with next/prev"; exit 1; };; 102 | -q|--quiet) VERBOSE=1;; 103 | -h|--help) show_help; exit 0;; 104 | *) WALLPAPERS="$1"; NEXT=1;; 105 | 106 | esac; shift; done 107 | 108 | if [ $NEXT -lt 0 ]; then 109 | show_help "Please specify a direction or a path to an image." 110 | exit 1 111 | fi 112 | 113 | } 114 | 115 | change_next() { 116 | [ -f ~/.fehbg ] && cp ~/.fehbg ~/$PREV_NAME 117 | 118 | echo "Setting next wallpaper with wal" 119 | wal -a "$ALPHA" -b "$COLOR_BG" --iterative -q -i $WALLPAPERS || echo "Could not call pywal with: '$WALLPAPERS'" 120 | } 121 | 122 | change_prev() { 123 | PREV_WAL=$(find_prev) 124 | 125 | if [ -z $PREV_WAL ]; then 126 | show_help "no prev .fehbg found" 127 | exit 1 128 | fi 129 | 130 | echo "Setting wallpaper to " $PREV_WAL 131 | wal -a "$ALPHA" -b "$COLOR_BG" -i "$PREV_WAL" >/dev/null 2>&1 132 | } 133 | 134 | main() { 135 | parse_args "$@" 136 | 137 | if [ $VERBOSE == 1 ]; then exec >/dev/null 2>&1; fi 138 | 139 | if [ "$NEXT" == 1 ]; then 140 | change_next 141 | else 142 | change_prev 143 | fi 144 | } 145 | 146 | main "$@" 147 | -------------------------------------------------------------------------------- /home/bin/toggle-day-mode: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | -------------------------------------------------------------------------------- /home/config/bat/config: -------------------------------------------------------------------------------- 1 | --color always 2 | --theme gruvbox-dark 3 | --style=changes,snip,numbers 4 | --wrap never 5 | --italic-text=always 6 | --paging=never 7 | -------------------------------------------------------------------------------- /home/config/dunst/launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set colors generated by 'wal' 4 | . "${XDG_CACHE_HOME}/wal/colors.sh" 5 | 6 | dunst \ 7 | -frame_width 0 \ 8 | -lb "${color0}" \ 9 | -nb "${color0}" \ 10 | -cb "${color0}" \ 11 | -bf "${color7}" \ 12 | -cf "${color7}" \ 13 | -nf "${color7}" 14 | -------------------------------------------------------------------------------- /home/config/feh/buttons: -------------------------------------------------------------------------------- 1 | # Unbind existing scroll operations 2 | prev_img 3 | next_img 4 | # Set 5 | zoom_in 4 6 | zoom_out 5 7 | -------------------------------------------------------------------------------- /home/config/fish/completions/ev.fish: -------------------------------------------------------------------------------- 1 | complete -x -c ev -a '(env | cut -d = -f 1)' 2 | -------------------------------------------------------------------------------- /home/config/fish/completions/fisher.fish: -------------------------------------------------------------------------------- 1 | fisher complete 2 | -------------------------------------------------------------------------------- /home/config/fish/completions/mkdir.fish: -------------------------------------------------------------------------------- 1 | 2 | # Checks if we are using GNU tools 3 | if mkdir --version >/dev/null 2>/dev/null 4 | complete -c mkdir -l version -d 'Output version' 5 | complete -c mkdir -s m -l mode -d 'Set file mode (as in chmod)' -x 6 | complete -c mkdir -s p -l parents -d 'Make parent directories as needed' 7 | complete -c mkdir -s v -l verbose -d 'Print a message for each created directory' 8 | complete -c mkdir -l help -d 'Display help' 9 | 10 | else 11 | complete -c mkdir -s m -d 'Set file mode (as in chmod)' -x 12 | complete -c mkdir -s p -d 'Make parent directories as needed' 13 | complete -c mkdir -s v -d 'Print a message for each created directory' 14 | end 15 | 16 | # Checks if SELinux is installed 17 | if command -s sestatus >/dev/null 2>/dev/null 18 | complete -c mkdir -l context -s Z -d 'Set SELinux security context of each created directory to the default type' 19 | end 20 | -------------------------------------------------------------------------------- /home/config/fish/completions/nvim.fish: -------------------------------------------------------------------------------- 1 | complete -c nvim -w vim 2 | -------------------------------------------------------------------------------- /home/config/fish/completions/vim.fish: -------------------------------------------------------------------------------- 1 | # these don't work 2 | #complete vim -a - -d 'The file to edit is read from stdin. Commands are read from stderr, which should be a tty' 3 | 4 | # todo 5 | # +[num] : Position the cursor on line number 6 | # +/{pat} : Position the cursor on the first occurrence of {pat} 7 | # +{command} : Execute Ex command after the first file has been read 8 | complete -c vim -s c -r -d 'Execute Ex command after the first file has been read' 9 | complete -c vim -s S -r -d 'Source file after the first file has been read' 10 | complete -c vim -l cmd -r -d 'Execute Ex command before loading any vimrc' 11 | complete -c vim -s d -r -d 'Use device as terminal (Amiga only)' 12 | complete -c vim -s i -r -d 'Set the viminfo file location' 13 | complete -c vim -s o -r -d 'Open stacked windows for each file' 14 | complete -c vim -s O -r -d 'Open side by side windows for each file' 15 | complete -c vim -s p -r -d 'Open tab pages for each file' 16 | complete -c vim -s q -r -d 'Start in quickFix mode' 17 | complete -c vim -s r -r -d 'Use swap files for recovery' 18 | complete -c vim -s s -r -d 'Source and execute script file' 19 | complete -c vim -s t -r -d 'Set the cursor to tag' 20 | complete -c vim -s T -r -d 'Terminal name' 21 | complete -c vim -s u -r -d 'Use alternative vimrc' 22 | complete -c vim -s U -r -d 'Use alternative vimrc in GUI mode' 23 | complete -c vim -s w -r -d 'Record all typed characters' 24 | complete -c vim -s W -r -d 'Record all typed characters (overwrite file)' 25 | complete -c vim -s A -d 'Start in Arabic mode' 26 | complete -c vim -s b -d 'Start in binary mode' 27 | complete -c vim -s C -d 'Behave mostly like vi' 28 | complete -c vim -s d -d 'Start in diff mode' 29 | complete -c vim -s D -d 'Debugging mode' 30 | complete -c vim -s e -d 'Start in Ex mode' 31 | complete -c vim -s E -d 'Start in improved Ex mode' 32 | complete -c vim -s f -d 'Start in foreground mode' 33 | complete -c vim -s F -d 'Start in Farsi mode' 34 | complete -c vim -s g -d 'Start in GUI mode' 35 | complete -c vim -s h -d 'Print help message and exit' 36 | complete -c vim -s H -d 'Start in Hebrew mode' 37 | complete -c vim -s L -d 'List swap files' 38 | complete -c vim -s l -d 'Start in lisp mode' 39 | complete -c vim -s m -d 'Disable file modification' 40 | complete -c vim -s M -d 'Disallow file modification' 41 | complete -c vim -s N -d 'Reset compatibility mode' 42 | complete -c vim -s n -d 'Don\'t use swap files' 43 | complete -c vim -s R -d 'Read only mode' 44 | complete -c vim -s r -d 'List swap files' 45 | complete -c vim -s s -d 'Start in silent mode' 46 | complete -c vim -s V -d 'Start in verbose mode' 47 | complete -c vim -s v -d 'Start in vi mode' 48 | complete -c vim -s x -d 'Use encryption when writing files' 49 | complete -c vim -s X -d 'Don\'t connect to X server' 50 | complete -c vim -s y -d 'Start in easy mode' 51 | complete -c vim -s Z -d 'Start in restricted mode' 52 | complete -c vim -o nb -d 'Become an editor server for NetBeans' 53 | complete -c vim -l no-fork -d 'Start in foreground mode' 54 | complete -c vim -l echo-wid -d 'Echo the Window ID on stdout (GTK GUI only)' 55 | complete -c vim -l help -d 'Print help message and exit' 56 | complete -c vim -l literal -d 'Do not expand wildcards' 57 | complete -c vim -l noplugin -d 'Skip loading plugins' 58 | complete -c vim -l remote -d 'Edit files on Vim server' 59 | complete -c vim -l remote-expr -d 'Evaluate expr on Vim server' 60 | complete -c vim -l remote-send -d 'Send keys to Vim server' 61 | complete -c vim -l remote-silent -d 'Edit files on Vim server' 62 | complete -c vim -l remote-wait -d 'Edit files on Vim server' 63 | complete -c vim -l remote-wait-silent -d 'Edit files on Vim server' 64 | complete -c vim -l serverlist -d 'List all Vim servers that can be found' 65 | complete -c vim -l servername -d 'Set server name' 66 | complete -c vim -l version -d 'Print version information and exit' 67 | complete -c vim -l socketid -r -d 'Run gvim in another window (GTK GUI only)' 68 | -------------------------------------------------------------------------------- /home/config/fish/conf.d/_abbr.fish: -------------------------------------------------------------------------------- 1 | abbr ss 'sudo systemctl' 2 | abbr se 'sudoedit' 3 | 4 | abbr ex exit 5 | abbr q exit 6 | 7 | abbr j jobs 8 | abbr c clear; abbr cl clear 9 | abbr v nvim; abbr nv nvim 10 | abbr g git 11 | abbr h history 12 | 13 | abbr gs git s 14 | abbr gp git push 15 | abbr gd git diff 16 | abbr gca git commit --amend --no-edit 17 | abbr gb git branch 18 | 19 | abbr cd.. 'cd ..' 20 | abbr .. 'cd ..' 21 | abbr ... 'cd ../..' 22 | abbr .... 'cd ../../..' 23 | abbr ..... 'cd ../../../..' 24 | 25 | abbr home 'cd $HOME' 26 | 27 | abbr cx 'chmod +x' 28 | abbr 'c-x' 'chmod -x' 29 | 30 | if has zzz 31 | abbr zz sudo zzz 32 | abbr Z sudo zzz 33 | abbr zzr sudo zzz -R 34 | abbr ZZZ sudo zzz -Z 35 | end 36 | 37 | if has kitty; alias icat 'kitty +kitten icat --align left'; end 38 | -------------------------------------------------------------------------------- /home/config/fish/conf.d/fzf_user_bindings.fish: -------------------------------------------------------------------------------- 1 | has fzf_key_bindings; and fzf_key_bindings 2 | -------------------------------------------------------------------------------- /home/config/fish/conf.d/pipr.fish: -------------------------------------------------------------------------------- 1 | function run-pipr --description "Runs pipr on current prompt" 2 | set -l pipr_out (mktemp --suffix=fishpipr) 3 | 4 | pipr --out-file $pipr_out --default (commandline -b) 5 | and begin 6 | commandline -r (cat $pipr_out) 7 | commandline -f repaint # reset commandline 8 | end 9 | 10 | rm $pipr_out 11 | end 12 | 13 | # Pipr binding 14 | has pipr; and bind \ca run-pipr 15 | -------------------------------------------------------------------------------- /home/config/fish/conf.d/plugins.fish: -------------------------------------------------------------------------------- 1 | # Automatically install fundle (Warning: dangerous on bad connections) 2 | if not functions -q fundle 3 | eval (curl -sfL https://git.io/fundle-install) 4 | end 5 | 6 | fundle plugin 'fl-w/ortega' 7 | fundle plugin 'jethrokuan/z' 8 | fundle plugin 'oh-my-fish/plugin-await' 9 | fundle plugin 'oh-my-fish/plugin-license' 10 | fundle plugin 'jorgebucaran/nvm.fish' 11 | fundle plugin 'nakulj/auto-venv' 12 | 13 | # auto install fundle plugins 14 | for plugin in (fundle list -s) 15 | if not test -d (__fundle_plugins_dir)/$plugin 16 | fundle install 17 | return 18 | end 19 | end 20 | 21 | fundle init 22 | 23 | not set -q __plugins_nvm_install 24 | and echo 'running _nvm_install' 25 | and _nvm_install 26 | and set -U __plugins_nvm_install 1 27 | -------------------------------------------------------------------------------- /home/config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # fish init script 2 | # @fl-w 3 | 4 | test -f ~/.env; and dotenv -x ~/.env 5 | 6 | if status --is-login 7 | # for now don't source /etc/profile - this is handled by lightdm 8 | # look into this for future; for now this will break ssh login 9 | # (which i don't do often) 10 | source $__fish_config_dir/profile.fish 11 | end 12 | 13 | function add_path -a path 14 | fish_add_path -P $path 15 | end 16 | 17 | # Prepend pyenv bin dir to PATH 18 | add_path $PYENV_ROOT/bin 19 | 20 | # Prepend Go bin dir to PATH 21 | add_path $GOPATH/bin 22 | 23 | # Prepend n directory to PATH 24 | add_path $N_PREFIX/bin 25 | 26 | # Prepend PNPM directory to PATH 27 | add_path $PNPM_HOME 28 | 29 | # Prepend DART pub bin dir to PATH 30 | add_path $HOME/.pub-cache/bin 31 | 32 | # Prepend RUST cargo bin dir to PATH 33 | add_path $CARGO_HOME/bin 34 | 35 | # Add private bin to path 36 | add_path $BIN_DIR; add_path ~/.local/bin 37 | 38 | # Prepend android-sdk & emulator to PATH 39 | set -x ANDROID_HOME /opt/android-sdk 40 | and begin 41 | add_path $ANDROID_HOME/tools; 42 | add_path $ANDROID_HOME/emulator 43 | add_path $ANDROID_HOME/platform-tools 44 | add_path $ANDROID_HOME/tools/bin 45 | end 46 | 47 | if status --is-interactive 48 | test -f $conf/sh/aliases; and . $conf/sh/aliases 49 | 50 | # Set FZF to use rg 51 | if has fzf 52 | set -gx FZF_PREVIEW_COMMAND "bat {} || cat {} || tree -a -C {}" 53 | 54 | # Set fzf to use preview in ctrl-t 55 | set -gx FZF_DEFAULT_OPTS --layout=reverse --inline-info 56 | set -gx FZF_CTRL_T_OPTS $FZF_DEFAULT_OPTS \ 57 | --min-height 30 \ 58 | --preview-window down:60% \ 59 | --preview-window noborder 60 | 61 | # set fzf to use ripgrep by default 62 | has rg 63 | and set -gx FZF_DEFAULT_COMMAND rg --files 64 | and set -gx FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND" 2>/dev/null 65 | end 66 | 67 | # replace cat with bat command 68 | has bat; and alias cat bat 69 | 70 | # kitty completion 71 | has kitty; and kitty + complete setup fish | source 72 | 73 | # Set prompt options 74 | set -gx LSCOLORS gxfxbEaEBxxEhEhBaDaCaD 75 | set -q theme_prompt_symbol; or set -g theme_prompt_symbol '🢂' # ► 🢂 76 | 77 | # finally open fish in vim-mode 78 | fish_vi_key_bindings 79 | end 80 | 81 | for file in $__fish_config_dir/config.fish.local $apps/config.fish.local ~/.fish.local 82 | [ -f $file -a -r $file ]; and source $file 83 | end 84 | 85 | has pyenv; 86 | and pyenv init - | source 87 | 88 | has ssh_agent_init 89 | and ssh_agent_init &>/dev/null 90 | 91 | has java 92 | and alias java="java $_SILENT_JAVA_OPTIONS" 93 | -------------------------------------------------------------------------------- /home/config/fish/functions/!!.fish: -------------------------------------------------------------------------------- 1 | function !! --description "run last fish command." 2 | history | head -1 3 | end 4 | -------------------------------------------------------------------------------- /home/config/fish/functions/__fish_command_not_found_handler.fish: -------------------------------------------------------------------------------- 1 | function __fish_command_not_found_handler --on-event fish_command_not_found 2 | # TODO: change this 3 | __fish_default_command_not_found_handler $argv[1] 4 | end 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/auri.fish: -------------------------------------------------------------------------------- 1 | function auri -a pkg --description="Download and install a package from the AUR" 2 | if test -z $pkg 3 | echo "Syntax: auri " 4 | return 1 5 | end 6 | 7 | set -q _CACHE_DIR; or set _CACHE_DIR $HOME/.cache/aur 8 | 9 | mkdir -p $_CACHE_DIR 10 | 11 | if [ -d $_CACHE_DIR/$pkg ] 12 | pushd $_CACHE_DIR/$pkg 13 | git reset HEAD --hard && git pull 14 | else 15 | git clone https://aur.archlinux.org/$pkg.git $_CACHE_DIR/$pkg 16 | pushd $_CACHE_DIR/$pkg 17 | end 18 | 19 | makepkg --clean --install --syncdeps 20 | and popd 21 | end 22 | -------------------------------------------------------------------------------- /home/config/fish/functions/bak.fish: -------------------------------------------------------------------------------- 1 | function bak --argument filename 2 | cp -r $filename $filename.bak 3 | end 4 | 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/bg-func.fish: -------------------------------------------------------------------------------- 1 | function bg-func 2 | fish -c (string join -- ' ' (string escape -- $argv)) & 3 | end 4 | -------------------------------------------------------------------------------- /home/config/fish/functions/bt.fish: -------------------------------------------------------------------------------- 1 | function _bt_devices 2 | set -l uuids (bluetoothctl devices | cut -f2 -d' ') 3 | 4 | for uuid in $uuids 5 | bluetoothctl info $uuid 6 | end |grep -e "Device\|Connected\|Name" 7 | end 8 | 9 | function _bt_reconnect 10 | function __reconnect -a uuid 11 | bluetoothctl info $uuid | grep -qe 'Connected: yes' 12 | and bluetoothctl disconnect $uuid 13 | and bluetoothctl connect $uuid 14 | end 15 | 16 | for uuid in (bluetoothctl devices | cut -f2 -d' ') 17 | echo $uuid 18 | __reconnect $uuid & 19 | end 20 | end 21 | 22 | 23 | function _bt_connect 24 | if test (count $argv) -eq 0 25 | set -l dev (bluetoothctl devices | cut -f2 -d' ') 26 | if ! test (count $dev) -eq 0 27 | _bt_connect $dev 28 | end 29 | else 30 | for uuid in $argv 31 | bluetoothctl connect $uuid & 32 | end 33 | wait 34 | end 35 | end 36 | 37 | function bt --wraps=bluetoothctl 38 | switch $argv[1] 39 | case 'con*' 40 | _bt_connect 41 | case 'rec*' 42 | _bt_reconnect 43 | case 'dev*' 44 | _bt_devices 45 | case '*' 46 | bluetoothctl $argv 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /home/config/fish/functions/coln.fish: -------------------------------------------------------------------------------- 1 | function coln --description 'Splits its input on whitespace and prints the column indicated.' 2 | while read -l input 3 | echo $input | awk '{print $'$argv[1]'}' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /home/config/fish/functions/conf.fish: -------------------------------------------------------------------------------- 1 | function conf -d "open directory in config home with editor" -a name 2 | begin 3 | set -q name 4 | and echo $conf/$name 5 | or echo $conf/*/ | string split ' /' | fzf -m $FZF_CTRL_T_OPTS 6 | end | xargs -I % $EDITOR % 7 | end 8 | -------------------------------------------------------------------------------- /home/config/fish/functions/dotenv.fish: -------------------------------------------------------------------------------- 1 | function dotenv --description 'Load environment variables from env file' 2 | argparse 'v/verbose' 'x/export' 'q/quiet' -- $argv 3 | 4 | set -q argv[1]; or set -a argv ".env" 5 | 6 | for envfile in $argv 7 | if not test -r $envfile 8 | set -q _flag_quiet 9 | and echo "Error: cannot read $envfile" 1>&2 10 | return 1 11 | else 12 | for line in (command cat $envfile) 13 | if test (echo "$line" | sed -E 's/^[[:space:]]*(.).+$/\\1/g') != "#" 14 | set keyvalue (echo $line | string split -m1 =) 15 | if not test -z $keyvalue[1] 16 | # print key is verbose flag is present 17 | set -q _flag_verbose; and echo $keyvalue[1] 18 | # declare parsed keyvalue pair 19 | eval set -g $_flag_x $keyvalue[1] $keyvalue[2] 20 | end 21 | end 22 | end 23 | end 24 | end 25 | end 26 | 27 | function __auto_source_dotenv --on-variable PWD --description 'Source .env file on directory change' 28 | status --is-command-substitution; and return 29 | dotenv -x 30 | end 31 | -------------------------------------------------------------------------------- /home/config/fish/functions/dots.fish: -------------------------------------------------------------------------------- 1 | function dots --description "Open a rofi menu if all dots in ~/.dotfiles" 2 | set -l dothome ~/opt/dotfiles 3 | for d in $dothome/home/*/*/ $dothome/root/*/*/ 4 | echo $d 5 | end \ 6 | | fzf -m --preview="$FZF_PREVIEW_COMMAND 2> /dev/null" --preview-window noborder --reverse --preview-window=right:50% | xargs -I % $EDITOR % 7 | end 8 | -------------------------------------------------------------------------------- /home/config/fish/functions/exit.fish: -------------------------------------------------------------------------------- 1 | function exit 2 | # jobs -q; and disown (jobs -p) 3 | builtin exit 4 | end 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/fish_add_path.fish: -------------------------------------------------------------------------------- 1 | # Defined in /usr/share/fish/functions/fish_add_path.fish @ line 1 2 | function fish_add_path --description 'Add paths to the PATH' 3 | # This is meant to be the easy one-stop shop to adding stuff to $PATH. 4 | # By default it'll prepend the given paths to a universal $fish_user_paths, excluding the already-included ones. 5 | # 6 | # That means it can be executed once in an interactive session, or stuffed in config.fish, 7 | # and it will do The Right Thing. 8 | # 9 | # The options: 10 | # --prepend or --append to select whether to put the new paths first or last 11 | # --global or --universal to decide whether to use a universal or global fish_user_paths 12 | # --path to set $PATH instead 13 | # --move to move existing entries instead of ignoring them 14 | # --verbose to print the set-command used 15 | # --dry-run to print the set-command without running it 16 | # We do not allow setting $PATH universally. 17 | # 18 | # It defaults to keeping $fish_user_paths or creating a universal, prepending and ignoring existing entries. 19 | argparse -x g,U -x P,U -x a,p g/global U/universal P/path p/prepend a/append h/help m/move v/verbose n/dry-run -- $argv 20 | or return 21 | 22 | if set -q _flag_help 23 | __fish_print_help fish_add_path 24 | return 0 25 | end 26 | 27 | set -l scope $_flag_global $_flag_universal 28 | if not set -q scope[1]; and not set -q fish_user_paths 29 | set scope -U 30 | end 31 | 32 | set -l var fish_user_paths 33 | set -q _flag_path 34 | and set var PATH 35 | # $PATH should be global 36 | and set scope -g 37 | set -l mode $_flag_prepend $_flag_append 38 | set -q mode[1]; or set mode -p 39 | 40 | # To keep the order of our arguments, go through and save the ones we want to keep. 41 | set -l newpaths 42 | set -l indexes 43 | for path in $argv 44 | # Realpath allows us to canonicalize the path, which is needed for deduplication. 45 | # We could add a non-canonical version of the given path if no duplicate exists, but tbh that's a recipe for disaster. 46 | 47 | # realpath complains if a parent directory does not exist, so we silence stderr. 48 | set -l p (builtin realpath -s -- $path 2>/dev/null) 49 | 50 | # Ignore non-existing paths 51 | test -d "$p"; or continue 52 | 53 | if set -l ind (contains -i -- $p $$var) 54 | # In move-mode, we remove it from its current position and add it back. 55 | if set -q _flag_move 56 | set -a indexes $ind 57 | set -a newpaths $p 58 | end 59 | else 60 | # Without move, we only add it if it's not in. 61 | set -a newpaths $p 62 | end 63 | end 64 | 65 | # Ensure the variable is only set once, by constructing a new variable before. 66 | # This is to stop any handlers or anything from firing more than once. 67 | set -l newvar $$var 68 | if set -q _flag_move; and set -q indexes[1] 69 | # We remove in one step, so the indexes don't move. 70 | set -e newvar["$indexes"] 71 | end 72 | set $mode newvar $newpaths 73 | 74 | # Finally, only set if there is anything *to* set. 75 | # This saves us from setting, especially in the common case of someone putting this in config.fish 76 | # to ensure a path is in $PATH. 77 | if set -q newpaths[1]; or set -q indexes[1] 78 | if set -q _flag_verbose; or set -q _flag_n 79 | # The escape helps make it unambiguous - so you see whether an argument includes a space or something. 80 | echo (string escape -- set $scope $var $newvar) 81 | end 82 | 83 | not set -q _flag_n 84 | and set $scope $var $newvar 85 | return 0 86 | else 87 | return 1 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /home/config/fish/functions/fish_mode_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_mode_prompt --description 'Display the mode for the prompt' 2 | # Do nothing if not in vi mode 3 | if test "$fish_key_bindings" = fish_vi_key_bindings 4 | or test "$fish_key_bindings" = fish_hybrid_key_bindings 5 | switch $fish_bind_mode 6 | case default 7 | set_color --bold red 8 | echo 'N' 9 | case insert 10 | set_color --bold green 11 | echo 'I' 12 | case replace_one 13 | set_color --bold green 14 | echo 'R' 15 | case replace 16 | set_color --bold cyan 17 | echo 'R' 18 | case visual 19 | set_color --bold magenta 20 | echo 'V' 21 | end 22 | set_color normal 23 | echo -n ' ' 24 | end 25 | end 26 | 27 | -------------------------------------------------------------------------------- /home/config/fish/functions/ga.fish: -------------------------------------------------------------------------------- 1 | function ga --description 'Like git add, but defaults to . if no arguments given, rather than erroring.' 2 | if [ -z "$argv" ] 3 | git add . 4 | else 5 | git add $argv 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /home/config/fish/functions/gac.fish: -------------------------------------------------------------------------------- 1 | function gac --description 'git commit -am' 2 | git add . 3 | gc $argv 4 | end 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/gc.fish: -------------------------------------------------------------------------------- 1 | function gc --description 'git commit -m without the need to quote commit message.\nIf no commit message is given then commit message will be chosen from (whatthecommit)' 2 | if [ -z "$argv" ] 3 | if test (git diff --name-only --diff-filter=A --cached | wc -l | tr -d ' ') = 1 4 | git commit -m "Add "(git diff --name-only --diff-filter=A --cached) 5 | else if test (git diff --name-only --diff-filter=D --cached | wc -l | tr -d ' ') = 1 6 | git commit -m "Delete "(git diff --name-only --diff-filter=D --cached) 7 | else if test (git diff --name-only --cached --diff-filter=RM | wc -l | tr -d ' ') = 1 8 | git commit -m "Update "(git diff --name-only --cached --diff-filter=RM) 9 | else if not git diff --cached --exit-code --quiet 10 | git commit -m (commit-msg) 11 | else 12 | echo "Nothing staged" 13 | end 14 | else if [ "$argv" = - ] 15 | echo 'git checkout -' 16 | git checkout - 17 | else 18 | # if nothing is staged, then ammend commit 19 | git commit -m "$argv" (git diff --cached --exit-code --quiet && echo --amend) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /home/config/fish/functions/gcr.fish: -------------------------------------------------------------------------------- 1 | function gcr 2 | set ref (git current | cut -d / -f 2 | tr '[:lower:]' '[:upper:]') 3 | git commit -m "[$ref] $argv" 4 | end 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/getopts.fish: -------------------------------------------------------------------------------- 1 | set -g getopts_version 1.0.0 2 | 3 | function getopts -d "CLI options parser" 4 | if not set -q argv[1] 5 | return 1 6 | end 7 | printf "%s\n" $argv | command awk ' 8 | { argv[n++] = $0 } 9 | END { 10 | for (i = 0; i < n; i++) { 11 | a = argv[i] 12 | if (a == "-" || a !~ /^-/) print "_", a 13 | else if (a == "--") while (++i < n) print "_", argv[i] 14 | else if (a ~ /^--/) 15 | print (m = index(a, "=")) ? substr(a, 3, m - 3) : substr(a, 3), 16 | m ? substr(a, m + 1) : (n == i + 1 || argv[i + 1] ~ /^-/ ? "true" : argv[++i]) 17 | else { 18 | v = substr(a, (m = match(substr(a, 3), /$|[!-@[-`{-~]|[[:space:]]/) + 2)) 19 | for (j = 2; j < m; j++) 20 | print substr(a, j, 1), 21 | (j + 1 < m ? "true": v == "" ? \ 22 | n == i + 1 || argv[i + 1] ~ /^-/ ? "true" : argv[++i] : v) 23 | } 24 | } 25 | } 26 | ' 27 | end 28 | -------------------------------------------------------------------------------- /home/config/fish/functions/has.fish: -------------------------------------------------------------------------------- 1 | function has -a program --description "returns true if arg is in path" 2 | type "$program" &>/dev/null 3 | end 4 | -------------------------------------------------------------------------------- /home/config/fish/functions/kheme.fish: -------------------------------------------------------------------------------- 1 | function kheme -a theme --description "set kitty theme" 2 | if test -z $theme 3 | if ! test -d $conf/kitty/themes 4 | echo "$conf/kitty/themes does not exist" 5 | return 1 6 | end 7 | pushd $conf/kitty/themes 8 | if ! fzf --preview 'head -n 40 {} && kitty @ set-colors -a -c {}' 9 | kitty @ set-colors --reset 10 | end 11 | popd 12 | else 13 | kitty @ set-colors -a -c $conf/kitty/themes/$theme.conf 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /home/config/fish/functions/mc.fish: -------------------------------------------------------------------------------- 1 | function mc --desc 'Make a directory and cd into it.' 2 | mkdir $argv 3 | cd $argv 4 | end 5 | -------------------------------------------------------------------------------- /home/config/fish/functions/new.fish: -------------------------------------------------------------------------------- 1 | function new --argument project --argument desc --description "Create a new directory of the project name, enter it, initialize git, and create a git repo." 2 | src 3 | if test -d $project 4 | echo "Error: $project is already a project name" 1>&2 5 | else 6 | mc $project 7 | git init 8 | hub create -d (test -n "$desc"; and echo $desc; or echo (basename (pwd))) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /home/config/fish/functions/pfetch.fish: -------------------------------------------------------------------------------- 1 | function pfetch --description 'Run pfetch with predefined args' 2 | set -l user $USER 3 | set -l PF_INFO "ascii title os kernel pkgs shell wm" 4 | set -l infinity false 5 | set -l clear false 6 | 7 | getopts $argv | while read -l key val 8 | set --erase argv[1] 9 | switch $key 10 | case u user 11 | set user $val 12 | case c clear 13 | set clear true 14 | case i infinite 15 | set infinity true 16 | case p pallete 17 | set PF_INFO "$PF_INFO pallete" 18 | end 19 | end 20 | if $clear 21 | clear 22 | end 23 | USER=$user PF_INFO=$PF_INFO command pfetch 24 | and $infinity; and sleep infinity 25 | 26 | return 0; 27 | end 28 | -------------------------------------------------------------------------------- /home/config/fish/functions/print_fish_colors.fish: -------------------------------------------------------------------------------- 1 | function print_fish_colors --description 'Shows the various fish colors being used' 2 | set -l clr_list (set -n | grep fish | grep color | grep -v __) 3 | if test -n "$clr_list" 4 | set -l bclr (set_color normal) 5 | set -l bold (set_color --bold) 6 | printf "\n| %-38s | %-38s |\n" Variable Definition 7 | echo '|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|' 8 | for var in $clr_list 9 | set -l def $$var 10 | set -l clr (set_color $def ^/dev/null) 11 | or begin 12 | printf "| %-38s | %s%-38s$bclr |\n" "$var" (set_color --bold white --background=red) "$def" 13 | continue 14 | end 15 | printf "| $clr%-38s$bclr | $bold%-38s$bclr |\n" "$var" "$def" 16 | end 17 | echo '|________________________________________|________________________________________|'\n 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /home/config/fish/functions/qemu-run.fish: -------------------------------------------------------------------------------- 1 | function find_image_path --argument image 2 | set -l dirs (pwd) /var/lib/libvirt/images/ $HOME/images/ $HOME/vms/ 3 | for dir in $dirs 4 | for ext in "" ".raw" ".qcow2" ".qcow" 5 | set --local file $dir$image$ext 6 | if test -f $file; printf $file; return; end 7 | end 8 | end 9 | end 10 | 11 | function qemu-run --argument image 12 | # find image file 13 | set --local file (find_image_path $image) 14 | 15 | if ! test -n "$file" 16 | echo "no image file found for $image" 17 | return 1 18 | end 19 | 20 | set format (split-file-ext $file | coln 2) 21 | 22 | set --local cmd qemu-system-x86_64 -enable-kvm -m 4096M \ 23 | -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd \ 24 | -cdrom $HOME/vms/imgs/archlinux.iso -boot d \ 25 | -drive file=$file,format=$format 26 | # -soundhw hda \ 27 | echo $file 28 | 29 | test -w "$file"; or echo "[*] running as sudo"; set cmd sudo $cmd 30 | command $cmd 31 | end 32 | -------------------------------------------------------------------------------- /home/config/fish/functions/restore.fish: -------------------------------------------------------------------------------- 1 | function rbak --argument file --description 'Rename file.bak to file.' 2 | mv $file (echo $file | sed s/.bak//) 3 | end 4 | -------------------------------------------------------------------------------- /home/config/fish/functions/split-file-ext.fish: -------------------------------------------------------------------------------- 1 | function split-file-ext --description 'split extension and name given a file name/path' --argument file 2 | set file (basename $file) 3 | set --local ext (echo $file | awk -F. '{print $NF}') 4 | set --local name (echo $file | awk -F. '{print $1}') 5 | 6 | echo "$name $ext" 7 | end 8 | -------------------------------------------------------------------------------- /home/config/fish/functions/src.fish: -------------------------------------------------------------------------------- 1 | function src 2 | cd ~/src 3 | end 4 | -------------------------------------------------------------------------------- /home/config/fish/functions/ssh_agent_init.fish: -------------------------------------------------------------------------------- 1 | function sshagent_findsockets 2 | find /tmp -uid (id -u) -type s -name agent.\* 2>/dev/null 3 | end 4 | 5 | function sshagent_testsocket 6 | if [ ! -x (command which ssh-add) ] ; 7 | echo "ssh-add is not available; agent testing aborted" 8 | return 1 9 | end 10 | 11 | if [ X"$argv[1]" != X ] ; 12 | set -xg SSH_AUTH_SOCK $argv[1] 13 | end 14 | 15 | if [ X"$SSH_AUTH_SOCK" = X ] 16 | return 2 17 | end 18 | 19 | if [ -S $SSH_AUTH_SOCK ] ; 20 | ssh-add -l > /dev/null 21 | if [ $status = 2 ] ; 22 | echo "Socket $SSH_AUTH_SOCK is dead! Deleting!" 23 | rm -f $SSH_AUTH_SOCK 24 | return 4 25 | else ; 26 | echo "Found ssh-agent $SSH_AUTH_SOCK" 27 | return 0 28 | end 29 | else ; 30 | echo "$SSH_AUTH_SOCK is not a socket!" 31 | return 3 32 | end 33 | end 34 | 35 | 36 | function ssh_agent_init 37 | # ssh agent sockets can be attached to a ssh daemon process or an 38 | # ssh-agent process. 39 | 40 | set -l AGENTFOUND 0 41 | 42 | # Attempt to find and use the ssh-agent in the current environment 43 | if sshagent_testsocket ; 44 | set AGENTFOUND 1 45 | end 46 | 47 | # If there is no agent in the environment, search /tmp for 48 | # possible agents to reuse before starting a fresh ssh-agent 49 | # process. 50 | if [ $AGENTFOUND = 0 ] ; 51 | for agentsocket in (sshagent_findsockets) 52 | if [ $AGENTFOUND != 0 ] ; 53 | break 54 | end 55 | if sshagent_testsocket $agentsocket ; 56 | set AGENTFOUND 1 57 | end 58 | 59 | end 60 | end 61 | 62 | # If at this point we still haven't located an agent, it's time to 63 | # start a new one 64 | if [ $AGENTFOUND = 0 ] ; 65 | echo need to start a new agent 66 | eval (ssh-agent -c -t 1h) 67 | end 68 | 69 | # Finally, show what keys are currently in the agent 70 | ssh-add -l 71 | end 72 | -------------------------------------------------------------------------------- /home/config/fish/functions/sv.fish: -------------------------------------------------------------------------------- 1 | function _run_cmd 2 | if [ "$UID" = 0 ] 3 | command $argv 4 | else 5 | eval "sudo $argv" 6 | end 7 | end 8 | 9 | function sv --description 'wrapper function for sv to add (dis)/enable subcommand' 10 | if test (count $argv) -gt 0 11 | set -l service "$argv[2]" 12 | switch "$argv[1]" 13 | case 'list' 14 | if command -q rsm 15 | _run_cmd rsm 16 | else 17 | echo "sv-list: you need to install 'rsm' first" 18 | end 19 | case 'enable' 20 | if test -z $service 21 | echo -e "usage: sv enable service ..." 22 | else 23 | if [ -d /etc/runit/sv/$service ] 24 | [ ! -L "/run/runit/service/$service" ] 25 | and _run_cmd ln -s /etc/runit/sv/$service /run/runit/service 26 | 27 | echo "sv-enable: symlinked /etc/runit/sv/$service -> /run/runit/service" 28 | echo " start the service with 'sv start $service'" 29 | else 30 | echo "sv-enable: service not found in /etc/runit/sv: $service" 31 | end 32 | end 33 | case 'disable' 34 | if test -z $service 35 | echo -e "usage: sv disable service ..." 36 | else 37 | if [ -L "/run/runit/service/$service" ] 38 | and _run_cmd rm /run/runit/service/$service 39 | 40 | echo "sv-disable: removed symlink /run/runit/service/$service" 41 | echo " stop the service with 'sv stop $service'" 42 | else 43 | echo "sv-disable: service not found in /run/runit/service: $service" 44 | end 45 | end 46 | case '*' 47 | _run_cmd sv $argv[1..-1] 48 | end 49 | else 50 | command sv 51 | end 52 | 53 | end 54 | -------------------------------------------------------------------------------- /home/config/fish/functions/test: -------------------------------------------------------------------------------- 1 | cat <(python -c 'print "A"*7 + "\0" + "A"*8 + "A"*4') - | ./a.out 2 | -------------------------------------------------------------------------------- /home/config/fish/functions/utils.fish: -------------------------------------------------------------------------------- 1 | function lsd -d 'List only directories (in the current dir)' 2 | ls -d */ | sed -Ee 's,/+$,,' 3 | end 4 | 5 | function ls --description 'List contents of directory' 6 | ls -G $argv 7 | end 8 | 9 | function timestamp 10 | python -c 'import time; print(int(time.time()))' 11 | end 12 | 13 | function serve 14 | if test (count $argv) -ge 1 15 | if python -c 'import sys; sys.exit(sys.version_info[0] != 3)' 16 | /bin/sh -c "(cd $argv[1] && python -m http.server)" 17 | else 18 | /bin/sh -c "(cd $argv[1] && python -m SimpleHTTPServer)" 19 | end 20 | else 21 | python2 -m SimpleHTTPServer 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /home/config/fish/functions/void.fish: -------------------------------------------------------------------------------- 1 | function void --description 'scream into the void' 2 | set -q argv[1] 3 | or return 4 | 5 | command $argv &>/dev/null 6 | end 7 | -------------------------------------------------------------------------------- /home/config/fish/functions/wexec.fish: -------------------------------------------------------------------------------- 1 | function wexec --description "use inotifywait to watch input files and exec command" 2 | inotifywait -q -m --event close_write --format '%w' $argv[1..-2] | 3 | while read -l filename 4 | printf 'read $filename' 5 | eval (string replace '{file}' '$filename' $argv[-1]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /home/config/fish/profile.fish: -------------------------------------------------------------------------------- 1 | set -q conf; or set -gx conf $HOME/etc 2 | set -q data; or set -gx data $HOME/usr 3 | set -q cache; or set -gx cache $HOME/usr/cache 4 | set -q apps; or set -gx apps $HOME/opt 5 | 6 | # Set XDG directories to custom dirs 7 | set -x XDG_CONFIG_HOME $conf 8 | set -x XDG_DATA_HOME $data 9 | set -x XDG_CACHE_HOME $cache 10 | 11 | # Set env vars for other locations 12 | set -q SCR_DIR; or set -x SCR_DIR $HOME/media/scr 13 | set -q BIN_DIR; or set -x BIN_DIR $HOME/bin 14 | 15 | 16 | function move_sym -a from -a to 17 | if [ -d "$from" -a ! -L "$from" ] 18 | echo "move symlink $from --> $to" 19 | mkdir -p $to || exit 1 20 | 21 | has rsync 22 | and yes | rsync --update --progress --recursive $from/{.,}* $to/ 23 | or cp -fru $from/{.,}* $to/ 24 | and rm -r $from 25 | and ln -sf $to $from 26 | end 27 | end 28 | 29 | move_sym "$HOME/.config" "$conf" 30 | move_sym "$HOME/.local/share" "$data" 31 | move_sym "$HOME/.cache" "$cache" 32 | move_sym "$HOME/.mozilla" "$apps/mozilla" 33 | move_sym "$HOME/.local" "$data/local" 34 | # move_sym "$HOME/Downloads" "$XDG_DOWNLOAD_DIR" 35 | 36 | function default -a name 37 | for def in $argv[2..-1] 38 | if has $def 39 | set -gx $name $def 40 | return 41 | end 42 | end 43 | end 44 | 45 | # set default editor 46 | default EDITOR /usr/bin/nvim /usr/bin/vim /usr/bin/vi /usr/bin/nano 47 | 48 | # set default browser (i switch between browsers on diff machines) 49 | default BROWSER firefox{-developer-edition,} brave-browser chromium 50 | 51 | 52 | set -gx PLATFORM (uname | string lower) 53 | 54 | # Declutter $HOME (https://wiki.archlinux.org/title/XDG_Base_Directory) 55 | set -gx N_PREFIX "$apps/tj-n" 56 | set -gx CARGO_HOME "$apps/cargo" 57 | set -gx PYENV_ROOT "$apps/pyenv" 58 | set -gx NVM_DIR "$apps/nvm" 59 | set -gx GNUPGHOME "$apps/gpg" 60 | set -gx RUSTUP_HOME "$cache/rustup" 61 | set -gx GOPATH "$cache/go" 62 | set -gx TEXMFHOME "$data/texmf/" 63 | set -gx WEECHAT_HOME "$conf/weechat" 64 | set -gx RIPGREP_CONFIG_PATH "$conf/rg/ripgreprc" 65 | set -gx SQLITE_HISTORY "$cache/sqlite_history" 66 | set -gx USERXSESSION "$conf/x/xsession" 67 | set -gx PASSWORD_STORE_DIR "$data/pass" 68 | set -gx USERXSESSIONRC "$conf/x/xsessionrc" 69 | set -gx VSCODE_PORTABLE "$data"/vscode 70 | set -gx ERRFILE "$cache/xsession-errors" 71 | set -gx GTK2_RC_FILES "$conf/gtk-2.0/gtkrc-2.0" 72 | set -gx _FASD_DATA "$cache/fasd" 73 | set -gx LESSHISTFILE "$cache/_lessht" 74 | set -gx HISTFILE "$cache/bash_history" 75 | set -gx PNPM_HOME "/home/fl-w/usr/pnpm" 76 | set -gx NPM_CONFIG_USERCONFIG "$conf/npm/npmrc" 77 | set -gx USER_SVDIR "$data/runit/runsvdir/" 78 | set -gx USER_FLDIR "$data/runit/sv/" 79 | set -gx KUBECONFIG "$conf/kube" 80 | set -gx KUBECACHEDIR "$cache/kube" 81 | set -gx MINIKUBE_HOME "$data/minikube" 82 | # Move java clutter 83 | set -gx _SILENT_JAVA_OPTIONS "-Djava.util.prefs.userRoot=$conf/java" 84 | set -gx MAVEN_CONFIG "--global-settings $conf/maven/settings.xml" 85 | set -gx ANDROID_SDK_HOME "$data/android" 86 | set -gx ANDROID_PREFS_ROOT "$data/android" 87 | set -gx GRADLE_USER_HOME "$data/gradle" 88 | 89 | # Add xcursor path to env (avoid ~/.icons) 90 | set -gx XCURSOR_PATH "$data/icons" 91 | 92 | # prevent less from storing history 93 | set -gx LESSHISTFILE /dev/null 94 | 95 | function void 96 | $argv >/dev/null 97 | end 98 | -------------------------------------------------------------------------------- /home/config/flashfocus/flashfocus.yml: -------------------------------------------------------------------------------- 1 | # config file 2 | 3 | # Opacity of window during flash. 4 | flash-opacity: 0.8 5 | 6 | # Windows are restored to this opacity value at the end of a flash. 7 | default-opacity: 1 8 | 9 | # Length of flash in milliseconds. 10 | time: 250 11 | 12 | # If true, flashes are not faded out. This will improve performance but flashes 13 | # won't be smooth. 14 | simple: false 15 | 16 | # Number of animation frames in a flash. 17 | ntimepoints: 10 18 | 19 | # Set this to false if you don't want windows to flash on focus. 20 | flash-on-focus: true 21 | 22 | # Set this to false if you don't want fullscreen windows to flash. 23 | flash-fullscreen: true 24 | 25 | # Whether or not to flash windows if they are the only window on the desktop. 26 | # Possible values: 27 | # 'always': 28 | # Always flash lone windows 29 | # 'never': 30 | # Never flash lone windows 31 | # 'on_open_close': 32 | # Lone windows will be flashed only if a) if they were just opened and b) 33 | # if another window was just closed. 34 | # 'on_switch': 35 | # Lone windows will be flashed only upon switching desktops. 36 | flash-lone-windows: 'on_switch' 37 | 38 | # rules: 39 | # - window-class: kitty 40 | # default-opacity: 0.98 41 | -------------------------------------------------------------------------------- /home/config/git/config: -------------------------------------------------------------------------------- 1 | ; Git configuration (user): ~/etc/git/config 2 | ; @fl-w 3 | 4 | [include] 5 | path = ~/opt/gitconfig.local 6 | [user] 7 | name = fl-w 8 | email = 30976147+fl-w@users.noreply.github.com 9 | signingkey = 1FF0C279CA45EAE3 10 | [commit] 11 | gpgsign = true 12 | [init] 13 | defaultBranch = main 14 | 15 | [core] 16 | editor = nvim 17 | autocrlf = input 18 | pager = delta 19 | [color] 20 | ui = auto 21 | status = auto 22 | diff = auto 23 | branch = auto 24 | showBranch = auto 25 | interactive = auto 26 | [alias] 27 | a = add 28 | c = commit 29 | ch = checkout 30 | s = status -sb 31 | mt = mergetool 32 | undo = reset --soft HEAD~ 33 | clear = reset --hard HEAD 34 | reset-up = reset --hard $(git upstream) 35 | unstage = restore --staged 36 | l = log --pretty=format:'[%C(blue)%h%Creset] %C(cyan)%an%Creset %C(yellow)%cr: %C(white)%s' --name-status 37 | lg = log --graph --abbrev-commit --decorate --pretty=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' 38 | la = log --pretty=format:'[%C(blue)%h%Creset] %C(cyan)%an%Creset %C(yellow)%ar%Creset: %C(white)%s' --stat 39 | ll = log --reverse --pretty=format:'%C(blue)%h%Creset %C(red)%G?%Creset %C(normal)%s %C(yellow)(%cr) %C(cyan)%an%Creset - %C(magenta)%gd' 40 | squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" 41 | conflicts = diff --name-only --diff-filter=U 42 | [delta] 43 | features = line-numbers hope 44 | syntax-theme = gruvbox-dark 45 | [delta "fl-w"] 46 | commit-decoration-style = bold box ul "#34fd50" 47 | dark = true 48 | file-decoration-style = none 49 | file-style = omit 50 | hunk-header-decoration-style = "#00b494" box ul 51 | hunk-header-file-style = "#999999" 52 | hunk-header-line-number-style = bold "#03a4ff" 53 | hunk-header-style = file syntax 54 | line-numbers = true 55 | line-numbers-left-style = black 56 | line-numbers-minus-style = "#B10036" 57 | line-numbers-plus-style = "#03a4ff" 58 | line-numbers-right-style = black 59 | line-numbers-zero-style = "#999999" 60 | minus-emph-style = normal "#de004e" 61 | minus-style = normal "#990017" 62 | plus-emph-style = syntax "#03a4ff" 63 | plus-style = syntax "#450eff" 64 | [interactive] 65 | ; diffFilter = delta --color-only 66 | [format] 67 | pretty = format:%C(yellow)%h %Cblue%>(15)%ad %Cgreen%<(15)%aN%Cred%d %Creset%s 68 | [pull] 69 | rebase = false 70 | [push] 71 | default = simple 72 | followTags = true 73 | autoSetupRemote = true 74 | [diff] 75 | colorMoved = default 76 | [fetch] 77 | prune = true 78 | [rebase] 79 | autoStash = true 80 | [status] 81 | submoduleSummary = true 82 | [advice] 83 | addEmptyPathspec = false 84 | [merge] 85 | tool = kitty 86 | [mergetool] 87 | prompt = true 88 | keepBackup = true 89 | [mergetool "vimdiff"] 90 | cmd = nvim -d $BASE $LOCAL $REMOTE -c '$wincmd w' -c 'wincmd J' 91 | [mergetool "kitty"] 92 | cmd = kitty +kitten diff $LOCAL $REMOTE 93 | 94 | 95 | ; vim: ft=.gitconfig sw=2 tw=0 96 | -------------------------------------------------------------------------------- /home/config/gtk-3.0/.gitignore: -------------------------------------------------------------------------------- 1 | bookmarks 2 | -------------------------------------------------------------------------------- /home/config/gtk-3.0/bookmarks: -------------------------------------------------------------------------------- 1 | file:///data 2 | file:///home/fl-w/src 3 | -------------------------------------------------------------------------------- /home/config/gtk-3.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-theme-name=Layan-dark-solid 3 | gtk-font-name=JetBrainsMono Nerd Font Mono Medium 9 4 | gtk-icon-theme-name=Kora 5 | gtk-application-prefer-dark-theme=true 6 | gtk-cursor-theme-name=DeppinDark-cursors 7 | gtk-cursor-theme-size=0 8 | gtk-enable-animations=1 9 | gtk-enable-event-sounds=1 10 | gtk-toolbar-style=GTK_TOOLBAR_BOTH 11 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR 12 | gtk-button-images=1 13 | gtk-menu-images=1 14 | gtk-enable-event-sounds=1 15 | gtk-enable-input-feedback-sounds=1 16 | gtk-xft-antialias=1 17 | gtk-xft-hinting=1 18 | gtk-xft-hintstyle=hintmedium 19 | -------------------------------------------------------------------------------- /home/config/i3/scripts/i3-alternate-layout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import getopt 4 | import os 5 | import re 6 | import socket 7 | import subprocess 8 | import sys 9 | 10 | import i3 11 | 12 | 13 | def find_parent(window_id): 14 | """ 15 | Find the parent of a given window id 16 | """ 17 | root_window = i3.get_tree() 18 | result = [None] 19 | 20 | def finder(n, p=None): 21 | if result[0] is not None: 22 | return 23 | 24 | for node in n: 25 | if node["id"] == window_id: 26 | result[0] = p 27 | 28 | return 29 | 30 | if len(node["nodes"]): 31 | finder(node["nodes"], node) 32 | 33 | finder(root_window["nodes"]) 34 | 35 | return result[0] 36 | 37 | 38 | def set_layout(): 39 | """ 40 | Set the layout/split for the currently 41 | focused window to either vertical or 42 | horizontal, depending on its width/height 43 | """ 44 | current_win = i3.filter(nodes=[], focused=True) 45 | 46 | for win in current_win: 47 | parent = find_parent(win["id"]) 48 | 49 | if ( 50 | parent 51 | and "rect" in parent 52 | and parent["layout"] != "tabbed" 53 | and parent["layout"] != "stacked" 54 | ): 55 | height = parent["rect"]["height"] 56 | width = parent["rect"]["width"] 57 | 58 | if height > width: 59 | new_layout = "vertical" 60 | else: 61 | new_layout = "horizontal" 62 | 63 | i3.split(new_layout) 64 | 65 | 66 | def print_help(): 67 | print("Usage: " + sys.argv[0] + " [-p path/to/pid.file]") 68 | print("") 69 | print("Options:") 70 | print( 71 | " -p path/to/pid.file Saves the PID for this program in the filename specified" 72 | ) 73 | print("") 74 | 75 | 76 | def get_lock(process_name): 77 | # Without holding a reference to our socket somewhere it gets garbage 78 | # collected when the function exits 79 | get_lock._lock_socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) 80 | 81 | try: 82 | get_lock._lock_socket.bind("\0" + process_name) 83 | except socket.error: 84 | print("Cannot obtain lock, process already running.") 85 | sys.exit() 86 | 87 | 88 | def main(): 89 | """ 90 | Main function - listen for window focus 91 | changes and call set_layout when focus 92 | changes 93 | """ 94 | opt_list, args = getopt.getopt(sys.argv[1:], "hp:") 95 | pid_file = None 96 | 97 | for opt in opt_list: 98 | if opt[0] == "-h": 99 | print_help() 100 | sys.exit() 101 | 102 | if opt[0] == "-p": 103 | pid_file = opt[1] 104 | 105 | if pid_file: 106 | with open(pid_file, "w") as f: 107 | f.write(str(os.getpid())) 108 | 109 | get_lock(sys.argv[0]) 110 | 111 | process = subprocess.Popen( 112 | ["xprop", "-root", "-spy"], stdout=subprocess.PIPE, stderr=subprocess.PIPE 113 | ) 114 | regex = re.compile(b"^_NET_CLIENT_LIST_STACKING|^_NET_ACTIVE_WINDOW") 115 | 116 | last_line = "" 117 | 118 | while True: 119 | line = process.stdout.readline() 120 | 121 | if line == b"": # X is dead 122 | break 123 | 124 | if line == last_line: 125 | continue 126 | 127 | if regex.match(line): 128 | set_layout() 129 | last_line = line 130 | 131 | process.kill() 132 | sys.exit() 133 | 134 | 135 | if __name__ == "__main__": 136 | main() 137 | -------------------------------------------------------------------------------- /home/config/i3/scripts/i3-swallow.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | #----------------------------------------------- 4 | # used to swallow a terminal window in i3 5 | # 6 | # INSTALL 7 | # Install python 3 and install i3ipc libary 8 | # pip3 install i3ipc 9 | # download this scrript and put it to your i3 config folder and run 10 | 11 | # chmod +x $HOME/.config/i3/i3-swallow.py 12 | # python3 $HOME/.config/i3/i3-swallow.py 13 | # 14 | # You can add this script to your i3 config file. 15 | # exec --no-startup-id python3 $HOME/.config/i3/i3-swallow.py 16 | # reload i3 and try run xclock 17 | #---------------------------------------------------- 18 | 19 | import i3ipc 20 | import subprocess 21 | 22 | swallowDict={} 23 | i3 = i3ipc.Connection() 24 | 25 | 26 | def hideSwallowParent(node, windowId, swallowId): 27 | if(str(node.window) == str(windowId)): 28 | global swallowDict 29 | i3.command('[con_id=%s] focus' % swallowId) 30 | i3.command('[con_id=%s] move to scratchpad' % node.id) 31 | swallowDict[str(swallowId)] = { 32 | "id": node.id, "layout": node.parent.layout} 33 | return True 34 | for node in node.nodes: 35 | if(hideSwallowParent(node, windowId, swallowId)): 36 | return True 37 | return False 38 | 39 | 40 | def getParentNodePid(node): 41 | # get parent of pid because terminal spwan shell(zsh or fish) and then spawn that child process 42 | output = subprocess.getoutput( 43 | "ps -o ppid= -p $(ps -o ppid= -p $(xprop -id %d _NET_WM_PID | cut -d' ' -f3 ))" % (node.window)) 44 | return output 45 | 46 | 47 | def getWindowIdfromPId(pid): 48 | output = subprocess.getoutput("xdotool search -pid %s" % pid) 49 | return output 50 | 51 | 52 | def on_new(self, event): 53 | workspace = i3.get_tree().find_focused().workspace() 54 | # if we can find parent have pid container map to any node in workspace we will hide it 55 | parentContainerPid = getParentNodePid(event.container) 56 | parentContainerWid = getWindowIdfromPId(parentContainerPid) 57 | for item in workspace.nodes: 58 | hideSwallowParent(item, parentContainerWid, event.container.id) 59 | 60 | 61 | 62 | def on_close(self, event): 63 | global swallowDict 64 | swallow = swallowDict.get(str(event.container.id)) 65 | if swallow != None: 66 | window = i3.get_tree().find_by_id(swallow["id"]) 67 | if window != None: 68 | del swallowDict[str(event.container.id)] 69 | event.container.command( 70 | '[con_id=%s] scratchpad show;floating disable;focus' % (window.id)) 71 | if swallow['layout'] == 'splitv': 72 | event.container.command( 73 | '[con_id=%s]split vertical' % (window.id)) 74 | 75 | # Subscribe to events 76 | i3.on("window::new", on_new) 77 | i3.on("window::close",on_close) 78 | i3.main() 79 | -------------------------------------------------------------------------------- /home/config/i3/scripts/move-to-ws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -z "$1" ]]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | CURRENT_WS=$(i3-msg -t get_workspaces \ 9 | | jq '.[] | select(.focused==true).name' \ 10 | | cut -d"\"" -f2) 11 | 12 | [[ "$CURRENT_WS" != "$1" ]] && i3-msg move container to workspace $1 13 | -------------------------------------------------------------------------------- /home/config/i3/scripts/x-close-no-focus: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if [ $# = 0 ]; 4 | then 5 | echo "no window class supplied. aborting..." 6 | exit 1 7 | fi 8 | 9 | # kill previous instances 10 | ps aux | grep -P "${BASH_SOURCE[0]} $1\b" \ 11 | | grep -v $$ | grep -P "sh" \ 12 | | awk -F\ '{print $2}' \ 13 | | xargs -I % kill % 14 | 15 | WINDOW_CLASS=$1 16 | WINDOW_ID= 17 | 18 | xprop -spy -root _NET_ACTIVE_WINDOW \ 19 | | while read -r window 20 | do 21 | ID="$(echo $window | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{ print $NF }')" 22 | CLASS=$(xprop -id $ID | awk '/WM_CLASS/{$1=$2="";print}' | cut -d'"' -f4) 23 | if [ ! -z $WINDOW_ID ]; then 24 | xkill -id $WINDOW_ID 25 | WINDOW_ID= 26 | fi 27 | [ $CLASS = "$WINDOW_CLASS" ] && WINDOW_ID=$ID 28 | done 29 | -------------------------------------------------------------------------------- /home/config/kitty/keys.conf: -------------------------------------------------------------------------------- 1 | # _ _________ ______ 2 | # | |/ | ____\ \ / / ___| 3 | # | ' /| _| \ V /\___ \ 4 | # | . \| |___ | | ___) | 5 | # |_|\_|_____| |_| |____/ 6 | # 7 | # For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html 8 | # For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html 9 | 10 | kitty_mod ctrl+shift 11 | 12 | # window management -- 13 | map kitty_mod+z kitten zoom_toggle.py 14 | map kitty_mod+enter new_window_with_cwd 15 | map kitty_mod+h neighboring_window left 16 | map kitty_mod+j neighboring_window down 17 | map kitty_mod+k neighboring_window up 18 | map kitty_mod+l neighboring_window right 19 | map kitty_mod+[ previous_window 20 | map kitty_mod+] next_window 21 | map kitty_mod+f move_window_forward 22 | map kitty_mod+b move_window_backward 23 | 24 | # tab management -- 25 | map ctrl+alt+enter new_tab 26 | map kitty_mod+q close_tab 27 | map kitty_mod+left previous_tab 28 | map kitty_mod+right next_tab 29 | map kitty_mod+t new_tab 30 | map kitty_mod+/ edit_config_file 31 | map kitty_mod+space next_layout 32 | map kitty_mod+1 first_tab 33 | map kitty_mod+2 second_tab 34 | map kitty_mod+3 third_tab 35 | map kitty_mod+4 fourth_tab 36 | map kitty_mod+5 fifth_tab 37 | map kitty_mod+6 sixth_tab 38 | map kitty_mod+7 seventh_tab 39 | map kitty_mod+8 eighth_tab 40 | map kitty_mod+9 ninth_tab 41 | 42 | # kitten hints -- 43 | map kitty_mod+u kitten hints 44 | # copy url 45 | map kitty_mod+e kitten hints --program @ 46 | # file path 47 | map kitty_mod+o kitten hints --type path --program - 48 | # any line 49 | map kitty_mod+i kitten hints --type line --program - 50 | # copy line 51 | map kitty_mod+y kitten hints --type line --program @ 52 | # copy multiple line 53 | map kitty_mod+alt+y kitten hints --multiple --type line --program @ 54 | 55 | map kitty_mod+. edit_config_file 56 | map kitty_mod+alt+escape kitty_shell window 57 | 58 | # correct terminal key-code for shift+enter 59 | map shift+enter send_text all \x1b[13;2u 60 | map ctrl+enter send_text all \x1b[13;5u 61 | -------------------------------------------------------------------------------- /home/config/kitty/kitty.d/keys.conf: -------------------------------------------------------------------------------- 1 | # _ _________ ______ 2 | # | |/ | ____\ \ / / ___| 3 | # | ' /| _| \ V /\___ \ 4 | # | . \| |___ | | ___) | 5 | # |_|\_|_____| |_| |____/ 6 | # 7 | # For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html 8 | # For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html 9 | 10 | kitty_mod ctrl+shift 11 | 12 | # window management -- 13 | map kitty_mod+z kitten zoom_toggle.py 14 | map kitty_mod+enter new_window_with_cwd 15 | map kitty_mod+h neighboring_window left 16 | map kitty_mod+j neighboring_window down 17 | map kitty_mod+k neighboring_window up 18 | # map kitty_mod+l neighboring_window right 19 | # map kitty_mod+[ previous_window 20 | map kitty_mod+] next_window 21 | map kitty_mod+f move_window_forward 22 | map kitty_mod+b move_window_backward 23 | 24 | # tab management -- 25 | map ctrl+alt+enter new_tab 26 | map kitty_mod+q close_tab 27 | map kitty_mod+{ previous_tab 28 | map kitty_mod+} next_tab 29 | map kitty_mod+t new_tab 30 | map kitty_mod+/ edit_config_file 31 | map kitty_mod+space next_layout 32 | map kitty_mod+1 first_tab 33 | map kitty_mod+2 second_tab 34 | map kitty_mod+3 third_tab 35 | map kitty_mod+4 fourth_tab 36 | map kitty_mod+5 fifth_tab 37 | map kitty_mod+6 sixth_tab 38 | map kitty_mod+7 seventh_tab 39 | map kitty_mod+8 eighth_tab 40 | map kitty_mod+9 ninth_tab 41 | 42 | # kitten hints -- 43 | map kitty_mod+u kitten hints 44 | # copy url 45 | map kitty_mod+e kitten hints --program @ 46 | # file path 47 | map kitty_mod+o kitten hints --type path --program - 48 | # any line 49 | map kitty_mod+i kitten hints --type line --program - 50 | # copy line 51 | map kitty_mod+y kitten hints --type line --program @ 52 | # copy multiple line 53 | map kitty_mod+alt+y kitten hints --multiple --type line --program @ 54 | 55 | map kitty_mod+. edit_config_file 56 | map kitty_mod+alt+escape kitty_shell window 57 | 58 | # correct terminal key-code for shift+enter 59 | map shift+enter send_text all \x1b[13;2u 60 | map ctrl+enter send_text all \x1b[13;5u 61 | -------------------------------------------------------------------------------- /home/config/kitty/themes/ayu.conf: -------------------------------------------------------------------------------- 1 | background #0e1419 2 | foreground #e5e1cf 3 | cursor #f19618 4 | selection_background #243340 5 | color0 #000000 6 | color8 #323232 7 | color1 #ff3333 8 | color9 #ff6565 9 | color2 #b8cc52 10 | color10 #e9fe83 11 | color3 #e6c446 12 | color11 #fff778 13 | color4 #36a3d9 14 | color12 #68d4ff 15 | color5 #f07078 16 | color13 #ffa3aa 17 | color6 #95e5cb 18 | color14 #c7fffc 19 | color7 #ffffff 20 | color15 #ffffff 21 | selection_foreground #0e1419 22 | 23 | -------------------------------------------------------------------------------- /home/config/kitty/themes/dark.conf: -------------------------------------------------------------------------------- 1 | fl-w.conf -------------------------------------------------------------------------------- /home/config/kitty/themes/fl-w.conf: -------------------------------------------------------------------------------- 1 | # dracula theme with custom background color 2 | background #F7F7F8 3 | foreground #8a9199 4 | background #000 5 | background #14151A 6 | background #0F0F0F 7 | background #0F0C14 8 | foreground #f8f8f2 9 | background #090E15 10 | background #04060C 11 | background #0C0E14 12 | background #06070a 13 | background #06090b 14 | # background #F7F7F8 15 | 16 | cursor #f8f8f2 17 | selection_background #44475a 18 | selection_foreground #1e1f28 19 | 20 | # black 21 | color0 #000000 22 | color8 #545454 23 | 24 | # red 25 | color1 #ff5555 26 | color9 #ff5454 27 | 28 | # green 29 | color2 #50fa7b 30 | color10 #50fa7b 31 | 32 | # yellow 33 | color3 #f0fa8b 34 | color11 #f0fa8b 35 | 36 | # blue 37 | color4 #bd92f8 38 | color12 #bd92f8 39 | 40 | # magenta 41 | color5 #ff78c5 42 | color13 #ff78c5 43 | 44 | # cyan 45 | color6 #8ae9fc 46 | color14 #8ae9fc 47 | 48 | # white 49 | color7 #bbbbbb 50 | color15 #ffffff 51 | -------------------------------------------------------------------------------- /home/config/kitty/themes/light.conf: -------------------------------------------------------------------------------- 1 | # Github.conf https://github.com/dexpota/kitty-themes/blob/master/themes/Github.conf 2 | background #ffffff 3 | foreground #3e3e3e 4 | cursor #3f3f3f 5 | selection_background #a9c1e2 6 | color0 #3e3e3e 7 | color8 #666666 8 | color1 #970b16 9 | color9 #de0000 10 | color2 #07962a 11 | color10 #87d5a2 12 | color3 #f7edc7 13 | color11 #f0cf06 14 | color4 #003e8a 15 | color12 #2e6cba 16 | color5 #e94691 17 | color13 #ffa29f 18 | color6 #89d1ec 19 | color14 #1cfafe 20 | color7 #ffffff 21 | color15 #ffffff 22 | selection_foreground #f4f4f4 23 | -------------------------------------------------------------------------------- /home/config/kitty/zoom_toggle.py: -------------------------------------------------------------------------------- 1 | from kittens.tui.handler import result_handler 2 | 3 | @result_handler(no_ui=True) 4 | def handle_result(args, answer, target_window_id, boss): 5 | tab = boss.active_tab 6 | if tab is not None: 7 | if tab.current_layout.name == 'stack': 8 | tab.last_used_layout() 9 | else: 10 | tab.goto_layout('stack') 11 | 12 | def main(args): 13 | pass 14 | -------------------------------------------------------------------------------- /home/config/maven/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | /data/repo/m2 3 | 4 | -------------------------------------------------------------------------------- /home/config/nvim/after/ftplugin/fish.vim: -------------------------------------------------------------------------------- 1 | " https://github.com/dag/vim-fish 2 | 3 | " Set up :make to use fish for syntax checking. 4 | compiler fish 5 | 6 | " Set this to have long lines wrap inside comments. 7 | setlocal textwidth=79 8 | 9 | " Enable folding of block structures in fish. 10 | setlocal foldmethod=expr 11 | -------------------------------------------------------------------------------- /home/config/nvim/after/ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | " markdown ft configuration 2 | " 3 | 4 | set concealcursor=c 5 | set synmaxcol=3000 " For long paragraphs 6 | set nonu nornu 7 | 8 | if exists('g:loaded_ftmarkdown') 9 | finish 10 | endif 11 | 12 | let g:md_auto_compile = 1 13 | let g:md_auto_compile_outdir = "~/.cache/" 14 | let g:loaded_ftmarkdown = 1 15 | 16 | function! CompileMarkdown() 17 | silent execute ":Start! pandoc " . expand("%") . " -o " . g:md_auto_compile_outdir . expand("%:r") . 18 | \ ".pdf --toc --toc-depth=3 --number-sections" 19 | endfunction 20 | 21 | function! InsertMarkdownScreenShot() 22 | let l:scr_dir = expand('%:h') . '/.screenshots' 23 | silent! execute "!mkdir -p " . l:scr_dir 24 | let l:path = system('SCR_DIR=' . l:scr_dir . ' SCR_PREFIX=' . expand('%:t:r') . '_ scr -s') 25 | 26 | if strlen(l:path) != 0 27 | silent! execute "normal! i![" . fnamemodify(l:path, ':t:r') . "](" . fnamemodify(l:path, ':.') . ")\" 28 | endif 29 | endfunction 30 | 31 | augroup markdown_tools 32 | autocmd! BufWritePost *.md if g:md_auto_compile | call CompileMarkdown() | endif 33 | autocmd FileType md,markdown noremap s :call InsertMarkdownScreenShot() 34 | augroup end 35 | 36 | 37 | " vim: sw=2 sts=2 tw=0 fdm=marker 38 | -------------------------------------------------------------------------------- /home/config/nvim/after/ftplugin/vim.vim: -------------------------------------------------------------------------------- 1 | " Use :help command for keyword when pressing `K` in vim file, 2 | " see `:h K` and https://stackoverflow.com/q/15867323/6064933 3 | setl keywordprg=:help 4 | 5 | setl softtabstop=2 6 | setl shiftwidth=2 7 | setl foldmethod=syntax 8 | setl formatoptions-=r | " disable auto insert comment after in insert mode 9 | setl formatoptions-=o | " disable auto insert comment after o or O 10 | 11 | " set only useful autopairs in vim fts 12 | if &runtimepath =~? 'auto-pairs' 13 | let b:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", "`":"`", '<':'>'} 14 | endif 15 | 16 | if !exists('g:which_key_map') 17 | nnoremap .. :source % 18 | endif 19 | 20 | noremap :exec getline('.') 21 | 22 | " vim: sw=2 sts=2 tw=0 fdm=marker 23 | -------------------------------------------------------------------------------- /home/config/nvim/autoload/folws.vim: -------------------------------------------------------------------------------- 1 | 2 | " 3 | " For 'foldtext'. 4 | " 5 | function! folws#foldy() 6 | let linelen = &tw ? &tw : 80 7 | let marker = strpart(&fmr, 0, stridx(&fmr, ',')) . '\d*' 8 | let range = foldclosedend(v:foldstart) - foldclosed(v:foldstart) + 1 9 | 10 | let left = substitute(getline(v:foldstart), marker, '', '') 11 | let leftlen = len(left) 12 | 13 | let right = range . ' [' . v:foldlevel . ']' 14 | let rightlen = len(right) 15 | 16 | let tmp = strpart(left, 0, linelen - rightlen) 17 | let tmplen = len(tmp) 18 | 19 | if leftlen > len(tmp) 20 | let left = strpart(tmp, 0, tmplen - 4) . '... ' 21 | let leftlen = tmplen 22 | endif 23 | 24 | let fill = repeat(' ', linelen - (leftlen + rightlen)) 25 | 26 | return left . fill . right . repeat(' ', 100) 27 | endfunction 28 | 29 | " vim: sw=2 sts=2 tw=0 fdm=marker 30 | 31 | " vim: sw=2 sts=2 tw=0 fdm=marker 32 | -------------------------------------------------------------------------------- /home/config/nvim/autoload/statusline.vim: -------------------------------------------------------------------------------- 1 | " statusline.vim: helper functions for statusline 2 | " 3 | 4 | scriptencoding utf-8 5 | 6 | let s:mode_map = extend(get(g:, 'statusline#mode_map', {}), { 7 | \ 'n': "\ufb26", 8 | \ 'i': "", 9 | \ 'R': '', 10 | \ 't': '~', 11 | \ 'v': 'VISUAL', 'V': 'V-LINE', "\": 'V-BLOCK', 12 | \ 'c': 'COMMAND', 's': 'SELECT', 'S': 'S-LINE', "\": 'S-BLOCK' 13 | \ }) 14 | 15 | let s:ft_map = extend(get(g:, 'statusline#ft_map', {}), { 16 | \ 'unite': 'Unite', 'vimshell': 'VimShell', 17 | \ 'fern': function('fern#get_status_string'), 18 | \ 'vimfiler': function('vimfiler#get_status_string'), 19 | \ }) 20 | 21 | function! statusline#map_mode(mode, str) 22 | let s:mode_map[a:mode] = a:str 23 | endfu 24 | 25 | fun! statusline#map_ft(ft, map) 26 | let s:ft_map[a:ft] = a:map 27 | endf 28 | 29 | fun! s:tjoin(l, ...) 30 | return join(filter(a:l, 'v:val != ""'), get(a:, 1, ' ')) 31 | endf 32 | 33 | function! statusline#mode() 34 | return get(s:mode_map, mode(), '') 35 | endfunction 36 | 37 | function! statusline#paste() 38 | return &paste ? 'PASTE ' : '' 39 | endfunction 40 | 41 | function! statusline#fname() 42 | return expand("%:.") 43 | endfunction 44 | 45 | function! statusline#fname_full_active() 46 | " return '« ' . statusline#fname() . ' »' 47 | return statusline#fname() 48 | endfunction 49 | 50 | function! statusline#fname_full() 51 | return has_key(s:ft_map, &ft) ? type(s:ft_map[&ft]) == 2 ? s:ft_map[&ft]() : s:ft_map[&ft]() : 52 | \ s:tjoin([statusline#fname(), statusline#fname_readonly(), statusline#fname_modified()]) 53 | endfunction 54 | 55 | function! statusline#fname_readonly() 56 | return !&readonly ? '' : get(g:, 'statusline_icon_readonly', '') "  is a good alt 57 | endfunction 58 | 59 | function! statusline#fname_modified() 60 | return !&modified ? '' : get(g:, 'statusline_icon_modified', '') " ⚡is a good alt 61 | endfunction 62 | 63 | function! statusline#ftype() 64 | return get(s:ft_map, &ft, '') 65 | endfunction 66 | 67 | fun! statusline#ft_icon() 68 | return exists('*WebDevIconsGetFileTypeSymbol') && &ft != '' ? WebDevIconsGetFileTypeSymbol() : get(g:, 'statusline_icon_file', '') 69 | endf 70 | 71 | function! statusline#git() 72 | return trim(join([statusline#gitbranch(), statusline#gitstatus()])) 73 | endfunction 74 | 75 | function! statusline#gitbranch() 76 | if !exists('g:loaded_fugitive') 77 | return '' 78 | endif 79 | let branch = fugitive#head() 80 | return branch ==# '' ? branch : branch . ' ' . get(g:, 'statusline_icon_branch', '') 81 | endfunction 82 | 83 | function! statusline#gitstatus() 84 | if !exists('*sy#repo#get_stats()') 85 | return '' 86 | endif 87 | let [a, m, r] = sy#repo#get_stats() 88 | return max([a, m, r]) > 0 ? printf('+%d ~%d -%d', a, m, r) : '' 89 | endfunction 90 | 91 | function! statusline#current_function_tag() 92 | let fn = get(b:, 'vista_nearest_method_or_function', get(b:, 'coc_current_function', '')) 93 | return !empty(fn) ? printf('%s%s', fn, fn =~ '*)' ? '' : '()') : '' 94 | endfunction 95 | 96 | function! statusline#linter() abort 97 | return printf('%s %s', statusline#linter_warning() , statusline#linter_error()) 98 | endfunction 99 | 100 | function! statusline#linter_warning() abort 101 | return printf('%s %s', get(g:, 'statusline#icon#warning', ''), 102 | \ get(get(b:, 'coc_diagnostic_info', {}), 'warning', 0)) 103 | endfunction 104 | 105 | function! statusline#linter_error() abort 106 | " ✘ is a good alt 107 | return printf('%s %s', 108 | \ get(g:, 'statusline#icon#error', ''), 109 | \ get(get(b:, 'coc_diagnostic_info', {}), 'error', 0)) 110 | endfunction 111 | 112 | function! statusline#hlsearch() abort 113 | return !&hlsearch ? '' : ' ' . get(g:, 'statusline_icon_search', '' ) 114 | endfunction 115 | 116 | function! statusline#spell() abort 117 | return !&spell ? '' : ' ' . get(g:, 'statusline_icon_spell', '' ) 118 | endfunction 119 | 120 | function! statusline#markdownpreview() abort 121 | return exists('b:markdownpreview') ? get(g:, 'statusline_icon_markdownpreview', '' . ' ') : '' 122 | endfunction 123 | 124 | " vim: sw=2 sts=2 tw=0 fdm=marker 125 | -------------------------------------------------------------------------------- /home/config/nvim/autoload/utils/color.vim: -------------------------------------------------------------------------------- 1 | " color functions 2 | 3 | fu! utils#color#rgb(color) 4 | let hex = substitute(a:color, '^#', '', '') 5 | let rgb = #{r: 0, g: 0, b: 0} 6 | if len(hex) <= 3 7 | let hex = join(map(split(hex), {_, c -> c .. c}), '') 8 | endif 9 | let rgb.r = str2nr(hex[:1], 16) 10 | let rgb.g = str2nr(hex[2:3], 16) 11 | let rgb.b = str2nr(hex[4:6], 16) 12 | return rgb 13 | endfu 14 | 15 | fu! utils#color#brightness(color) abort 16 | let rgb = utils#color#rgb(a:color) 17 | return ((rgb.r * 299) + (rgb.g * 587) + (rgb.b * 114)) / 1000 18 | endfu 19 | 20 | fu! utils#color#is_dark(color) abort 21 | return utils#color#brightness(a:color) < 128 22 | endfu 23 | 24 | fu! utils#color#is_light(color) abort 25 | return !utils#color#is_dark(a:color) 26 | endfu 27 | 28 | function! utils#color#syn_group() 29 | let l:s = synID(line('.'), col('.'), 1) 30 | return synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') 31 | endfun 32 | 33 | fun! utils#color#copy_hi_group(group, to) 34 | let id = synIDtrans(hlID(a:group)) 35 | for mode in ['cterm', 'gui'] 36 | for g in ['fg', 'bg'] 37 | exe 'let '. mode.g. "= synIDattr(id, '". g."#', '". mode. "')" 38 | exe "let ". mode.g. " = empty(". mode.g. ") ? 'NONE' : ". mode.g 39 | endfor 40 | endfor 41 | exe printf('hi %s ctermfg=%s ctermbg=%s guifg=%s guibg=%s', a:to, ctermbg, ctermfg, guifg, guibg) 42 | endf 43 | 44 | function! utils#color#has_colorscheme(name) abort 45 | " check if a colorscheme exists 46 | " inspired by https://stackoverflow.com/a/5703164/6064933. 47 | let l:pat = 'colors/' . a:name . '.vim' 48 | return !empty(globpath(&runtimepath, l:pat)) 49 | endfunction 50 | 51 | " vim: sw=2 sts=2 tw=0 fdm=marker 52 | -------------------------------------------------------------------------------- /home/config/nvim/autoload/utils/explorer.vim: -------------------------------------------------------------------------------- 1 | fu! utils#explorer#_name() 2 | return get(g:, 'utils#explorer#name', 'explorer') 3 | endfu 4 | 5 | fu! utils#explorer#init(...) 6 | " This function is called ON an explorer buffer when initialized 7 | """ 8 | let l:explorer_name = get(a:, 1, utils#explorer#_name()) 9 | exe 'keepalt file ' . l:explorer_name 10 | setl conceallevel=3 11 | setl nofoldenable 12 | setl foldmethod=manual 13 | setl signcolumn=no 14 | call utils#init_minimal_window() 15 | endfunction 16 | 17 | " vim: sw=2 sts=2 tw=0 fdm=marker 18 | -------------------------------------------------------------------------------- /home/config/nvim/autoload/utils/window.vim: -------------------------------------------------------------------------------- 1 | " winslide.vim 2 | " 3 | 4 | let s:ft_winsize = get(s:, 'ft_winsize', {}) 5 | let s:warned = v:false 6 | 7 | function! utils#window#animate(nr, is_vert, size, callback) 8 | " navigate to window 9 | exe a:nr . 'wincmd w' 10 | 11 | if exists('g:animate#loaded') && g:animate#loaded 12 | if !animate#window_is_animating(winnr()) 13 | exe printf('call animate#window_absolute_%s(%f)', 14 | \ a:is_vert ? 'width' : 'height', a:size) 15 | call timer_start(float2nr(get(g:, 'animate#duration', 0)), a:callback) 16 | endif 17 | else 18 | if !s:warned 19 | echohl WarningMsg | echomsg "plug 'animate.vim' is required to animate windows" | echohl NONE 20 | let s:warned = v:true 21 | endif 22 | exe printf('%sresize %d', a:is_vert ? 'vert ' : '', 1) 23 | call a:callback() 24 | endif 25 | endf 26 | 27 | augroup sliding_window_ftdetect 28 | au! 29 | 30 | " au WinNew * call timer_start(1, { -> s:on_new_win(winnr())}) 31 | au FileType * if has_key(s:ft_winsize, &ft) | call s:slide_win(s:ft_winsize[&ft]) | endif 32 | augroup end 33 | 34 | fun! s:slide_win(size) 35 | let n = winnr() 36 | 37 | if winheight(n) + &cmdheight + 2 == &lines 38 | let is_vertical = v:true 39 | elseif winwidth(n) == &columns 40 | let is_vertical = v:false 41 | else 42 | " echohl WarningMsg | echom 'cannot slide, window is not in a valid split' (winwidth(a:n) - &columns )| echohl NONE 43 | return 44 | endif 45 | 46 | " minimise window 47 | exe printf('%sresize %d', is_vertical ? 'vert ' : '', 1) 48 | 49 | " if size is decimal, treat it as a percent 50 | let size = type(a:size) == v:t_float ? 51 | \ float2nr((is_vertical ? &columns : &lines) * a:size) : 52 | \ a:size 53 | 54 | " animate window to correct dimensions 55 | call utils#window#animate(n, is_vertical, size, { -> printf('') }) 56 | 57 | let cl = printf(':call utils#window#animate(%d, %d, 0, { -> execute("%dwincmd c") })', n, is_vertical, n) 58 | 59 | " set win var to animate close this window 60 | call setwinvar(n, '_animated_close', cl) 61 | 62 | " create mapping to slide out window on q 63 | exe printf('nnoremap q %s', cl) 64 | endf 65 | 66 | fun! utils#window#slide_window(name, size) 67 | if a:size > 0 68 | let s:ft_winsize[a:name] = a:size 69 | else 70 | call remove(s:ft_winsize, a:name) 71 | endif 72 | endf 73 | 74 | 75 | fu! utils#window#toggle_window(name) 76 | " name: name of sliding window 77 | " opt: 78 | " size: size of window in direction 79 | let window = { 'name': a:name } 80 | 81 | function! window.id() 82 | return get(t:, self.name, -1) 83 | endf 84 | 85 | function! window.is_open() 86 | return win_id2win(self.id()) != 0 87 | endf 88 | 89 | function! window.open(...) abort 90 | " open([, fnc]) 91 | " {fnc} is the callback function to create the new window 92 | if win_gotoid(self.id()) | return | endif 93 | 94 | let name = self.name 95 | let Create = get(a:, 1, 96 | \ { -> execute(printf('botright split +set\ nobuflisted %s', name)) }) 97 | 98 | try 99 | call Create() | call utils#safe('call statusline#update_hi()') | setl wfh wfw 100 | catch 101 | echoerr 'Error: could not create window with function:' string(Create) 102 | return 103 | endtry 104 | 105 | call settabvar(tabpagenr(), name, win_getid()) 106 | endf 107 | 108 | function! window.close() 109 | let w = win_id2win(self.id()) 110 | let cl = getwinvar(w, '_animated_close') 111 | 112 | " unset tab variable 113 | exe printf('unlet t:%s', self.name) 114 | 115 | " close normally or animate if possible 116 | exe empty(cl) ? printf('%dwincmd c', w) : cl 117 | endf 118 | 119 | function window.toggle(fnc) 120 | " 121 | " {fnc} is the callback function to create the new window 122 | 123 | if self.is_open() 124 | call self.close() 125 | else 126 | call self.open(a:fnc) 127 | endif 128 | endf 129 | 130 | return window 131 | endf 132 | 133 | " vim: sw=2 sts=2 tw=0 fdm=marker 134 | -------------------------------------------------------------------------------- /home/config/nvim/clients/firenvim.vim: -------------------------------------------------------------------------------- 1 | " firenvim.vim 2 | " 3 | 4 | if exists('g:started_by_firenvim') && g:started_by_firenvim 5 | " general options 6 | set laststatus=0 nonumber noruler noshowcmd 7 | 8 | " general config for firenvim 9 | let g:firenvim_config = { 10 | \ 'globalSettings': { 11 | \ 'alt': 'all', 12 | \ }, 13 | \ 'localSettings': { 14 | \ '.*': { 15 | \ 'cmdline': 'neovim', 16 | \ 'priority': 0, 17 | \ 'selector': 'textarea', 18 | \ 'takeover': 'never', 19 | \ }, 20 | \ } 21 | \ } 22 | 23 | augroup firenvim 24 | autocmd! 25 | autocmd BufEnter *.txt setlocal filetype=markdown.pandoc 26 | augroup END 27 | endif 28 | 29 | " vim: sw=2 sts=2 tw=0 fdm=marker 30 | -------------------------------------------------------------------------------- /home/config/nvim/clients/idea.vim: -------------------------------------------------------------------------------- 1 | let mapleader=" " 2 | 3 | """ Plugins -------------------------------- 4 | set surround 5 | set multiple-cursors 6 | set commentary 7 | set argtextobj 8 | set easymotion 9 | set textobj-entire 10 | set ReplaceWithRegister 11 | 12 | """ Plugin settings ------------------------- 13 | let g:argtextobj_pairs="[:],(:),<:>" 14 | 15 | """ Common settings ------------------------- 16 | set showmode 17 | set so=5 18 | set incsearch 19 | set nu 20 | 21 | """ Idea specific settings ------------------ 22 | set ideajoin 23 | set ideastatusicon=gray 24 | set idearefactormode=keep 25 | set NERDTree 26 | 27 | """ Mappings -------------------------------- 28 | nmap e :action RecentFiles 29 | 30 | map d (Debug) 31 | map r (RenameElement) 32 | map c (Stop) 33 | map z (ToggleDistractionFreeMode) 34 | 35 | map s (SelectInProjectView) 36 | map a (Annotate) 37 | map h (Vcs.ShowTabbedFileHistory) 38 | map (GotoNextError) 39 | 40 | map b (ToggleLineBreakpoint) 41 | map o (FileStructurePopup) 42 | 43 | " nnoremap K (Quick) 44 | 45 | -------------------------------------------------------------------------------- /home/config/nvim/clients/vscode.vim: -------------------------------------------------------------------------------- 1 | " vscode.vim: vscode neovim configuration 2 | " with https://github.com/asvetliakov/vscode-neovim 3 | " 4 | 5 | if !exists('g:vscode') 6 | " additional check for vscode only configuration but is this neccesary? 7 | finish 8 | endif 9 | 10 | " TODO 11 | 12 | " vim: sw=2 sts=2 tw=0 fdm=marker 13 | -------------------------------------------------------------------------------- /home/config/nvim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "coc.preferences.bracketEnterImprove": true, 3 | "coc.source.buffer.priority": 80, 4 | "coc.source.neco.priority": 100, 5 | "coc.source.syntax.priority": 60, 6 | "codeLens.enable": true, 7 | "diagnostic.errorSign": "", 8 | "diagnostic.checkCurrentLine": true, 9 | "diagnostic.enableHighlightLineNumber": true, 10 | "diagnostic.warningSign": "", 11 | "diagnostic.infoSign": "", 12 | "diagnostic.hintSign": " ", 13 | "diagnostic.virtualText": true, 14 | "languageserver": { 15 | "bash": { 16 | "command": "bash-language-server", 17 | "args": [ 18 | "start" 19 | ], 20 | "filetypes": [ 21 | "sh", 22 | "bash" 23 | ] 24 | }, 25 | "efm": { 26 | "command": "efm-langserver", 27 | "args": [], 28 | "filetypes": [ 29 | "vim", 30 | "markdown", 31 | "yaml" 32 | ] 33 | } 34 | }, 35 | "java.jdt.ls.vmargs": "-javaagent:/home/fola/opt/repo/m2/org/projectlombok/lombok/1.18.20/lombok-1.18.20.jar", 36 | "java.format.settings.url": "/home/fola/etc/coc/extensions/node_modules/google.java/eclipse-java-google-style.xml", 37 | "java.format.settings.profile": "Google", 38 | "list.indicator": ">", 39 | "list.selectedSignText": " ", 40 | "list.alignColumns": true, 41 | "list.source.diagnostics.includeCode": false, 42 | "list.source.diagnostics.pathFormat": "filename", 43 | "python.formatting.provider": "black", 44 | "python.linting.enabled": true, 45 | "python.linting.pylintEnabled": true, 46 | "rust-analyzer.updates.channel": "nightly", 47 | "rust-analyzer.checkOnSave.command": "clippy", 48 | "rust-analyzer.completion.postfix.enable": true, 49 | "rust-analyzer.completion.addCallParenthesis": false, 50 | "rust-analyzer.cargo.noDefaultFeatures": true, 51 | "rust-analyzer.cargo.loadOutDirsFromCheck": true, 52 | "rust-analyzer.debug.runtime": "vimspector", 53 | "rust-analyzer.diagnostics.disabled": [ 54 | "incorrect-ident-case", 55 | "macro-error", 56 | "unresolved-macro-call" 57 | ], 58 | "rust-analyzer.diagnostics.enableExperimental": true, 59 | "rust-analyzer.inlayHints.chainingHints": false, 60 | "rust-analyzer.hoverActions.linksInHover": true, 61 | "rust-analyzer.procMacro.enable": true, 62 | "session.saveOnVimLeave": false, 63 | "signature.target": "float", 64 | "suggest.echodocSupport": true, 65 | "suggest.floatEnable": true, 66 | "snippets.priority": 85, 67 | "snippets.ultisnips.enable": false, 68 | "suggest.noselect": false, 69 | "suggest.completionItemKindLabels": { 70 | "text": "t", 71 | "method": "m", 72 | "function": "" 73 | }, 74 | "coc-actions.hideCursor": true, 75 | "clangd.path": "/home/fl-w/etc/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd", 76 | "tabnine.priority": 85 77 | } 78 | -------------------------------------------------------------------------------- /home/config/nvim/conf.d/abbr.vim: -------------------------------------------------------------------------------- 1 | " abbr.vim: useful command abbreviations 2 | " 3 | 4 | if exists('g:utils#abbr#loaded') 5 | finish 6 | endif 7 | 8 | let g:utils#abbr#loaded = 1 9 | 10 | cnoreabbrev W w 11 | cnoreabbrev E e 12 | 13 | cnoreabbrev Qa qa 14 | cnoreabbrev Bd bd 15 | 16 | cnoreabbrev wrap set wrap 17 | cnoreabbrev nowrap set nowrap 18 | 19 | " vim: sw=2 sts=2 tw=0 fdm=marker 20 | -------------------------------------------------------------------------------- /home/config/nvim/conf.d/autocmd.vim: -------------------------------------------------------------------------------- 1 | " Filetype specific settings 2 | " 3 | au! BufRead,BufNewFile *.asm setfiletype r 4 | au! filetype *commit*,markdown setlocal spell | " Spell Check 5 | au! filetype *commit*,markdown setlocal textwidth=72 | " Looks good 6 | au! filetype make setlocal noexpandtab | " In Makefiles DO NOT use spaces instead of tabs 7 | au! filetype r set tabstop=4 | retab 8 | 9 | augroup window_size 10 | au! VimResized * wincmd = 11 | augroup END 12 | 13 | augroup vimrc 14 | au! 15 | 16 | au BufWritePre * call utils#trim_whitespace() " Remove trailing whitespace when saving 17 | 18 | au BufWritePre * 19 | \ call utils#auto_mkdir(expand(':p:h'), v:cmdbang) " auto create missing directories 20 | 21 | au InsertEnter * let b:icul = &cul | set nocul 22 | au InsertLeave * if utils#boolexists('b:icul') 23 | \| unlet b:icul | set cul | endif " Remove cursorline on insertmode 24 | 25 | au BufEnter *.txt if &buftype == 'help' 26 | \| nnoremap q :q | if winnr('$') > 1 | wincmd T | endif | endif 27 | 28 | au BufReadPost * if line('$') > 20 | set foldlevel=1 | endif " fold large files 29 | 30 | au WinLeave * if &cursorline | let w:cur = 1 | setl cul | endif 31 | au WinEnter * if utils#boolexists('w:cur') | unlet w:cur | setl nocul | endif 32 | augroup END 33 | 34 | " fun! s:on_focus_lost() 35 | " " Remove relative number on focus lost 36 | " if &nu 37 | " let b:irnu = 1 38 | " setl nornu 39 | " endif 40 | " endf 41 | 42 | " fun! s:on_focus_enter() 43 | " " Restore relative number 44 | " if utils#boolexists('b:irnu') 45 | " unlet b:irnu 46 | " setl rnu 47 | " endif 48 | " endf 49 | 50 | " au vimrc FocusLost * call s:on_focus_lost() 51 | " au vimrc FocusGained * call s:on_focus_enter() 52 | 53 | augroup auto_read 54 | autocmd! 55 | autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * 56 | \ if mode() == 'n' && getcmdwintype() == '' | checktime | endif 57 | autocmd FileChangedShellPost * echohl WarningMsg 58 | \ | echo "File changed on disk. Buffer reloaded!" | echohl None 59 | augroup END 60 | 61 | " Return to last edit position when opening a file 62 | augroup resume_edit_position 63 | autocmd! 64 | autocmd BufReadPost * 65 | \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' 66 | \ | execute "normal! g`\"zvzz" 67 | \ | endif 68 | augroup END 69 | 70 | augroup ft_settings 71 | autocmd! 72 | autocmd FileType rust colorscheme gruvbox | doautocmd ColorScheme gruvbox 73 | \| let b:AutoPairs = AutoPairsDefine({'\w\zs<': '>'}) " if press < after a word will generate the pair 74 | autocmd FileType cmm setfiletype c 75 | \| if exists(":CocDisable") | CocDisable | endif " custom options for my language 76 | augroup END 77 | 78 | " vim: sw=2 sts=2 tw=0 fdm=marker 79 | -------------------------------------------------------------------------------- /home/config/nvim/conf.d/kitty.vim: -------------------------------------------------------------------------------- 1 | " kitty.vim: minimal configuration on kitty term 2 | " 3 | 4 | if $TERM != "xterm-kitty" || !executable('kitty') || empty("$KITTY_LISTEN_ON") 5 | finish 6 | endif 7 | 8 | if exists('g:loaded_kitty') | finish | endif 9 | let g:loaded_kitty = 1 10 | 11 | let s:save_cpo = &cpo 12 | set cpo&vim 13 | 14 | fu! kitty#get_colors() abort 15 | let l:colors = {} 16 | let l:kitty_colors = systemlist('kitty @ --to $KITTY_LISTEN_ON get-colors') 17 | for val in map(kitty_colors, {_, val -> split(val)}) 18 | let l:colors[val[0]] = val[1] 19 | endfor 20 | return l:colors 21 | endfu 22 | 23 | fu! kitty#refresh_bg() 24 | let kitty_bg = get(kitty#get_colors(), 'background') 25 | let &bg = utils#color#is_dark(kitty_bg) ? 'dark' : 'light' 26 | endfu 27 | 28 | let &cpo=s:save_cpo 29 | unlet s:save_cpo 30 | 31 | call kitty#refresh_bg() 32 | 33 | " vim: sw=2 sts=2 tw=0 fdm=marker 34 | -------------------------------------------------------------------------------- /home/config/nvim/conf.d/statusline.vim: -------------------------------------------------------------------------------- 1 | " statusline.vim: minimal custom statusline (inspired by eleline) 2 | " 3 | 4 | " if exists('g:loaded_statusline') || v:version < 700 | finish | endif 5 | let g:loaded_statusline = 1 6 | finish 7 | 8 | let s:save_cpo = &cpo 9 | set cpo&vim 10 | 11 | " todo split by (in)/active 12 | function! s:def(name, ...) abort 13 | let fn = 'statusline#' . a:name 14 | return exists('*'. fn) ? 15 | \ printf('%%#%s#%%{%s()}%%*', 16 | \ 'StatusLine' . s:titlecase(a:name), 17 | \ fn) 18 | \ : '' 19 | endfunction 20 | 21 | function! s:titlecase(word) 22 | return substitute(substitute(substitute(a:word,'_',' ','g'), 23 | \ '\(\<\w\)','\=toupper(submatch(1))','g'), ' ', '', 'g') 24 | endfunction 25 | 26 | function! s:statusline() abort 27 | let l:fname = s:def('fname_full') " show file name with icons 28 | let l:stl = {} 29 | let l:stl.active = {} 30 | let l:stl.inactive = {} 31 | 32 | let l:stl.active['slim'] = l:fname . '%<' 33 | let l:stl.active['_'] = join([ 34 | \ '%<', 35 | \ l:fname, 36 | \ '%=', 37 | \ join([ 38 | \ s:def('current_function_tag'), 39 | \ '', 40 | \ s:def('linter'), 41 | \ s:def('git'), 42 | \ '%{&fenc != "" ? &fenc : &enc} %l:%-2c', 43 | \ s:def('ft_icon') . ' %{&ft}'], 44 | \ repeat(' ', 2)) 45 | \]) 46 | 47 | " for now make inactive statusline same as active slim 48 | let l:stl.inactive.slim = l:stl.active.slim 49 | let l:stl.inactive._ = l:stl.active.slim 50 | 51 | return l:stl 52 | endfunction 53 | 54 | function! statusline#update(...) abort 55 | if s:is_invalid_win() | return | endif 56 | 57 | let w = winnr() 58 | let slim = utils#boolexists('statusline_slimmode') 59 | let slimw = get(g:, 'statusline_slimwidth', 50) 60 | 61 | let s:stl = get(a:, '1', !exists('s:stl')) ? s:statusline() : s:stl 62 | for n in range(1, winnr('$')) 63 | if getwinvar(n, '&buftype') != 'terminal' 64 | " call setwinvar(n, '&tabline', 65 | call setwinvar(n, '&stl', 66 | \ s:stl[n==w ? 'active' : 'inactive'][slim || winwidth(n) <= slimw ? 'slim' : '_']) 67 | endif 68 | endfor 69 | endfunction 70 | 71 | function statusline#update_hi() abort 72 | if !has('nvim') 73 | return 74 | endif 75 | 76 | for n in range(1, winnr('$')) 77 | let hl = getwinvar(n, '&winhl') 78 | let whl = getwinvar(n, '_statusline_winhl') 79 | if empty(whl) 80 | call setwinvar(n, '_statusline_winhl', { 'cache': hl }) 81 | else 82 | let hl = whl.cache 83 | endif 84 | call setwinvar(n, '&winhl', s:win_has_bottom_neighbour(n) ? 85 | \ hl . "StatusLine:StatusLineI,StatusLineNC:StatusLineINC" : 86 | \ hl 87 | \ ) 88 | endfor 89 | endf 90 | 91 | fun! s:win_has_bottom_neighbour(n) 92 | let b = win_screenpos(a:n)[0] + winheight(a:n) - 1 93 | for l:win in range(1, winnr('$')) 94 | if a:n != l:win && win_screenpos(l:win)[0] > b && buflisted(winbufnr(l:win)) 95 | return v:true 96 | endif 97 | endfor 98 | return v:false 99 | endf 100 | 101 | function! s:on_mode_change(mode) abort 102 | " todo 103 | endfunction 104 | 105 | function! s:is_temp_file() 106 | if !empty(&buftype) || &previewwindow 107 | return 1 108 | endif 109 | let curfname = expand('%:p') 110 | return curfname =~# '^/tmp' || curfname =~# '^fugitive:' 111 | endfunction 112 | 113 | function! s:is_invalid_win() abort 114 | return s:is_temp_file() || &buftype ==# 'popup' 115 | endfunction 116 | 117 | " init vars and set statusline 118 | call statusline#update() 119 | 120 | augroup statusline_update 121 | autocmd! 122 | " Change colors for insert mode 123 | " autocmd InsertEnter,InsertChange * call s:on_mode_change(v:insertmode) 124 | autocmd VimEnter,BufEnter,WinEnter * call statusline#update() 125 | autocmd WinNew,WinClosed * call statusline#update_hi() 126 | augroup END 127 | 128 | hi default link StatusLineI StatusLine 129 | hi default link StatusLineINC StatusLineNC 130 | 131 | let &cpo=s:save_cpo 132 | unlet s:save_cpo 133 | 134 | " vim: sw=2 sts=2 tw=0 fdm=marker 135 | -------------------------------------------------------------------------------- /home/config/nvim/conf.d/terminal.vim: -------------------------------------------------------------------------------- 1 | " terminal configuration. 2 | " 3 | 4 | " if !exists(':terminal') | finish | endif 5 | 6 | let s:term_height = 0.21 7 | let s:term_name = 'terminal-window' 8 | let s:term_auto_clear = v:false 9 | 10 | let s:terminal = utils#window#toggle_window('terminal_window_id') 11 | call utils#window#slide_window('terminal', s:term_height) 12 | 13 | fu! s:term_init() 14 | setl nonumber nornu " remove line numbering 15 | setl nobuflisted " hide term buffers 16 | setl noruler 17 | setl noshowmode 18 | setl cmdheight=1 19 | setl nocursorline 20 | setl bufhidden=hide 21 | 22 | " hide statusline 23 | let &l:statusline='%{getline(line("w$")+1)}' 24 | 25 | startinsert 26 | 27 | " Leave insert mode with escape in a term buffer and goto last win 28 | tnoremap 29 | nnoremap q :call terminal#close() 30 | nnoremap h h 31 | nnoremap j j 32 | nnoremap k k 33 | nnoremap l l 34 | endfu 35 | 36 | augroup term_btdetect 37 | au! 38 | " au VimResized * 39 | au BufEnter * if &buftype == 'terminal' | :startinsert | endif 40 | au BufEnter term://* startinsert 41 | au TermOpen * if win_getid() == s:terminal.id() 42 | \ | call s:term_init() 43 | \ | endif 44 | augroup END 45 | 46 | function! terminal#toggle() 47 | if s:terminal.is_open() 48 | call terminal#close() 49 | else 50 | call terminal#open() 51 | endif 52 | endf 53 | 54 | fun! terminal#close() 55 | call s:terminal.close() 56 | endf 57 | 58 | fun! terminal#open() abort 59 | " create a window pane 60 | call s:terminal.open() 61 | 62 | call win_gotoid(s:terminal.id()) 63 | let name = terminal#get_ready_term() 64 | setfiletype terminal 65 | 66 | " create buffer if not exists 67 | if !bufexists(name) 68 | " spawn term 69 | call termopen($SHELL, { 'detach': 1 }) 70 | 71 | " rename buffer 72 | silent exe 'noswapfile keepalt file' name 73 | else 74 | exe 'buffer' name 75 | endif 76 | endfunction 77 | 78 | fun! terminal#get_ready_term(...) 79 | " args: from 80 | " todo: return first available term buffer name 81 | return printf('%s-%d', s:term_name, get(a:, 1, 1)) 82 | endf 83 | 84 | 85 | fun! terminal#exec_interactive() 86 | call inputsave() | let cmd = input('exec> ') | call inputrestore() 87 | if !isempty(cmd) 88 | call terminal#exec(cmd, v:true) 89 | endif 90 | endfu 91 | 92 | fun! terminal#exec(cmd, ...) 93 | " open terminal if not open 94 | if !terminal#is_open() 95 | call terminal#open() 96 | endif 97 | 98 | " get job id of terminal buffer 99 | let l:term_job_id = getbufvar(terminal#get_ready_term(), 'terminal_job_id') 100 | 101 | " clear term if option is present 102 | if get(a:, 1, s:term_auto_clear) 103 | call jobsend(l:term_job_id, "clear\n") 104 | endif 105 | 106 | " run cmd 107 | call jobsend(l:term_job_id, printf("%s\n", a:cmd)) 108 | endf 109 | 110 | nnoremap tt :call terminal#toggle() 111 | nnoremap to :call terminal#open() 112 | nnoremap tc :call terminal#close() 113 | nnoremap te :call terminal#exec_interactive() 114 | 115 | " vim: sw=2 sts=2 tw=0 fdm=marker 116 | -------------------------------------------------------------------------------- /home/config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | " vim: sw=2 sts=2 tw=0 2 | " 3 | " .o oOOOOOOOo 0OOOo 4 | " Ob.OOOOOOOo OOOo. oOOo. .adOOOOOOO 5 | " OboO000000000000.OOo. .oOOOOOo. OOOo.oOOOOOo..0000000000OO 6 | " OOP.oOOOOOOOOOOO 0POOOOOOOOOOOo. `0OOOOOOOOOP,OOOOOOOOOOOB' 7 | " `O'OOOO' `OOOOo"OOOOOOOOOOO` .adOOOOOOOOO"oOOO' `OOOOo 8 | " .OOOO' `OOOOOOOOOOOOOOOOOOOOOOOOOO' `OO 9 | " OOOOO '"OOOOOOOOOOOOOOOO"` oOO 10 | " oOOOOOba. .adOOOOOOOOOOba .adOOOOo. 11 | " oOOOOOOOOOOOOOba. .adOOOOOOOOOO@^OOOOOOOba. .adOOOOOOOOOOOO 12 | " OOOOOOOOOOOOOOOOO.OOOOOOOOOOOOOO"` '"OOOOOOOOOOOOO.OOOOOOOOOOOOOO 13 | " : .oO%OOOOOOOOOOo.OOOOOO.oOOOOOOOOOOOO? . 14 | " Y 'OOOOOOOOOOOOOO: .oOOo. :OOOOOOOOOOO?' :` 15 | " . oOOP"%OOOOOOOOoOOOOOOO?oOOOOO?OOOO"OOo 16 | " '%o OOOO"%OOOO%"%OOOOO"OOOOOO"OOO': 17 | " `$" `OOOO' `O"Y ' `OOOO' o . 18 | " . . OP" : o . 19 | " 20 | 21 | let $VIM_ROOT = expand(':h') 22 | let $VIM_DATA_ROOT = stdpath('data') 23 | 24 | let g:is_darwin = has('win32') || has('win64') 25 | let g:is_linux = has('unix') && !has('macunix') 26 | let g:is_work = !empty($WORK_MACHINE) 27 | let g:vim_ignore_configs = ['ale'] 28 | 29 | if has('vim_starting') 30 | runtime settings.vim 31 | endif 32 | 33 | runtime maps/keys.vim 34 | 35 | if exists('g:started_by_firenvim') && g:started_by_firenvim 36 | runtime clients/firenvim.vim " firenvim specific configuration 37 | 38 | elseif exists('g:vscode') 39 | runtime clients/vscode.vim " vscode specific configuration 40 | 41 | elseif exists('g:ideavim') 42 | runtime clients/idea.vim " intellij idea specific configuration 43 | 44 | let $VIM_ROOT = expand(':p:h') 45 | else 46 | runtime plugins.vim 47 | 48 | runtime conf.d/kitty.vim 49 | runtime conf.d/events.vim 50 | runtime conf.d/abbr.vim 51 | runtime conf.d/colorscheme.vim 52 | runtime conf.d/statusline.vim 53 | 54 | runtime maps/which-key.vim 55 | 56 | " load plugin configs 57 | let g:plug_configs = map( 58 | \ filter( copy(g:plugs_order), { _, val -> index(g:vim_ignore_configs, val) == -1 } ), 59 | \ '"plugins.d/" . tolower(substitute(fnamemodify(v:val, ":r"), "\\.", "-", "")) . ".vim"' 60 | \) 61 | for s:plug in g:plug_configs 62 | exe 'runtime' s:plug 63 | endfor 64 | endif 65 | 66 | if exists('*utils#abbr_command') 67 | call utils#abbr_command('rc', 'so $MYVIMRC') " use :rc to resource this file 68 | endif 69 | 70 | " load external init.lua file whilst nvim is nightly 71 | if has('nvim-0.5') 72 | runtime lua/init-nightly.lua 73 | end 74 | -------------------------------------------------------------------------------- /home/config/nvim/lua/utils.lua: -------------------------------------------------------------------------------- 1 | -- _G.load = function(file) 2 | -- require("plenary.reload").reload_module(file, true) 3 | -- return require(file) 4 | -- end 5 | 6 | local M = {} 7 | 8 | -- easily define autocmd in lua 9 | -- https://github.com/lewis6991/dotfiles/blob/main/config/nvim/lua/lewis6991/nvim.lua#L4 10 | function M.autocmd(name) 11 | return function(opts) 12 | if opts[1] then 13 | if type(opts[1]) == 'function' then 14 | opts.callback = opts[1] 15 | elseif type(opts[1]) == 'string' then 16 | opts.command = opts[1] 17 | end 18 | opts[1] = nil 19 | end 20 | vim.api.nvim_create_autocmd(name, opts) 21 | end 22 | end 23 | 24 | -- easily define mappings in lua (stolen) 25 | -- https://github.com/lewis6991/dotfiles/blob/main/config/nvim/lua/lewis6991/nvim.lua#L4 26 | function M.map(mode) 27 | return function(first) 28 | return function(second) 29 | local opts 30 | if type(second) == 'table' then 31 | opts = second 32 | second = opts[1] 33 | opts[1] = nil 34 | end 35 | vim.keymap.set(mode, first, second, opts) 36 | end 37 | end 38 | end 39 | 40 | function M.nmap(first) return M.map 'n' (first) end 41 | function M.vmap(first) return M.map 'v' (first) end 42 | function M.cmap(first) return M.map 'c' (first) end 43 | 44 | return M 45 | -------------------------------------------------------------------------------- /home/config/nvim/maps/keys.vim: -------------------------------------------------------------------------------- 1 | " keys.vim: Basic keymaps i can't live without 2 | " 3 | 4 | let mapleader = "\" 5 | 6 | " Map ; -> : to speed up commands 7 | nnoremap ; : 8 | 9 | " Write file as sudo with w!! 10 | cnoremap w!! w !sudo tee > /dev/null % 11 | 12 | " Move lines up(_) or down(-) 13 | noremap - ddp 14 | noremap _ ddkP 15 | vmap J :m '>+1gv=gv 16 | vmap K :m '<-2gv=gv 17 | 18 | " Move lines with alt + up or down 19 | noremap ddkP 20 | noremap ddp 21 | vmap _ 22 | vmap - 23 | 24 | " Make j/k really go down 25 | nnoremap j gj 26 | nnoremap k gk 27 | 28 | " Yank to end of line 29 | nnoremap Y y$ 30 | 31 | " Open vertial split 32 | nnoremap \| :vnew 33 | nnoremap \ :new 34 | 35 | " Scroll with arrow keys 36 | noremap 37 | noremap 38 | 39 | " Clear highlight by pressing esc 40 | nnoremap :noh 41 | 42 | " Use alt + hjkl to resize windows 43 | nnoremap :resize +2 44 | nnoremap :resize -2 45 | nnoremap :vertical resize -2 46 | nnoremap :vertical resize +2 47 | 48 | " Force gf to open file under cursor 49 | map gf :e 50 | 51 | " Map double to save 52 | noremap :update! 53 | 54 | " Map + x to save and exit file 55 | noremap x :x! 56 | 57 | " Map + q to quit window 58 | nmap q :q! 59 | 60 | " Map gd to goto word def 61 | noremap gd 62 | 63 | " Map {[/]} to {prepend/append} blank line (inspired by tpope) 64 | noremap ] :pu =repeat(nr2char(10),v:count)execute "'[-1" 65 | noremap [ :pu!=repeat(nr2char(10),v:count)execute "']+1" 66 | 67 | " Map useful commands to [/] 68 | nnoremap [l :lprevious 69 | nnoremap ]l :lnext 70 | nnoremap [t :tabprevious 71 | nnoremap ]t :tabnext 72 | 73 | " Map {,shift} + enter to insert blank line with ( ]/[ + space ) ^ 74 | nmap ] 75 | nmap [ 76 | 77 | " Use ctrl+{h,j,k,l} to navigate window panes 78 | noremap h 79 | noremap j 80 | noremap k 81 | noremap l 82 | inoremap h 83 | inoremap j 84 | inoremap k 85 | inoremap l 86 | if exists(':tnoremap') 87 | tnoremap h 88 | tnoremap j 89 | tnoremap k 90 | tnoremap l 91 | endif 92 | 93 | " Use ctrl+p to replace word under cursor with clipboard text 94 | noremap viw"0p 95 | noremap vaW"0p 96 | 97 | " Use {,shift}+tab to navigate tabs 98 | " nnoremap :tabnext 99 | " nnoremap :tabprevious 100 | 101 | " Use (left/right) to navigate buffers 102 | " nnoremap :bnext 103 | " nnoremap :bprevious 104 | 105 | " Navigate lines quickly 106 | nnoremap L $ 107 | nnoremap H ^ 108 | 109 | " Keep visual mode after indent 110 | vnoremap > >gv 111 | vnoremap < mode() != visualmode() ? 'V' : 'k' 118 | " noremap mode() != visualmode() ? 'V' : 'j' 119 | 120 | noremap y "*y 121 | noremap p "*p 122 | noremap Y "+y 123 | noremap P "+y 124 | 125 | " Map {jj/kk} -> {down/up} in insert mode 126 | inoremap kk k 127 | inoremap jj j 128 | 129 | " Use ctrl+{j,k} to navigate omnifunc 130 | inoremap ("\") 131 | inoremap ("\") 132 | 133 | " vim: sw=2 sts=2 tw=0 fdm=marker 134 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/FixCursorHold-nvim.vim: -------------------------------------------------------------------------------- 1 | " FixCursorHold.nvim configuration 2 | " fix neovim CusorHold and CursorHoldI autocmd events 3 | " https://github.com/neovim/neovim/issues/12587 4 | " 5 | 6 | let g:cursorhold_updatetime = &updatetime 7 | 8 | " vim: sw=2 sts=2 tw=0 fdm=marker 9 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/ale.vim: -------------------------------------------------------------------------------- 1 | " ale configuration 2 | " 3 | 4 | let g:ale_completion_enabled = 1 5 | let g:ale_fix_on_save = 1 6 | let g:ale_completion_tsserver_autoimport = 1 7 | let g:ale_set_ballons = 1 8 | let g:ale_sign_column_always = 1 9 | let g:ale_change_sign_column_color = 0 10 | let g:ale_close_preview_on_insert = 1 11 | let g:ale_sign_error = '' 12 | let g:ale_sign_warning = '' 13 | let g:ale_python_flake8_options = '--ignore=E501' 14 | 15 | let g:ale_fixers = { 16 | \ '*': ['remove_trailing_lines', 'trim_whitespace'], 17 | \ 'javascript': ['prettier', 'eslint'], 18 | \ 'css': ['prettier'], 19 | \ 'c': ['clang-format'], 20 | \ 'json': ['fixjson'], 21 | \ 'haskell': ['brittany'], 22 | \ 'java': ['google_java_format'], 23 | \ 'typescript': ['eslint'], 24 | \ 'python': ['black', 'isort', 'add_blank_lines_for_python_control_statements'] 25 | \} 26 | let g:ale_linters = { 27 | \ 'python': ['pylint', 'flake8'], 28 | \ 'c': ['clang-tidy'], 29 | \ 'java': ['checkstyle'], 30 | \ 'rust': ['clippy'] 31 | \} 32 | 33 | " vim: sw=2 sts=2 tw=0 fdm=marker 34 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/animate.vim: -------------------------------------------------------------------------------- 1 | " animate.vim configuration 2 | " 3 | 4 | let g:animate#distribute_space = 0 5 | let g:animate#duration = 160.0 6 | 7 | " vim: sw=2 sts=2 tw=0 fdm=marker 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/auto-pairs.vim: -------------------------------------------------------------------------------- 1 | let g:AutoPairsMultilineClose = 0 2 | let g:AutoPairsMapCR = 0 3 | let g:AutoPairsFlyMode = 0 4 | 5 | " vim: sw=2 sts=2 tw=0 fdm=marker 6 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/ayu-vim.vim: -------------------------------------------------------------------------------- 1 | " vim: sw=2 sts=2 tw=0 fdm=marker 2 | " ayu-vim configuration 3 | " 4 | finish 5 | augroup ayu_color 6 | autocmd ColorScheme ayu call s:set_colors() 7 | au OptionSet background if exists('g:colors_name') && g:colors_name == 'ayu' 8 | \ | echo 'colorscheme ayu' 9 | \ | endif 10 | augroup end 11 | 12 | fun s:set_colors() 13 | return 14 | " let g:ayucolor = &background == 'light' ? 'light' : 'dark' 15 | if &bg == 'dark' 16 | hi CursorLine guibg=#151A1E 17 | else 18 | " hi CursorLine guibg=#151A1E 19 | endif 20 | endfu 21 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/badwolf.vim: -------------------------------------------------------------------------------- 1 | autocmd! ColorScheme badwolf hi DiffAdd guifg=#B8CC52 2 | \| hi DiffChange guifg=#36A3D9 3 | \| hi Normal guifg=#e4e0ed 4 | \| call utils#color#copy_hi_group('SpecialChar', 'SpecialComment') 5 | \| hi SpecialComment gui=bold 6 | \| hi String ctermfg=140 guifg=#a790d5 gui=italic 7 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/camelcasemotion.vim: -------------------------------------------------------------------------------- 1 | " CamelCaseMotion configuration 2 | " 3 | " let g:camelcasemotion_key = '' 4 | 5 | " Map w,b and e mappings 6 | map w CamelCaseMotion_w 7 | map b CamelCaseMotion_b 8 | map e CamelCaseMotion_e 9 | map ge CamelCaseMotion_ge 10 | sunmap w 11 | sunmap b 12 | sunmap e 13 | sunmap ge 14 | 15 | " " Map iw, ib and ie motions 16 | " omap iw CamelCaseMotion_iw 17 | " xmap iw CamelCaseMotion_iw 18 | " omap ib CamelCaseMotion_ib 19 | " xmap ib CamelCaseMotion_ib 20 | " omap ie CamelCaseMotion_ie 21 | " xmap ie CamelCaseMotion_ie 22 | 23 | " Map insert mode motions 24 | imap CamelCaseMotion_b 25 | imap CamelCaseMotion_w 26 | 27 | " vim: sw=2 sts=2 tw=0 fdm=marker 28 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/clever-f.vim: -------------------------------------------------------------------------------- 1 | " clever-f configuration 2 | " 3 | 4 | let g:clever_f_timeout_ms = 2000 5 | let g:clever_f_fix_key_direction = 1 " always search forward with f 6 | let g:clever_f_smart_case = 1 " enable searching by smart case 7 | 8 | " vim: sw=2 sts=2 tw=0 fdm=marker 9 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/coc-fzf.vim: -------------------------------------------------------------------------------- 1 | " coc-fzf configuration 2 | 3 | " GoTo code navigation. 4 | nmap go :CocFzfList outline 5 | nmap gO :CocFzfList symbols 6 | nmap ge :CocFzfList diagnostics 7 | nmap gE :CocFzfList diagnostics --current-buf 8 | 9 | " vim: sw=2 sts=2 tw=0 fdm=marker 10 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/dashboard-nvim.vim: -------------------------------------------------------------------------------- 1 | " dashboard-nvim configuration. 2 | " 3 | 4 | let g:dashboard_custom_header = [ 5 | \ '', 6 | \ 7 | \ ' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', 8 | \ ' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', 9 | \ ' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', 10 | \ ' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', 11 | \ ' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', 12 | \ ' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', 13 | \ '', 14 | \ '', 15 | \ " .o oOOOOOOOo 0OOOo", 16 | \ " Ob.OOOOOOOo OOOo. oOOo. .adOOOOOOO", 17 | \ " OboO000000000000.OOo. .oOOOOOo. OOOo.oOOOOOo..0000000000OO", 18 | \ " OOP.oOOOOOOOOOOO 0POOOOOOOOOOOo. `0OOOOOOOOOP,OOOOOOOOOOOB'", 19 | \ " `O'OOOO' `OOOOo\"OOOOOOOOOOO` .adOOOOOOOOO\"oOOO' `OOOOo", 20 | \ " .OOOO' `OOOOOOOOOOOOOOOOOOOOOOOOOO' `OO", 21 | \ " OOOOO '\"OOOOOOOOOOOOOOOO\"` oOO", 22 | \ " oOOOOOba. .adOOOOOOOOOOba .adOOOOo.", 23 | \ " oOOOOOOOOOOOOOba. .adOOOOOOOOOO@^OOOOOOOba. .adOOOOOOOOOOOO", 24 | \ " OOOOOOOOOOOOOOOOO.OOOOOOOOOOOOOO\"` '\"OOOOOOOOOOOOO.OOOOOOOOOOOOOO", 25 | \ " : .oO%OOOOOOOOOOo.OOOOOO.oOOOOOOOOOOOO? .", 26 | \ " Y 'OOOOOOOOOOOOOO: .oOOo. :OOOOOOOOOOO?' :`", 27 | \ " . oOOP\"%OOOOOOOOoOOOOOOO?oOOOOO?OOOO\"OOo", 28 | \ " '%o OOOO\"%OOOO%\"%OOOOO\"OOOOOO\"OOO':", 29 | \ " `$\" `OOOO' `O\"Y ' `OOOO' o .", 30 | \ " . . OP\" : o .", 31 | \ "", 32 | \ ] 33 | 34 | let g:dashboard_default_executive = 'fzf' 35 | 36 | let g:dashboard_custom_shortcut = { 37 | \ 'toggle_drawer' : 'SPC d', 38 | \ 'find_history' : 'SPC f h', 39 | \ 'find_file' : 'SPC f f', 40 | \ 'find_word' : 'SPC f w', 41 | \ 'last_session' : 'SPC s l', 42 | \ 'change_colorscheme' : 'SPC . c', 43 | \ 'book_marks' : 'SPC f b', 44 | \ } 45 | 46 | " let g:dashboard_custom_section = { 47 | " \ 'buffer_list': [' Recently lase session SPC b b'], 48 | " \ 'find_file': [] 49 | " \} 50 | 51 | function! s:dashboard_init() abort 52 | call utils#nonwrite_buffer_init() 53 | endfunction 54 | 55 | augroup dashboard_init 56 | autocmd! 57 | autocmd User dashboardReady let &l:stl = ' This statusline rocks!' 58 | " I like the dashboard commands over my fzf bindings 59 | " 20/8/2020: the :DashboardFind commands use override global 60 | " fzf vars hence my config 61 | autocmd filetype dashboard call utils#init_minimal_window() 62 | \| nnoremap :bd 63 | " \| nnoremap fw :DashboardFindWord 64 | " \| nnoremap fh :DashboardFindHistory 65 | " \| nnoremap ff :DashboardFindFile 66 | " \| nnoremap fb :DashboardJumpMarks 67 | autocmd VimEnter * if !argc() | Dashboard | endif 68 | augroup END 69 | 70 | " vim: sw=2 sts=2 tw=0 fdm=marker 71 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/defx.vim: -------------------------------------------------------------------------------- 1 | if !exists('IsPlugLoaded') || !IsPlugLoaded('defx') 2 | finish 3 | endif 4 | 5 | augroup defxinit 6 | au! 7 | autocmd FileType defx call s:defx_init() 8 | " auto close last defx windows 9 | autocmd BufEnter * nested if 10 | \ (!has('vim_starting') && winnr('$') == 1 && &filetype ==# 'defx') 11 | \ | endif 12 | augroup END 13 | 14 | let s:icon_root = ' ' 15 | let s:icon_opened = '▼' 16 | let s:icon_directory = '▶' 17 | 18 | " default options for all buffers 19 | call defx#custom#option('_', { 20 | \ 'winwidth': 30, 21 | \ 'columns': 'indent:git:icons:filename:type', 22 | \ 'split': 'vertical', 23 | \ 'direction': 'leftabove', 24 | \ 'show_ignored_files': 1, 25 | \ 'buffer_name': '', 26 | \ 'toggle': 1, 27 | \ 'resume': 1, 28 | \ }) 29 | 30 | call defx#custom#column('icon', { 31 | \ 'directory_icon': s:icon_directory, 32 | \ 'opened_icon': s:icon_opened, 33 | \ 'root_icon': s:icon_root, 34 | \ }) 35 | 36 | call defx#custom#column('mark', { 37 | \ 'readonly_icon': '', 38 | \ 'selected_icon': '', 39 | \ }) 40 | 41 | call defx#custom#column('filename', { 42 | \ 'max_width': -90, 43 | \ 'root_marker_highlight': 'String', 44 | \ }) 45 | 46 | function! s:defx_init() abort 47 | 48 | setl nonumber 49 | "setl nospell 50 | "setl nolist 51 | "setl conceallevel=3 52 | "setl statusline=0 53 | setl nofoldenable 54 | setl foldmethod=manual 55 | "setl signcolumn=no 56 | set guifont=FiraCode\ Nerd\ Font\ 11 57 | 58 | " disable this mappings 59 | nnoremap <3-LeftMouse> 60 | nnoremap <4-LeftMouse> 61 | nnoremap 62 | 63 | nnoremap <2-LeftMouse> defx_expand_or_open() 64 | nnoremap defx_expand_or_open() 65 | nnoremap l defx_expand_or_open() 66 | nnoremap h defx#do_action('close_tree') 67 | nnoremap C defx#do_action('copy') 68 | nnoremap P defx#do_action('paste') 69 | nnoremap M defx#do_action('rename') 70 | nnoremap D defx#do_action('remove_trash') 71 | nnoremap A defx#do_action('new_multiple_files') 72 | nnoremap S defx#do_action('open', 'vsplit') 73 | nnoremap U defx#do_action('cd', ['..']) 74 | nnoremap . defx#do_action('toggle_ignored_files') 75 | nnoremap defx#do_action('toggle_select') 76 | nnoremap R defx#do_action('redraw') 77 | nnoremap defx_toggle_zoom() 78 | endfunction 79 | 80 | function s:defx_expand_or_open() 81 | return defx#is_directory() ? defx#do_action('open_or_close_tree') : defx#do_action('drop') 82 | endfunction 83 | 84 | function s:defx_toggle_zoom() abort "{{{ 85 | let b:DefxOldWindowSize = get(b:, 'DefxOldWindowSize', winwidth('%')) 86 | let size = b:DefxOldWindowSize 87 | if exists("b:DefxZoomed") && b:DefxZoomed 88 | exec "silent vertical resize ". size 89 | let b:DefxZoomed = 0 90 | else 91 | exec "vertical resize ". get(g:, 'DefxWinSizeMax', '') 92 | let b:DefxZoomed = 1 93 | endif 94 | endfunction "}}} 95 | 96 | " vim: sw=2 sts=2 tw=0 fdm=marker 97 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/echodoc.vim: -------------------------------------------------------------------------------- 1 | " echodoc configuration 2 | " 3 | " set noshowmode 4 | let g:echodoc#enable_at_startup = 1 5 | let g:echodoc#type = "echo" 6 | 7 | " vim: sw=2 sts=2 tw=0 fdm=marker 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/fzf.vim: -------------------------------------------------------------------------------- 1 | " fzf{,.vim} configuration 2 | " 3 | 4 | " Tell ripgrep to use current working directory 5 | " let g:rg_derive_root = v:true 6 | 7 | " Jump to the existing window if possible. 8 | let g:fzf_buffers_jump = v:true 9 | 10 | " Prefix all fzf commands with F 11 | let g:fzf_command_prefix = 'F' 12 | 13 | let g:fzf_height = 16 14 | 15 | " don't open files over the following buffers 16 | let g:_fzf_prevent_winbuf = ['fern', 'fugitive', 'vista'] 17 | 18 | function fzf#__open(command) 19 | let buf = expand('%') 20 | if winnr('$') > 1 21 | \ && len(filter(copy(g:_fzf_prevent_winbuf), "bufname('%') =~ v:val")) > 0 22 | exe "normal! \\" 23 | endif 24 | 25 | exe ':' . a:command 26 | endf 27 | 28 | " Set fzf to floating layout 29 | let g:fzf_layout = { 30 | \ 'window': { 31 | \ 'width': 0.95, 32 | \ 'height': 0.65, 33 | \ 'highlight': 'Comment', 34 | \ 'yoffset': 0.25, 35 | \ 'border': 'sharp' 36 | \ } } 37 | 38 | " " slide fzf in 39 | " call utils#window#slide_window('fzf', g:fzf_height) 40 | 41 | fun! s:close_fzf() 42 | let w = winnr() 43 | let cl = getwinvar(w, '_animated_close') 44 | " close normally or animate if possible 45 | exe empty(cl) ? printf('%dwincmd c', w) : cl 46 | endf 47 | 48 | augroup fzf_custom 49 | au! 50 | autocmd FileType fzf call utils#init_minimal_window() 51 | \ | tnoremap :call close_fzf() 52 | augroup end 53 | 54 | " Override fzf command to add extra ripgrep opts 55 | if !empty($FZF_DEFAULT_COMMAND) 56 | let g:fzf_default_command = get(g:, 'fzf_default_command', 57 | \ $FZF_DEFAULT_COMMAND . ' --follow -g "!vim-undo/**" -g "!plugged/**" -g "!.git/**"') 58 | let $FZF_DEFAULT_COMMAND = g:fzf_default_command 59 | endif 60 | 61 | " Override fzf opts 62 | let g:fzf_default_opts = get(g:, 'fzf_default_opts', 63 | \ $FZF_DEFAULT_OPTS . ' --inline-info --bold --margin=1,4') 64 | let $FZF_DEFAULT_OPTS = g:fzf_default_opts 65 | 66 | let g:fzf_colors = { 67 | \ 'fg': ['fg', 'Normal'], 68 | \ 'bg': ['bg', 'Normal'], 69 | \ 'hl': ['fg', 'Comment'], 70 | \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], 71 | \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], 72 | \ 'hl+': ['fg', 'Statement'], 73 | \ 'info': ['fg', 'PreProc'], 74 | \ 'border': ['fg', 'Ignore'], 75 | \ 'prompt': ['fg', 'Conditional'], 76 | \ 'pointer': ['fg', 'Exception'], 77 | \ 'marker': ['fg', 'Keyword'], 78 | \ 'spinner': ['fg', 'Label'], 79 | \ 'header': ['fg', 'Comment'] } 80 | 81 | " nnoremap \ :Rg 82 | nnoremap :Files 83 | nnoremap ? :Rg 84 | 85 | let s:fzf_opts = {'options': [ 86 | \ '--prompt=ﬦ ', 87 | \ '--info=hidden', 88 | \ '--preview-window=noborder' 89 | \ ]} 90 | 91 | command! -bang -nargs=? -complete=dir Files 92 | \ call fzf#vim#files( 93 | \ , 94 | \ fzf#vim#with_preview(s:fzf_opts), 95 | \ 0) 96 | 97 | command! -bang -nargs=* Rg 98 | \ call fzf#vim#grep( 99 | \ printf( 100 | \ 'rg --follow --column --line-number --no-heading --color=always --smart-case -- %s || true', 101 | \ shellescape()), 102 | \ 1, 103 | \ fzf#vim#with_preview(s:fzf_opts), 0) 104 | 105 | command! -bang -nargs=* GGrep 106 | \ call fzf#vim#grep( 107 | \ 'git grep --line-number -- '.shellescape(), 0, 108 | \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) 109 | 110 | " vim: sw=2 sts=2 tw=0 fdm=marker 111 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/goyo.vim: -------------------------------------------------------------------------------- 1 | " goyo.vim + limelight configuration 2 | " 3 | 4 | let g:goyo_width = 104 5 | let g:limelight_conceal_guifg = '#2b2b30' 6 | 7 | fun! s:goyo_enter() 8 | let s:scr = &scrolloff 9 | let s:col = g:colors_name 10 | colo ayu 11 | Limelight 12 | set scrolloff=999 13 | endf 14 | 15 | fun! s:goyo_leave() 16 | let &scrolloff = s:scr 17 | exe 'colo' s:col 18 | Limelight! 19 | endf 20 | 21 | autocmd! User GoyoEnter nested call goyo_enter() 22 | autocmd! User GoyoLeave nested call goyo_leave() 23 | 24 | " vim: sw=2 sts=2 tw=0 fdm=marker 25 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/gruvbox.vim: -------------------------------------------------------------------------------- 1 | " gruvbox config file 2 | " 3 | 4 | augroup gruv_color 5 | autocmd ColorScheme gruvbox call s:set_colors() 6 | augroup end 7 | 8 | fun s:set_colors() 9 | hi GruvboxRed gui=bold 10 | hi GruvboxGreen gui=bold 11 | hi CursorLineNr guibg=bg ctermbg=NONE 12 | if &bg == 'dark' 13 | hi CursorLine guibg=#151A1E 14 | else 15 | " hi CursorLine guibg=#151A1E 16 | endif 17 | 18 | hi! link LineNr EndOfBuffer 19 | call utils#color#copy_hi_group("GruvboxRedSign", "CocErrorSign") 20 | hi CocErrorSign guibg=bg ctermbg=NONE 21 | endfu 22 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/highlightedyank-vim.vim: -------------------------------------------------------------------------------- 1 | " highlightedyank-vim configuration 2 | 3 | let g:highlightedyank_highlight_duration = 100 4 | 5 | " vim: sw=2 sts=2 tw=0 fdm=marker 6 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/indentline.vim: -------------------------------------------------------------------------------- 1 | " indentline configuration 2 | " 3 | 4 | let g:indentLine_fileTypeExclude = ['fern', 'startify', 'dashboard'] 5 | let g:indentLine_first_char = '┆' 6 | let g:indentLine_showFirstIndentLevel = 0 7 | let g:indentLine_setColors = 1 8 | " vim: sw=2 sts=2 tw=0 fdm=marker 9 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/lens.vim: -------------------------------------------------------------------------------- 1 | " lens.vim configuration 2 | " 3 | let g:lens#disabled_filetypes = ['nerdtree', 'fzf', 'Untitled', 'Scratch', '[coc-explorer]-1', 4 | \ 'NERD_tree_1', 'NERD_tree_2', 'NERD_tree_3'] 5 | let g:lens#height_resize_min = 5 6 | let g:lens#height_resize_max = 40 7 | let g:lens#width_resize_max = 80 8 | let g:lens#width_resize_min = 20 9 | 10 | " vim: sw=2 sts=2 tw=0 fdm=marker 11 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/lightline.vim: -------------------------------------------------------------------------------- 1 | " lightline/-buffers configuration 2 | " 3 | 4 | let g:lightline = get(g:, 'lightline', {}) 5 | 6 | let g:lightline.colorscheme = 'molokai' 7 | 8 | let g:lightline.separator = { 'left': "\ue0b0", 'right': "\ue0b2" } 9 | let g:lightline.subseparator = { 'left': "\ ", 'right': "/" } 10 | 11 | let g:lightline.mode_map = { 12 | \ 'n' : 'n', 13 | \ 'i' : 'i', 14 | \ 'R' : 'r', 15 | \ 'v' : 'VISUAL', 16 | \ 'V' : 'V-LINE', 17 | \ "\": 'V-BLOCK', 18 | \ 'c' : 'COMMAND', 19 | \ 's' : 'SELECT', 20 | \ 'S' : 'S-LINE', 21 | \ "\": 'S-BLOCK', 22 | \ 't': 'TERMINAL', 23 | \ } 24 | 25 | let g:lightline#bufferline#clickable = 1 26 | let g:lightline#bufferline#enable_devicons = 1 27 | let g:lightline#bufferline#unicode_symbols = 1 28 | let g:lightline#bufferline#min_buffer_count = 1 29 | let g:lightline#bufferline#show_number = 2 30 | let g:lightline#bufferline#unnamed = 'Untitled' 31 | let g:lightline#bufferline#filename_modifier = ':t' 32 | 33 | let g:lightline.active = {} 34 | let g:lightline.active.left = [['mode', 'paste'], ['filename', 'gitbranch']] 35 | let g:lightline.active.right = [['lineinfo', 'percent'], ['hlsearch', 'spell'], ['diagnostics', 'linter', 'cocstatus', 'currentfunction']] 36 | 37 | let g:lightline.inactive = {} 38 | 39 | " 40 | let g:lightline.tabline = { 41 | \ 'left': [['buffers']], 42 | \ 'right': [[ 'close' ]] 43 | \} 44 | 45 | " let g:lightline.component = { } 46 | 47 | let g:lightline.component_raw = { 'buffers': 1 } 48 | 49 | let g:lightline.component_function = { 50 | \ 'filename': 'statusline#filename', 51 | \ 'gitbranch': 'statusline#gitbranch', 52 | \ 'linter': 'statusline#linter', 53 | \ 'hlsearch': 'statusline#hlsearch', 54 | \ 'cocstatus': 'coc#status', 55 | \ 'currentfunction': 'CocCurrentFunction', 56 | \ 'spell': 'statusline#spell', 57 | \ 'diagnostics': 'Diag' 58 | \} 59 | 60 | function! Diag() 61 | let info = get(b:, 'coc_diagnostic_info', {}) 62 | if empty(info) | return '' | endif 63 | let msgs = [] 64 | if get(info, 'error', 0) 65 | call add(msgs, 'E' . info['error']) 66 | endif 67 | if get(info, 'warning', 0) 68 | call add(msgs, 'W' . info['warning']) 69 | endif 70 | return join(msgs, ' '). ' ' . get(g:, 'coc_status', '') 71 | endfunction 72 | 73 | function! CocCurrentFunction() 74 | return get(b:, 'coc_current_function', tagbar#currenttag('%s', '', '')) 75 | endfunction 76 | 77 | let g:lightline.component_expand = { 78 | \ 'buffers': 'lightline#bufferline#buffers', 79 | \ 'linter_checking': 'lightline#ale#checking', 80 | \ 'linter_warnings': 'lightline#ale#warnings', 81 | \ 'linter_errors': 'lightline#ale#errors', 82 | \ 'linter_ok': 'lightline#ale#ok', 83 | \} 84 | 85 | let g:lightline.component_type = { 86 | \ 'buffers': 'tabsel', 87 | \ 'linter_checking': 'left', 88 | \ 'linter_warnings': 'warning', 89 | \ 'linter_errors': 'error', 90 | \ 'linter_ok': 'left', 91 | \ } 92 | 93 | 94 | fu! lightline#_update() 95 | call lightline#init() 96 | call lightline#colorscheme() 97 | call lightline#update() 98 | endfu 99 | 100 | 101 | call lightline#_update() 102 | 103 | let g:lightline#bufferline#number_map = { 104 | \ 0: '⁰', 1: '¹', 2: '²', 3: '³', 4: '⁴', 105 | \ 5: '⁵', 6: '⁶', 7: '⁷', 8: '⁸', 9: '⁹'} 106 | 107 | " vim: sw=2 sts=2 tw=0 fdm=marker 108 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/markdown-auto-compile.vim: -------------------------------------------------------------------------------- 1 | 2 | " vim: sw=2 sts=2 tw=0 fdm=marker 3 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/nerdcommenter.vim: -------------------------------------------------------------------------------- 1 | " NERDCommenter configuration 2 | " 3 | 4 | "" Add spaces after comment delimiters by default 5 | let g:NERDSpaceDelims = 1 6 | 7 | " Use compact syntax for prettified multi-line comments 8 | let g:NERDCompactSexyComs = 1 9 | 10 | " Allow commenting and inverting empty lines (useful when commenting a region) 11 | let g:NERDCommentEmptyLines = 1 12 | 13 | " Align line-wise comment delimiters flush left instead of following code indentation 14 | let g:NERDDefaultAlign = 'left' 15 | 16 | " Allow commenting and inverting empty lines (useful when commenting a region) 17 | let g:NERDCommentEmptyLines = 1 18 | 19 | " Enable trimming of trailing whitespace when uncommenting 20 | let g:NERDTrimTrailingWhitespace = 1 21 | 22 | " Enable NERDCommenterToggle to check all selected lines is commented or not 23 | let g:NERDToggleCheckAllLines = 1 24 | 25 | " vim: sw=2 sts=2 tw=0 fdm=marker 26 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/nerdtree.vim: -------------------------------------------------------------------------------- 1 | " NERDTree 2 | " 3 | let NERDTreeIgnore = ['node_modules', 'tmp', 'bower_components'] 4 | let NERDTreeMinimalUI = 1 5 | let NERDTreeDirArrows = 1 6 | let NERDTreeShowHidden = 1 7 | let g:NERDTreeHijackNetrw = 1 8 | let g:NERDTreeQuitOnOpen = 1 9 | 10 | "" Open nerd tree on start 11 | au VimEnter NERD_tree_1 enew | execute 'NERDTree '.argv()[0] 12 | 13 | " If NERDTree is open in the current buffer 14 | function! NERDTreeToggleInCurDir() 15 | if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 16 | exe ":NERDTreeClose" 17 | else 18 | if (expand("%:t") != '') 19 | exe ":NERDTreeFind" 20 | else 21 | exe ":NERDTreeToggle" 22 | endif 23 | endif 24 | endfunction 25 | 26 | " NERDTrees File highlighting 27 | let s:colors = palenight#GetColors() 28 | 29 | function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) 30 | exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg 31 | exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#' 32 | endfunction 33 | 34 | call NERDTreeHighlightFile('md', 'blue', 'none', s:colors.blue.gui, 'none') 35 | call NERDTreeHighlightFile('yml', 'magenta', 'none', s:colors.purple.gui, 'none') 36 | call NERDTreeHighlightFile('json', 'yellow', 'none', s:colors.yellow.gui, 'none') 37 | call NERDTreeHighlightFile('html', 'blue', 'none', s:colors.blue.gui, 'none') 38 | call NERDTreeHighlightFile('css', 'cyan', 'none', s:colors.cyan.gui, 'none') 39 | call NERDTreeHighlightFile('scss', 'cyan', 'none', s:colors.cyan.gui, 'none') 40 | call NERDTreeHighlightFile('coffee', 'yellow', 'none', s:colors.dark_yellow.gui, 'none') 41 | call NERDTreeHighlightFile('js', 'yellow', 'none', s:colors.yellow.gui, 'none') 42 | call NERDTreeHighlightFile('rb', 'red', 'none', s:colors.red.gui, 'none') 43 | 44 | " vim: sw=2 sts=2 tw=0 fdm=marker 45 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/quick-scope.vim: -------------------------------------------------------------------------------- 1 | " quick-scope configuration 2 | " 3 | 4 | let g:qs_buftype_blacklist = ['terminal', 'nofile', 'coc-explorer'] 5 | 6 | " Trigger a highlight in the appropriate direction when pressing these keys: 7 | let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] 8 | 9 | " vim: sw=2 sts=2 tw=0 fdm=marker 10 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/ultisnips.vim: -------------------------------------------------------------------------------- 1 | " ultisnips configuration 2 | " 3 | let g:UltiSnipsExpandTrigger='' 4 | let g:UltiSnipsJumpForwardTrigger='' 5 | let g:UltiSnipsJumpBackwardTrigger='' 6 | 7 | " vim: sw=2 sts=2 tw=0 fdm=marker 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/undotree.vim: -------------------------------------------------------------------------------- 1 | " undotree.vim configuration 2 | " 3 | 4 | let g:undotree_WindowLayout = 2 5 | let g:undotree_SetFocusWhenToggle = 1 6 | let g:undotree_ShortIndicators = 1 7 | 8 | " vim: sw=2 sts=2 tw=0 fdm=marker 9 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-easy-align.vim: -------------------------------------------------------------------------------- 1 | " vim-easy-align configuration 2 | " 3 | 4 | xmap ga (EasyAlign) 5 | nmap ga (EasyAlign) 6 | 7 | " vim: sw=2 sts=2 tw=0 fdm=marker 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-easymotion.vim: -------------------------------------------------------------------------------- 1 | " vim-easy-motion configuration 2 | " 3 | 4 | let g:EasyMotion_do_mapping = 0 5 | let g:EasyMotion_smartcase = 1 6 | let g:EasyMotion_inc_highlight = 0 7 | let g:EasyMotion_landing_highlight = 0 8 | let g:EasyMotion_off_screen_search = 0 9 | let g:EasyMotion_smartcase = 0 10 | let g:EasyMotion_startofline = 0 11 | let g:EasyMotion_use_smartsign_us = 1 12 | let g:EasyMotion_use_upper = 0 13 | let g:EasyMotion_skipfoldedline = 0 14 | 15 | function! Easyfuzzymotion(...) 16 | return extend(copy({ 17 | \ 'converters': [incsearch#config#fuzzy#converter()], 18 | \ 'modules': [incsearch#config#easymotion#module()], 19 | \ 'keymap': {"\": '(easymotion)'}, 20 | \ 'is_expr': 0, 21 | \ 'is_stay': 1 22 | \ }), get(a:, 1, {})) 23 | endfunction 24 | 25 | """ IncSearch 26 | noremap / incsearch#go(Easyfuzzymotion()) 27 | map / (incsearch-easymotion-/) 28 | " map ? (incsearch-easymotion-?) 29 | map g/ (incsearch-easymotion-stay) 30 | 31 | " `s{char}{char}{label}` 32 | nmap s (easymotion-s2) 33 | " JK motions: Line motions 34 | map j (easymotion-j) 35 | map k (easymotion-k) 36 | 37 | " vim: sw=2 sts=2 tw=0 fdm=marker 38 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-expand-region.vim: -------------------------------------------------------------------------------- 1 | " vim-expand-region configuration 2 | " 3 | 4 | " map +/- to expand regions 5 | nmap (expand_region_expand) 6 | vmap (expand_region_expand) 7 | vmap (expand_region_shrink) 8 | nmap (expand_region_shrink) 9 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-highlightedyank.vim: -------------------------------------------------------------------------------- 1 | " vim-highlightedyank configuration 2 | " 3 | 4 | " Reverse the highlight color for yanked text for better visuals 5 | highlight HighlightedyankRegion cterm=reverse gui=reverse 6 | 7 | " Let highlight endures longer 8 | let g:highlightedyank_highlight_duration = 1000 9 | 10 | " vim: sw=2 sts=2 tw=0 fdm=marker 11 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-matchup.vim: -------------------------------------------------------------------------------- 1 | " vim-matchup configuration 2 | " 3 | 4 | 5 | let g:loaded_matchit = 1 6 | let g:matchup_matchparen_deferred = 1 7 | let g:matchup_matchparen_hi_surround_always = 1 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-mergetool.vim: -------------------------------------------------------------------------------- 1 | " vim-mergetool configuration 2 | 3 | let g:mergetool_layout = 'mr' 4 | let g:mergetool_prefer_revision = 'local' 5 | 6 | " vim: sw=2 sts=2 tw=0 fdm=marker 7 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-obsession.vim: -------------------------------------------------------------------------------- 1 | " vim-obsession configuration 2 | " 3 | augroup AutomaticallySourceSession | au! 4 | autocmd BufEnter *.* 5 | \ if !empty(glob(expand('%:h') . '/Session.vim')) 6 | \ | :so Session.vim 7 | \ | :Obsession! 8 | \ | endif 9 | augroup end 10 | " \ if !empty(glob('~/.local/share/nvim/site/Session.vim')) 11 | " \ | :so ~/.local/share/nvim/site/Session.vim 12 | " \ | :Obsession! ~/.local/share/nvim/site/Session.vim 13 | " \ | endif 14 | 15 | " vim: sw=2 sts=2 tw=0 fdm=marker 16 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-rooter.vim: -------------------------------------------------------------------------------- 1 | " vim-rooter configuration 2 | " 3 | let g:rooter_change_directory_for_non_project_files = 'current' 4 | let g:rooter_patterns = [ '.project-root', 'deps', 'package.json', 'README.*', '.git/' ] 5 | " let g:rooter_targets = '*' 6 | 7 | " vim: sw=2 sts=2 tw=0 fdm=marker 8 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-signify.vim: -------------------------------------------------------------------------------- 1 | " vim-signify configuration 2 | " 3 | 4 | let g:signify_sign_add = '▍' 5 | let g:signify_sign_delete = '▍' 6 | let g:signify_sign_delete_first_line = '▍' 7 | let g:signify_sign_change = '▍' 8 | let g:signify_sign_show_count = 0 9 | 10 | au! ColorScheme * silent call set_colors() 11 | 12 | function! s:set_colors() 13 | hi SignifySignAdd cterm=NONE gui=NONE guifg=#8ec07c guibg=bg 14 | hi SignifySignDelete cterm=NONE gui=NONE guifg=#fb4934 guibg=bg 15 | hi SignifySignChange cterm=NONE gui=NONE guifg=#83a598 guibg=bg 16 | endfunction 17 | 18 | call set_colors() 19 | 20 | " vim: sw=2 sts=2 tw=0 fdm=marker 21 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-smoothie.vim: -------------------------------------------------------------------------------- 1 | " vim-smoothie configuration 2 | " 3 | 4 | let g:smoothie_no_default_mappings = v:false 5 | 6 | silent! nmap (SmoothieBackwards) 7 | silent! nmap (SmoothieForwards) 8 | 9 | " vim: sw=2 sts=2 tw=0 fdm=marker 10 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-startify.vim: -------------------------------------------------------------------------------- 1 | " vim-startify configuration 2 | " 3 | 4 | let g:startify_change_to_dir = 0 5 | let g:startify_custom_header = 'startify#pad(startify#fortune#boxed())' 6 | let g:startify_enable_special = 0 7 | let g:startify_fortune_use_unicode = 1 8 | let g:startify_update_oldfiles = 1 9 | let g:startify_use_env = 1 10 | 11 | let g:startify_custom_footer = 12 | \ startify#center(['', " Vim is charityware. Please read ':help uganda'.", '']) 13 | function! s:list_commits() 14 | let git = 'git -C ~/repo' 15 | let commits = systemlist(git .' log --oneline | head -n10') 16 | let git = 'G'. git[1:] 17 | return map(commits, '{"line": matchstr(v:val, "\\s\\zs.*"), "cmd": "'. git .' show ". matchstr(v:val, "^\\x\\+") }') 18 | endfunction 19 | 20 | let g:startify_lists = [ 21 | \ { 'header': [' MRU'], 'type': 'files' }, 22 | \ { 'header': [' MRU '. getcwd()], 'type': 'dir' }, 23 | \ { 'header': [' Sessions'], 'type': 'sessions' }, 24 | \ { 'header': [' Commits'], 'type': function('s:list_commits') }, 25 | \ ] 26 | 27 | let g:startify_custom_header = startify#center([ 28 | \ '', 29 | \ 30 | \ ' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', 31 | \ ' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', 32 | \ ' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', 33 | \ ' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', 34 | \ ' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', 35 | \ ' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', 36 | \ '', 37 | \ '', 38 | \ " .o oOOOOOOOo 0OOOo", 39 | \ " Ob.OOOOOOOo OOOo. oOOo. .adOOOOOOO", 40 | \ " OboO000000000000.OOo. .oOOOOOo. OOOo.oOOOOOo..0000000000OO", 41 | \ " OOP.oOOOOOOOOOOO 0POOOOOOOOOOOo. `0OOOOOOOOOP,OOOOOOOOOOOB'", 42 | \ " `O'OOOO' `OOOOo\"OOOOOOOOOOO` .adOOOOOOOOO\"oOOO' `OOOOo", 43 | \ " .OOOO' `OOOOOOOOOOOOOOOOOOOOOOOOOO' `OO", 44 | \ " OOOOO '\"OOOOOOOOOOOOOOOO\"` oOO", 45 | \ " oOOOOOba. .adOOOOOOOOOOba .adOOOOo.", 46 | \ " oOOOOOOOOOOOOOba. .adOOOOOOOOOO@^OOOOOOOba. .adOOOOOOOOOOOO", 47 | \ " OOOOOOOOOOOOOOOOO.OOOOOOOOOOOOOO\"` '\"OOOOOOOOOOOOO.OOOOOOOOOOOOOO", 48 | \ " : .oO%OOOOOOOOOOo.OOOOOO.oOOOOOOOOOOOO? .", 49 | \ " Y 'OOOOOOOOOOOOOO: .oOOo. :OOOOOOOOOOO?' :`", 50 | \ " . oOOP\"%OOOOOOOOoOOOOOOO?oOOOOO?OOOO\"OOo", 51 | \ " '%o OOOO\"%OOOO%\"%OOOOO\"OOOOOO\"OOO':", 52 | \ " `$\" `OOOO' `O\"Y ' `OOOO' o .", 53 | \ " . . OP\" : o .", 54 | \ "", 55 | \ ]) 56 | 57 | " vim: sw=2 sts=2 tw=0 fdm=marker 58 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vim-wintabs.vim: -------------------------------------------------------------------------------- 1 | " vim-wintabs configuration 2 | " 3 | 4 | noremap :WintabsPrevious 5 | noremap :WintabsNext 6 | 7 | let g:wintabs_ui_readonly = ' ' 8 | let g:wintabs_ui_modified = ' ' 9 | let g:wintabs_autoclose = 2 10 | let g:wintabs_autoclose_vim = 2 11 | let g:wintabs_ui_sep_inbetween = "" 12 | let g:wintabs_ui_sep_rightmost = "" 13 | 14 | let s:sep_left = "\ue0ba" " or ue0b6 | a | e 15 | let s:sep_right = "\ue0bc" " or ue0b4 | c | 8 16 | 17 | let s:sep_left = "" 18 | let s:sep_right = "" 19 | 20 | fun! s:init() 21 | let g:wintabs_renderers = extend(wintabs#renderers#defaults(), { 22 | \ 'buffer': funcref('s:buffer'), 23 | \ 'buffer_sep': funcref('s:buffer_sep'), 24 | \ 'line_sep': funcref('s:line_sep'), 25 | \ 'padding': funcref('s:padding'), 26 | \ }) 27 | 28 | augroup wintabs_powerline_on_colorscheme 29 | autocmd! 30 | autocmd ColorScheme,VimEnter * call s:on_colorscheme() 31 | augroup END 32 | 33 | call s:on_colorscheme() 34 | endf 35 | 36 | 37 | fun! s:on_colorscheme() 38 | hi WintabsEmpty guibg=NONE 39 | hi WintabsArrow guibg=NONE 40 | hi WintabsActive guibg=#a790d5 gui=bold 41 | hi WintabsActiveSep guibg=NONE guifg=#a790d5 42 | hi! link WintabsActive Statement 43 | 44 | hi! link WintabsInactive Wintabs 45 | hi! link Wintabs LineNr 46 | hi! link WintabsEmpty WintabsActive 47 | endf 48 | 49 | fun! s:buffer(bufnr, config) 50 | let is_active = a:config.is_active && a:config.is_active_window 51 | return { 52 | \'label': wintabs#renderers#buf_label(a:bufnr, a:config), 53 | \'highlight': is_active ? 'WintabsActive' : 'WintabsInactive', 54 | \} 55 | endf 56 | 57 | fun! s:buffer_sep(config) 58 | let label = a:config.is_leftmost ? s:sep_left : 59 | \ a:config.is_rightmost ? s:sep_right : 60 | \ join([s:sep_right, s:sep_left], '') 61 | let is_active = a:config.is_active && a:config.is_active_window 62 | 63 | return { 64 | \ 'label': is_active ? a:config.is_left ? s:sep_left : s:sep_right : '', 65 | \ 'highlight': is_active ? 'WintabsActiveSep' : 'Wintabs' 66 | \ } 67 | endf 68 | 69 | fun! s:line_sep() 70 | return { 71 | \'type': 'sep', 72 | \'label': ' ', 73 | \'highlight': 'WintabsEmpty', 74 | \} 75 | endf 76 | 77 | fun! s:padding(len) 78 | return { 79 | \'type': 'sep', 80 | \'label': repeat(' ', a:len), 81 | \'highlight': 'WintabsEmpty', 82 | \} 83 | endf 84 | 85 | call s:init() 86 | 87 | " vim: sw=2 sts=2 tw=0 fdm=marker 88 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vimtex.vim: -------------------------------------------------------------------------------- 1 | " vimtex.vim - vimtex configuration 2 | 3 | let g:tex_flavor = 'latex' 4 | let g:vimtex_view_method = 'zathura' 5 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/vista.vim: -------------------------------------------------------------------------------- 1 | " vista.vim configuration 2 | " 3 | 4 | if utils#is_plug_loaded('fzf') 5 | nmap gO :Vista finder 6 | endif 7 | 8 | 9 | " au! BufReadPost * call vista#RunForNearestMethodOrFunction() 10 | 11 | let g:vista_sidebar_position = 'vertical botright' 12 | let g:vista_sidebar_width = '50' 13 | 14 | call utils#window#slide_window('vista', 50) 15 | 16 | " vim: sw=2 sts=2 tw=0 fdm=marker 17 | -------------------------------------------------------------------------------- /home/config/nvim/plugins.d/wilder.vim: -------------------------------------------------------------------------------- 1 | call wilder#set_option('modes', [':', '/', '?']) 2 | 3 | call wilder#set_option('pipeline', [ 4 | \ wilder#branch( 5 | \ wilder#cmdline_pipeline(), 6 | \ wilder#search_pipeline(), 7 | \ ), 8 | \ ]) 9 | 10 | call wilder#set_option('renderer', wilder#popupmenu_renderer({ 11 | \ 'highlighter': wilder#basic_highlighter(), 12 | \ 'left': [ 13 | \ wilder#popupmenu_devicons(), 14 | \ ], 15 | \ })) 16 | -------------------------------------------------------------------------------- /home/config/nvim/snippet/javascript.snippets: -------------------------------------------------------------------------------- 1 | snippet log "console.log(...)" i 2 | console.log($1) 3 | endsnippet 4 | -------------------------------------------------------------------------------- /home/config/picom/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # kill picom & wait until it has been shut down 4 | killall -q picom 5 | while pgrep -x picom >/dev/null; do sleep 1; done 6 | 7 | picom -b 8 | -------------------------------------------------------------------------------- /home/config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | # general 2 | backend = "xrender" 3 | vsync = false 4 | corner-radius = 4 5 | 6 | opacity-rule = [ 7 | "50:class_g = 'conky'", 8 | ]; 9 | 10 | # shadows 11 | shadow = true 12 | xinerama-shadow-crop = true 13 | shadow-radius = 29 14 | shadow-offset-x = -33 15 | shadow-offset-y = -28 16 | shadow-opacity = .35 17 | 18 | # fade 19 | fading = false 20 | fade-delta = 3 21 | fade-in-step = .03 22 | fade-out-step = .04 23 | -------------------------------------------------------------------------------- /home/config/polybar/fonts/Ubuntu-C.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/home/config/polybar/fonts/Ubuntu-C.ttf -------------------------------------------------------------------------------- /home/config/polybar/fonts/icomoon-feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/home/config/polybar/fonts/icomoon-feather.ttf -------------------------------------------------------------------------------- /home/config/polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ## Add this to your wm startup file. 4 | bar_type=single 5 | 6 | if [ "$THEME" = "light" ]; then COLOR_THEME="theme/light"; 7 | else COLOR_THEME="theme/dark"; fi 8 | 9 | launch_bar() { 10 | if [ $1 = "split" ]; then 11 | for bar in left center right; do 12 | polybar --reload $bar & 13 | done 14 | else 15 | polybar --reload single & 16 | fi 17 | } 18 | 19 | # Launch bar for all monitors 20 | if command -v xrandr &> /dev/null; then 21 | for MONITOR in $(xrandr --query | grep -i connected | grep -v disconnected | cut -d ' ' -f1); do 22 | MONITOR="$MONITOR" launch_bar $bar_type 23 | done 24 | else 25 | launch_bar $bar_type 26 | fi 27 | -------------------------------------------------------------------------------- /home/config/polybar/scripts/check-network: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | count=0 4 | disconnected="" 5 | wireless_connected="" 6 | ethernet_connected="" 7 | 8 | ID="$(ip link | awk '/state UP/ {print $2}')" 9 | 10 | while true; do 11 | if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then 12 | if [[ $ID == e* ]]; then 13 | echo "$ethernet_connected" ; sleep 25 14 | else 15 | echo "$wireless_connected" ; sleep 25 16 | fi 17 | else 18 | echo "$disconnected" ; sleep 0.5 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /home/config/polybar/scripts/checkupdates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # 3 | # checkupdates: Safely print a list of pending updates. 4 | # 5 | # Copyright (c) 2013 Kyle Keen 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see . 19 | # 20 | 21 | declare -r myname='checkupdates' 22 | declare -r myver='1.0.0' 23 | 24 | plain() { 25 | (( QUIET )) && return 26 | local mesg=$1; shift 27 | printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 28 | } 29 | 30 | msg() { 31 | (( QUIET )) && return 32 | local mesg=$1; shift 33 | printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 34 | } 35 | 36 | msg2() { 37 | (( QUIET )) && return 38 | local mesg=$1; shift 39 | printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1 40 | } 41 | 42 | ask() { 43 | local mesg=$1; shift 44 | printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1 45 | } 46 | 47 | warning() { 48 | local mesg=$1; shift 49 | printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 50 | } 51 | 52 | error() { 53 | local mesg=$1; shift 54 | printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 55 | } 56 | 57 | # check if messages are to be printed using color 58 | unset ALL_OFF BOLD BLUE GREEN RED YELLOW 59 | if [[ -t 2 && ! $USE_COLOR = "n" ]]; then 60 | # prefer terminal safe colored and bold text when tput is supported 61 | if tput setaf 0 &>/dev/null; then 62 | ALL_OFF="$(tput sgr0)" 63 | BOLD="$(tput bold)" 64 | BLUE="${BOLD}$(tput setaf 4)" 65 | GREEN="${BOLD}$(tput setaf 2)" 66 | RED="${BOLD}$(tput setaf 1)" 67 | YELLOW="${BOLD}$(tput setaf 3)" 68 | else 69 | ALL_OFF="\e[1;0m" 70 | BOLD="\e[1;1m" 71 | BLUE="${BOLD}\e[1;34m" 72 | GREEN="${BOLD}\e[1;32m" 73 | RED="${BOLD}\e[1;31m" 74 | YELLOW="${BOLD}\e[1;33m" 75 | fi 76 | fi 77 | readonly ALL_OFF BOLD BLUE GREEN RED YELLOW 78 | 79 | 80 | if (( $# > 0 )); then 81 | echo "${myname} v${myver}" 82 | echo 83 | echo "Safely print a list of pending updates" 84 | echo 85 | echo "Usage: ${myname}" 86 | echo 87 | echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.' 88 | exit 0 89 | fi 90 | 91 | if ! type -P fakeroot >/dev/null; then 92 | error 'Cannot find the fakeroot binary.' 93 | exit 1 94 | fi 95 | 96 | if [[ -z $CHECKUPDATES_DB ]]; then 97 | CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/" 98 | fi 99 | 100 | trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT 101 | 102 | DBPath="$(pacman-conf DBPath)" 103 | if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then 104 | DBPath="/var/lib/pacman/" 105 | fi 106 | 107 | mkdir -p "$CHECKUPDATES_DB" 108 | ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null 109 | if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then 110 | error 'Cannot fetch updates' 111 | exit 1 112 | fi 113 | pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]' 114 | 115 | exit 0 116 | 117 | # vim: set noet: 118 | -------------------------------------------------------------------------------- /home/config/polybar/scripts/lupdates: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | kitty -e "sudo pacman -Syu" 4 | -------------------------------------------------------------------------------- /home/config/polybar/scripts/updates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BAR_ICON="" 4 | NOTIFY_ICON=/usr/share/icons/Papirus/32x32/apps/system-software-update.svg 5 | 6 | get_total_updates() { UPDATES=$(checkupdates 2>/dev/null | wc -l); } 7 | 8 | while true; do 9 | get_total_updates 10 | 11 | # notify user of updates 12 | if hash notify-send &>/dev/null; then 13 | if (( UPDATES > 50 )); then 14 | notify-send -u critical -i $NOTIFY_ICON \ 15 | "You really need to update!!" "$UPDATES New packages" 16 | elif (( UPDATES > 25 )); then 17 | notify-send -u normal -i $NOTIFY_ICON \ 18 | "You should update soon" "$UPDATES New packages" 19 | elif (( UPDATES > 2 )); then 20 | notify-send -u low -i $NOTIFY_ICON \ 21 | "$UPDATES New packages" 22 | fi 23 | fi 24 | 25 | # when there are updates available 26 | # every 10 seconds another check for updates is done 27 | while (( UPDATES > 0 )); do 28 | if (( UPDATES == 1 )); then 29 | echo " $UPDATES Update" 30 | elif (( UPDATES > 1 )); then 31 | echo " $UPDATES Updates" 32 | else 33 | echo $BAR_ICON 34 | fi 35 | sleep 10 36 | get_total_updates 37 | done 38 | 39 | # when no updates are available, use a longer loop, this saves on CPU 40 | # and network uptime, only checking once every 30 min for new updates 41 | while (( UPDATES == 0 )); do 42 | echo $BAR_ICON 43 | sleep 1800 44 | get_total_updates 45 | done 46 | done 47 | -------------------------------------------------------------------------------- /home/config/polybar/scripts/windows: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Created By Aditya Shakya 4 | 5 | rofi -modi window -show window -hide-scrollbar -padding 20 -line-padding 4 -width 40 -lines 6 6 | -------------------------------------------------------------------------------- /home/config/rg/ripgreprc: -------------------------------------------------------------------------------- 1 | # Search hidden files and directories 2 | --hidden 3 | 4 | # Don't let ripgrep vomit really long lines to my terminal, and show a preview. 5 | --max-columns=150 6 | --max-columns-preview 7 | 8 | # Add my 'web' type. 9 | --type-add 10 | web:*.{html,css,js}* 11 | 12 | # Using glob patterns to include/exclude files or folders 13 | --glob=!.git/* 14 | --glob=!Cargo.lock 15 | 16 | # Set the colors. 17 | --colors=line:none 18 | --colors=line:style:bold 19 | 20 | # Because who cares about case!? 21 | --smart-case 22 | 23 | # Follow symlinks 24 | --follow 25 | -------------------------------------------------------------------------------- /home/config/rofi/config: -------------------------------------------------------------------------------- 1 | rofi.hide-scrollbar: true 2 | rofi.modi: combi,ssh,window 3 | rofi.terminal: kitty 4 | rofi.kb-cancel: Escape,Alt+F1,Alt+F2 5 | rofi.soft: true 6 | rofi.sorting-method: fzf 7 | rofi.combi-modi: drun,run 8 | rofi.combi-hide-mode-prefix: true 9 | rofi.display-drun:  10 | rofi.display-combi:  11 | rofi.display-window: 缾 12 | rofi.display-ssh:  13 | rofi.bw: 2 14 | rofi.fixed-num-lines: false 15 | rofi.theme: themes/main 16 | 17 | rofi.me-select-entry: MouseSecondary 18 | rofi.me-accept-entry: MousePrimary 19 | rofi.kb-mode-next: Shift+Right 20 | rofi.kb-mode-previous: Shift+Left,ISO_Left_Tab 21 | rofi.kb-row-tab: Control+Tab 22 | rofi.kb-row-up: Up,Control+p,Control+ISO_Left_Tab 23 | -------------------------------------------------------------------------------- /home/config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | @theme "themes/main" 2 | 3 | configuration { 4 | modi: "combi,ssh,window"; 5 | bw: 2; 6 | fixed-num-lines: false; 7 | terminal: "kitty"; 8 | sorting-method: "fzf"; 9 | combi-modi: "drun,run"; 10 | hide-scrollbar: true; 11 | combi-hide-mode-prefix: true; 12 | display-window: "缾"; 13 | display-ssh: ""; 14 | display-drun: ""; 15 | display-combi: ""; 16 | kb-mode-next: "Shift+Right"; 17 | kb-mode-previous: "Shift+Left"; 18 | kb-row-up: "Up,Control+p,Control+ISO_Left_Tab"; 19 | kb-row-tab: "Control+Tab"; 20 | kb-cancel: "Escape,Alt+F1,Alt+F2"; 21 | me-select-entry: "MouseSecondary"; 22 | me-accept-entry: "MousePrimary"; 23 | } 24 | -------------------------------------------------------------------------------- /home/config/rofi/scripts/app-launcher.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | PROGRAM_NAME=$(basename "$0") 4 | 5 | # options 6 | DEFAULT_MODI=drun 7 | RELATIVE_PATH=themes 8 | 9 | VARIANT= 10 | SIDEBAR_MODE= 11 | THEME=main 12 | SIDE= 13 | FULLSCREEN= 14 | ICONS= 15 | MODI= 16 | 17 | print_help() { 18 | echo "Show a menu in rofi" 19 | echo 20 | echo "Usage: $0 [ options ... ]" 21 | echo "optional arguments:" 22 | echo " -h, --help show this help text" 23 | echo " -m, --show-mode select all packages." 24 | echo " -b, --sidebar sidebar variant." 25 | echo " -s, --switcher add the window modi." 26 | echo " -r, --right show the menu on the right." 27 | echo " -l, --left show the menu on the left." 28 | echo " -v, --variant \"name\" run variant of theme." 29 | echo " -p, --path \"path\" relative path to theme directory." 30 | echo " -f, --fullscreen show menu in fullscreen." 31 | echo 32 | 33 | exit 34 | } 35 | 36 | # if [ $# -eq 0 ]; then 37 | # print_help 38 | # fi 39 | print_err() { local m=$1 && shift; printf "\033[0;31mERROR:\033[0m $m\n" "$@"; exit 1; } 40 | 41 | set_opt() { 42 | if [ "$2" ]; then 43 | eval $1="$2" 44 | else 45 | print_err "No argument supplied for $1. (default: ${!1})" 46 | fi 47 | } 48 | 49 | add_modi() { 50 | if [ "$MODI" ]; then 51 | MODI="$MODI,$1" 52 | else 53 | MODI="$1" 54 | fi 55 | } 56 | 57 | check() { 58 | [ ! "$THEME_NAME" ] && THEME_NAME="$THEME" 59 | 60 | for f in $HOME/.config/rofi/$RELATIVE_PATH/"$THEME_NAME$1"*.rasi ; do 61 | [ -e "$f" ] && THEME_NAME="$THEME_NAME$1" && return || break 62 | done 63 | return 1 64 | } 65 | 66 | while [ "$1" ]; do 67 | case "$1" in 68 | -h|--help) 69 | print_help;; 70 | -m|--modes|--tabs) SIDEBAR_MODE="-sidebar-mode";; 71 | -f|--fullscreen) FULLSCREEN="-fullscreen";; 72 | -i|--icons) ICONS="-show-icons";; 73 | -r|--right) SIDE="-r";; 74 | -l|--left) SIDE= ;; 75 | -b|--sidebar) VARIANT="sb";; 76 | -s|--switcher|--window) add_modi window;; 77 | -k|--keys) add_modi keys;; 78 | -d|--drun) add_modi drun;; 79 | -s|--ssh) add_modi ssh;; 80 | -c|--combi) add_modi combi;; 81 | --show) set_opt SHOW $2 && shift;; 82 | -v|--variant) 83 | set_opt VARIANT $2 && shift;; 84 | -p|--path) 85 | set_opt RELATIVE_PATH $2 && shift;; 86 | -t|--theme) 87 | set_opt THEME $2 && shift;; 88 | esac; shift 89 | done 90 | 91 | type rofi > /dev/null || { echo "Executable \"rofi\" not in PATH or installed, aborting." && exit 1; } 92 | 93 | [ "$VARIANT" ] && VARIANT=.$VARIANT 94 | check $VARIANT || { echo "Variant \"${VARIANT#?}\" doesn't exist." && exit 1; } 95 | 96 | [ "$SIDE" ] && SIDE_NAME="right" || SIDE_NAME="left"; \ 97 | check $SIDE || { echo "Theme side $SIDE_NAME doesn't exist for theme $THEME:${VARIANT:-default}." && exit 1; } 98 | 99 | if [ ! "$MODI" ]; then 100 | MODI=$DEFAULT_MODI 101 | fi 102 | 103 | rofi -theme "$RELATIVE_PATH/$THEME_NAME" -modi $MODI -show ${SHOW:-${MODI##*,}} $SIDEBAR_MODE $FULLSCREEN $ICONS 104 | 105 | # elif [ "$1" = "-f" ]; then 106 | # rofi -show combi -hide-scrollbar -line-margin 15 \ 107 | # -columns 3 -bw 0 -eh 2 -show-icons -fullscreen 108 | # else 109 | # echo "syntax: launcher [-f]" 110 | # fi 111 | -------------------------------------------------------------------------------- /home/config/rofi/scripts/calc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Use it by adding a new mode, e.g.: 5 | # rofi -show run -modi calc:../Examples/rofi-calculator.sh 6 | ROFI_CALC_HISTORY_FILE=~/.local/share/rofi/rofi_calc_history 7 | ROFI_CALC_HISTORY_MAXCOUNT=15 # maximum number of history entries 8 | 9 | # Create the directory for the files of the script 10 | if [ ! -d $(dirname "${ROFI_CALC_HISTORY_FILE}") ] 11 | then 12 | mkdir -p "$(dirname "${ROFI_CALC_HISTORY_FILE}")" 13 | fi 14 | 15 | if [ -z $@ ] 16 | then 17 | cat ${ROFI_CALC_HISTORY_FILE} 18 | else 19 | FORMULA=$@ 20 | 21 | if [ -n "${FORMULA}" ] 22 | then 23 | if [[ "${FORMULA}" =~ "=" ]] 24 | then 25 | OUTPUT=${FORMULA} 26 | else 27 | RESULT=`echo "${FORMULA}" | bc -l` 28 | OUTPUT="${FORMULA} = ${RESULT}" 29 | fi 30 | echo -e "${OUTPUT}\n$(cat ${ROFI_CALC_HISTORY_FILE})" > ${ROFI_CALC_HISTORY_FILE} 31 | if [ $( wc -l < "${ROFI_CALC_HISTORY_FILE}" ) -gt ${ROFI_CALC_HISTORY_MAXCOUNT} ] 32 | then 33 | echo "$(head -n ${ROFI_CALC_HISTORY_MAXCOUNT} ${ROFI_CALC_HISTORY_FILE})" > ${ROFI_CALC_HISTORY_FILE} 34 | fi 35 | cat ${ROFI_CALC_HISTORY_FILE} 36 | fi 37 | fi 38 | -------------------------------------------------------------------------------- /home/config/rofi/scripts/cycle-themes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | tmp=/tmp/rofi-cycle-themes."$USER" 4 | 5 | # create if not exists 6 | touch $tmp 7 | 8 | i=$(cat $tmp | wc -m) 9 | rofi="~/.config/rofi/scripts/app-launcher.sh --window --combi --ssh --show combi" 10 | case $(($i % 8)) in 11 | 0) eval $rofi ;; 12 | 1) eval $rofi --modes;; 13 | 2) eval $rofi --modes -v modes;; 14 | 3) eval $rofi --modes -v modes --right;; 15 | 4) eval $rofi --sidebar;; 16 | 5) eval $rofi --sidebar --modes;; 17 | 6) eval $rofi --sidebar --right;; 18 | 7) eval $rofi --sidebar --right --modes;; 19 | esac 20 | 21 | printf "+" >> $tmp 22 | -------------------------------------------------------------------------------- /home/config/rofi/scripts/powermenu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | theme=themes/powermenu 4 | if [ $# -ne 0 ] && [ "$1" = "-with-hint" ] 5 | then 6 | options=" Hibernate|ﰇ Reboot| Shutdown| Logout| Lock" 7 | theme="$theme-text" 8 | else 9 | options="|ﰇ|||" 10 | fi 11 | 12 | case "$(rofi -sep '|' -dmenu -i -p 'Power' -theme $theme <<< "$options")" in 13 | *Lock|) 14 | ~/.local/bin/lockscreen 15 | ;; 16 | *Logout||) 17 | i3-msg exit 18 | ;; 19 | *Shutdown|) 20 | loginctl poweroff 21 | ;; 22 | *Reboot|ﰇ) 23 | loginctl reboot 24 | ;; 25 | *Hibernate|) 26 | loginctl hibernate 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /home/config/rofi/themes/colors/fallback.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * Define fallback colors if not using pywal to gen colors. 3 | */ 4 | 5 | * { 6 | foreground: #c5c8c6; 7 | background: #1d1f21; 8 | alternate-foreground: #c5c8c6; 9 | alternate-background: #1d1f21; 10 | soft: #85678f; 11 | complement: #eadab6; 12 | accent: #883B32; 13 | } 14 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.colorscheme.rasi: -------------------------------------------------------------------------------- 1 | @import "colors/fallback" 2 | @import "~/.cache/wal/colors-rofi-dark" 3 | 4 | * { 5 | /* make background color transparent */ 6 | background-color: rgba (0, 0, 0, 0 %); 7 | 8 | prompt-colon-color: @complement; 9 | prompt-text-color: @soft; 10 | 11 | /* normal colors */ 12 | normal-foreground: @foreground; 13 | normal-background: @background; 14 | selected-normal-background: @accent; 15 | selected-normal-foreground: @complement; 16 | 17 | /* active colors */ 18 | active-foreground: @background; 19 | active-background: @foreground; 20 | selected-active-foreground: @active-background; 21 | selected-active-background: @soft; 22 | 23 | /* urgent colors */ 24 | urgent-foreground: @foreground; 25 | urgent-background: @soft; 26 | selected-urgent-foreground: @urgent-foreground; 27 | selected-urgent-background: white; 28 | 29 | /* alternate colors */ 30 | alternate-normal-foreground: @normal-foreground; 31 | alternate-normal-background: @normal-background; 32 | alternate-active-foreground: @active-foreground; 33 | alternate-active-background: @active-background; 34 | alternate-urgent-foreground: @urgent-foreground; 35 | alternate-urgent-background: @urgent-background; 36 | 37 | text-color: @normal-foreground; 38 | border-color: none; 39 | separatorcolor: none; 40 | } 41 | 42 | #window { 43 | transparency: "real"; 44 | background-color: @background; 45 | } 46 | 47 | #inputbar { 48 | text-color: @normal-foreground; 49 | border: @inputbar-border; 50 | border-color: @complement; 51 | } 52 | 53 | #textbox-prompt-colon { 54 | str: @prompt-colon-text; 55 | text-color: @prompt-colon-color; 56 | } 57 | 58 | #prompt { 59 | text-color: @prompt-text-color; 60 | } 61 | 62 | #message { 63 | border-color: @separatorcolor; 64 | } 65 | 66 | #listview { 67 | border-color: @separatorcolor; 68 | } 69 | 70 | #element normal normal { 71 | background-color: @normal-background; 72 | text-color: @normal-foreground; 73 | } 74 | #element normal urgent { 75 | background-color: @urgent-background; 76 | text-color: @urgent-foreground; 77 | } 78 | #element normal active { 79 | background-color: @active-background; 80 | text-color: @active-foreground; 81 | } 82 | #element selected normal { 83 | background-color: @selected-normal-background; 84 | text-color: @selected-normal-foreground; 85 | } 86 | #element selected urgent { 87 | background-color: @selected-urgent-background; 88 | text-color: @selected-urgent-foreground; 89 | } 90 | #element selected active { 91 | background-color: @selected-active-background; 92 | text-color: @selected-active-foreground; 93 | } 94 | #element alternate normal { 95 | background-color: @alternate-normal-background; 96 | text-color: @alternate-normal-foreground; 97 | } 98 | #element alternate urgent { 99 | background-color: @alternate-urgent-background; 100 | text-color: @alternate-urgent-foreground; 101 | } 102 | #element alternate active { 103 | background-color: @alternate-active-background; 104 | text-color: @alternate-active-foreground; 105 | } 106 | #button selected { 107 | text-color: @prompt-text-color; 108 | } 109 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.modes-r.rasi: -------------------------------------------------------------------------------- 1 | @import "main.modes" 2 | 3 | /* main with modes on the right */ 4 | #window { 5 | children: [ content, mode-switcher ]; 6 | orientation: horizontal; 7 | } 8 | 9 | #content { 10 | children: [ inputbar, message, listview ]; 11 | } 12 | 13 | #prompt { 14 | enabled: false; 15 | } 16 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.modes.rasi: -------------------------------------------------------------------------------- 1 | @import "main.rasi" 2 | 3 | /* main with modes on the left */ 4 | #window { 5 | children: [ inputbar, mainbox ]; 6 | border: @border-size; 7 | padding: 20; 8 | width: 30%; 9 | x-offset: -30px; 10 | } 11 | 12 | #mainbox { 13 | children: [ mode-switcher, content ]; 14 | orientation: horizontal; 15 | } 16 | 17 | #content { 18 | children: [ message, listview ]; 19 | } 20 | 21 | 22 | #mode-switcher { 23 | orientation: vertical; 24 | padding: 0 25 0 5; 25 | } 26 | 27 | #button { 28 | margin: 10 0; 29 | padding: 0 22; 30 | } 31 | 32 | #button selected { 33 | text-color: @selected-active-foreground; 34 | background-color: @selected-active-background; 35 | } 36 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.rasi: -------------------------------------------------------------------------------- 1 | @import "main.colorscheme" 2 | 3 | * { 4 | font: "FiraCode Nerd Font Regular 10.5"; 5 | icon-font: "FiraCode Nerd Font Regular 12.5"; /* Nerd Font is patched so includes icons */ 6 | bold-font: "FiraCode Nerd Font Bold 11.5"; 7 | 8 | prompt-colon-text: " ﬦ "; 9 | 10 | /* default settings */ 11 | spacing: 2; 12 | border-size: 0; 13 | element-padding: 15px; 14 | button-padding: 9px 10px; 15 | 16 | inputbar-border: 0 0 0px; 17 | } 18 | 19 | #window { 20 | border: @border-size; 21 | padding: 20; 22 | width: 30%; 23 | y-offset: -100; 24 | } 25 | 26 | // Input bar {{{ 27 | #inputbar { 28 | children: [ textbox-prompt-colon, entry, case-indicator, prompt ]; 29 | spacing: 0; 30 | padding: 0px 0px 20px; 31 | margin: 10px 10px 5px; 32 | border: @inputbar-border; 33 | } 34 | 35 | #textbox-prompt-colon { 36 | expand: false; 37 | } 38 | 39 | #entry { 40 | spacing: 0; 41 | } 42 | 43 | #case-indicator { 44 | spacing: 0; 45 | } 46 | 47 | #prompt { 48 | spacing: 0; 49 | font: @bold-font; 50 | margin: 0 0 0 -40px; 51 | } 52 | // }}} 53 | 54 | #message { 55 | border: 0px; 56 | padding: 1px; 57 | margin-top: 2px; 58 | } 59 | 60 | #listview { 61 | fixed-height: true; 62 | lines: 6; 63 | columns: 2; 64 | padding: 4px; 65 | } 66 | 67 | #mode-switcher { 68 | spacing: 40; 69 | padding: 0 30; 70 | } 71 | 72 | #element { 73 | padding: @element-padding; 74 | } 75 | 76 | #button { 77 | padding: @button-padding; 78 | font: @icon-font; 79 | } 80 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.sb-r.rasi: -------------------------------------------------------------------------------- 1 | @import "main.sb" 2 | 3 | /* main as a sidebar on the right */ 4 | 5 | #window { 6 | location: north east; 7 | } 8 | -------------------------------------------------------------------------------- /home/config/rofi/themes/main.sb.rasi: -------------------------------------------------------------------------------- 1 | @import "main.rasi" 2 | 3 | /* main as a sidebar on the left */ 4 | #window { 5 | border: @border-size; 6 | padding: 20; 7 | width: 30%; 8 | height: 100%; 9 | x-offset: 0px; 10 | y-offset: 0px; 11 | location: north west; 12 | } 13 | -------------------------------------------------------------------------------- /home/config/rofi/themes/powermenu-text.rasi: -------------------------------------------------------------------------------- 1 | @import "powermenu" 2 | 3 | #window { 4 | width: 642px; 5 | } 6 | 7 | #listview { 8 | padding: 7 0; 9 | } 10 | 11 | #element { 12 | padding: 15 19; 13 | font: @bold-font; 14 | } 15 | -------------------------------------------------------------------------------- /home/config/rofi/themes/powermenu.rasi: -------------------------------------------------------------------------------- 1 | @import "main" 2 | 3 | * { 4 | selected-normal-background: @soft; 5 | selected-normal-foreground: @foreground; 6 | cycle: false; 7 | } 8 | 9 | #window { 10 | width: 726px; 11 | children: [ listview ]; 12 | } 13 | #listview { 14 | fixed-columns: true; 15 | layout: horizontal; 16 | spacing: 0px; 17 | } 18 | #element { 19 | padding: 30 60; 20 | font: "FiraCode Nerd Font 45"; 21 | } 22 | -------------------------------------------------------------------------------- /home/config/sh/aliases: -------------------------------------------------------------------------------- 1 | # /.aliases - helpful shell aliases 2 | 3 | alias cp="cp -i" # confirm before overwriting something 4 | alias df='df -mh' # human-readable sizes 5 | alias free='free -h' # human-readable sizes 6 | alias np='nano -w PKGBUILD' 7 | alias more=less 8 | alias quit=exit; alias ex=exit; alias q=exit 9 | alias cl=clear; alias cll='clear && ls -al' 10 | alias ll='ls -gaG' 11 | alias ls='ls -hG --color=auto' 12 | alias la='ls -lahG' 13 | alias su='su -m' 14 | alias grep='grep --color=auto' 15 | alias lsblk='lsblk -o name,mountpoint,label,size,uuid' 16 | alias ..='cd ..' 17 | 18 | # Declutter $HOME 19 | alias wget="wget --hsts-file $cache/_wget-hsts" 20 | alias yarn="yarn --use-yarnrc $conf/npm/yarnrc" 21 | alias sqlite3="sqlite3 -init $conf/sqlite3/sqliterc" 22 | alias mvn="mvn -gs $conf/maven/settings.xml" 23 | 24 | type xclip &>/dev/null \ 25 | && alias clip='xclip -selection c' \ 26 | && alias clop='xclip -selection clipboard -o' 27 | 28 | type pbcopy &>/dev/null \ 29 | && alias clip='pbcopy' \ 30 | && alias clop='pbpaste' 31 | 32 | # vim: set ft=sh: 33 | -------------------------------------------------------------------------------- /home/config/sh/bashrc: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.bashrc 3 | # 4 | 5 | [[ $- != *i* ]] && return 6 | 7 | colors() { 8 | local fgc bgc vals seq0 9 | 10 | printf "Color escapes are %s\n" '\e[${value};...;${value}m' 11 | printf "Values 30..37 are \e[33mforeground colors\e[m\n" 12 | printf "Values 40..47 are \e[43mbackground colors\e[m\n" 13 | printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n" 14 | 15 | # foreground colors 16 | for fgc in {30..37}; do 17 | # background colors 18 | for bgc in {40..47}; do 19 | fgc=${fgc#37} # white 20 | bgc=${bgc#40} # black 21 | 22 | vals="${fgc:+$fgc;}${bgc}" 23 | vals=${vals%%;} 24 | 25 | seq0="${vals:+\e[${vals}m}" 26 | printf " %-9s" "${seq0:-(default)}" 27 | printf " ${seq0}TEXT\e[m" 28 | printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m" 29 | done 30 | echo; echo 31 | done 32 | } 33 | 34 | [ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion 35 | 36 | # Change the window title of X terminals 37 | case ${TERM} in 38 | xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) 39 | PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' 40 | ;; 41 | screen*) 42 | PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' 43 | ;; 44 | esac 45 | 46 | if [[ ${EUID} == 0 ]] ; then 47 | PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] ' 48 | else 49 | PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] ' 50 | fi 51 | 52 | xhost +local:root > /dev/null 2>&1 53 | 54 | complete -cf sudo 55 | 56 | # Bash won't get SIGWINCH if another process is in the foreground. 57 | # Enable checkwinsize so that bash will check the terminal size when 58 | # it regains control. #65623 59 | # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) 60 | shopt -s checkwinsize 61 | 62 | shopt -s expand_aliases 63 | 64 | # export QT_SELECT=4 65 | 66 | # Enable history appending instead of overwriting. #139609 67 | shopt -s histappend 68 | 69 | export HISTFILE="${XDG_CONFIG_HOME:-$HOME/.config}/sh/bash_history" 70 | 71 | alias ls='ls --color=auto' 72 | alias grep='grep --colour=auto' 73 | alias egrep='egrep --colour=auto' 74 | alias fgrep='fgrep --colour=auto' 75 | alias la='ls -la' 76 | 77 | 78 | # 79 | # # ex - archive extractor 80 | # # usage: ex 81 | ex () 82 | { 83 | if [ -f $1 ] ; then 84 | case $1 in 85 | *.tar.bz2) tar xjf $1 ;; 86 | *.tar.gz) tar xzf $1 ;; 87 | *.bz2) bunzip2 $1 ;; 88 | *.rar) unrar x $1 ;; 89 | *.gz) gunzip $1 ;; 90 | *.tar) tar xf $1 ;; 91 | *.tbz2) tar xjf $1 ;; 92 | *.tgz) tar xzf $1 ;; 93 | *.zip) unzip $1 ;; 94 | *.Z) uncompress $1;; 95 | *.7z) 7z x $1 ;; 96 | *) echo "'$1' cannot be extracted via ex()" ;; 97 | esac 98 | else 99 | echo "'$1' is not a valid file" 100 | fi 101 | } 102 | 103 | [[ -s /home/fola/.cache/yay/autojump-git/pkg/autojump-git/etc/profile.d/autojump.sh ]] && source /home/fola/.cache/yay/autojump-git/pkg/autojump-git/etc/profile.d/autojump.sh 104 | # source ~/.cache/wal/colors-tty.sh 105 | # (cat ~/.cache/wal/sequences &) 106 | 107 | # Setup fzf 108 | # --------- 109 | if [[ ! "$PATH" == */home/fola/.local/lib/fzf/bin* ]]; then 110 | export PATH="${PATH:+${PATH}:}/home/fola/.local/lib/fzf/bin" 111 | fi 112 | 113 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 114 | 115 | # Auto-completion 116 | # --------------- 117 | [[ $- == *i* ]] && source "/home/fola/.local/lib/fzf/shell/completion.bash" 2> /dev/null 118 | 119 | # Key bindings 120 | # ------------ 121 | -------------------------------------------------------------------------------- /home/config/spicetify/Themes/Pywal/color.ini: -------------------------------------------------------------------------------- 1 | [Base] 2 | ; Pywal Theme 3 | main_fg = ${xrdb:foreground} 4 | secondary_fg = DEDEDE 5 | main_bg = ${xrdb:background} 6 | sidebar_and_player_bg = ${xrdb:background} 7 | cover_overlay_and_shadow = 000000 8 | indicator_fg_and_button_bg = 00FF9C 9 | pressing_fg = 4C566A 10 | slider_bg = ${xrdb:color4} 11 | sidebar_indicator_and_hover_button_bg = 81A1C1 12 | scrollbar_fg_and_selected_row_bg = 4C566A 13 | pressing_button_fg = 5E81AC 14 | pressing_button_bg = 3B4252 15 | selected_button = 81A1C1 16 | miscellaneous_bg = 434C5E 17 | miscellaneous_hover_bg = 81A1C1 18 | preserve_1 = FFFFFF 19 | -------------------------------------------------------------------------------- /home/config/spicetify/config.ini: -------------------------------------------------------------------------------- 1 | [AdditionalOptions] 2 | lyric_force_no_sync = 0 3 | new_feedback_ui = 0 4 | radio = 0 5 | song_page = 0 6 | extensions = 7 | lyric_always_show = 0 8 | fastUser_switching = 0 9 | home = 0 10 | made_for_you_hub = 0 11 | search_in_sidebar = 0 12 | visualization_high_framerate = 0 13 | custom_apps = 14 | experimental_features = 0 15 | tastebuds = 0 16 | minimal_ui = 0 17 | 18 | [Setting] 19 | inject_css = 1 20 | replace_colors = 1 21 | overwrite_assets = 0 22 | spotify_path = /opt/spotify 23 | prefs_path = /home/fola/.config/spotify/prefs 24 | current_theme = Pywal 25 | color_scheme = dark 26 | 27 | [Preprocesses] 28 | disable_sentry = 1 29 | disable_ui_logging = 1 30 | remove_rtl_rule = 1 31 | expose_apis = 1 32 | 33 | ; DO NOT CHANGE! 34 | [Backup] 35 | version = 1.1.10.546.ge08ef575 36 | 37 | -------------------------------------------------------------------------------- /home/config/user-dirs.dirs: -------------------------------------------------------------------------------- 1 | XDG_DOWNLOAD_DIR="$HOME/dl" 2 | XDG_DOCUMENTS_DIR="$HOME/docs" 3 | XDG_MUSIC_DIR="$HOME/media/music" 4 | XDG_PICTURES_DIR="$HOME/pics" 5 | XDG_VIDEOS_DIR="$HOME/media/vids" 6 | XDG_DESKTOP_DIR="$HOME/var/desktop" 7 | XDG_PUBLICSHARE_DIR="$HOME/var/public" 8 | XDG_TEMPLATES_DIR="$HOME/var/templates" 9 | -------------------------------------------------------------------------------- /home/config/wal/colorschemes/dark/default.rasi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/home/config/wal/colorschemes/dark/default.rasi -------------------------------------------------------------------------------- /home/config/wal/templates/colors-rofi-dark.rasi: -------------------------------------------------------------------------------- 1 | * {{ 2 | foreground: {foreground}; 3 | background: {background}; 4 | alternate-foreground: @foreground; 5 | alternate-background: @background; 6 | soft: {color1}; 7 | complement: {foreground}; 8 | accent: {color3}; 9 | }} 10 | -------------------------------------------------------------------------------- /home/config/wal/templates/colors.Xresources: -------------------------------------------------------------------------------- 1 | ! X colors. 2 | ! Generated by 'wal' 3 | *foreground: {foreground} 4 | *background: {background} 5 | *.foreground: {foreground} 6 | *.background: {background} 7 | polybar.background: #{alpha}{background.strip} 8 | emacs*foreground: {foreground} 9 | emacs*background: {background} 10 | URxvt*foreground: {foreground} 11 | XTerm*foreground: {foreground} 12 | UXTerm*foreground: {foreground} 13 | URxvt*background: {background} 14 | XTerm*background: {background} 15 | UXTerm*background: {background} 16 | URxvt*cursorColor: {cursor} 17 | XTerm*cursorColor: {cursor} 18 | UXTerm*cursorColor: {cursor} 19 | URxvt*borderColor: {background.alpha} 20 | 21 | ! Colors 0-15. 22 | *.color0: {color0} 23 | *color0: {color0} 24 | *.color1: {color1} 25 | *color1: {color1} 26 | *.color2: {color2} 27 | *color2: {color2} 28 | *.color3: {color3} 29 | *color3: {color3} 30 | *.color4: {color4} 31 | *color4: {color4} 32 | *.color5: {color5} 33 | *color5: {color5} 34 | *.color6: {color6} 35 | *color6: {color6} 36 | *.color7: {color7} 37 | *color7: {color7} 38 | *.color8: {color8} 39 | *color8: {color8} 40 | *.color9: {color9} 41 | *color9: {color9} 42 | *.color10: {color10} 43 | *color10: {color10} 44 | *.color11: {color11} 45 | *color11: {color11} 46 | *.color12: {color12} 47 | *color12: {color12} 48 | *.color13: {color13} 49 | *color13: {color13} 50 | *.color14: {color14} 51 | *color14: {color14} 52 | *.color15: {color15} 53 | *color15: {color15} 54 | 55 | ! Black color that will not be affected by bold highlighting. 56 | *.color66: {color0} 57 | *color66: {color0} 58 | 59 | ! Xclock colors. 60 | XClock*foreground: {foreground} 61 | XClock*background: {background} 62 | XClock*majorColor: rgba:{color15.xrgba} 63 | XClock*minorColor: rgba:{color15.xrgba} 64 | XClock*hourColor: rgba:{color15.xrgba} 65 | XClock*minuteColor: rgba:{color15.xrgba} 66 | XClock*secondColor: rgba:{color15.xrgba} 67 | 68 | ! Set depth to make transparency work. 69 | URxvt*depth: 32 70 | -------------------------------------------------------------------------------- /home/config/x/initrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # wrapper to run around X sessions. 4 | 5 | echo "Running X session wrapper" > ~/hmm 6 | 7 | c="${XDG_CONFIG_HOME:-$HOME/.config}" 8 | 9 | # Launch D-BUS 10 | [ "$DBUS_SESSION_BUS_ADDRESS" ] \ 11 | || exec dbus-launch --exit-with-session "$c/x/initrc" "$@" \ 12 | || exit 13 | 14 | # Choose session command 15 | [ "$1" ] || set -- i3 16 | case $1 in 17 | i3|bspwm|xmonad) 18 | swp # start sh*tty wallpaper setter 19 | ;; 20 | kde) set -- startplasma-x11 ;; 21 | openbox) set -- openbox --startup "$c/openbox/autostart" ;; 22 | *) lch sxhkd picom dunst ;; 23 | esac 24 | 25 | # Load profile 26 | for file in "/etc/profile" "$HOME/.profile" "$c/shell/profile" "/etc/xprofile" "$HOME/.xprofile" "$c/x/xprofile" ; do 27 | if [ -f "$file" ]; then 28 | echo "Loading profile from $file"; 29 | . "$file" 30 | fi 31 | done 32 | 33 | # Load resources 34 | for file in "/etc/X11/Xresources" "$HOME/.Xresources" "$c/x/resources"; do 35 | if [ -f "$file" ]; then 36 | echo "Loading resource: $file" 37 | xrdb -merge "$file" 38 | fi 39 | done 40 | 41 | echo "X init wrapper complete, running session " "$@" > ~/done 42 | exec "$@" 43 | -------------------------------------------------------------------------------- /home/config/x/profile: -------------------------------------------------------------------------------- 1 | # /.xprofile - xorg login script 2 | 3 | has() { 4 | type "$1" >/dev/null 5 | } 6 | 7 | ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8 | 9 | if has xset; then 10 | xset r rate 190 60 # increase kb repeat rate 11 | xset -dpms # disable dpms(https://wiki.archlinux.org/index.php/Display_Power_Management_Signaling) 12 | fi 13 | 14 | # set dual monitor layout (TODO: make more advanced ?? 13/12/20 - i dont know what this means) 15 | if has xrandr; then 16 | for sc in "$ROOT/xrandr/set-layout" "$ROOT/xrandr/aset-layout"; do 17 | [ -x $sc ] && $sc & 18 | done 19 | fi 20 | 21 | if test -f "$ROOT/resources"; then 22 | xrdb -merge "$ROOT/resources" 23 | fi 24 | 25 | # if has replay-sorcery; then 26 | # sleep 5 && replay-sorcery 27 | # fi 28 | -------------------------------------------------------------------------------- /home/config/x/resources: -------------------------------------------------------------------------------- 1 | Xft.dpi: 120 2 | Xcursor.size: 16 3 | Xcursor.theme: deepinv20-dark-cursors 4 | -------------------------------------------------------------------------------- /home/config/x/xrandr/aset-layout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # aset-layout - wait until change of (monitor) outputs, and set custom layout 3 | 4 | ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 5 | 6 | while "$ROOT/xocw"; do 7 | . "$ROOT"/set-layout 8 | done 9 | -------------------------------------------------------------------------------- /home/config/x/xrandr/set-layout: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # set-layout - set custom monitor layout with xrandr based on connected outputs 3 | 4 | if type xrandr &>/dev/null; then 5 | outputs=$(xrandr | grep -i connected | grep -v discon | cut -f1 -d' ' | tr '\n' ',' | sed 's/,$/\n/') 6 | echo "$outputs" 7 | 8 | case "$outputs" in 9 | DisplayPort-1,HDMI-A-0) 10 | xrandr \ 11 | --output HDMI-A-0 --mode 2560x1440 --pos 0x0 --rotate left \ 12 | --output DisplayPort-1 --primary --mode 2560x1440 --pos 1440x560 --rotate normal --rate 300 --primary 13 | echo "Monitor layout set to 2560x1440 (vert) & 2560x1440 (horizontal) " 14 | ;; 15 | DisplayPort-1) 16 | xrandr \ 17 | --output DisplayPort-1 --primary --mode 2560x1440 --pos 1440x560 --rotate normal --rate 300 18 | echo "Monitor layout set to 2560x1440 (horizontal)" 19 | ;; 20 | DisplayPort-2) 21 | xrandr \ 22 | --output DisplayPort-2 --primary --mode 2560x1440 --pos 0x240 --rotate normal \ 23 | --output HDMI-A-0 --off --output DisplayPort-1 --off --output DisplayPort-3 --off --output DVI-D-1 --off 24 | echo "Monitor layout set to 2560x1440 (horizontal)" 25 | ;; 26 | HDMI-A-0) 27 | xrandr \ 28 | --output HDMI-A-0 --mode 1920x1080 --pos 2560x0 --rotate left \ 29 | --output DisplayPort-1 --off --output DisplayPort-2 --off --output DisplayPort-3 --off --output DVI-D-1 --off 30 | echo "Monitor layout set to 1920x1080 (vert)" 31 | ;; 32 | *) 33 | echo "No monitor setup found for the outputs $outputs";; 34 | esac 35 | fi 36 | -------------------------------------------------------------------------------- /home/config/x/xrandr/xocw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/home/config/x/xrandr/xocw -------------------------------------------------------------------------------- /home/config/x/xrandr/xocw.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #define die_if_null(what) \ 8 | if (! (what)) \ 9 | return EXIT_FAILURE 10 | 11 | int 12 | main(int argc, char * * argv) 13 | { 14 | int screen, rr_event_base, rr_error_base, rr_mask = RROutputChangeNotifyMask; 15 | Display* display; 16 | Window rootwindow; 17 | XEvent event; 18 | 19 | display = XOpenDisplay(getenv("DISPLAY")); 20 | die_if_null(display); 21 | 22 | screen = DefaultScreen(display); 23 | 24 | rootwindow = RootWindow(display, screen); 25 | die_if_null(rootwindow); 26 | 27 | XSelectInput(display, rootwindow, StructureNotifyMask); 28 | XRRSelectInput(display, rootwindow, rr_mask); 29 | XRRQueryExtension (display, &rr_event_base, &rr_error_base); 30 | 31 | XNextEvent(display, &event); 32 | return EXIT_SUCCESS; 33 | } -------------------------------------------------------------------------------- /home/config/zathura/zathurarc: -------------------------------------------------------------------------------- 1 | # Font 2 | set font "FiraCode Nerd Font 10" 3 | 4 | # Automatically adjust the document to full width 5 | set adjust-open width 6 | 7 | # Set the title to the filename 8 | set window-title-basename true 9 | 10 | # Larger scoll steps with j/k 11 | set scroll-step 50 12 | 13 | # Adjusting the document 14 | map [normal] E adjust_window best-fit 15 | map [fullscreen] E adjust_window best-fit 16 | map [normal] e adjust_window width 17 | map [fullscreen] e adjust_window width 18 | 19 | set selection-clipboard clipboard 20 | 21 | # Toggling the inverted colours 22 | map recolor 23 | 24 | # setting this to true will keep pdf color 25 | set recolor-keephue "true" 26 | set recolor-darkcolor "#fbfbfb" 27 | set recolor-lightcolor "#1b1d1e" 28 | 29 | set default-fg "#fbfbfb" 30 | set default-bg "#1b1d1e" 31 | 32 | # set inputbar-bg "#464646" 33 | # set inputbar-fg "#1b1d1e" 34 | # set statusbar-bg "#222222" 35 | # set statusbar-fg "#1b1d1e" 36 | # 37 | # set completion-bg "#464646" 38 | # set completion-fg "#1b1d1e" 39 | # set completion-group-bg "#464646" 40 | # set completion-group-fg "#099709" 41 | # set completion-highlight-bg "#6f6f6f" 42 | # set completion-highlight-fg "#1b1d1e" 43 | # 44 | # set notification-bg "#464646" 45 | # set notification-fg "#f6f0e1" 46 | # set notification-warning-bg "#464646" 47 | # set notification-warning-fg "#e8e815" 48 | # set notification-error-bg "#c64242" 49 | # set notification-error-fg "#f6f0e1" 50 | # 51 | # set index-bg "#3f3f3f" 52 | # set index-fg "#1b1d1e" 53 | # set index-active-bg "#4f4f4f" 54 | # set index-active-fg "#1b1d1e" 55 | -------------------------------------------------------------------------------- /home/env: -------------------------------------------------------------------------------- 1 | # ~/.env - local env file for each host 2 | 3 | # conf= 4 | # data= 5 | # cache= 6 | # opt= 7 | -------------------------------------------------------------------------------- /home/opt/config.fish.local: -------------------------------------------------------------------------------- 1 | # config.fish.local - per machine fish configuration 2 | 3 | # vim: ft=fish 4 | -------------------------------------------------------------------------------- /home/opt/gitconfig.local: -------------------------------------------------------------------------------- 1 | [user] 2 | name = fl-w 3 | email = 30976147+fl-w@users.noreply.github.com 4 | -------------------------------------------------------------------------------- /root/efi/refind.conf: -------------------------------------------------------------------------------- 1 | # refind.conf - configuration file for the rEFInd boot menu 2 | # 3 | 4 | timeout 5 5 | 6 | #enable_mouse 7 | #mouse_size 8 | #mouse_speed 4 9 | 10 | use_graphics_for osx,windows,linux 11 | 12 | showtools install, shell, bootorder, gdisk, memtest, mok_tool, apple_recovery, windows_recovery, about, hidden_tags, reboot, exit, firmware, fwupdate 13 | 14 | scan_all_linux_kernels false 15 | 16 | extra_kernel_version_strings linux-lts,linux 17 | 18 | include themes/rEFInd-minimal-dark/theme.conf 19 | -------------------------------------------------------------------------------- /root/etc/lightdm/Xsession: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # LightDM wrapper to run around X sessions. 4 | 5 | echo "Running X session wrapper" 6 | 7 | # Load profile 8 | for file in "/etc/profile" "$HOME/.profile" "$HOME/etc/sh/profile" "/etc/xprofile" "$HOME/.xprofile" "$HOME/etc/x/profile"; do 9 | if [ -f "$file" ]; then 10 | echo "Loading profile from $file"; 11 | . "$file" 12 | fi 13 | done 14 | 15 | # Load resources 16 | for file in "/etc/X11/Xresources" "$HOME/.Xresources" "$HOME/etc/x/resources"; do 17 | if [ -f "$file" ]; then 18 | echo "Loading resource: $file" 19 | xrdb -merge "$file" 20 | fi 21 | done 22 | 23 | # Load keymaps 24 | for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap" "$HOME/etc/x/kbmap"; do 25 | if [ -f "$file" ]; then 26 | echo "Loading keymap: $file" 27 | setxkbmap `cat "$file"` 28 | XKB_IN_USE=yes 29 | fi 30 | done 31 | 32 | # Load xmodmap if not using XKB 33 | if [ -z "$XKB_IN_USE" ]; then 34 | for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap" "$HOME/etc/x/modmap"; do 35 | if [ -f "$file" ]; then 36 | echo "Loading modmap: $file" 37 | xmodmap "$file" 38 | fi 39 | done 40 | fi 41 | 42 | unset XKB_IN_USE 43 | 44 | # Run all system xinitrc shell scripts 45 | xinitdir="/etc/X11/xinit/xinitrc.d" 46 | if [ -d "$xinitdir" ]; then 47 | for script in $xinitdir/*; do 48 | echo "Loading xinit script $script" 49 | if [ -x "$script" -a ! -d "$script" ]; then 50 | . "$script" 51 | fi 52 | done 53 | fi 54 | 55 | # Run user xsession shell script 56 | for script in "$HOME/.xsession" "$HOME/etc/x/session"; do 57 | if [ -x "$script" -a ! -d "$script" ]; then 58 | echo "Loading xsession script $script" 59 | . "$script" 60 | fi 61 | done 62 | 63 | echo "X session wrapper complete, running session $@" 64 | 65 | exec $@ 66 | -------------------------------------------------------------------------------- /root/etc/lightdm/lightdm-mini-greeter.conf: -------------------------------------------------------------------------------- 1 | # LightDM Mini Greeter Configuration 2 | # 3 | # To test your configuration out, run: lightdm --test-mode 4 | 5 | [greeter] 6 | # The user to login as. 7 | user = fl-w 8 | # Whether to show the password input's label. 9 | show-password-label = true 10 | # The text of the password input's label. 11 | password-label-text = Password: 12 | # The text shown when an invalid password is entered. May be blank. 13 | invalid-password-text = Invalid Password 14 | # Show a blinking cursor in the password input. 15 | show-input-cursor = true 16 | # The text alignment for the password input. Possible values are: 17 | # "left" or "right" 18 | password-alignment = right 19 | 20 | 21 | [greeter-hotkeys] 22 | # The modifier key used to trigger hotkeys. Possible values are: 23 | # "alt", "control" or "meta" 24 | # meta is also known as the "Windows"/"Super" key 25 | mod-key = meta 26 | # Power management shortcuts (single-key, case-sensitive) 27 | shutdown-key = s 28 | restart-key = r 29 | hibernate-key = h 30 | suspend-key = u 31 | 32 | 33 | [greeter-theme] 34 | # A color from X11's `rgb.txt` file, a quoted hex string(`"#rrggbb"`) or a 35 | # RGB color(`rgb(r,g,b)`) are all acceptable formats. 36 | 37 | # The font to use for all text 38 | font = "mononoki Nerd Font" 39 | # The font size to use for all text 40 | font-size = 1em 41 | # The font weight to use for all text 42 | font-weight = bold 43 | # The font style to use for all text 44 | font-style = normal 45 | # The default text color 46 | text-color = "#080800" 47 | # The color of the error text 48 | error-color = "#F8F8F0" 49 | # An absolute path to an optional background image. 50 | # The image will be displayed centered & unscaled. 51 | # Note: The file should be somewhere that LightDM has permissions to read 52 | # (e.g., /etc/lightdm/). 53 | background-image = "" 54 | # The screen's background color. 55 | background-color = "#1B1D1E" 56 | # The password window's background color 57 | window-color = "#F92672" 58 | # The color of the password window's border 59 | border-color = "#080800" 60 | # The width of the password window's border. 61 | # A trailing `px` is required. 62 | border-width = 2px 63 | # The pixels of empty space around the password input. 64 | # Do not include a trailing `px`. 65 | layout-space = 15 66 | # The color of the text in the password input. 67 | password-color = "#F8F8F0" 68 | # The background color of the password input. 69 | password-background-color = "#1B1D1E" 70 | # The color of the password input's border. 71 | # Falls back to `border-color` if missing. 72 | password-border-color = "#080800" 73 | # The width of the password input's border. 74 | # Falls back to `border-width` if missing. 75 | password-border-width = 2px 76 | -------------------------------------------------------------------------------- /root/etc/pacman.conf: -------------------------------------------------------------------------------- 1 | # /etc/pacman.conf 2 | 3 | [options] 4 | HoldPkg = pacman glibc 5 | Architecture = auto 6 | IgnorePkg = tracker3 7 | UseSyslog 8 | ILoveCandy 9 | Color 10 | VerbosePkgLists 11 | CheckSpace 12 | SigLevel = Required DatabaseOptional 13 | LocalFileSigLevel = Optional 14 | 15 | [system] 16 | Include = /etc/pacman.d/mirrorlist 17 | 18 | [world] 19 | Include = /etc/pacman.d/mirrorlist 20 | 21 | [galaxy] 22 | Include = /etc/pacman.d/mirrorlist 23 | 24 | [extra] 25 | Include = /etc/pacman.d/mirrorlist-arch 26 | 27 | [community] 28 | Include = /etc/pacman.d/mirrorlist-arch 29 | -------------------------------------------------------------------------------- /root/etc/zzz.d/resume/resume.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # resume.sh - post hibernate hook 3 | 4 | # restart bluetooth 5 | sv restart bluetoothd 6 | 7 | # refresh drivers 8 | for i in r8169 psmouse; do 9 | modprobe -r $i 10 | modprobe $i 11 | done 12 | 13 | # swap seems to keep growing after hibernation restore 14 | # so clear swap 15 | swapoff -a; swapon -a 16 | -------------------------------------------------------------------------------- /wallpapers/0GxKbT0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/0GxKbT0.png -------------------------------------------------------------------------------- /wallpapers/158579144128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/158579144128.png -------------------------------------------------------------------------------- /wallpapers/2_1585332720236.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/2_1585332720236.png -------------------------------------------------------------------------------- /wallpapers/3BIoeLR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/3BIoeLR.jpg -------------------------------------------------------------------------------- /wallpapers/5qs6xdl7i5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/5qs6xdl7i5771.webp -------------------------------------------------------------------------------- /wallpapers/97506.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/97506.jpg -------------------------------------------------------------------------------- /wallpapers/9cwlt8edjb261.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/9cwlt8edjb261.jpg -------------------------------------------------------------------------------- /wallpapers/HXaoMFb2NYsIcPTmbQeN3WRAVi3lLlYFPc3L0wdxb70.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/HXaoMFb2NYsIcPTmbQeN3WRAVi3lLlYFPc3L0wdxb70.webp -------------------------------------------------------------------------------- /wallpapers/J6g7XPZ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/J6g7XPZ.jpg -------------------------------------------------------------------------------- /wallpapers/abstract-wow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/abstract-wow.jpg -------------------------------------------------------------------------------- /wallpapers/alena-aenami-004-1k1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/alena-aenami-004-1k1.jpg -------------------------------------------------------------------------------- /wallpapers/bboxzel7i5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/bboxzel7i5771.webp -------------------------------------------------------------------------------- /wallpapers/bnbw200ng8571.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/bnbw200ng8571.png -------------------------------------------------------------------------------- /wallpapers/c41aohicxml71.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/c41aohicxml71.webp -------------------------------------------------------------------------------- /wallpapers/clay-banks-u27Rrbs9Dwc-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/clay-banks-u27Rrbs9Dwc-unsplash.jpg -------------------------------------------------------------------------------- /wallpapers/clouds-9-1920×1080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/clouds-9-1920×1080.jpg -------------------------------------------------------------------------------- /wallpapers/dey56n6-cc262177-2961-4854-b61c-7d92ddba4678.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/dey56n6-cc262177-2961-4854-b61c-7d92ddba4678.jpg -------------------------------------------------------------------------------- /wallpapers/dh0o8txg8c641.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/dh0o8txg8c641.jpg -------------------------------------------------------------------------------- /wallpapers/eagle-2560×1440.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/eagle-2560×1440.jpg -------------------------------------------------------------------------------- /wallpapers/girl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/girl.png -------------------------------------------------------------------------------- /wallpapers/i2n6jel7i5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/i2n6jel7i5771.webp -------------------------------------------------------------------------------- /wallpapers/jz1f2el7i5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/jz1f2el7i5771.webp -------------------------------------------------------------------------------- /wallpapers/lq1cjddeuj861.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/lq1cjddeuj861.jpg -------------------------------------------------------------------------------- /wallpapers/lqpn6am7i5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/lqpn6am7i5771.webp -------------------------------------------------------------------------------- /wallpapers/pink-sunset-1920×1080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/pink-sunset-1920×1080.jpg -------------------------------------------------------------------------------- /wallpapers/q38ud32si5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/q38ud32si5771.webp -------------------------------------------------------------------------------- /wallpapers/tianshu-liu-aqZ3UAjs_M4-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/tianshu-liu-aqZ3UAjs_M4-unsplash.jpg -------------------------------------------------------------------------------- /wallpapers/vadim-bahryi-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/vadim-bahryi-9.jpg -------------------------------------------------------------------------------- /wallpapers/wDOzl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wDOzl.png -------------------------------------------------------------------------------- /wallpapers/wallhaven-39go6v.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-39go6v.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-39ykq6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-39ykq6.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-6oqzgq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-6oqzgq.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-96kdzx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-96kdzx.png -------------------------------------------------------------------------------- /wallpapers/wallhaven-eyrpo8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-eyrpo8.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-eyv7xl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-eyv7xl.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-g7jg63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-g7jg63.png -------------------------------------------------------------------------------- /wallpapers/wallhaven-kw22p1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-kw22p1.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-lm2rry.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-lm2rry.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-lmrvxr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-lmrvxr.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-p8gp83.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-p8gp83.jpg -------------------------------------------------------------------------------- /wallpapers/wallhaven-pkz5r9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/wallhaven-pkz5r9.png -------------------------------------------------------------------------------- /wallpapers/xbb178yhi5771.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fl-w/dotfiles/304d2d632b52ff8f5b8079562833a7db251e21a2/wallpapers/xbb178yhi5771.webp --------------------------------------------------------------------------------