├── .config ├── fish │ ├── completions │ │ └── pnpm.fish │ ├── fish_plugins │ └── config.fish ├── nvim │ └── init.vim ├── picom │ └── picom.conf ├── television │ └── config.toml ├── mise │ └── config.toml ├── efm-langserver │ └── config.yaml ├── ghostty │ └── config ├── bspwm │ └── bspwmrc ├── aichat │ └── config.yaml ├── sxhkd │ └── sxhkdrc ├── zed │ ├── settings.json │ └── keymap.json ├── rofi │ └── config.rasi ├── polybar │ └── config.ini ├── wezterm │ └── wezterm.lua └── awesome │ └── rc.lua ├── system ├── env.zsh ├── path.bash ├── grc.zsh ├── path.zsh ├── aliases.zsh └── keys.zsh ├── .xprofile ├── configure ├── tools ├── 7za │ └── 7za.exe └── curl │ ├── curl.exe │ ├── libeay32.dll │ └── ssleay32.dll ├── powerline-fonts ├── PowerlineSymbols.otf ├── Monaco_Linux-Powerline.ttf └── Menlo+Regular+for+Powerline.otf ├── renovate.json ├── .gitmodules ├── .gitattributes ├── .gitignore ├── .dotter ├── local.toml └── global.toml ├── install.cmd ├── .mappings ├── clink ├── home.lua ├── clink_settings ├── git_prompt.lua.disable ├── scoop.lua └── zoxide.lua ├── .gitconfig ├── LICENSE ├── README.md ├── .zshrc ├── bin ├── zfs-recursive-restore └── get-gh-copilot-token.sh ├── .aider.conf.yml ├── .tmux.conf ├── install ├── .bash_profile └── .vimrc /.config/fish/completions/pnpm.fish: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | source ~/.vimrc 2 | -------------------------------------------------------------------------------- /system/env.zsh: -------------------------------------------------------------------------------- 1 | #export EDITOR='mvim' 2 | -------------------------------------------------------------------------------- /.xprofile: -------------------------------------------------------------------------------- 1 | setxkbmap -option "ctrl:swapcaps" 2 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dotter -vv 3 | -------------------------------------------------------------------------------- /.config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | inactive-opacity = 0.9 2 | -------------------------------------------------------------------------------- /.config/television/config.toml: -------------------------------------------------------------------------------- 1 | [ui] 2 | show_help_bar = false 3 | -------------------------------------------------------------------------------- /.config/fish/fish_plugins: -------------------------------------------------------------------------------- 1 | jorgebucaran/fisher 2 | jethrokuan/fzf 3 | nakulj/auto-venv 4 | -------------------------------------------------------------------------------- /tools/7za/7za.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/tools/7za/7za.exe -------------------------------------------------------------------------------- /tools/curl/curl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/tools/curl/curl.exe -------------------------------------------------------------------------------- /system/path.bash: -------------------------------------------------------------------------------- 1 | export PATH=".:bin:/usr/local/bin:/usr/local/sbin:$HOME/.sfs:~/.dotfiles/bin:$PATH" 2 | -------------------------------------------------------------------------------- /tools/curl/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/tools/curl/libeay32.dll -------------------------------------------------------------------------------- /tools/curl/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/tools/curl/ssleay32.dll -------------------------------------------------------------------------------- /powerline-fonts/PowerlineSymbols.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/powerline-fonts/PowerlineSymbols.otf -------------------------------------------------------------------------------- /powerline-fonts/Monaco_Linux-Powerline.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/powerline-fonts/Monaco_Linux-Powerline.ttf -------------------------------------------------------------------------------- /powerline-fonts/Menlo+Regular+for+Powerline.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prabirshrestha/dotfiles/HEAD/powerline-fonts/Menlo+Regular+for+Powerline.otf -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /system/grc.zsh: -------------------------------------------------------------------------------- 1 | # GRC colorizes nifty unix tools all over the place 2 | #if $(gls &>/dev/null) 3 | #then 4 | # source `brew --prefix`/etc/grc.bashrc 5 | #fi -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".config/awesome/awesome-wm-widgets"] 2 | path = .config/awesome/awesome-wm-widgets 3 | url = https://github.com/streetturtle/awesome-wm-widgets.git 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.cmd eol=crlf 5 | *.bat eol=crlf 6 | *.BAT eol=crlf 7 | *.CMD eol=crlf 8 | *.reg eol=crlf -------------------------------------------------------------------------------- /system/path.zsh: -------------------------------------------------------------------------------- 1 | export PATH=".:bin:/usr/local/bin:/usr/local/sbin:$HOME/.sfs:$ZSH/bin:$PATH" 2 | 3 | export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" 4 | -------------------------------------------------------------------------------- /.config/mise/config.toml: -------------------------------------------------------------------------------- 1 | [settings] 2 | idiomatic_version_file_enable_tools = ["node", "rust"] 3 | experimental = true 4 | 5 | [tools] 6 | cargo = "latest" 7 | bun = "latest" 8 | node = "latest" 9 | rust = "latest" 10 | "npm:prettier" = "latest" 11 | uv = "latest" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dotter/cache.toml 2 | .dotter/cache/ 3 | 4 | local.config.fish 5 | mise.local.toml 6 | 7 | vim/vim.symlink/.netrwhist 8 | 9 | vim/edit_with_vim.reg 10 | path.txt 11 | 12 | .DS_Store 13 | *.orig 14 | *.swp 15 | 16 | clink/.history 17 | clink/clink_history* 18 | clink/clink.log 19 | .aider* 20 | .env 21 | -------------------------------------------------------------------------------- /system/aliases.zsh: -------------------------------------------------------------------------------- 1 | # grc overides for ls 2 | # Made possible through contributions from generous benefactors like 3 | # `brew install coreutils` 4 | if $(gls &>/dev/null) 5 | then 6 | #alias ls="gls -F --color" 7 | #alias l="gls -lAh --color" 8 | #alias ll="gls -l --color" 9 | #alias la='gls -A --color' 10 | fi -------------------------------------------------------------------------------- /system/keys.zsh: -------------------------------------------------------------------------------- 1 | # Remove the hosts that I don't want to keep around- in this case, only 2 | # keep the first host. Like a boss. 3 | alias hosts="head -2 ~/.ssh/known_hosts | tail -1 > ~/.ssh/known_hosts" 4 | 5 | # Pipe my public key to my clipboard. Fuck you, pay me. 6 | alias pubkey="more ~/.ssh/id_dsa.public | pbcopy | echo '=> Public key copied to pasteboard.'" -------------------------------------------------------------------------------- /.config/efm-langserver/config.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | root-markers: 3 | - .git/ 4 | 5 | tools: 6 | prettier: &prettier 7 | format-command: 'prettier --stdin-filepath ${INPUT}' 8 | format-stdin: true 9 | 10 | languages: 11 | javascript: 12 | - <<: *prettier 13 | javascriptreact: 14 | - <<: *prettier 15 | typescript: 16 | - <<: *prettier 17 | typescriptreact: 18 | - <<: *prettier 19 | -------------------------------------------------------------------------------- /.dotter/local.toml: -------------------------------------------------------------------------------- 1 | includes = [] 2 | packages = [ 3 | "aichat", 4 | # "aider", 5 | "awesomewm", 6 | "bash", 7 | "bspwm", 8 | "efm-langserver", 9 | "fish", 10 | "git", 11 | "ghostty", 12 | "mise", 13 | "nvim", 14 | "picom", 15 | "polybar", 16 | "rofi", 17 | "sxhkd", 18 | "xorg", 19 | "television", 20 | "tmux", 21 | "vim", 22 | "wezterm", 23 | "zed", 24 | "zsh" 25 | ] 26 | -------------------------------------------------------------------------------- /install.cmd: -------------------------------------------------------------------------------- 1 | @set scoop_buckets=^ 2 | extras 3 | 4 | @for %%i in (%scoop_buckets%) do @( 5 | scoop bucket list | findstr /i "%%i" >nul || ( 6 | echo Adding bucket: %%i 7 | scoop bucket add %%i 8 | ) 9 | ) 10 | 11 | @set scoop_packages=^ 12 | 7zip^ 13 | fzf^ 14 | sudo^ 15 | television^ 16 | zoxide 17 | 18 | @for %%i in (%scoop_packages%) do scoop install %%i 2>nul 19 | -------------------------------------------------------------------------------- /.mappings: -------------------------------------------------------------------------------- 1 | [general] 2 | ".gitconfig"="~/.gitconfig" 3 | ".tmux.conf"="~/.tmux.conf" 4 | ".zshrc"="~/.zshrc" 5 | ".config/wezterm"="~/.config/wezterm" 6 | ".config/efm-langserver"="~/.config/efm-langserver" 7 | 8 | [linux] 9 | ".config/awesome"="~/.config/awesome" 10 | ".config/rofi"="~/.config/rofi" 11 | ".config/bspwm"="~/.config/bspwm" 12 | ".config/sxhkd"="~/.config/sxhkd" 13 | ".xprofile"="~/.xprofile" 14 | 15 | [windows] 16 | "clink"="~/scoop/persist/clink/profile" 17 | -------------------------------------------------------------------------------- /clink/home.lua: -------------------------------------------------------------------------------- 1 | local function tilde_match (text, f, l) 2 | if text == '~' then 3 | clink.add_match(clink.get_env('userprofile')) 4 | clink.matches_are_files() 5 | return true 6 | end 7 | if text:sub(1, 1) == '~' then 8 | clink.add_match(string.gsub(text, "~", clink.get_env('userprofile'), 1)) 9 | clink.suppress_char_append() 10 | clink.matches_are_files() 11 | return true 12 | end 13 | end 14 | clink.register_match_generator(tilde_match, 1) 15 | -------------------------------------------------------------------------------- /.config/ghostty/config: -------------------------------------------------------------------------------- 1 | command = /opt/homebrew/bin/fish --login --interactive 2 | 3 | keybind = ctrl+shift+comma=reload_config 4 | 5 | keybind = ctrl+a>n=new_window 6 | keybind = ctrl+a>c=new_tab 7 | keybind = ctrl+a>-=new_split:down 8 | keybind = ctrl+a>\=new_split:right 9 | keybind = ctrl+a>k=goto_split:up 10 | keybind = ctrl+a>j=goto_split:down 11 | keybind = ctrl+a>l=goto_split:right 12 | keybind = ctrl+a>h=goto_split:left 13 | keybind = ctrl+a>z=toggle_split_zoom 14 | keybind = ctrl+a>x=close_surface 15 | 16 | keybind = shift+enter=text:\n 17 | 18 | keybind = ctrl+shift+v=paste_from_clipboard 19 | keybind = ctrl+shift+c=copy_to_clipboard 20 | keybind = ctrl+shift+a=select_all 21 | -------------------------------------------------------------------------------- /clink/clink_settings: -------------------------------------------------------------------------------- 1 | # name: Strips CR and LF chars on paste 2 | # type: enum 3 | # options: delete,space,ampersand,crlf 4 | clink.paste_crlf = space 5 | 6 | # name: Auto-answer terminate prompt 7 | # type: enum 8 | # options: off,answer_yes,answer_no 9 | cmd.auto_answer = answer_yes 10 | 11 | # name: Skip adding lines prefixed with whitespace 12 | # type: boolean 13 | history.ignore_space = False 14 | 15 | # name: The number of history lines to save 16 | # type: integer 17 | history.max_lines = 10000 18 | 19 | # name: Support Windows' Ctrl-Alt substitute for AltGr 20 | # type: boolean 21 | terminal.use_altgr_substitute = True 22 | 23 | 24 | 25 | exec.cwd = 1 26 | 27 | exec.dirs = 1 28 | 29 | exec.enable = 1 30 | 31 | exec.path = 1 32 | 33 | exec.space_prefix = 1 34 | 35 | -------------------------------------------------------------------------------- /.config/bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | killall -q sxhkd 4 | while pgrep -u $UID -x sxhkd >/dev/null; do sleep 1; done 5 | sxhkd & 6 | 7 | killall -q polybar 8 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 9 | polybar & 10 | 11 | killall -q picom 12 | while pgrep -u $UID -x picom >/dev/null; do sleep 1; done 13 | picom & 14 | 15 | # Monitors 16 | for monitor in $(bspc query -M) 17 | do 18 | # set the workspaces on each monitor to 1-9 19 | bspc monitor $monitor -d 1 2 3 4 5 6 7 8 9 20 | ##polybar hidden when fullscreen for vlc, youtube, mpv ... 21 | #xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_$monitor) 22 | done 23 | 24 | # BSPWM configuration 25 | bspc config border_radius 20 26 | bspc config border_width 3 27 | bspc config window_gap 5 28 | bspc config split_ratio 0.50 29 | -------------------------------------------------------------------------------- /.config/aichat/config.yaml: -------------------------------------------------------------------------------- 1 | model: ollama:qwen2.5:14b 2 | keybindings: vi 3 | editor: vim 4 | use_tools: true 5 | document_loaders: 6 | # You can add custom loaders using the following syntax: 7 | # : 8 | # Note: Use `$1` for input file and `$2` for output file. If `$2` is omitted, use stdout as output. 9 | pdf: 'pdftotext $1 -' # Load .pdf file, see https://poppler.freedesktop.org to set up pdftotext 10 | docx: 'pandoc --to plain $1' # Load .docx file, see https://pandoc.org to set up pandoc 11 | rag_embedding_model: ollama:mxbai-embed-large 12 | # Defines document loaders 13 | rag_document_loaders: 14 | # You can add more loaders, here is the syntax: 15 | # : 16 | pdf: 'pdftotext $1 -' # Load .pdf file 17 | docx: 'pandoc --to plain $1' # Load .docx file 18 | clients: 19 | - type: openai-compatible 20 | name: ollama 21 | api_base: http://localhost:11434/v1 22 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Prabir Shrestha 3 | email = mail@prabir.me 4 | 5 | [core] 6 | {{#if (is_executable "delta")}} 7 | pager = delta 8 | {{/if}} 9 | {{#if (eq dotter.os "windows")}} 10 | symlinks = true 11 | autocrlf = true 12 | {{else}} 13 | autocrlf = input 14 | {{/if}} 15 | editor = vim 16 | untrackedCache = true 17 | fsmonitor = true 18 | 19 | [push] 20 | autoSetupRemote = true 21 | 22 | {{#if (eq dotter.os "unix")}} 23 | [merge] 24 | tool = vimdiff 25 | conflictstyle = diff3 26 | [mergetool] 27 | prompt = false 28 | {{/if}} 29 | 30 | {{#if (eq dotter.os "windows")}} 31 | [diff] 32 | tool = kdiff3 33 | [difftool "kdiff3"] 34 | path = C:/Users/prshrest/scoop/shims/kdiff3.exe 35 | [merge] 36 | tool = kdiff3 37 | [mergetool "kdiff3"] 38 | path = C:/Users/prshrest/scoop/shims/kdiff3.exe 39 | keepBackup = false 40 | trustExitCode = false 41 | {{/if}} 42 | 43 | {{#if (eq dotter.os "unix")}} 44 | [credential] 45 | helper = /usr/local/share/gcm-core/git-credential-manager 46 | [credential "https://dev.azure.com"] 47 | useHttpPath = true 48 | {{/if}} 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) Zach Holman and Prabir Shrestha 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /.config/sxhkd/sxhkdrc: -------------------------------------------------------------------------------- 1 | # quit or restart 2 | alt + ctrl + {q,r} 3 | bspc {quit, wm -r} 4 | 5 | # reload sxhkd configuration 6 | super + Escape 7 | pkill -USR1 -x sxhkd 8 | 9 | # program launcher 10 | alt + space 11 | rofi -modi run,drun -show drun -show-icons 12 | # rofi -show run 13 | alt + p 14 | rofi -modi run,drun -show drun -show-icons 15 | # rofi -show run 16 | 17 | # switch workspace 18 | alt + ctrl + {Left,Right} 19 | bspc desktop -f {prev.local,next.local} 20 | 21 | # switch to numbered desktop 22 | alt + {1-9} 23 | bspc desktop --focus {1-9} 24 | 25 | # move current node to numbered desktop 26 | alt + shift + {1-9} 27 | bspc node --to-desktop {1-9} 28 | 29 | # change monitor 30 | alt + {comma,period} 31 | bspc monitor --focus {next,prev} 32 | 33 | # move to monitor 34 | alt + shift + {comma,period} 35 | bspc monitor --m {next,prev} 36 | 37 | # fullscreen toggle 38 | alt + f 39 | bspc desktop --layout next 40 | 41 | # resize 42 | alt + control + shift + {h,j,k,l} 43 | bspc node -z {left -20 0 || bspc node -z right -20 0, \ 44 | bottom 0 20 || bspc node -z top 0 20,\ 45 | top 0 -20 || bspc node -z bottom 0 -20,\ 46 | right 20 0 || bspc node -z left 20 0} 47 | 48 | # change focus 49 | alt + {j,k} 50 | bspc node --focus {next.local,prev.local} 51 | 52 | # close window 53 | alt + shift + c 54 | bspc node -c 55 | alt + F4 56 | bspc node -c 57 | 58 | # alt+tab 59 | alt + Tab 60 | rofi -show windowcd -show-icons 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # prabir does dotfiles 2 | 3 | ## dotfiles 4 | 5 | Your dotfiles are how you personalize your system. These are mine. The very 6 | prejudiced mix: OS X, Linux, Windows, zsh, Bash, git, homebrew, vim. 7 | If you match up along most of those lines, you may dig my dotfiles. 8 | 9 | If you're interested in the philosophy behind why projects like these are 10 | awesome, you might want to [read Zach Holman's post on the 11 | subject](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/). 12 | 13 | ## installation 14 | 15 | ### ArchLinux 16 | 17 | ```bash 18 | paru -Sy --noconfirm dotter-rs-bin git 19 | ``` 20 | 21 | ### Mac 22 | 23 | ```bash 24 | bash <(curl -s https://raw.githubusercontent.com/prabirshrestha/dotfiles/main/install) 25 | ``` 26 | 27 | or 28 | 29 | ```bash 30 | ./install 31 | ``` 32 | 33 | ### Windows 34 | 35 | ```cmd 36 | scoop install dotter 37 | ``` 38 | 39 | ## Install dotter 40 | 41 | ```bash 42 | git clone --recurse-submodules https://github.com/prabirshrestha/dotfiles.git ~/.dotfiles 43 | cd ~/.dotter && ./configure 44 | ``` 45 | 46 | This will clone the repo and symlink the appropriate files in `.dotfiles` to your 47 | home directory. Everything is configured and tweaked within `~/.dotter`, 48 | though. 49 | 50 | ## Thanks 51 | 52 | Fork of [Holman's dotfiles](https://github.com/holman/dotfiles) which has been supported to work 53 | on all 3 major OS - Mac OSX, Linux and Windows and of coure my own customizations. 54 | 55 | [Dotter](https://github.com/SuperCuber/dotter) tool to help with dotfiles automation. 56 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.zshrc -o ~/.zshrc 2 | # Path to your oh-my-zsh installation. 3 | 4 | PROMPT='%~ %# ' 5 | unsetopt flow_control 6 | 7 | # enable vi bindings 8 | bindkey -v 9 | bindkey -M viins 'jj' vi-cmd-mode 10 | 11 | stty -ixon 12 | 13 | [[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh # This loads NVM 14 | export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/Library/Python/3.7/bin:$PATH" 15 | export PATH="$HOME/.config/nvim/plugins/vim-themis/bin:$PATH" 16 | export PATH="/opt/homebrew/bin:$PATH" 17 | #export PATH="/opt/pkg/bin:$PATH" 18 | 19 | # alias 20 | alias ls='ls -Gp' 21 | alias vi='vim' 22 | 23 | # git alias 24 | alias g='git' 25 | alias ga='git add' 26 | alias gb='git branch' 27 | alias gba='git branch -a' 28 | alias gca='git commit -a' 29 | alias gclean='git clean -xdf' 30 | alias gcm='git checkout master' 31 | alias gco='git checkout' 32 | alias gcp='git cherry-pick' 33 | alias gf='git fetch --all' 34 | alias gl='git log --oneline --graph --decorate' 35 | alias gm='git merge' 36 | alias gmt='git mergetool' 37 | alias gp='git push origin HEAD' 38 | alias gs='git status' 39 | alias gup='git fetch --all && git rebase' 40 | 41 | gpr() { 42 | git fetch origin pull/${1}/head:pr${1} 43 | git checkout pr${1} 44 | } 45 | 46 | 47 | autoload -U +X bashcompinit && bashcompinit 48 | 49 | if hash zoxide 2>/dev/null; then eval "$(zoxide init zsh)"; fi 50 | 51 | # Generated for envman. Do not edit. 52 | [ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh" 53 | 54 | [[ -s ~/.grit/bin/env ]] && . ~/.grit/bin/env 55 | 56 | if hash mise 2>/dev/null; then eval "$(mise activate zsh)"; fi 57 | 58 | # Added by LM Studio CLI (lms) 59 | export PATH="$PATH:/Users/prabirshrestha/.lmstudio/bin" 60 | # End of LM Studio CLI section 61 | 62 | 63 | ### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT) 64 | export PATH="/Users/prabirshrestha/.rd/bin:$PATH" 65 | ### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT) 66 | -------------------------------------------------------------------------------- /bin/zfs-recursive-restore: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Originally by: Dr. Martin Menzel www.dr-menzel-it.de 3 | # Modified by Matthew Pherigo https://gist.github.com/mwpher/4493681e9efdcc271830 4 | # Rewritten by Charles Anthony 5 | # 6 | # Recursively restores the zfs filesystems below a given filesystem to a snapshot 7 | # e.g. given 8 | # the-pool 9 | # the-pool/var 10 | # the-pool/var/lib 11 | # the-pool/doris 12 | # and a snapshot of @backup 13 | # 14 | # using this script with the-pool/doris@backup will restore just that one file system 15 | # Using this script with the-pool/var@backup will restore the-pool/var AND the-pool/var/lib 16 | # Using this script with the-pool@backup will restore the-pool. the-pool/var, the-pool/var/lib AND 17 | # the-pool/doris 18 | # 19 | # Accepts just one parameter - the root snapshot reference to restore, in the form of 20 | # the-root-zfs-file-system@snapshot-name 21 | 22 | usage() { 23 | echo "Usage: $0 zpool/root@snapshot" 24 | } 25 | 26 | if [ $# -ne 1 ] 27 | then 28 | usage; 29 | else 30 | # Patter matches any valid filename character follwed by @ followeding by anything else 31 | regex="^([a-zA-Z0-9/\.\_\-]*)\@(.*)" 32 | if [[ ! $1 =~ $regex ]] 33 | then 34 | usage; 35 | else 36 | # Curious #/} here drops any leading / 37 | pool="${BASH_REMATCH[1]#/}" 38 | root_snapshot="${BASH_REMATCH[2]}" 39 | echo Restoring ${root_snapshot} in ${pool} 40 | while IFS= read -r snapshot; do 41 | echo -n "Rolling Back ${snapshot} : " 42 | # -r : also destroys the snapshots newer than the specified one 43 | # -R : also destroys the snapshots newer than the one specified and their clones 44 | # -f : forces an unmount of any clone file systems that are to be destroyed 45 | zfs rollback -r -R -f ${snapshot} 46 | echo "Done" 47 | done < <(zfs list -H -t snapshot -r $pool | grep "@$root_snapshot" | cut -f 1) 48 | fi 49 | fi 50 | -------------------------------------------------------------------------------- /.dotter/global.toml: -------------------------------------------------------------------------------- 1 | [aichat.files] 2 | ".config/aichat" = { type = "symbolic" , target = "~/.config/aichat" } 3 | 4 | # [aider.files] 5 | # ".aider.conf.yml" = { type = "symbolic" , target = "~/.aider.conf.yml" } 6 | # ".aider.model.metadata.json" = { type = "symbolic" , target = "~/.aider.model.metadata.json" } 7 | 8 | [awesomewm.files] 9 | ".config/awesome" = { type = "symbolic" , target = "~/.config/awesome" } 10 | 11 | [bash.files] 12 | ".bash_profile" = { type = "symbolic", target = "~/.bash_profile" } 13 | 14 | [bspwm.files] 15 | ".config/bspwm" = { type = "symbolic" , target = "~/.config/bspwm" } 16 | 17 | [efm-langserver.files] 18 | ".config/efm-langserver" = { type = "symbolic" , target = "~/.config/efm-langserver" } 19 | 20 | [fish.files] 21 | ".config/fish" = { type = "symbolic", target = "~/.config/fish" } 22 | 23 | [git.files] 24 | ".gitconfig" = "~/.gitconfig" 25 | 26 | [ghostty.files] 27 | ".config/ghostty" = { type = "symbolic" , target = "~/.config/ghostty" } 28 | 29 | [mise.files] 30 | ".config/mise" = { type = "symbolic" , target = "~/.config/mise" } 31 | 32 | [nvim.files] 33 | ".config/nvim/init.vim" = { type = "symbolic" , target = "~/.config/nvim/init.vim" } 34 | 35 | [picom.files] 36 | ".config/picom" = { type = "symbolic" , target = "~/.config/picom" } 37 | 38 | [polybar.files] 39 | ".config/polybar" = { type = "symbolic" , target = "~/.config/polybar" } 40 | 41 | [rofi.files] 42 | ".config/rofi" = { type = "symbolic" , target = "~/.config/rofi" } 43 | 44 | [sxhkd.files] 45 | ".config/sxhkd" = { type = "symbolic" , target = "~/.config/sxhkd" } 46 | 47 | [xorg.files] 48 | ".xprofile" = { type = "symbolic" , target = "~/.xprofile" } 49 | 50 | [television.files] 51 | ".config/television" = { type = "symbolic" , target = "~/.config/television" } 52 | 53 | [tmux.files] 54 | ".tmux.conf" = { type = "symbolic" , target = "~/.tmux.conf" } 55 | 56 | [vim.files] 57 | ".vimrc" = { type = "symbolic" , target = "~/.vimrc" } 58 | 59 | [wezterm.files] 60 | ".config/wezterm" = { type = "symbolic" , target = "~/.config/wezterm" } 61 | 62 | [zed.files] 63 | ".config/zed" = { type = "symbolic" , target = "~/.config/zed" } 64 | 65 | [zsh.files] 66 | ".zshrc" = { type = "symbolic" , target = "~/.zshrc" } 67 | -------------------------------------------------------------------------------- /clink/git_prompt.lua.disable: -------------------------------------------------------------------------------- 1 | local colors = { 2 | bold_white_on_black = "\x1b[1;37;40m", 3 | normal_white_on_black = "\x1b[0;37;40m", 4 | bold_green_on_black = "\x1b[1;32;40m", 5 | normal_green_on_black = "\x1b[0;32;40m", 6 | bold_yellow_on_black = "\x1b[1;33;40m", 7 | normal_yellow_on_black = "\x1b[0;33;40m", 8 | git_clean = "\x1b[1;37;40m", 9 | git_dirty = "\x1b[31;1m", 10 | } 11 | 12 | --- 13 | -- Finds out the git current branch 14 | -- @return {false|git branch name} 15 | --- 16 | function get_git_branch() 17 | for line in io.popen("git branch 2>nul"):lines() do 18 | local m = line:match("%* (.+)$") 19 | if m then 20 | return m 21 | end 22 | end 23 | 24 | return false 25 | end 26 | 27 | --- 28 | -- Gets the git status of the current dir 29 | -- @return {bool} 30 | --- 31 | function get_git_status() 32 | return os.execute("git diff --quiet --ignore-submodules HEAD 2>nul") 33 | end 34 | 35 | --- 36 | -- Gets the current git status in short format 37 | -- @return {string} 38 | --- 39 | function get_git_full_status() 40 | local file = assert(io.popen("git status -s")) 41 | local status = file:read('*all') 42 | file:close() 43 | return status 44 | end 45 | 46 | --- 47 | -- If we are in a git directory gets the 48 | -- status and sets the prompt string accordingly 49 | -- @return {string} 50 | --- 51 | function git_prompt(path) 52 | 53 | local branch = get_git_branch() 54 | if branch then 55 | -- Has branch => therefore it is a git folder, now figure out status 56 | if get_git_status() then 57 | color = colors.git_clean 58 | else 59 | color = colors.git_dirty 60 | end 61 | 62 | -- return color.."("..branch..")".."\n"..colors.normal_white_on_black..get_git_full_status() 63 | return color.."("..branch..")" 64 | end 65 | 66 | return "" 67 | 68 | end 69 | 70 | --- 71 | -- Tries to retrieve the current path 72 | -- @return {string} 73 | --- 74 | function pwd() 75 | local path = "" 76 | 77 | local file = assert(io.popen('cd')) 78 | local cd = file:read('*all'):match("^(.+)[\r\n]$") 79 | if cd then 80 | path = colors.normal_green_on_black .. cd .. " " 81 | end 82 | file:close() 83 | 84 | return path 85 | end 86 | 87 | function lambda_prompt_filter() 88 | local path = pwd() 89 | local git_status = git_prompt(path) 90 | local lambda_prompt = colors.normal_yellow_on_black .. "λ " 91 | 92 | clink.prompt.value = path .. git_status .. "\n" .. lambda_prompt 93 | end 94 | 95 | clink.prompt.register_filter(lambda_prompt_filter, 50) 96 | -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # disable fish greeting 2 | set fish_greeting 3 | 4 | set -gx EDITOR vim 5 | 6 | # https://github.com/sigoden/aichat/issues/769#issuecomment-2259388600 7 | set -x AICHAT_CONFIG_DIR $HOME/.config/aichat 8 | 9 | set -x TELEVISION_CONFIG $HOME/.config/television 10 | 11 | fish_add_path ~/.dotfiles/bin 12 | fish_add_path ~/.local/bin 13 | 14 | if test -f /opt/homebrew/bin/brew 15 | /opt/homebrew/bin/brew shellenv | source 16 | end 17 | 18 | if type -q brew 19 | fish_add_path (brew --prefix python)/libexec/bin 20 | fish_add_path (brew --prefix llvm)/bin 21 | end 22 | 23 | fish_add_path ~/.bun/bin 24 | fish_add_path ~/.cargo/bin 25 | 26 | type -q zoxide; and zoxide init fish | source 27 | if test -n "$HOME/.config/fish/completions/pnpm.fish" 28 | source "$HOME/.config/fish/completions/pnpm.fish" 29 | end 30 | 31 | type -q uv; and uv generate-shell-completion fish | source 32 | 33 | set -gx SOPS_AGE_KEY_FILE ~/.config/sops/age/keys.txt 34 | 35 | alias tailscale "/Applications/Tailscale.app/Contents/MacOS/Tailscale" 36 | 37 | alias satyrn "open /Applications/satyrn.app" 38 | 39 | alias k "kubectl" 40 | 41 | alias g "git" 42 | alias gs "git status" 43 | alias gb "git branch" 44 | alias gp "git push" 45 | alias gco "git checkout" 46 | alias gca "git commit -a" 47 | alias gcm "git checkout main || git checkout master" 48 | alias gup "git fetch && git rebase" 49 | alias gca "git commit -a" 50 | alias gco "git checkout" 51 | alias gcp "git cherry-pick" 52 | 53 | function gpr 54 | git fetch origin pull/$argv[1]/head:pr$argv[1] 55 | git checkout pr$argv[1] 56 | end 57 | 58 | # Added by LM Studio CLI (lms) 59 | set -gx PATH $PATH /Users/prabirshrestha/.cache/lm-studio/bin 60 | 61 | # Ensure tv is installed and configured 62 | if command -q tv 63 | # Ctrl+Alt+f to select and paste file path 64 | bind \e\cf 'set -l selected_file (tv) 65 | if test -n "$selected_file" 66 | commandline -i "$selected_file" 67 | end 68 | commandline -f repaint' 69 | 70 | # Ctrl+Alt+d to select and paste directory path 71 | bind \e\cd 'set -l selected_dir (find . -type d | tv) 72 | if test -n "$selected_dir" 73 | commandline -i "$selected_dir" 74 | end 75 | commandline -f repaint' 76 | end 77 | 78 | if test -f ~/.config/fish/local.config.fish 79 | source ~/.config/fish/local.config.fish 80 | end 81 | 82 | # Added by LM Studio CLI (lms) 83 | set -gx PATH $PATH /Users/prabirshrestha/.lmstudio/bin 84 | # End of LM Studio CLI section 85 | 86 | 87 | ### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT) 88 | set --export --prepend PATH "/Users/prabirshrestha/.rd/bin" 89 | ### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT) 90 | -------------------------------------------------------------------------------- /.aider.conf.yml: -------------------------------------------------------------------------------- 1 | # https://github.com/lutzleonhardt/copilot-proxy 2 | # npx copilot-api@latest start 3 | # npx copilot-api@latest start --enterprise 4 | 5 | # Reference 6 | # https://aider.chat/docs/config/aider_conf.html#sample-yaml-config-file 7 | 8 | ## Specify the model to use for the main chat 9 | 10 | # model: gemini/gemini-2.5-pro-preview-05-06 11 | # model: gemini/gemini-2.5-flash-preview-04-17 12 | # model: openai/gemini-2.5-pro-preview-06-05 13 | # model: openai/gemini-2.5-flash 14 | model: openai/claude-sonnet-4 15 | # model: openai/claude-3.7-sonnet-thought 16 | # model: openai/claude-3.7-sonnet 17 | # model: openai/claude-3.5-sonnet 18 | # model: openai/gpt-4o 19 | # model: openai/o1 20 | # model: openai/o3-mini 21 | 22 | ######################## 23 | ## API Keys and settings: 24 | 25 | ## Specify the OpenAI API key 26 | openai-api-key: not-needed 27 | 28 | ## Specify the api base url 29 | openai-api-base: http://localhost:4141/ 30 | # openai-api-base: http://localhost:4460/ 31 | 32 | ################# 33 | ## Model settings: 34 | 35 | ## Add a model alias (can be used multiple times) 36 | alias: 37 | - "sonnet:openai/claude-3.7-sonnet" 38 | - "sonnet-thinking:openai/claude-3.7-sonnet-thought" 39 | - "gemini-flash:gemini/gemini-2.5-flash-preview-04-17" 40 | - "gemini:gemini-2.5-pro-preview-06-05" 41 | 42 | ## Specify the model to use for commit messages and chat history summarization (default depends on --model) 43 | # weak-model: gemini/gemini-2.5-flash-preview-04-17 44 | # weak-model: gemini/gemini-2.0-flash 45 | weak-model: openai/gpt-4o-mini 46 | # weak-model: openai/gpt-4o 47 | 48 | ## Specify the model to use for editor tasks (default depends on --model) 49 | # editor-model: openai/claude-3.7-sonnet-thought 50 | # editor-model: openai/claude-3.7-sonnet 51 | # editor-model: openai/claude-3.5-sonnet 52 | # editor-model: gemini/gemini-2.0-flash 53 | 54 | ## Only work with models that have meta-data available (default: True) 55 | show-model-warnings: true 56 | 57 | ################### 58 | # Repomap settings: 59 | 60 | ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) 61 | map-tokens: 1024 62 | 63 | ################## 64 | # Output settings: 65 | 66 | ## Use colors suitable for a dark terminal background (default: False) 67 | dark-mode: true 68 | 69 | ############### 70 | # Git settings: 71 | 72 | ## Enable/disable auto commit of LLM changes (default: True) 73 | auto-commits: false 74 | 75 | ## Enable/disable commits when repo is found dirty (default: True) 76 | dirty-commits: false 77 | 78 | ## Attribute aider code changes in the git author name (default: True) 79 | attribute-author: false 80 | 81 | ## Attribute aider commits in the git committer name (default: True) 82 | attribute-committer: false 83 | 84 | ################# 85 | # Other settings: 86 | 87 | ## Specify read-only files 88 | # read: 89 | # - "~/conventions/general.md" 90 | # - "~/conventions/typescript.md" 91 | # - "~/conventions/ghostty-shader.md" 92 | 93 | ## Enable/disable detection and offering to add URLs to chat (default: True) 94 | detect-urls: false 95 | 96 | ## Always say yes to every confirmation 97 | yes-always: false 98 | -------------------------------------------------------------------------------- /.config/zed/settings.json: -------------------------------------------------------------------------------- 1 | // Zed settings 2 | // 3 | // For information on how to configure Zed, see the Zed 4 | // documentation: https://zed.dev/docs/configuring-zed 5 | // 6 | // To see all of Zed's default settings without changing your 7 | // custom settings, run the `open default settings` command 8 | // from the command palette or from `Zed` application menu. 9 | { 10 | "agent": { 11 | "always_allow_tool_actions": true, 12 | "profiles": { 13 | "write": { 14 | "context_servers": { 15 | "browser-mcp": { 16 | "tools": { 17 | "getConsoleLogs": true, 18 | }, 19 | }, 20 | }, 21 | "name": "Write", 22 | "tools": { 23 | "copy_path": true, 24 | "create_directory": true, 25 | "create_file": true, 26 | "delete_path": true, 27 | "diagnostics": true, 28 | "edit_file": true, 29 | "fetch": true, 30 | "list_directory": true, 31 | "move_path": true, 32 | "now": true, 33 | "find_path": true, 34 | "read_file": true, 35 | "grep": true, 36 | "terminal": true, 37 | "thinking": true, 38 | "web_search": true, 39 | }, 40 | "enable_all_context_servers": true, 41 | }, 42 | }, 43 | "default_profile": "write", 44 | "default_model": { 45 | "provider": "copilot_chat", 46 | "model": "claude-sonnet-4.5", 47 | }, 48 | }, 49 | "features": { 50 | "edit_prediction_provider": "copilot", 51 | }, 52 | "theme": "Github Dark Dimmed", 53 | "tab_size": 2, 54 | "auto_install_extensions": { 55 | "docker-compose": true, 56 | "dockerfile": true, 57 | "emmet": true, 58 | "github-theme": true, 59 | "harper": true, 60 | "html": true, 61 | "just": true, 62 | "toml": true, 63 | }, 64 | "vim_mode": true, 65 | "vim": { 66 | "use_system_clipboard": "always", 67 | }, 68 | "ui_font_size": 14, 69 | "buffer_font_size": 14, 70 | "cursor_blink": true, 71 | "languages": { 72 | "JavaScript": { 73 | "code_actions_on_format": { 74 | "source.fixAll.eslint": true, 75 | "source.organizeImports": true, 76 | }, 77 | }, 78 | "TSX": { 79 | "code_actions_on_format": { 80 | "source.fixAll.eslint": true, 81 | "source.organizeImports": false, 82 | }, 83 | }, 84 | "TypeScript": { 85 | "code_actions_on_format": { 86 | "source.fixAll.eslint": true, 87 | "source.organizeImports": false, 88 | }, 89 | }, 90 | "Rust": { 91 | "tab_size": 4, 92 | }, 93 | }, 94 | "telemetry": { 95 | "enabled": false, 96 | "diagnostics": false, 97 | "metrics": false, 98 | }, 99 | "terminal": { 100 | "dock": "bottom", 101 | "env": { 102 | "GIT_EDITOR": "zed --wait", 103 | }, 104 | "font_size": 14, 105 | "shell": { 106 | "program": "fish", 107 | }, 108 | }, 109 | "context_servers": { 110 | "browser-mcp": { 111 | "command": "bunx", 112 | "args": ["-y", "@browsermcp/mcp@latest"], 113 | }, 114 | }, 115 | } 116 | -------------------------------------------------------------------------------- /.config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | /*Dracula theme based on the Purple official rofi theme*/ 2 | 3 | * { 4 | font: "IBM Plex Mono 14"; 5 | foreground: #f8f8f2; 6 | background: #282a36; 7 | active-background: #6272a4; 8 | urgent-background: #ff5555; 9 | selected-background: @active-background; 10 | selected-urgent-background: @urgent-background; 11 | selected-active-background: @active-background; 12 | separatorcolor: @active-background; 13 | bordercolor: @active-background; 14 | } 15 | 16 | #window { 17 | background-color: @background; 18 | border: 1; 19 | border-radius: 6; 20 | border-color: @bordercolor; 21 | padding: 5; 22 | } 23 | #mainbox { 24 | border: 0; 25 | padding: 0; 26 | } 27 | #message { 28 | border: 1px dash 0px 0px ; 29 | border-color: @separatorcolor; 30 | padding: 1px ; 31 | } 32 | #textbox { 33 | text-color: @foreground; 34 | } 35 | #listview { 36 | fixed-height: 0; 37 | border: 2px dash 0px 0px ; 38 | border-color: @bordercolor; 39 | spacing: 2px ; 40 | scrollbar: false; 41 | padding: 2px 0px 0px ; 42 | } 43 | #element { 44 | border: 0; 45 | padding: 1px ; 46 | } 47 | #element.normal.normal { 48 | background-color: @background; 49 | text-color: @foreground; 50 | } 51 | #element.normal.urgent { 52 | background-color: @urgent-background; 53 | text-color: @urgent-foreground; 54 | } 55 | #element.normal.active { 56 | background-color: @active-background; 57 | text-color: @foreground; 58 | } 59 | #element.selected.normal { 60 | background-color: @selected-background; 61 | text-color: @foreground; 62 | } 63 | #element.selected.urgent { 64 | background-color: @selected-urgent-background; 65 | text-color: @foreground; 66 | } 67 | #element.selected.active { 68 | background-color: @selected-active-background; 69 | text-color: @foreground; 70 | } 71 | #element.alternate.normal { 72 | background-color: @background; 73 | text-color: @foreground; 74 | } 75 | #element.alternate.urgent { 76 | background-color: @urgent-background; 77 | text-color: @foreground; 78 | } 79 | #element.alternate.active { 80 | background-color: @active-background; 81 | text-color: @foreground; 82 | } 83 | #scrollbar { 84 | width: 2px ; 85 | border: 0; 86 | handle-width: 8px ; 87 | padding: 0; 88 | } 89 | #sidebar { 90 | border: 2px dash 0px 0px ; 91 | border-color: @separatorcolor; 92 | } 93 | #button.selected { 94 | background-color: @selected-background; 95 | text-color: @foreground; 96 | } 97 | #inputbar { 98 | spacing: 0; 99 | text-color: @foreground; 100 | padding: 1px ; 101 | } 102 | #case-indicator { 103 | spacing: 0; 104 | text-color: @foreground; 105 | } 106 | #entry { 107 | spacing: 0; 108 | text-color: @foreground; 109 | } 110 | #prompt { 111 | spacing: 0; 112 | text-color: @foreground; 113 | } 114 | #inputbar { 115 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; 116 | } 117 | #textbox-prompt-colon { 118 | expand: false; 119 | str: ":"; 120 | margin: 0px 0.3em 0em 0em ; 121 | text-color: @foreground; 122 | } 123 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.tmux.conf -o ~/.tmux.conf 2 | 3 | bind r source-file ~/.tmux.conf \; display "Reloaded!" 4 | 5 | ## Change the prefix to Ctrl+a 6 | #unbind C-b 7 | #set -g prefix C-a 8 | #bind C-a send-prefix 9 | 10 | bind-key -n C-Space send-keys C-Space 11 | 12 | # enable pretty colors 13 | set-option -ga terminal-overrides ",xterm-256color:Tc" 14 | 15 | # increase scroll-back history 16 | set -g history-limit 5000 17 | 18 | # use vim key bindings 19 | setw -g mode-keys vi 20 | 21 | # start window index at 1 22 | set -g base-index 1 23 | 24 | # start pane index at 1 25 | set -g pane-base-index 1 26 | 27 | # change the default delay to make it more responsive 28 | set -sg escape-time 1 29 | 30 | # window 31 | bind c new-window -c "#{pane_current_path}" 32 | 33 | # Splitting panes 34 | bind \\ split-window -h -c "#{pane_current_path}" 35 | bind - split-window -v -c "#{pane_current_path}" 36 | 37 | # pane movements 38 | bind h select-pane -L 39 | bind j select-pane -D 40 | bind k select-pane -U 41 | bind l select-pane -R 42 | 43 | # pane resizing 44 | bind H resize-pane -L 5 45 | bind J resize-pane -D 5 46 | bind K resize-pane -U 5 47 | bind L resize-pane -R 5 48 | 49 | # pane resizing 50 | bind -r H resize-pane -L 5 51 | bind -r J resize-pane -D 5 52 | bind -r K resize-pane -U 5 53 | bind -r L resize-pane -R 5 54 | 55 | # window movement 56 | bind -r C-h select-window -t:- 57 | bind -r C-l select-window -t:+ 58 | 59 | # remapping copy paste to vim 60 | # unbind [ 61 | bind Escape copy-mode 62 | unbind p 63 | bind p paste-buffer 64 | # bind -t vi-copy 'v' begin-selection 65 | # bind -t vi-copy 'y' copy-selection 66 | 67 | # setw -g monitory-activity on 68 | set -g visual-activity on 69 | # Enable mouse support in ~/.tmux.conf 70 | set -g mouse on 71 | 72 | set-option -g renumber-windows on 73 | 74 | setw -g aggressive-resize on 75 | 76 | # Status bar design 77 | # status line 78 | set -g status-justify left 79 | set -g status-bg default 80 | set -g status-fg colour12 81 | set -g status-interval 2 82 | 83 | # window status 84 | setw -g window-status-format " #F#I:#W#F " 85 | setw -g window-status-current-format " #F#I:#W#F " 86 | setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W " 87 | setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W " 88 | 89 | # Info on left (I don't have a session display for now) 90 | set -g status-left '' 91 | 92 | # loud or quiet? 93 | set-option -g visual-activity off 94 | set-option -g visual-bell off 95 | set-option -g visual-silence off 96 | set-window-option -g monitor-activity off 97 | set-option -g bell-action none 98 | 99 | set -g default-terminal "screen-256color" 100 | 101 | # The modes { 102 | setw -g clock-mode-colour colour135 103 | # } 104 | 105 | # The statusbar { 106 | 107 | set -g status-position bottom 108 | set -g status-left '' 109 | set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' 110 | set -g status-right-length 50 111 | set -g status-left-length 20 112 | 113 | setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F ' 114 | 115 | setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' 116 | # } 117 | -------------------------------------------------------------------------------- /bin/get-gh-copilot-token.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://github.com/Aider-AI/aider/issues/2227#issuecomment-2869404979 4 | 5 | CLIENT_ID='Iv23ctfURkiMfJ4xr5mv' 6 | COMMON_HEADERS=( 7 | -H 'accept: application/json' 8 | -H 'content-type: application/json' 9 | -H 'accept-encoding: gzip,deflate,br' 10 | ) 11 | 12 | # Step 1: Request device and user codes 13 | echo "Requesting device and user codes..." 14 | DEVICE_CODE_RESPONSE=$(curl -s --compressed -X POST \ 15 | "${COMMON_HEADERS[@]}" \ 16 | -d "{\"client_id\":\"$CLIENT_ID\",\"scope\":\"read:user\"}" \ 17 | https://github.com/login/device/code) 18 | 19 | DEVICE_CODE=$(echo "$DEVICE_CODE_RESPONSE" | jq -r '.device_code') 20 | USER_CODE=$(echo "$DEVICE_CODE_RESPONSE" | jq -r '.user_code') 21 | VERIFICATION_URI=$(echo "$DEVICE_CODE_RESPONSE" | jq -r '.verification_uri') 22 | 23 | if [ "$DEVICE_CODE" == "null" ] || [ "$USER_CODE" == "null" ] || [ "$VERIFICATION_URI" == "null" ]; then 24 | echo "Error: Could not parse device code response." 25 | echo "$DEVICE_CODE_RESPONSE" 26 | exit 1 27 | fi 28 | 29 | echo "Please visit $VERIFICATION_URI and enter code $USER_CODE to authenticate." 30 | 31 | # Step 2: Poll for access token 32 | ACCESS_TOKEN="null" 33 | echo "Polling for access token..." 34 | while [ "$ACCESS_TOKEN" == "null" ]; do 35 | # wait 5 seconds between polls, unless a different interval is specified later 36 | CURRENT_POLL_INTERVAL=5 37 | sleep $CURRENT_POLL_INTERVAL 38 | 39 | TOKEN_RESPONSE=$(curl -s --compressed -X POST \ 40 | "${COMMON_HEADERS[@]}" \ 41 | -d "{\"client_id\":\"$CLIENT_ID\",\"device_code\":\"$DEVICE_CODE\",\"grant_type\":\"urn:ietf:params:oauth:grant-type:device_code\"}" \ 42 | https://github.com/login/oauth/access_token) 43 | 44 | CURL_EXIT_CODE=$? 45 | if [ $CURL_EXIT_CODE -ne 0 ]; then 46 | echo "Error: Access token request failed during polling with curl exit code $CURL_EXIT_CODE." 47 | # Optionally, you might want to check the error from TOKEN_RESPONSE here 48 | # For now, we'll just continue polling or let the user interrupt 49 | continue 50 | fi 51 | 52 | if [ -z "$TOKEN_RESPONSE" ]; then 53 | echo "Error: Empty response from token request during polling." 54 | continue 55 | fi 56 | 57 | if ! echo "$TOKEN_RESPONSE" | jq -e . > /dev/null 2>&1; then 58 | echo "Error: Token response is not valid JSON during polling." 59 | echo "Raw response: $TOKEN_RESPONSE" 60 | continue 61 | fi 62 | 63 | # Check for errors in the response before trying to parse access_token 64 | ERROR=$(echo "$TOKEN_RESPONSE" | jq -r '.error') 65 | if [ "$ERROR" != "null" ] && [ "$ERROR" != "authorization_pending" ]; then 66 | ERROR_DESCRIPTION=$(echo "$TOKEN_RESPONSE" | jq -r '.error_description') 67 | echo "Error received from token endpoint: $ERROR_DESCRIPTION" 68 | # Depending on the error, you might want to exit or handle it differently 69 | # For "slow_down", we should respect the interval provided 70 | # Default to 5 if interval not present or not a number 71 | INTERVAL=$(echo "$TOKEN_RESPONSE" | jq -r '.interval') 72 | if ! [[ "$INTERVAL" =~ ^[0-9]+$ ]] || [ "$INTERVAL" -le 0 ]; then 73 | echo "Warning: Invalid or non-positive interval '$INTERVAL' received. Defaulting to 5 seconds for slow_down." 74 | INTERVAL=5 75 | fi 76 | echo "Slowing down... waiting $INTERVAL seconds." 77 | CURRENT_POLL_INTERVAL=$INTERVAL # This will be used by sleep at the start of the loop 78 | # The actual sleep for "slow_down" will happen here before continuing 79 | sleep "$INTERVAL" 80 | continue 81 | fi 82 | 83 | ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token') 84 | # If access_token is still "null" (as a string from jq -r), it means it wasn't found or was literally null 85 | # The loop condition `while [ "$ACCESS_TOKEN" == "null" ]` will handle this. 86 | done 87 | 88 | echo "Authentication success: $ACCESS_TOKEN" 89 | 90 | echo "Testing Token..." 91 | 92 | curl -s "https://api.githubcopilot.com/chat/completions" \ 93 | -X POST \ 94 | -H "Content-Type: application/json" \ 95 | -H "Copilot-Integration-Id: vscode-chat" \ 96 | -H "Authorization: Bearer $ACCESS_TOKEN" \ 97 | -d '{ 98 | "model": "gpt-4.1", 99 | "messages": [ 100 | {"role": "user", "content": "Answer with \"OK it worked\""} 101 | ] 102 | }' | jq -r '.choices[0].delta.content' 103 | -------------------------------------------------------------------------------- /clink/scoop.lua: -------------------------------------------------------------------------------- 1 | local scoop_dir = os.getenv('SCOOP') 2 | if not scoop_dir then 3 | scoop_dir = os.getenv('USERPROFILE')..'/scoop' 4 | end 5 | local scoop_global = os.getenv('SCOOP_GLOBAL') 6 | 7 | 8 | local function trim_extensions (apps) 9 | for k, v in pairs(apps) do 10 | apps[k] = string.match(v, '[%w-]*') 11 | end 12 | return apps 13 | end 14 | 15 | local function find_dirs (path) 16 | dirs = clink.find_dirs(path) 17 | -- Remove .. and . from table of directories 18 | table.remove(dirs, 1) 19 | table.remove(dirs, 1) 20 | return dirs 21 | end 22 | 23 | local function find_files (path) 24 | files = clink.find_files(path) 25 | -- Remove .. and . from table of files 26 | table.remove(files, 1) 27 | table.remove(files, 1) 28 | return files 29 | end 30 | 31 | local function get_cache () 32 | cache = find_files(scoop_dir..'/cache/*') 33 | for i, name in pairs(cache) do 34 | signPos = string.find(name, "#") 35 | cache[i] = signPos and string.sub(name, 0, signPos - 1) or nil 36 | end 37 | return cache 38 | end 39 | 40 | local Buckets = {} 41 | 42 | function Buckets.get_local () 43 | return find_dirs(scoop_dir..'/buckets/*') 44 | end 45 | 46 | function Buckets.get_known () 47 | json = io.open(scoop_dir..'/apps/scoop/current/buckets.json') 48 | known = {} 49 | for line in json:lines() do 50 | bucket = string.match(line, '\"(.-)\"') 51 | if bucket then 52 | table.insert(known, bucket) 53 | end 54 | end 55 | return known 56 | end 57 | 58 | local Apps = {} 59 | 60 | function Apps.get_installed () 61 | installed = find_dirs(scoop_dir..'/apps/*') 62 | if scoop_global then 63 | for _, dir in pairs(find_dirs(scoop_global..'/apps/*')) do 64 | table.insert(installed, dir) 65 | end 66 | end 67 | return installed 68 | end 69 | 70 | function Apps.get_known () 71 | apps = trim_extensions(clink.find_files(scoop_dir..'/apps/scoop/current/bucket/*.json')) 72 | for _, dir in pairs(Buckets.get_local()) do 73 | for u, app in pairs(trim_extensions(clink.find_files(scoop_dir..'/buckets/'..dir..'/*.json'))) do 74 | table.insert(apps, app) 75 | end 76 | for u, app in pairs(trim_extensions(clink.find_files(scoop_dir..'/buckets/'..dir..'/bucket/*.json'))) do 77 | table.insert(apps, app) 78 | end 79 | end 80 | return apps 81 | end 82 | 83 | local parser = clink.arg.new_parser 84 | 85 | local boolean_parser = parser({'true', 'false'}) 86 | local architecture_parser = parser({'32bit', '64bit'}) 87 | 88 | local config_parser = parser({ 89 | 'MSIEXTRACT_USE_LESSMSI' ..boolean_parser, 90 | 'aria2-enabled' ..boolean_parser, 91 | 'aria2-retry-wait', 92 | 'aria2-split', 93 | 'aria2-max-connection-per-server', 94 | 'aria2-min-split-size', 95 | 'aria2-options', 96 | 'NO_JUNCTIONS' ..boolean_parser, 97 | 'show_update_log' ..boolean_parser, 98 | 'virustotal_api_key', 99 | 'proxy' 100 | }) 101 | 102 | local scoop_parser = parser({ 103 | {'info', 'depends', 'home'} ..parser({Apps.get_known}), 104 | 'alias' ..parser({'add', 'list' ..parser({'-v', '--verbose'}), 'rm'}), 105 | 'bucket' ..parser({'add' ..parser({Buckets.get_known}), 'list', 'known', 'rm' ..parser({Buckets.get_local})}), 106 | 'cache' ..parser({'show', 'rm'} ..parser({get_cache})), 107 | 'checkup', 108 | 'cleanup' ..parser({Apps.get_installed}, 109 | '-g', '--global'):loop(1), 110 | 'config' ..config_parser, 111 | 'create', 112 | 'export', 113 | 'list', 114 | 'install' ..parser({Apps.get_known}, 115 | '-g', '--global', 116 | '-i', '--independent', 117 | '-k', '--no-cache', 118 | '-s', '--skip', 119 | '-a' ..architecture_parser, '--arch' ..architecture_parser 120 | ):loop(1), 121 | 'prefix' ..parser({Apps.get_installed}), 122 | 'reset' ..parser({Apps.get_installed}):loop(1), 123 | 'search', 124 | 'status', 125 | 'uninstall' ..parser({Apps.get_installed}, 126 | '-g', '--global', 127 | '-p', '--purge'):loop(1), 128 | 'update' ..parser({Apps.get_installed}, 129 | '-g', '--global', 130 | '-f', '--force', 131 | '-i', '--independent', 132 | '-k', '--no-cache', 133 | '-s', '--skip', 134 | '-q', '--quite'):loop(1), 135 | 'virustotal' ..parser({Apps.get_known}, 136 | '-a' ..architecture_parser, '--arch' ..architecture_parser, 137 | '-s', '--scan', 138 | '-n', '--no-depends'):loop(1), 139 | 'which' 140 | }) 141 | 142 | local help_parser = parser({ 143 | 'help' ..parser(scoop_parser:flatten_argument(1)) 144 | }) 145 | 146 | clink.arg.register_parser('scoop', scoop_parser) 147 | clink.arg.register_parser('scoop', help_parser) 148 | -------------------------------------------------------------------------------- /.config/polybar/config.ini: -------------------------------------------------------------------------------- 1 | ;========================================================== 2 | ; 3 | ; 4 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ 5 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ 6 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ 7 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ 8 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ 9 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ 10 | ; 11 | ; 12 | ; To learn more about how to configure Polybar 13 | ; go to https://github.com/polybar/polybar 14 | ; 15 | ; The README contains a lot of information 16 | ; 17 | ;========================================================== 18 | 19 | [colors] 20 | background = #282A2E 21 | background-alt = #373B41 22 | foreground = #C5C8C6 23 | primary = #F0C674 24 | secondary = #8ABEB7 25 | alert = #A54242 26 | disabled = #707880 27 | 28 | [bar/top] 29 | width = 100% 30 | height = 24pt 31 | radius = 6 32 | 33 | ; dpi = 96 34 | 35 | background = ${colors.background} 36 | foreground = ${colors.foreground} 37 | 38 | line-size = 3pt 39 | 40 | border-size = 4pt 41 | border-color = #00000000 42 | 43 | padding-left = 0 44 | padding-right = 1 45 | 46 | module-margin = 1 47 | 48 | separator = | 49 | separator-foreground = ${colors.disabled} 50 | 51 | font-0 = monospace;2 52 | 53 | modules-left = applauncher xworkspaces xwindow 54 | modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date 55 | 56 | cursor-click = pointer 57 | cursor-scroll = ns-resize 58 | 59 | enable-ipc = true 60 | 61 | tray-position = right 62 | 63 | ; wm-restack = generic 64 | ; wm-restack = bspwm 65 | ; wm-restack = i3 66 | 67 | ; override-redirect = true 68 | 69 | [module/applauncher] 70 | type = custom/text 71 | click-left = rofi -modi run,drun -show drun -show-icons 72 | content-padding = 2 73 | content = Apps 74 | 75 | [module/xworkspaces] 76 | type = internal/xworkspaces 77 | 78 | label-active = %name% 79 | label-active-background = ${colors.background-alt} 80 | label-active-underline= ${colors.primary} 81 | label-active-padding = 1 82 | 83 | label-occupied = %name% 84 | label-occupied-padding = 1 85 | 86 | label-urgent = %name% 87 | label-urgent-background = ${colors.alert} 88 | label-urgent-padding = 1 89 | 90 | label-empty = %name% 91 | label-empty-foreground = ${colors.disabled} 92 | label-empty-padding = 1 93 | 94 | [module/xwindow] 95 | type = internal/xwindow 96 | label = %title:0:60:...% 97 | 98 | [module/filesystem] 99 | type = internal/fs 100 | interval = 25 101 | 102 | mount-0 = / 103 | 104 | label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% 105 | 106 | label-unmounted = %mountpoint% not mounted 107 | label-unmounted-foreground = ${colors.disabled} 108 | 109 | [module/pulseaudio] 110 | type = internal/pulseaudio 111 | 112 | format-volume-prefix = "VOL " 113 | format-volume-prefix-foreground = ${colors.primary} 114 | format-volume = 115 | 116 | label-volume = %percentage%% 117 | 118 | label-muted = muted 119 | label-muted-foreground = ${colors.disabled} 120 | 121 | [module/xkeyboard] 122 | type = internal/xkeyboard 123 | blacklist-0 = num lock 124 | 125 | label-layout = %layout% 126 | label-layout-foreground = ${colors.primary} 127 | 128 | label-indicator-padding = 2 129 | label-indicator-margin = 1 130 | label-indicator-foreground = ${colors.background} 131 | label-indicator-background = ${colors.secondary} 132 | 133 | [module/memory] 134 | type = internal/memory 135 | interval = 2 136 | format-prefix = "RAM " 137 | format-prefix-foreground = ${colors.primary} 138 | label = %percentage_used:2%% 139 | 140 | [module/cpu] 141 | type = internal/cpu 142 | interval = 2 143 | format-prefix = "CPU " 144 | format-prefix-foreground = ${colors.primary} 145 | label = %percentage:2%% 146 | 147 | [network-base] 148 | type = internal/network 149 | interval = 5 150 | format-connected = 151 | format-disconnected = 152 | label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected 153 | 154 | [module/wlan] 155 | inherit = network-base 156 | interface-type = wireless 157 | label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% 158 | 159 | [module/eth] 160 | inherit = network-base 161 | interface-type = wired 162 | label-connected = %{F#F0C674}%ifname%%{F-} %local_ip% 163 | 164 | [module/date] 165 | type = internal/date 166 | interval = 1 167 | 168 | date = %Y-%m-%d %H:%M:%S 169 | date-alt = %H:%M 170 | 171 | label = %date% 172 | label-foreground = ${colors.primary} 173 | 174 | [settings] 175 | screenchange-reload = true 176 | pseudo-transparency = true 177 | 178 | ; vim:ft=dosini 179 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | arch="$(uname -m)" 5 | unameOut="$(uname -s)" 6 | case "${unameOut}" in 7 | Linux*) platform=linux;; 8 | Darwin*) platform=mac;; 9 | CYGWIN*) platform=cygwin;; 10 | MINGW*) platform=mingw;; 11 | *) platform="UNKNOWN:${unameOut}" 12 | esac 13 | 14 | if [ "$platform" == "mac" ]; then 15 | echo "Detected MacOS" 16 | 17 | if ! command -v brew &> /dev/null; then 18 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 19 | eval "$(/opt/homebrew/bin/brew shellenv)" 20 | fi 21 | 22 | brew install \ 23 | age \ 24 | aider \ 25 | bacon \ 26 | bat \ 27 | axodotdev/tap/cargo-dist \ 28 | cargo-make \ 29 | cargo-watch \ 30 | code2prompt \ 31 | deskpad \ 32 | docker \ 33 | docker-credential-helper \ 34 | docker-compose \ 35 | dotter \ 36 | efm-langserver \ 37 | fd \ 38 | ffmpeg \ 39 | fish \ 40 | fisher \ 41 | flameshot \ 42 | fnm \ 43 | fzf \ 44 | gh \ 45 | hyperfine \ 46 | jj \ 47 | jq \ 48 | just \ 49 | derailed/k9s/k9s \ 50 | keycastr \ 51 | kind \ 52 | kluctl/tap/kluctl \ 53 | kubectl \ 54 | kubectx \ 55 | lazydocker \ 56 | llama.cpp \ 57 | llm \ 58 | localai \ 59 | lnav \ 60 | mise \ 61 | opensuperwhisper \ 62 | poppler \ 63 | portaudio \ 64 | pnpm \ 65 | ripgrep \ 66 | rustup \ 67 | satyrn \ 68 | sops \ 69 | talhelper \ 70 | television \ 71 | tree \ 72 | utm \ 73 | uv \ 74 | vim \ 75 | vlc \ 76 | wezterm \ 77 | wget \ 78 | yq \ 79 | zoxide \ 80 | ; 81 | 82 | brew install dotenvx/brew/dotenvx 83 | brew install --cask \ 84 | claude-code \ 85 | freelens \ 86 | ghostty \ 87 | ollama-app \ 88 | rancher \ 89 | ; 90 | 91 | brew tap hashicorp/tap 92 | brew install hashicorp/tap/nomad 93 | if command -v rustup &> /dev/null; then 94 | rustup component add rust-src rust-analyzer 95 | fi 96 | 97 | brew tap versatiles-org/versatiles 98 | brew install versatiles 99 | 100 | brew install --cask \ 101 | disk-inventory-x \ 102 | keepassxc \ 103 | zed@preview \ 104 | ; 105 | 106 | brew install turbot/tap/steampipe 107 | steampipe plugin install azuredevops 108 | 109 | brew install siderolabs/tap/talosctl 110 | 111 | if [[ "$(scutil --get ComputerName)" == *"Work"* ]]; then 112 | brew install \ 113 | gettext \ 114 | azure-data-studio \ 115 | azure-cli \ 116 | ; 117 | brew install --cask yubico-yubikey-manager 118 | else 119 | brew install \ 120 | betterzip \ 121 | ; 122 | fi 123 | elif [ "$platform" == "linux" ]; then 124 | echo "Linux Detected" 125 | if [ -f "/etc/arch-release" ]; then 126 | echo "ArchLinux detected" 127 | 128 | if [ "$EUID" -eq 0 ]; then 129 | read -p "Enter non-root username: " USERNAME 130 | if id "$USERNAME" >/dev/null 2>&1; then 131 | echo 'user found' 132 | else 133 | useradd -m -G wheel "$USERNAME" 134 | passwd "$USERNAME" 135 | fi 136 | pacman -Sy sudo --noconfirm 137 | sed -i '/%wheel ALL=(ALL:ALL) ALL/s/^#//' /etc/sudoers 138 | else 139 | USERNAME=$(whoami) 140 | fi 141 | if ! command -v paru &> /dev/null; then 142 | sudo pacman -S --needed --noconfirm base-devel git 143 | sudo rm -rf /tmp/paru-bin 144 | sudo -u "$USERNAME" git clone https://aur.archlinux.org/paru-bin.git /tmp/paru-bin 145 | pushd /tmp/paru-bin 146 | sudo -u "$USERNAME" makepkg -si --noconfirm 147 | popd 148 | rm -rf /tmp/paru-bin 149 | fi 150 | sudo -u "$USERNAME" paru -Sy --noconfirm \ 151 | age \ 152 | bspwm \ 153 | curl \ 154 | chromium \ 155 | git \ 156 | google-chrome \ 157 | gvim \ 158 | linux-headers \ 159 | lua \ 160 | picom \ 161 | polybar \ 162 | rofi \ 163 | sxhkd \ 164 | unzip \ 165 | wezterm \ 166 | xsel 167 | if [[ $arch != "aarch64" ]]; then 168 | sudo -u "$USERNAME" paru -Sy --noconfirm \ 169 | dotter-rs-bin 170 | fi 171 | sudo -u "$USERNAME" paru -Sy --noconfirm xorg xfce4 sddm 172 | sudo -u "$USERNAME" systemctl enable sddm 173 | elif [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then 174 | echo "Debian based distro detected" 175 | sudo apt-get update 176 | sudo apt-get install -y \ 177 | age \ 178 | build-essential \ 179 | curl \ 180 | git \ 181 | vim 182 | else 183 | echo "Unsupported Linux Distro" 184 | exit 1 185 | fi 186 | fi 187 | -------------------------------------------------------------------------------- /.config/zed/keymap.json: -------------------------------------------------------------------------------- 1 | // Zed keymap 2 | // 3 | // For information on binding keys, see the Zed 4 | // documentation: https://zed.dev/docs/key-bindings 5 | // 6 | // To see the default key bindings run `zed: open default keymap` 7 | // from the command palette. 8 | [ 9 | { 10 | "bindings": { 11 | "ctrl-j": "menu::SelectNext", 12 | "ctrl-n": "menu::SelectNext", 13 | "ctrl-k": "menu::SelectPrevious", 14 | "ctrl-p": "menu::SelectPrevious" 15 | } 16 | }, 17 | { 18 | "context": "Workspace", 19 | "bindings": { 20 | "ctrl-a c": "workspace::NewCenterTerminal", 21 | "ctrl-a -": "workspace::NewTerminal", 22 | "ctrl-a \\": "pane::SplitRight", // temporary create split pane until split terminal in right is supported. https://github.com/zed-industries/zed/discussions/26243 23 | "ctrl-a x": "pane::CloseActiveItem", 24 | "ctrl-a j": "workspace::ActivatePaneDown", 25 | "ctrl-a l": "workspace::ActivatePaneRight", 26 | "ctrl-a h": "workspace::ActivatePaneLeft" 27 | } 28 | }, 29 | { 30 | "context": "ProjectPanel", 31 | "bindings": { 32 | "space e": "workspace::ToggleLeftDock" 33 | // "q": "workspace::ToggleLeftDock" 34 | } 35 | }, 36 | { 37 | "context": "!VimWaiting && vim_mode == insert", 38 | "bindings": { 39 | "ctrl-p": "file_finder::Toggle" 40 | } 41 | }, 42 | { 43 | "context": "Editor && (vim_mode == normal || vim_mode == visual)", 44 | "bindings": { 45 | "space e": "workspace::ToggleLeftDock" 46 | } 47 | }, 48 | { 49 | "context": "Editor && vim_mode == normal", 50 | "bindings": {} 51 | }, 52 | { 53 | "context": "Editor && vim_mode == visual", 54 | "bindings": {} 55 | }, 56 | { 57 | "context": "Editor && vim_mode == normal && (vim_operator == none || vim_operator == n) && !VimWaiting", 58 | "bindings": { 59 | "space q": "pane::CloseActiveItem" 60 | } 61 | }, 62 | { 63 | "context": "Editor && VimControl && !VimWaiting && !menu", 64 | "bindings": { 65 | "ctrl-p": "file_finder::Toggle", 66 | "g o t": "workspace::OpenInTerminal", 67 | "ctrl-w z": "workspace::ToggleZoom", 68 | "space w": "workspace::Save", 69 | "space r n": "editor::Rename", 70 | "space c a": "editor::ToggleCodeActions", 71 | "space g b": "editor::ToggleGitBlame", 72 | "shift-k": "editor::Hover", 73 | "g c c": "editor::ToggleComments", 74 | "g d": "editor::GoToDefinition", 75 | "space g d": "editor::GoToDefinitionSplit", 76 | "g D": "editor::GoToDeclaration", 77 | "space g D": "editor::GoToDeclarationSplit", 78 | "g r": "editor::FindAllReferences", 79 | "g i": "editor::GoToImplementation", 80 | "space g i": "editor::GoToImplementationSplit", 81 | "g t": "editor::GoToTypeDefinition", 82 | "j": [ 83 | "vim::Down", 84 | { 85 | "display_lines": true 86 | } 87 | ], 88 | "k": [ 89 | "vim::Up", 90 | { 91 | "display_lines": true 92 | } 93 | ] 94 | } 95 | }, 96 | { 97 | "context": "Editor && showing_completions", 98 | "bindings": { 99 | "enter": "editor::ConfirmCompletion", 100 | "ctrl-j": "editor::ContextMenuNext", 101 | "ctrl-n": "editor::ContextMenuNext", 102 | "ctrl-k": "editor::ContextMenuPrevious", 103 | "ctrl-p": "editor::ContextMenuPrevious" 104 | } 105 | }, 106 | { 107 | "context": "Pane", 108 | "bindings": { 109 | "cmd-1": ["pane::ActivateItem", 0], 110 | "cmd-2": ["pane::ActivateItem", 1], 111 | "cmd-3": ["pane::ActivateItem", 2], 112 | "cmd-4": ["pane::ActivateItem", 3], 113 | "cmd-5": ["pane::ActivateItem", 4], 114 | "cmd-6": ["pane::ActivateItem", 5], 115 | "cmd-7": ["pane::ActivateItem", 6], 116 | "cmd-8": ["pane::ActivateItem", 7], 117 | "cmd-9": ["pane::ActivateItem", 8], 118 | "ctrl-a 1": ["pane::ActivateItem", 0], 119 | "ctrl-a 2": ["pane::ActivateItem", 1], 120 | "ctrl-a 3": ["pane::ActivateItem", 2], 121 | "ctrl-a 4": ["pane::ActivateItem", 3], 122 | "ctrl-a 5": ["pane::ActivateItem", 4], 123 | "ctrl-a 6": ["pane::ActivateItem", 5], 124 | "ctrl-a 7": ["pane::ActivateItem", 6], 125 | "ctrl-a 8": ["pane::ActivateItem", 7], 126 | "ctrl-a 9": ["pane::ActivateItem", 8] 127 | } 128 | }, 129 | { 130 | "context": "Terminal", 131 | "bindings": { 132 | "ctrl-shift-c": "terminal::Copy", 133 | "ctrl-shift-v": "terminal::Paste", 134 | "ctrl-a k": "workspace::ActivatePaneUp", 135 | "ctrl-a j": "workspace::ActivatePaneDown", 136 | "ctrl-a l": "workspace::ActivatePaneRight", 137 | "ctrl-a h": "workspace::ActivatePaneLeft", 138 | "ctrl-a z": "workspace::ToggleZoom" 139 | } 140 | } 141 | ] 142 | -------------------------------------------------------------------------------- /.config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | 3 | local function file_exists(path) 4 | local f = io.open(path, "r") 5 | if f~=nil then io.close(f) return true else return false end 6 | end 7 | 8 | local config = { 9 | audible_bell = "Disabled", 10 | check_for_updates = false, 11 | color_scheme = "Builtin Solarized Dark", 12 | inactive_pane_hsb = { 13 | hue = 1.0, 14 | saturation = 1.0, 15 | brightness = 1.0, 16 | }, 17 | font_size = 16.0, 18 | launch_menu = {}, 19 | leader = { key="a", mods="CTRL" }, 20 | disable_default_key_bindings = true, 21 | keys = { 22 | -- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A 23 | { key = "a", mods = "LEADER|CTRL", action=wezterm.action{SendString="\x01"}}, 24 | { key = "-", mods = "LEADER", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}}, 25 | { key = "\\",mods = "LEADER", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}}, 26 | { key = "z", mods = "LEADER", action="TogglePaneZoomState" }, 27 | { key = "c", mods = "LEADER", action=wezterm.action{SpawnTab="CurrentPaneDomain"}}, 28 | { key = "h", mods = "LEADER", action=wezterm.action{ActivatePaneDirection="Left"}}, 29 | { key = "j", mods = "LEADER", action=wezterm.action{ActivatePaneDirection="Down"}}, 30 | { key = "k", mods = "LEADER", action=wezterm.action{ActivatePaneDirection="Up"}}, 31 | { key = "l", mods = "LEADER", action=wezterm.action{ActivatePaneDirection="Right"}}, 32 | { key = "H", mods = "LEADER|SHIFT", action=wezterm.action{AdjustPaneSize={"Left", 5}}}, 33 | { key = "J", mods = "LEADER|SHIFT", action=wezterm.action{AdjustPaneSize={"Down", 5}}}, 34 | { key = "K", mods = "LEADER|SHIFT", action=wezterm.action{AdjustPaneSize={"Up", 5}}}, 35 | { key = "L", mods = "LEADER|SHIFT", action=wezterm.action{AdjustPaneSize={"Right", 5}}}, 36 | { key = "1", mods = "LEADER", action=wezterm.action{ActivateTab=0}}, 37 | { key = "2", mods = "LEADER", action=wezterm.action{ActivateTab=1}}, 38 | { key = "3", mods = "LEADER", action=wezterm.action{ActivateTab=2}}, 39 | { key = "4", mods = "LEADER", action=wezterm.action{ActivateTab=3}}, 40 | { key = "5", mods = "LEADER", action=wezterm.action{ActivateTab=4}}, 41 | { key = "6", mods = "LEADER", action=wezterm.action{ActivateTab=5}}, 42 | { key = "7", mods = "LEADER", action=wezterm.action{ActivateTab=6}}, 43 | { key = "8", mods = "LEADER", action=wezterm.action{ActivateTab=7}}, 44 | { key = "9", mods = "LEADER", action=wezterm.action{ActivateTab=8}}, 45 | { key = "&", mods = "LEADER|SHIFT", action=wezterm.action{CloseCurrentTab={confirm=true}}}, 46 | { key = "x", mods = "LEADER", action=wezterm.action{CloseCurrentPane={confirm=true}}}, 47 | 48 | { key = "n", mods="SHIFT|CTRL", action="ToggleFullScreen" }, 49 | { key ="v", mods="SHIFT|CTRL", action=wezterm.action.PasteFrom 'Clipboard'}, 50 | { key ="c", mods="SHIFT|CTRL", action=wezterm.action.CopyTo 'Clipboard'}, 51 | { key = "+", mods="SHIFT|CTRL", action="IncreaseFontSize" }, 52 | { key = "-", mods="SHIFT|CTRL", action="DecreaseFontSize" }, 53 | { key = "0", mods="SHIFT|CTRL", action="ResetFontSize" }, 54 | }, 55 | set_environment_variables = {}, 56 | } 57 | 58 | if wezterm.target_triple == "x86_64-pc-windows-msvc" then 59 | if string.match(wezterm.hostname(), '^C') then 60 | config.prefer_egl = true 61 | end 62 | -- config.front_end = "Software" -- OpenGL doesn't work quite well with RDP. 63 | -- config.term = "" -- Set to empty so FZF works on windows 64 | table.insert(config.launch_menu, { label = "PowerShell", args = {"powershell.exe", "-NoLogo"} }) 65 | 66 | -- Find installed visual studio version(s) and add their compilation 67 | -- environment command prompts to the menu 68 | for _, vsvers in ipairs(wezterm.glob("Microsoft Visual Studio/20*", "C:/Program Files (x86)")) do 69 | local year = vsvers:gsub("Microsoft Visual Studio/", "") 70 | table.insert(config.launch_menu, { 71 | label = "x64 Native Tools VS " .. year, 72 | args = {"cmd.exe", "/k", "C:/Program Files (x86)/" .. vsvers .. "/BuildTools/VC/Auxiliary/Build/vcvars64.bat"}, 73 | }) 74 | end 75 | else 76 | local fish_bin_path = "/bin/fish" 77 | if file_exists("/opt/homebrew/bin/fish") then 78 | fish_bin_path = "/opt/homebrew/bin/fish" 79 | config.default_prog = { '/opt/homebrew/bin/fish', '-l' } 80 | else 81 | config.default_prog = { '/bin/bash', '-l' } 82 | end 83 | table.insert(config.launch_menu, { label = "fish", args = {fish_bin_path, "-l"} }) 84 | table.insert(config.launch_menu, { label = "bash", args = {"bash", "-l"} }) 85 | end 86 | 87 | return config 88 | -------------------------------------------------------------------------------- /clink/zoxide.lua: -------------------------------------------------------------------------------- 1 | -- ============================================================================= 2 | -- 3 | -- Settings copied from 'zoxide init'. Run `clink set` to modify these options, e.g. `clink set zoxide.cmd f` 4 | -- 5 | 6 | settings.add('zoxide.cmd', 'z', 'Changes the prefix of the aliases') 7 | settings.add('zoxide.hook', { 'pwd', 'prompt', 'none' }, 'Changes when directory scores are incremented') 8 | settings.add('zoxide.no_aliases', false, "Don't define aliases") 9 | 10 | -- ============================================================================= 11 | -- 12 | -- Utility functions for zoxide. 13 | -- 14 | 15 | -- Generate `cd` command 16 | local function __zoxide_cd(dir) 17 | if os.getenv '_ZO_ECHO' == '1' then 18 | print(dir) 19 | end 20 | 21 | -- 'cd /d -' doesn't work for clink versions before v1.2.41 (https://github.com/chrisant996/clink/issues/191) 22 | -- lastest cmder release (v1.3.18) uses clink v1.1.45 23 | if dir == '-' and (clink.version_encoded or 0) < 10020042 then 24 | return 'cd -' 25 | end 26 | 27 | return 'cd /d ' .. dir 28 | end 29 | 30 | -- Run `zoxide query` and generate `cd` command from result 31 | local function __zoxide_query(options, keywords) 32 | options = table.concat(options, ' ') 33 | keywords = table.concat(keywords, ' ') 34 | 35 | local file = io.popen('zoxide query ' .. options .. ' -- ' .. keywords) 36 | local result = file:read '*line' 37 | local ok = file:close() 38 | 39 | if ok then 40 | return __zoxide_cd(result) 41 | else 42 | return 'call' -- no-op that just sets %ERRORLEVEL% to 1 43 | end 44 | end 45 | 46 | -- Add directory to the database. 47 | local function __zoxide_add(dir) 48 | os.execute('zoxide add -- "' .. dir .. '"') 49 | end 50 | 51 | -- ============================================================================= 52 | -- 53 | -- Hook configuration for zoxide. 54 | -- 55 | 56 | local __zoxide_oldpwd 57 | local __zoxide_prompt = clink.promptfilter() 58 | 59 | function __zoxide_prompt:filter() 60 | local zoxide_hook = settings.get 'zoxide.hook' 61 | 62 | if zoxide_hook == 'none' then 63 | -- do nothing 64 | return 65 | elseif zoxide_hook == 'prompt' then 66 | -- run `zoxide add` on every prompt 67 | __zoxide_add(os.getcwd()) 68 | elseif zoxide_hook == 'pwd' then 69 | -- run `zoxide add` when the working directory changes 70 | local cwd = os.getcwd() 71 | if __zoxide_oldpwd and __zoxide_oldpwd ~= cwd then 72 | __zoxide_add(cwd) 73 | end 74 | __zoxide_oldpwd = cwd 75 | end 76 | end 77 | 78 | -- ============================================================================= 79 | -- 80 | -- Define aliases. 81 | -- 82 | 83 | -- 'z' alias 84 | local function __zoxide_z(keywords) 85 | if #keywords == 0 then 86 | return __zoxide_cd(os.getenv 'USERPROFILE') 87 | elseif #keywords == 1 then 88 | local keyword = keywords[1] 89 | if keyword == '-' then 90 | return __zoxide_cd '-' 91 | elseif os.isdir(keyword) then 92 | return __zoxide_cd(keyword) 93 | end 94 | end 95 | 96 | local cwd = '"' .. os.getcwd() .. '"' 97 | return __zoxide_query({ '--exclude', cwd }, keywords) 98 | end 99 | 100 | -- 'zi' alias 101 | local function __zoxide_zi(keywords) 102 | return __zoxide_query({ '--interactive' }, keywords) 103 | end 104 | 105 | -- ============================================================================= 106 | -- 107 | -- Clink input text filter. 108 | -- 109 | 110 | local function onfilterinput(text) 111 | args = string.explode(text, ' ', '"') 112 | if #args == 0 then 113 | return 114 | end 115 | 116 | -- settings 117 | zoxide_cmd = settings.get 'zoxide.cmd' 118 | zoxide_no_aliases = settings.get 'zoxide.no_aliases' 119 | 120 | -- edge case: 121 | -- * zoxide command prefix is 'cd' 122 | -- * clink converted 'cd -' -> 'cd /d "some_directory"' 123 | local cd_regex = '^%s*cd%s+/d%s+"(.-)"%s*$' 124 | if zoxide_cmd == 'cd' and text:match(cd_regex) then 125 | if zoxide_no_aliases then 126 | -- clink handles it 127 | return 128 | else 129 | -- zoxide handles it 130 | return __zoxide_cd(text:gsub(cd_regex, '%1')), false 131 | end 132 | end 133 | 134 | local cmd = table.remove(args, 1) 135 | if cmd == '__zoxide_z' or (cmd == zoxide_cmd and not zoxide_no_aliases) then 136 | return __zoxide_z(args), false 137 | elseif cmd == '__zoxide_zi' or (cmd == zoxide_cmd .. 'i' and not zoxide_no_aliases) then 138 | return __zoxide_zi(args), false 139 | else 140 | return 141 | end 142 | end 143 | 144 | if clink.onfilterinput then 145 | clink.onfilterinput(onfilterinput) 146 | else 147 | clink.onendedit(onfilterinput) 148 | end 149 | 150 | -- ============================================================================= 151 | -- 152 | -- To initalize zoxide, add this script to one of clink's lua script locations (e.g. zoxide.lua) 153 | -- (see https://chrisant996.github.io/clink/clink.html#location-of-lua-scripts) 154 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | # curl -Lk https://raw.githubusercontent.com/prabirshrestha/dotfiles/master/.bash_profile -o ~/.bash_profile 2 | stty -ixon 3 | 4 | export PS1='$(pwd)$ ' 5 | 6 | export EDITOR="vim" 7 | 8 | unameOut="$(uname -s)" 9 | case "${unameOut}" in 10 | Linux*) platform=linux;; 11 | Darwin*) platform=mac;; 12 | CYGWIN*) platform=cygwin;; 13 | MINGW*) platform=mingw;; 14 | *) platform="UNKNOWN:${unameOut}" 15 | esac 16 | 17 | 18 | if [ "$platform" == "mac" ]; then 19 | export BASH_SILENCE_DEPRECATION_WARNING=1 20 | export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH" 21 | export PATH="/opt/homebrew/anaconda3/bin:$PATH" 22 | export PATH="$(brew --prefix llvm)/bin:$PATH" 23 | export PATH="$(brew --prefix python)/libexec/bin:$PATH" 24 | fi 25 | 26 | if hash zoxide 2>/dev/null; then eval "$(zoxide init bash)"; fi 27 | #if hash just 2>/dev/null; then source <(just --completions bash); fi 28 | [[ -s ~/.cargo/env ]] && . ~/.cargo/env 29 | export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/Library/Python/3.8/bin:$PATH" 30 | export PATH="$HOME/.config/nvim/plugins/vim-themis/bin:$PATH" 31 | export PATH="$HOME/.dotfiles/bin:$PATH" 32 | export PATH="$HOME/.local/bin:$PATH" 33 | #export PATH="/opt/pkg/bin:$PATH" 34 | 35 | # if hash fnm 2>/dev/null; then eval "$(fnm env --use-on-cd)"; fi 36 | if hash mise 2>/dev/null; then eval "$(mise activate bash)"; fi 37 | 38 | if hash nomad 2>/dev/null; then complete -C nomad nomad; fi 39 | 40 | # if [ "$platform" == "mac" ] 41 | # then 42 | # if [ -d "$(echo /usr/local/Cellar/rocksdb/*/lib)" ] 43 | # then 44 | # export ROCKSDB_LIB_DIR="$(echo /usr/local/Cellar/rocksdb/*/lib)" 45 | # export ROCKSDB_STATIC=1 46 | # fi 47 | # fi 48 | # 49 | #. 50 | 51 | if [ "$platform" != "mac" ] 52 | then 53 | alias pbcopy='xsel --clipboard --input' 54 | alias pbpaste='xsel --clipboard --output' 55 | alias open='xdg-open' 56 | if hash xdotool 2>/dev/null; then export WINDOWID=$(xdotool getwindowfocus); fi 57 | fi 58 | 59 | # alias 60 | alias ls='ls -Gp' 61 | alias vi='vim' 62 | alias v='vim' 63 | 64 | # git alias 65 | alias g='git' 66 | alias ga='git add' 67 | alias gb='git branch' 68 | alias gba='git branch -a' 69 | alias gca='git commit -a' 70 | alias gclean='git clean -xdf' 71 | alias gcm='git checkout main || git checkout master' 72 | alias gco='git checkout' 73 | alias gcp='git cherry-pick' 74 | alias gf='git fetch' 75 | alias gl='git log --oneline --graph --decorate' 76 | alias gm='git merge' 77 | alias gmt='git mergetool' 78 | alias gp='git push origin HEAD' 79 | alias gs='git status' 80 | alias gup='git fetch && git rebase' 81 | 82 | swap-ctrl-caps() { 83 | if [ "$XDG_SESSION_TYPE" == "x11" ]; then 84 | if which setxkbmap >/dev/null; then setxkbmap -option "ctrl:swapcaps"; fi 85 | fi 86 | } 87 | 88 | swap-ctrl-caps 89 | 90 | gpr() { 91 | git fetch origin pull/${1}/head:pr${1} 92 | git checkout pr${1} 93 | } 94 | 95 | 96 | # fe [FUZZY PATTERN] - Open the selected file with the default editor 97 | # - Bypass fuzzy finder if there's only one match (--select-1) 98 | # - Exit if there's no match (--exit-0) 99 | fe() { 100 | local files 101 | IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0)) 102 | [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" 103 | } 104 | 105 | # fd - cd to selected directory 106 | fd() { 107 | local dir 108 | dir=$(find ${1:-.} -path '*/\.*' -prune \ 109 | -o -type d -print 2> /dev/null | fzf +m) && 110 | cd "$dir" 111 | } 112 | 113 | # fdr - cd to selected parent directory 114 | fdr() { 115 | local declare dirs=() 116 | get_parent_dirs() { 117 | if [[ -d "${1}" ]]; then dirs+=("$1"); else return; fi 118 | if [[ "${1}" == '/' ]]; then 119 | for _dir in "${dirs[@]}"; do echo $_dir; done 120 | else 121 | get_parent_dirs $(dirname "$1") 122 | fi 123 | } 124 | local DIR=$(get_parent_dirs $(realpath "${1:-$PWD}") | fzf-tmux --tac) 125 | cd "$DIR" 126 | } 127 | 128 | fco() { 129 | git checkout "$(git branch --all | fzf | tr -d ' ')" 130 | } 131 | 132 | # fcs - get git commit sha 133 | # example usage: git rebase -i `fcs` 134 | fcs() { 135 | local commits commit 136 | commits=$(git log --color=always --pretty=oneline --abbrev-commit --reverse) && 137 | commit=$(echo "$commits" | fzf --tac +s +m -e --ansi --reverse) && 138 | echo -n $(echo "$commit" | sed "s/ .*//") 139 | } 140 | 141 | # fstash - easier way to deal with stashes 142 | # type fstash to get a list of your stashes 143 | # enter shows you the contents of the stash 144 | # ctrl-d shows a diff of the stash against your current HEAD 145 | # ctrl-b checks the stash out as a branch, for easier merging 146 | fstash() { 147 | local out q k sha 148 | while out=$( 149 | git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" | 150 | fzf --ansi --no-sort --query="$q" --print-query \ 151 | --expect=ctrl-d,ctrl-b); 152 | do 153 | mapfile -t out <<< "$out" 154 | q="${out[0]}" 155 | k="${out[1]}" 156 | sha="${out[-1]}" 157 | sha="${sha%% *}" 158 | [[ -z "$sha" ]] && continue 159 | if [[ "$k" == 'ctrl-d' ]]; then 160 | git diff $sha 161 | elif [[ "$k" == 'ctrl-b' ]]; then 162 | git stash branch "stash-$sha" $sha 163 | break; 164 | else 165 | git stash show -p $sha 166 | fi 167 | done 168 | } 169 | 170 | start-openwebui() { 171 | docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_API_BASE_URL=http://localhost:11434/api --restart always --name open-webui ghcr.io/open-webui/open-webui:main 172 | } 173 | 174 | export GRIT_TELEMETRY_DISABLED=true 175 | [[ -s ~/.grit/bin/env ]] && . ~/.grit/bin/env 176 | 177 | # Added by LM Studio CLI (lms) 178 | export PATH="$PATH:/Users/prabirshrestha/.cache/lm-studio/bin" 179 | 180 | # Added by LM Studio CLI (lms) 181 | export PATH="$PATH:/Users/prabirshrestha/.lmstudio/bin" 182 | # End of LM Studio CLI section 183 | 184 | 185 | ### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT) 186 | export PATH="/Users/prabirshrestha/.rd/bin:$PATH" 187 | ### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT) 188 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " curl -Lk https://bit.ly/prabir-vimrc -o ~/.vimrc 2 | " to use existing vim configuration as neovim configuration 3 | " ln -s ~/.vimrc ~/.config/nvim/init.vim 4 | " For windows download lua binaries from https://sourceforge.net/projects/luabinaries/files/5.3.3/Windows%20Libraries/Dynamic/lua-5.3.3_Win64_dll11_lib.zip/download 5 | set nocompatible 6 | set encoding=utf-8 7 | scriptencoding utf-8 8 | set fileformats=unix,mac,dos 9 | set termencoding=utf-8 10 | syntax on 11 | filetype plugin indent on 12 | set backspace=indent,eol,start 13 | set nobackup noswapfile 14 | let mapleader = "\" 15 | 16 | let s:settings_config_dir = expand('~/.config/nvim') 17 | let s:settings_plug_path = expand(s:settings_config_dir . '/plug.vim') 18 | let s:settings_plugin_dir = expand(s:settings_config_dir . '/plugins') 19 | let s:settings_data_dir = expand(s:settings_config_dir . '/data') 20 | 21 | if !filereadable(s:settings_plug_path) 22 | silent! exec 'silent !curl -fkLo "' . s:settings_plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' 23 | endi 24 | silent! exec 'source ' . s:settings_plug_path 25 | 26 | let g:plug_shallow = 0 27 | call plug#begin(s:settings_plugin_dir) 28 | Plug 'lifepillar/vim-solarized8' 29 | if !has('nvim') | Plug 'rhysd/vim-healthcheck' | endif 30 | 31 | Plug 'itchyny/lightline.vim' 32 | Plug 'tpope/vim-sleuth' 33 | Plug 'justinmk/vim-gtfo' 34 | Plug 'andymass/vim-matchup' 35 | " Plug 'airblade/vim-rooter' 36 | Plug 'DataWraith/auto_mkdir' 37 | Plug 'Lokaltog/vim-easymotion', { 'on': ['(easymotion-s)'] } 38 | Plug 'ryanoasis/vim-devicons' 39 | " Plug 'preservim/nerdtree' 40 | Plug 'obaland/vfiler.vim' 41 | Plug 'obaland/vfiler-column-devicons' 42 | Plug 'lambdalisue/fern.vim' 43 | Plug 'lambdalisue/gina.vim' 44 | Plug 'tpope/vim-commentary' 45 | Plug 'tpope/vim-surround' 46 | Plug 'tyru/open-browser.vim' 47 | Plug 'skanehira/vsession' 48 | 49 | Plug 'thinca/vim-themis', { 'filetype': 'vim' } 50 | Plug 'cohama/lexima.vim' 51 | Plug 'sheerun/vim-polyglot' 52 | Plug 'Shougo/context_filetype.vim' 53 | Plug 'lambdalisue/vim-backslash', { 'filetype': 'vim' } 54 | Plug 'lambdalisue/vim-findent' 55 | Plug 'tweekmonster/helpful.vim' 56 | Plug 'cespare/vim-toml' 57 | Plug 'stephpy/vim-yaml' 58 | Plug 'rust-lang/rust.vim' 59 | Plug 'plasticboy/vim-markdown' 60 | Plug 'dhruvasagar/vim-table-mode' 61 | Plug 'mattn/vim-maketable', { 'on': ['MakeTable', 'MakeTable!', 'UnmakeTable'] } 62 | Plug 'shinespark/vim-list2tree', { 'on': ['List2Tree'] } 63 | 64 | Plug 'prabirshrestha/vital.vim', { 'branch': 'popup' } 65 | Plug 'github/copilot.vim' 66 | " Plug 'ggml-org/llama.vim' 67 | Plug 'prabirshrestha/callbag.vim' 68 | Plug 'prabirshrestha/async.vim' 69 | Plug 'prabirshrestha/vim-lsp' 70 | Plug 'hrsh7th/vim-vital-vs' 71 | Plug 'mattn/vim-lsp-settings' 72 | Plug 'mattn/vim-lsp-icons' 73 | Plug 'prabirshrestha/asyncomplete.vim' 74 | Plug 'prabirshrestha/asyncomplete-lsp.vim' 75 | Plug 'prabirshrestha/asyncomplete-buffer.vim' 76 | Plug 'hrsh7th/vim-vsnip' 77 | Plug 'hrsh7th/vim-vsnip-integ' 78 | Plug 'prabirshrestha/vsnip-snippets' 79 | Plug 'vim-test/vim-test' 80 | 81 | Plug 'prabirshrestha/tv.vim' 82 | Plug 'prabirshrestha/quickpick.vim' 83 | Plug 'prabirshrestha/quickpick-lsp.vim' 84 | Plug 'prabirshrestha/quickpick-colorscheme.vim' 85 | Plug 'prabirshrestha/quickpick-filetypes.vim' 86 | Plug 'prabirshrestha/split-term.vim', { 'branch': 'vim8', 'on': ['Term', 'VTerm', 'TTerm'] } 87 | Plug 'dyng/ctrlsf.vim' 88 | call plug#end() 89 | 90 | if has('gui_running') 91 | set guioptions=Mc! 92 | if has('win32') 93 | " scoop install JetBrainsMono-NF-Mono 94 | silent! set guifont=JetBrainsMono_NFM:h18 95 | else 96 | silent! set guifont=Fira\ Code\ Nerd\ Font\ weight=450\ 15 97 | endif 98 | endif 99 | 100 | let &t_8f = "\[38;2;%lu;%lu;%lum" 101 | let &t_8b = "\[48;2;%lu;%lu;%lum" 102 | let &t_SI.="\e[5 q" "SI = INSERT mode 103 | let &t_SR.="\e[4 q" "SR = REPLACE mode 104 | let &t_EI.="\e[1 q" "EI = NORMAL mode (ELSE) 105 | 106 | if !has('gui_running') | set t_Co=256 | endif 107 | set termguicolors 108 | set background=dark 109 | silent! colorscheme solarized8 110 | 111 | set mouse=a " automatically enable mouse usage 112 | set noerrorbells visualbell t_vb= " no annoying sound on errors 113 | set shortmess+=OI 114 | set nu " set line numbers on 115 | set updatetime=300 116 | set cmdheight=2 117 | set autoindent 118 | set timeoutlen=300 " http://stackoverflow.com/questions/2158516/delay-before-o-opens-a-new-line 119 | set scrolloff=2 120 | set noshowmode 121 | set hidden 122 | set nowrap 123 | 124 | set pastetoggle= " paste toggle (sane indentation pastes) 125 | " Leave paste mode when leaving insert mode 126 | autocmd InsertLeave * set nopaste 127 | 128 | " Visual shifting (does not exit Visual mode) 129 | vnoremap < >gv 131 | 132 | set nojoinspaces 133 | set signcolumn=no 134 | set splitright 135 | set splitbelow 136 | 137 | exec 'set undodir=' . expand(s:settings_data_dir) . '/undo' 138 | set undofile 139 | 140 | set wildmenu 141 | set wildmode=list:longest 142 | set wildignore=.hg,.svn,*~,*.png,*.jpg,*.gif,*.settings,Thumbs.db,*.min.js,*.swp,publish/*,intermediate/*,*.o,*.hi,Zend,vendor 143 | 144 | set shiftwidth=4 " Use indents of 4 spaces 145 | set expandtab " Tabs are spaces, not tabs 146 | set tabstop=4 " An indentation every four columns 147 | set softtabstop=4 " Let backspace delete indent 148 | nnoremap t2 :setl shiftwidth=2 softtabstop=2 tabstop=2 149 | nnoremap t4 :setl shiftwidth=4 softtabstop=4 tabstop=4 150 | nnoremap t8 :setl shiftwidth=8 softtabstop=8 tabstop=8 151 | 152 | " Wrapping options 153 | set formatoptions=tc " wrap text and comments using textwidth 154 | set formatoptions+=r " continue comments when pressing ENTER in I mode 155 | set formatoptions+=q " enable formatting of comments with gq 156 | set formatoptions+=n " detect lists for formatting 157 | set formatoptions+=b " auto-wrap in insert mode, and do not wrap old long lines 158 | 159 | " Proper search 160 | set incsearch 161 | set ignorecase 162 | set smartcase 163 | set nogdefault 164 | set hlsearch 165 | " Clear current search highlighting by fast // 166 | nmap // :nohlsearch 167 | 168 | set nofoldenable 169 | 170 | set ttyfast 171 | " https://github.com/vim/vim/issues/1735#issuecomment-383353563 172 | set lazyredraw 173 | set synmaxcol=500 174 | set laststatus=2 175 | set norelativenumber " Relative line numbers 176 | 177 | set number " Also show current absolute line 178 | set diffopt+=iwhite " No whitespace in vimdiff 179 | 180 | set diffopt+=algorithm:patience 181 | set diffopt+=indent-heuristic 182 | set colorcolumn=80 " and give me a colored column 183 | set showcmd " Show (partial) command in status line. 184 | 185 | " Show those damn hidden characters 186 | " Verbose: set listchars=nbsp:¬,eol:¶,extends:»,precedes:«,trail:• 187 | set listchars=nbsp:¬,extends:»,precedes:«,trail:• 188 | 189 | " Quick save 190 | nmap w :w 191 | 192 | " vimrc {{{ 193 | nnoremap ev :e $MYVIMRC 194 | nnoremap sv :source $MYVIMRC 195 | " }}} 196 | 197 | " CD to current directory of the file 198 | nnoremap cd :cd %:p:h 199 | 200 | if executable('rg') 201 | set grepprg=rg\ --no-heading\ --vimgrep 202 | set grepformat=%f:%l:%c:%m 203 | endif 204 | 205 | " Keyboard shortcuts 206 | nnoremap ; : 207 | vnoremap ; : 208 | 209 | " Ctrl+c as Esc 210 | nnoremap 211 | inoremap 212 | vnoremap 213 | snoremap 214 | xnoremap 215 | cnoremap 216 | onoremap 217 | lnoremap 218 | tnoremap 219 | 220 | " No arrow keys --- force yourself to use the home row 221 | nnoremap 222 | nnoremap 223 | inoremap 224 | inoremap 225 | inoremap 226 | inoremap 227 | 228 | " Left and right can switch buffers 229 | nnoremap :bp 230 | nnoremap :bn 231 | 232 | nnoremap [q :cprevious 233 | nnoremap ]q :cnext 234 | nnoremap [Q :cfirst 235 | nnoremap ]Q :clast 236 | nnoremap ]l :lnext 237 | nnoremap [l :lprevious 238 | nnoremap ]b :bnext 239 | nnoremap [b :bprevious 240 | 241 | " fuzzy picker {{{ 242 | command! TvColors call tv#run({ 243 | \ 'type': 'list', 244 | \ 'list': uniq(map(split(globpath(&rtp, "colors/*.vim"), "\n"), "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")), 245 | \ 'accept': {result->execute('colorscheme ' . result['items'][0])}, 246 | \ }) 247 | nnoremap :execute system('git rev-parse --is-inside-work-tree') =~ 'true' 248 | \ ? tv#run({ 'type': 'cmd', 'cmd': 'git ls-files --cached --others --exclude-standard', 'message': 'Tv>git ls-files' }) 249 | \ : tv#run({'message': 'Fz'}) 250 | 251 | " nmap s (fz-extras-rg) 252 | nmap f CtrlSFPrompt 253 | vmap f CtrlSFVwordPath 254 | vmap F CtrlSFVwordExec 255 | nmap n CtrlSFCwordPath 256 | nmap p CtrlSFPwordPath 257 | nnoremap t :CtrlSFToggle 258 | inoremap t :CtrlSFToggle 259 | 260 | let g:ctrlsf_auto_focus = { 261 | \ "at": "start" 262 | \ } 263 | " }}} 264 | 265 | " Prevent accidental writes to buffers that shouldn't be edited 266 | autocmd BufRead *.orig set readonly 267 | 268 | " Jump to last edit position on opening file 269 | if has("autocmd") 270 | " https://stackoverflow.com/questions/31449496/vim-ignore-specifc-file-in-autocommand 271 | au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 272 | endif 273 | 274 | " asyncomplete.vim,vim-lsp,vsnip {{{ 275 | " call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({ 276 | " \ 'name': 'buffer', 277 | " \ 'allowlist': ['*'], 278 | " \ 'blocklist': ['vim'], 279 | " \ 'completor': function('asyncomplete#sources#buffer#completor'), 280 | " \ 'config': { 281 | " \ 'max_buffer_size': 5000000, 282 | " \ }, 283 | " \ })) 284 | 285 | let g:vsnip_snippet_dir = expand(s:settings_plugin_dir . '/vsnip-snippets/vsnips') 286 | 287 | if !has('vsvim') 288 | " imap vsnip#available(1) ? '(vsnip-expand-or-jump)' : pumvisible() ? "\" : "\" 289 | " smap vsnip#available(1) ? '(vsnip-expand-or-jump)' : pumvisible() ? "\" : "\" 290 | " imap vsnip#available(1) ? '(vsnip-jump-prev)' : pumvisible() ? "\" : "\" 291 | " smap vsnip#available(1) ? '(vsnip-jump-prev)' : pumvisible() ? "\" : "\" 292 | inoremap pumvisible() ? "\" : "\" 293 | inoremap pumvisible() ? "\" : "\" 294 | 295 | inoremap pumvisible() ? asyncomplete#close_popup() : "\" 296 | inoremap pumvisible() ? asyncomplete#close_popup() : "\" 297 | inoremap pumvisible() ? asyncomplete#cancel_popup() : "\" 298 | 299 | " Move up and down in autocomplete with and 300 | inoremap ("\") 301 | inoremap ("\") 302 | 303 | autocmd! CompleteDone * if !pumvisible() | pclose | endif 304 | endif 305 | 306 | au! FileType rust setlocal tabstop=4 softtabstop=4 colorcolumn=100 307 | 308 | " let g:lsp_log_verbose = 1 309 | " let g:lsp_log_file = expand(s:settings_data_dir . '/lsp.log') 310 | " let g:asyncomplete_log_file = expand(s:settings_data_dir. '/asyncomplete.log') 311 | let g:lsp_auto_enable = 1 312 | let g:lsp_use_native_client = 1 313 | let g:lsp_preview_float = 1 314 | let g:lsp_diagnostics_echo_cursor = 1 315 | let g:lsp_format_sync_timeout = 1000 316 | let g:lsp_documentation_float_docked = 1 317 | let g:lsp_inlay_hints_enabled = 0 318 | let g:lsp_semantic_enabled = 1 319 | let g:lsp_code_actions_use_popup_menu = 1 320 | let g:lsp_virtual_text = 1 321 | let g:lsp_diagnostics_virtual_text_enabled = 0 322 | 323 | hi! LspErrorHighlight guifg=#dc322f guibg=NONE guisp=#dc322f gui=undercurl cterm=undercurl 324 | hi! LspInfoHighlight guifg=#2aa198 guibg=NONE guisp=#2aa198 gui=undercurl cterm=undercurl 325 | hi! LspWarningHighlight guifg=#b58900 guibg=NONE guisp=#b58900 gui=undercurl cterm=undercurl 326 | 327 | let g:lsp_settings = { 328 | \ 'efm-langserver': { 329 | \ 'disabled': 0, 330 | \ 'args': ['-c='.expand('~/.config/efm-langserver/config.yaml')], 331 | \ }, 332 | \} 333 | 334 | let g:lightline = { 335 | \ 'colorscheme': 'solarized', 336 | \ 'active': { 337 | \ 'left': [ 338 | \ ['mode', 'paste'], 339 | \ ['lsp_progress'], 340 | \ ], 341 | \ }, 342 | \ 'component_function': { 343 | \ 'lsp_progress': 'MyLspProgress' 344 | \ }, 345 | \ } 346 | 347 | let g:lsp_work_done_progress_enabled = 1 348 | function! MyLspProgress() abort 349 | let l:progress = lsp#get_progress() 350 | if empty(l:progress) | return '' | endif 351 | let l:progress = l:progress[len(l:progress) - 1] 352 | return l:progress['server'] . ': ' . l:progress['message'] 353 | endfunction 354 | 355 | augroup my_lightline_lsp 356 | autocmd! 357 | autocmd User lsp_progress_updated call lightline#update() 358 | augroup END 359 | 360 | function! s:on_lsp_buffer_enabled() abort 361 | setlocal omnifunc=lsp#complete 362 | setlocal signcolumn=yes 363 | if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif 364 | nmap gd (lsp-definition) 365 | nmap gs (lsp-document-symbol-search) 366 | nmap gS (lsp-workspace-symbol-search) 367 | nmap gr (lsp-references) 368 | nmap gi (lsp-implementation) 369 | nmap gt (lsp-type-definition) 370 | nmap rn (lsp-rename) 371 | nmap [g (lsp-previous-diagnostic) 372 | nmap ]g (lsp-next-diagnostic) 373 | nmap K (lsp-hover) 374 | if has('nvim') 375 | nnoremap ca :LspCodeAction 376 | xnoremap ca :LspCodeAction 377 | else 378 | nmap ca (lsp-code-action-float) 379 | endif 380 | 381 | nnoremap gQ :LspDocumentFormat 382 | vnoremap gQ :LspDocumentRangeFormat 383 | nnoremap cl :LspCodeLens 384 | autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') 385 | autocmd! BufWritePre *.ts,*.tsx call execute('LspDocumentFormatSync --server=efm-langserver') 386 | 387 | if !has('nvim') 388 | nmap popup_list()->empty() ? '' : lsp#scroll(-4) 389 | nmap popup_list()->empty() ? '' : lsp#scroll(+4) 390 | endif 391 | endfunction 392 | 393 | augroup configure_lsp 394 | au! 395 | autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() 396 | augroup END 397 | " }}} 398 | 399 | function! s:on_configure_tv() abort 400 | " Map Ctrl+Y to remove '> ' from terminal line, open as file, and kill terminal 401 | 402 | tnoremap :let @a=getline('.'):echom "Opening file: " . @a:bd!:e a 403 | endfunction 404 | 405 | augroup configure_tv 406 | au! 407 | autocmd User tv_terminal_created call s:on_configure_tv() 408 | augroup END 409 | 410 | " vim-test {{{ 411 | nnoremap tn :TestNearest 412 | nnoremap tf :TestFile 413 | nnoremap ts :TestSuite 414 | nnoremap tl :TestLast 415 | nnoremap tv :TestVisit 416 | " }}} 417 | 418 | " vim-gtfo {{{ 419 | if has('win32') | let g:gtfo#terminals = { 'win' : 'cmd /k' } | endif 420 | "}}} 421 | 422 | " vim-easymotion {{{ 423 | let g:EasyMotion_keys='hklyuiopnm,qwertzxcvbasdgjf' 424 | nmap s (easymotion-s) 425 | " }}} 426 | 427 | " vsession {{{ 428 | let g:vsession_path = expand(s:settings_data_dir . '/vsession') 429 | nnoremap s :LoadSession 430 | " }}} 431 | 432 | " gina.vim {{{ 433 | let g:gina#command#blame#formatter#format = "%in %au %=on %ti" 434 | let s:gina_cmd_opt = {'noremap': 1, 'silent': 1} 435 | call gina#custom#mapping#nmap('blame', 'dd', '(gina-diff-tab)') 436 | call gina#custom#mapping#nmap('blame', 'ee', '(gina-blame-echo)') 437 | call gina#custom#mapping#nmap('log', 'dd', '(gina-diff-tab)') 438 | call gina#custom#mapping#nmap('status', '', ':Gina commit', s:gina_cmd_opt) 439 | call gina#custom#mapping#nmap('/.*', 'q', ':bd', s:gina_cmd_opt) 440 | call gina#custom#mapping#nmap('/.*', '', '(gina-edit-tab)') 441 | " }}} 442 | 443 | " nerdtree {{{ 444 | " nnoremap e :NERDTreeFind 445 | " nnoremap E :NERDTreeToggle 446 | " }}} 447 | 448 | " fern.vim {{{ 449 | let g:fern#drawer_keep = 1 450 | let g:fern#default_hidden = 1 451 | let g:fern#default_exclude = '.git$' 452 | nnoremap e :Fern . -drawer -reveal=% -toggle 453 | function! s:fern_init() abort 454 | nnoremap q :bd 455 | map (fern-action-open:split) 456 | map (fern-action-open:vsplit) 457 | endfunction 458 | augroup fern-settings 459 | au! 460 | au FileType fern call s:fern_init() 461 | augroup END 462 | " }}} 463 | 464 | " vim-backslash {{{ 465 | let g:vim_backslash#preventers = [{ -> context_filetype#get_filetype() !=# 'vim' }] 466 | " }}} 467 | 468 | " vim-table-mode {{{ 469 | let g:table_mode_corner='|' 470 | " }}} 471 | 472 | if filereadable(expand('~/.vimrc.local')) | source ~/.vimrc.local | endif 473 | 474 | au BufNewFile,BufRead *.py 475 | \ set tabstop=4 | 476 | \ set softtabstop=4 | 477 | \ set shiftwidth=4 | 478 | \ set textwidth=79 | 479 | \ set expandtab | 480 | \ set autoindent | 481 | \ set fileformat=unix 482 | " vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{{,}}} foldmethod=marker spell: 483 | -------------------------------------------------------------------------------- /.config/awesome/rc.lua: -------------------------------------------------------------------------------- 1 | -- If LuaRocks is installed, make sure that packages installed through it are 2 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing. 3 | pcall(require, "luarocks.loader") 4 | 5 | -- Standard awesome library 6 | local gears = require("gears") 7 | local awful = require("awful") 8 | require("awful.autofocus") 9 | 10 | -- {{{ Variables 11 | local altkey = "Mod1" 12 | -- Default modkey. 13 | -- Usually, Mod4 is the key with a logo between Control and Alt. 14 | -- If you do not like this or do not have such a key, 15 | -- I suggest you to remap Mod4 to another key using xmodmap or other tools. 16 | -- However, you can use another modifier like Mod1, but it may interact with others. 17 | local superkey = "Mod4" 18 | local modkey = "Mod1" 19 | 20 | local home = os.getenv("HOME") 21 | local exec = awful.util.spawn 22 | local sexec = awful.util.spwan_with_shell 23 | local scount = screen.count() 24 | -- }}} 25 | 26 | 27 | 28 | -- Widget and layout library 29 | local wibox = require("wibox") 30 | -- Theme handling library 31 | local beautiful = require("beautiful") 32 | -- Notification library 33 | local naughty = require("naughty") 34 | local menubar = require("menubar") 35 | local hotkeys_popup = require("awful.hotkeys_popup") 36 | -- Enable hotkeys help widget for VIM and other apps 37 | -- when client with a matching name is opened: 38 | require("awful.hotkeys_popup.keys") 39 | 40 | separator = wibox.widget.textbox() 41 | separator.text = " : " 42 | 43 | small_separator = wibox.widget.textbox() 44 | small_separator.text = " " 45 | 46 | local brightnessarc_widget = require("awesome-wm-widgets.brightnessarc-widget.brightnessarc") 47 | local battery_widget = require("awesome-wm-widgets.battery-widget.battery") 48 | local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget") 49 | local fs_widget = require("awesome-wm-widgets.fs-widget.fs-widget") 50 | local volume_widget = require('awesome-wm-widgets.volume-widget.volume') 51 | 52 | -- {{{ Error handling 53 | -- Check if awesome encountered an error during startup and fell back to 54 | -- another config (This code will only ever execute for the fallback config) 55 | if awesome.startup_errors then 56 | naughty.notify({ preset = naughty.config.presets.critical, 57 | title = "Oops, there were errors during startup!", 58 | text = awesome.startup_errors }) 59 | end 60 | 61 | -- Handle runtime errors after startup 62 | do 63 | local in_error = false 64 | awesome.connect_signal("debug::error", function (err) 65 | -- Make sure we don't go into an endless error loop 66 | if in_error then return end 67 | in_error = true 68 | 69 | naughty.notify({ preset = naughty.config.presets.critical, 70 | title = "Oops, an error happened!", 71 | text = tostring(err) }) 72 | in_error = false 73 | end) 74 | end 75 | -- }}} 76 | 77 | -- {{{ Variable definitions 78 | -- Themes define colours, icons, font and wallpapers. 79 | beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") 80 | beautiful.font = "Fira Code 14" 81 | beautiful.get().hotkeys_font = "Fira Code Bold 14" 82 | beautiful.get().hotkeys_description_font = "Fira Code 14" 83 | 84 | -- This is used later as the default terminal and editor to run. 85 | editor = os.getenv("EDITOR") or "vim" 86 | if gears.filesystem.file_executable("/usr/bin/wezterm") then 87 | terminal = "wezterm" 88 | editor_cmd = terminal .. " start " .. editor 89 | else 90 | terminal = "xterm" 91 | editor_cmd = terminal .. " -e " .. editor 92 | end 93 | 94 | -- Table of layouts to cover with awful.layout.inc, order matters. 95 | awful.layout.layouts = { 96 | awful.layout.suit.tile, 97 | awful.layout.suit.tile.left, 98 | awful.layout.suit.tile.bottom, 99 | awful.layout.suit.tile.top, 100 | awful.layout.suit.floating, 101 | awful.layout.suit.fair, 102 | awful.layout.suit.fair.horizontal, 103 | awful.layout.suit.spiral, 104 | awful.layout.suit.spiral.dwindle, 105 | awful.layout.suit.max, 106 | awful.layout.suit.max.fullscreen, 107 | awful.layout.suit.magnifier, 108 | awful.layout.suit.corner.nw, 109 | -- awful.layout.suit.corner.ne, 110 | -- awful.layout.suit.corner.sw, 111 | -- awful.layout.suit.corner.se, 112 | } 113 | -- }}} 114 | 115 | -- {{{ Menu 116 | -- Create a launcher widget and a main menu 117 | myawesomemenu = { 118 | { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, 119 | { "manual", terminal .. " -e man awesome" }, 120 | { "edit config", editor_cmd .. " " .. awesome.conffile }, 121 | { "restart", awesome.restart }, 122 | { "quit", function() awesome.quit() end }, 123 | } 124 | 125 | powermenu = { 126 | { "Logout", function() awesome.quit() end, beautiful.logout_ico }, 127 | { "Sleep", "systemctl -q --no-block suspend"}, 128 | { "Restart", "systemctl -q --no-block reboot"}, 129 | { "Shutdown", function () 130 | awful.menu({ items = { 131 | { "Cancel", function() do end end } }, 132 | { "Ok", function() awful.spawn("systemctl -q --no-block poweroff") end } 133 | }):show() 134 | end} 135 | } 136 | 137 | mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, 138 | { "Apps", "rofi -modi drun -show drun -show-icons -width 22 -no-click-to-exit" }, 139 | { "Files", "nemo" }, 140 | { "Terminal", terminal }, 141 | { "Sqlite Browser", "sqlitebrowser" }, 142 | { "Virtual Box", "virtualbox" }, 143 | { "Web", "firefox-developer-edition" }, 144 | { "RDP", "remmina" }, 145 | { "Power", powermenu } 146 | }, 147 | theme = { 148 | width = 250, 149 | height = 30, 150 | font = "Fira Code 14" 151 | } 152 | }) 153 | 154 | mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, 155 | menu = mymainmenu }) 156 | 157 | -- Menubar configuration 158 | menubar.utils.terminal = terminal -- Set the terminal for applications that require it 159 | -- }}} 160 | 161 | -- Keyboard map indicator and switcher 162 | mykeyboardlayout = awful.widget.keyboardlayout() 163 | 164 | -- {{{ Wibar 165 | -- Create a textclock widget 166 | mytextclock = wibox.widget.textclock() 167 | 168 | -- Create a wibox for each screen and add it 169 | local taglist_buttons = gears.table.join( 170 | awful.button({ }, 1, function(t) t:view_only() end), 171 | awful.button({ modkey }, 1, function(t) 172 | if client.focus then 173 | client.focus:move_to_tag(t) 174 | end 175 | end), 176 | awful.button({ }, 3, awful.tag.viewtoggle), 177 | awful.button({ modkey }, 3, function(t) 178 | if client.focus then 179 | client.focus:toggle_tag(t) 180 | end 181 | end), 182 | awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), 183 | awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) 184 | ) 185 | 186 | local tasklist_buttons = gears.table.join( 187 | awful.button({ }, 1, function (c) 188 | if c == client.focus then 189 | c.minimized = true 190 | else 191 | c:emit_signal( 192 | "request::activate", 193 | "tasklist", 194 | {raise = true} 195 | ) 196 | end 197 | end), 198 | awful.button({ }, 3, function() 199 | awful.menu.client_list({ theme = { width = 250 } }) 200 | end), 201 | awful.button({ }, 4, function () 202 | awful.client.focus.byidx(1) 203 | end), 204 | awful.button({ }, 5, function () 205 | awful.client.focus.byidx(-1) 206 | end)) 207 | 208 | local function set_wallpaper(s) 209 | -- Wallpaper 210 | if beautiful.wallpaper then 211 | local wallpaper = beautiful.wallpaper 212 | -- If wallpaper is a function, call it with the screen 213 | if type(wallpaper) == "function" then 214 | wallpaper = wallpaper(s) 215 | end 216 | gears.wallpaper.maximized(wallpaper, s, true) 217 | end 218 | end 219 | 220 | -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) 221 | screen.connect_signal("property::geometry", set_wallpaper) 222 | 223 | awful.screen.connect_for_each_screen(function(s) 224 | -- Wallpaper 225 | set_wallpaper(s) 226 | 227 | -- Each screen has its own tag table. 228 | awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) 229 | 230 | -- Create a promptbox for each screen 231 | s.mypromptbox = awful.widget.prompt() 232 | -- Create an imagebox widget which will contain an icon indicating which layout we're using. 233 | -- We need one layoutbox per screen. 234 | s.mylayoutbox = awful.widget.layoutbox(s) 235 | s.mylayoutbox:buttons(gears.table.join( 236 | awful.button({ }, 1, function () awful.layout.inc( 1) end), 237 | awful.button({ }, 3, function () awful.layout.inc(-1) end), 238 | awful.button({ }, 4, function () awful.layout.inc( 1) end), 239 | awful.button({ }, 5, function () awful.layout.inc(-1) end))) 240 | -- Create a taglist widget 241 | s.mytaglist = awful.widget.taglist { 242 | screen = s, 243 | filter = awful.widget.taglist.filter.all, 244 | buttons = taglist_buttons 245 | } 246 | 247 | -- Create a tasklist widget 248 | s.mytasklist = awful.widget.tasklist { 249 | screen = s, 250 | filter = awful.widget.tasklist.filter.currenttags, 251 | buttons = tasklist_buttons 252 | } 253 | 254 | -- Create the wibox 255 | s.mywibox = awful.wibar({ position = "top", screen = s, height=30 }) 256 | 257 | -- Add widgets to the wibox 258 | s.mywibox:setup { 259 | layout = wibox.layout.align.horizontal, 260 | { -- Left widgets 261 | layout = wibox.layout.fixed.horizontal, 262 | mylauncher, 263 | s.mytaglist, 264 | s.mypromptbox, 265 | }, 266 | s.mytasklist, -- Middle widget 267 | { -- Right widgets 268 | layout = wibox.layout.fixed.horizontal, 269 | mykeyboardlayout, 270 | wibox.widget.systray(), 271 | separator, 272 | brightnessarc_widget({ 273 | get_brightness_cmd = 'xbacklight -get', 274 | inc_brightness_cmd = 'xbacklight -inc 5', 275 | dec_brightness_cmd = 'xbacklight -dec 5', 276 | -- path_to_icons = home .. "/.config/awesome/arc-icon-theme/Arc/status/symbolic/", 277 | }), 278 | separator, 279 | battery_widget({ 280 | -- path_to_icons = home .. "/.config/awesome/arc-icon-theme/Arc/status/symbolic/", 281 | }), 282 | separator, 283 | volume_widget(), 284 | cpu_widget({ enable_kill_button = true }), 285 | fs_widget(), 286 | mytextclock, 287 | s.mylayoutbox, 288 | }, 289 | } 290 | end) 291 | -- }}} 292 | 293 | -- {{{ Mouse bindings 294 | root.buttons(gears.table.join( 295 | awful.button({ }, 3, function () mymainmenu:toggle() end), 296 | awful.button({ }, 4, awful.tag.viewnext), 297 | awful.button({ }, 5, awful.tag.viewprev) 298 | )) 299 | -- }}} 300 | 301 | -- {{{ Key bindings 302 | globalkeys = gears.table.join( 303 | awful.key({ modkey, }, "s", hotkeys_popup.show_help, 304 | {description="show help", group="awesome"}), 305 | awful.key({ modkey, }, "Left", awful.tag.viewprev, 306 | {description = "view previous", group = "tag"}), 307 | awful.key({ modkey, }, "Right", awful.tag.viewnext, 308 | {description = "view next", group = "tag"}), 309 | awful.key({ modkey, }, "Escape", awful.tag.history.restore, 310 | {description = "go back", group = "tag"}), 311 | 312 | awful.key({ modkey, }, "j", 313 | function () 314 | awful.client.focus.byidx( 1) 315 | end, 316 | {description = "focus next by index", group = "client"} 317 | ), 318 | awful.key({ modkey, }, "k", 319 | function () 320 | awful.client.focus.byidx(-1) 321 | end, 322 | {description = "focus previous by index", group = "client"} 323 | ), 324 | awful.key({ modkey, }, "w", function () mymainmenu:show() end, 325 | {description = "show main menu", group = "awesome"}), 326 | 327 | -- Layout manipulation 328 | awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, 329 | {description = "swap with next client by index", group = "client"}), 330 | awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, 331 | {description = "swap with previous client by index", group = "client"}), 332 | awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, 333 | {description = "focus the next screen", group = "screen"}), 334 | awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, 335 | {description = "focus the previous screen", group = "screen"}), 336 | awful.key({ modkey, }, "u", awful.client.urgent.jumpto, 337 | {description = "jump to urgent client", group = "client"}), 338 | awful.key({ modkey, }, "Tab", 339 | function () 340 | awful.client.focus.history.previous() 341 | if client.focus then 342 | client.focus:raise() 343 | end 344 | end, 345 | {description = "go back", group = "client"}), 346 | 347 | -- Standard program 348 | --awful.key({ modkey, "Control" }, "Return", function () awful.spawn(terminal) end, 349 | -- {description = "open a terminal", group = "launcher"}), 350 | awful.key({ modkey, "Control" }, "r", awesome.restart, 351 | {description = "reload awesome", group = "awesome"}), 352 | awful.key({ modkey, "Shift" }, "q", awesome.quit, 353 | {description = "quit awesome", group = "awesome"}), 354 | 355 | awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, 356 | {description = "increase master width factor", group = "layout"}), 357 | awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, 358 | {description = "decrease master width factor", group = "layout"}), 359 | awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, 360 | {description = "increase the number of master clients", group = "layout"}), 361 | awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, 362 | {description = "decrease the number of master clients", group = "layout"}), 363 | awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, 364 | {description = "increase the number of columns", group = "layout"}), 365 | awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, 366 | {description = "decrease the number of columns", group = "layout"}), 367 | awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, 368 | {description = "select next", group = "layout"}), 369 | awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, 370 | {description = "select previous", group = "layout"}), 371 | 372 | awful.key({ modkey, "Control" }, "n", 373 | function () 374 | local c = awful.client.restore() 375 | -- Focus restored client 376 | if c then 377 | c:emit_signal( 378 | "request::activate", "key.unminimize", {raise = true} 379 | ) 380 | end 381 | end, 382 | {description = "restore minimized", group = "client"}), 383 | 384 | -- Prompt 385 | awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, 386 | {description = "run prompt", group = "launcher"}), 387 | 388 | awful.key({ modkey }, "x", 389 | function () 390 | awful.prompt.run { 391 | prompt = "Run Lua code: ", 392 | textbox = awful.screen.focused().mypromptbox.widget, 393 | exe_callback = awful.util.eval, 394 | history_path = awful.util.get_cache_dir() .. "/history_eval" 395 | } 396 | end, 397 | {description = "lua execute prompt", group = "awesome"}), 398 | -- Menubar 399 | -- awful.key({ modkey }, "p", function() menubar.show() end, 400 | -- {description = "show the menubar", group = "launcher"}), 401 | awful.key({ modkey }, "p", function () awful.util.spawn("rofi -show run") end), 402 | 403 | awful.key({}, "XF86AudioLowerVolume", function () awful.util.spawn("amixer -D pulse sset Master 20%-") end), 404 | awful.key({}, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer -D pulse sset Master 20%+") end), 405 | awful.key({}, "XF86AudioMute", function () awful.util.spawn("amixer -D pulse sset Master toggle", false) end), 406 | 407 | awful.key({}, "#232", function () awful.util.spawn("xbacklight -dec 10") end), 408 | awful.key({}, "#233", function () awful.util.spawn("xbacklight -inc 10") end) 409 | ) 410 | 411 | clientkeys = gears.table.join( 412 | awful.key({ modkey, }, "f", 413 | function (c) 414 | c.fullscreen = not c.fullscreen 415 | c:raise() 416 | end, 417 | {description = "toggle fullscreen", group = "client"}), 418 | awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, 419 | {description = "close", group = "client"}), 420 | awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , 421 | {description = "toggle floating", group = "client"}), 422 | awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, 423 | {description = "move to master", group = "client"}), 424 | awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, 425 | {description = "move to screen", group = "client"}), 426 | awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, 427 | {description = "toggle keep on top", group = "client"}), 428 | awful.key({ modkey, }, "n", 429 | function (c) 430 | -- The client currently has the input focus, so it cannot be 431 | -- minimized, since minimized clients can't have the focus. 432 | c.minimized = true 433 | end , 434 | {description = "minimize", group = "client"}), 435 | awful.key({ modkey, }, "m", 436 | function (c) 437 | c.maximized = not c.maximized 438 | c:raise() 439 | end , 440 | {description = "(un)maximize", group = "client"}), 441 | awful.key({ modkey, "Control" }, "m", 442 | function (c) 443 | c.maximized_vertical = not c.maximized_vertical 444 | c:raise() 445 | end , 446 | {description = "(un)maximize vertically", group = "client"}), 447 | awful.key({ modkey, "Shift" }, "m", 448 | function (c) 449 | c.maximized_horizontal = not c.maximized_horizontal 450 | c:raise() 451 | end , 452 | {description = "(un)maximize horizontally", group = "client"}) 453 | ) 454 | 455 | -- Bind all key numbers to tags. 456 | -- Be careful: we use keycodes to make it work on any keyboard layout. 457 | -- This should map on the top row of your keyboard, usually 1 to 9. 458 | for i = 1, 9 do 459 | globalkeys = gears.table.join(globalkeys, 460 | -- View tag only. 461 | awful.key({ modkey }, "#" .. i + 9, 462 | function () 463 | local screen = awful.screen.focused() 464 | local tag = screen.tags[i] 465 | if tag then 466 | tag:view_only() 467 | end 468 | end, 469 | {description = "view tag #"..i, group = "tag"}), 470 | -- Toggle tag display. 471 | awful.key({ modkey, "Control" }, "#" .. i + 9, 472 | function () 473 | local screen = awful.screen.focused() 474 | local tag = screen.tags[i] 475 | if tag then 476 | awful.tag.viewtoggle(tag) 477 | end 478 | end, 479 | {description = "toggle tag #" .. i, group = "tag"}), 480 | -- Move client to tag. 481 | awful.key({ modkey, "Shift" }, "#" .. i + 9, 482 | function () 483 | if client.focus then 484 | local tag = client.focus.screen.tags[i] 485 | if tag then 486 | client.focus:move_to_tag(tag) 487 | end 488 | end 489 | end, 490 | {description = "move focused client to tag #"..i, group = "tag"}), 491 | -- Toggle tag on focused client. 492 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, 493 | function () 494 | if client.focus then 495 | local tag = client.focus.screen.tags[i] 496 | if tag then 497 | client.focus:toggle_tag(tag) 498 | end 499 | end 500 | end, 501 | {description = "toggle focused client on tag #" .. i, group = "tag"}) 502 | ) 503 | end 504 | 505 | clientbuttons = gears.table.join( 506 | awful.button({ }, 1, function (c) 507 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 508 | end), 509 | awful.button({ modkey }, 1, function (c) 510 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 511 | awful.mouse.client.move(c) 512 | end), 513 | awful.button({ modkey }, 3, function (c) 514 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 515 | awful.mouse.client.resize(c) 516 | end) 517 | ) 518 | 519 | -- Set keys 520 | root.keys(globalkeys) 521 | -- }}} 522 | 523 | -- {{{ Rules 524 | -- Rules to apply to new clients (through the "manage" signal). 525 | awful.rules.rules = { 526 | -- All clients will match this rule. 527 | { rule = { }, 528 | properties = { border_width = beautiful.border_width, 529 | border_color = beautiful.border_normal, 530 | focus = awful.client.focus.filter, 531 | raise = true, 532 | keys = clientkeys, 533 | buttons = clientbuttons, 534 | screen = awful.screen.preferred, 535 | placement = awful.placement.no_overlap+awful.placement.no_offscreen 536 | } 537 | }, 538 | 539 | -- Floating clients. 540 | { rule_any = { 541 | instance = { 542 | "DTA", -- Firefox addon DownThemAll. 543 | "copyq", -- Includes session name in class. 544 | "pinentry", 545 | }, 546 | class = { 547 | "Arandr", 548 | "Blueman-manager", 549 | "Gpick", 550 | "Kruler", 551 | "MessageWin", -- kalarm. 552 | "Sxiv", 553 | "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. 554 | "Wpa_gui", 555 | "veromix", 556 | "xtightvncviewer"}, 557 | 558 | -- Note that the name property shown in xprop might be set slightly after creation of the client 559 | -- and the name shown there might not match defined rules here. 560 | name = { 561 | "Event Tester", -- xev. 562 | }, 563 | role = { 564 | "AlarmWindow", -- Thunderbird's calendar. 565 | "ConfigManager", -- Thunderbird's about:config. 566 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. 567 | } 568 | }, properties = { floating = true }}, 569 | 570 | -- Add titlebars to normal clients and dialogs 571 | { rule_any = {type = { "normal", "dialog" } 572 | }, properties = { titlebars_enabled = false } 573 | }, 574 | 575 | -- Set Firefox to always map on the tag named "2" on screen 1. 576 | -- { rule = { class = "Firefox" }, 577 | -- properties = { screen = 1, tag = "2" } }, 578 | } 579 | -- }}} 580 | 581 | -- {{{ Signals 582 | -- Signal function to execute when a new client appears. 583 | client.connect_signal("manage", function (c) 584 | -- Set the windows at the slave, 585 | -- i.e. put it at the end of others instead of setting it master. 586 | -- if not awesome.startup then awful.client.setslave(c) end 587 | 588 | if awesome.startup 589 | and not c.size_hints.user_position 590 | and not c.size_hints.program_position then 591 | -- Prevent clients from being unreachable after screen count changes. 592 | awful.placement.no_offscreen(c) 593 | end 594 | end) 595 | 596 | -- Add a titlebar if titlebars_enabled is set to true in the rules. 597 | client.connect_signal("request::titlebars", function(c) 598 | -- buttons for the titlebar 599 | local buttons = gears.table.join( 600 | awful.button({ }, 1, function() 601 | c:emit_signal("request::activate", "titlebar", {raise = true}) 602 | awful.mouse.client.move(c) 603 | end), 604 | awful.button({ }, 3, function() 605 | c:emit_signal("request::activate", "titlebar", {raise = true}) 606 | awful.mouse.client.resize(c) 607 | end) 608 | ) 609 | 610 | awful.titlebar(c) : setup { 611 | { -- Left 612 | awful.titlebar.widget.iconwidget(c), 613 | buttons = buttons, 614 | layout = wibox.layout.fixed.horizontal 615 | }, 616 | { -- Middle 617 | { -- Title 618 | align = "center", 619 | widget = awful.titlebar.widget.titlewidget(c) 620 | }, 621 | buttons = buttons, 622 | layout = wibox.layout.flex.horizontal 623 | }, 624 | { -- Right 625 | awful.titlebar.widget.floatingbutton (c), 626 | awful.titlebar.widget.maximizedbutton(c), 627 | awful.titlebar.widget.stickybutton (c), 628 | awful.titlebar.widget.ontopbutton (c), 629 | awful.titlebar.widget.closebutton (c), 630 | layout = wibox.layout.fixed.horizontal() 631 | }, 632 | layout = wibox.layout.align.horizontal 633 | } 634 | end) 635 | 636 | -- Enable sloppy focus, so that focus follows mouse. 637 | client.connect_signal("mouse::enter", function(c) 638 | c:emit_signal("request::activate", "mouse_enter", {raise = false}) 639 | end) 640 | 641 | client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) 642 | client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) 643 | -- }}} 644 | --------------------------------------------------------------------------------