├── nvim └── .config │ └── nvim │ ├── after │ ├── syntax │ │ └── .gitkeep │ └── ftplugin │ │ ├── gitcommit.vim │ │ ├── text.vim │ │ ├── qf.vim │ │ ├── vim.vim │ │ ├── markdown.vim │ │ └── spec.vim │ ├── ftdetect │ ├── dosini.vim │ └── groovy.vim │ ├── init.vim-debug │ └── init.vim │ ├── lua │ └── MyConfigs │ │ ├── statusline.lua │ │ └── nvim-cmp.lua │ └── init.vim ├── zsh ├── .config │ └── fsh │ │ └── overlay.ini ├── .zsh │ ├── aliases │ │ ├── tmux.zsh │ │ ├── npm.zsh │ │ ├── python.zsh │ │ ├── my-functions.zsh │ │ ├── distro.zsh │ │ ├── systemd.zsh │ │ ├── external.zsh │ │ ├── default.zsh │ │ └── git.zsh │ ├── functions │ │ ├── networking.zsh │ │ ├── programming.zsh │ │ ├── desktop.zsh │ │ ├── distro.zsh │ │ ├── default.zsh │ │ └── git.zsh │ ├── plugins.zsh │ ├── configs.zsh │ └── keymaps.zsh └── .zshrc ├── .gitignore ├── tmux └── .config │ └── tmux │ ├── disk_status.sh │ ├── themes │ ├── github_dark_transparent.conf │ ├── nightfox_blue.conf │ └── github_dark_high_contrast.conf │ ├── ram_status.sh │ └── tmux.conf ├── nnn └── .config │ └── nnn │ └── plugins │ ├── nnn_file_name_yank │ ├── nnn_file_path_yank │ ├── nnn_clipboard_file_path_cd │ ├── nnn_file_dir_yank │ └── nnn_my_opener ├── desktop └── .config │ ├── waybar │ ├── info-ssh-sessions.sh │ ├── systemd_show_failed.sh │ ├── updates-arch.sh │ ├── scratchpad_is_empty.sh │ ├── info-tmux-sessions.sh │ ├── detect_xwayland.sh │ ├── config_hyprland │ ├── config_sway │ ├── style.css │ └── config_base │ ├── rofi │ ├── config.rasi │ └── desktop_apps.rasi │ ├── alacritty │ ├── themes │ │ ├── nightfox_blue.toml │ │ └── github_dark_high_contrast.toml │ └── alacritty.toml │ ├── dunst │ └── dunstrc │ ├── hypr │ ├── move.sh │ ├── hyprlock.conf │ └── hyprland.conf │ └── sway │ └── config ├── .gitmodules ├── .pre-commit-config.yaml ├── README.md └── install.sh /nvim/.config/nvim/after/syntax/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zsh/.config/fsh/overlay.ini: -------------------------------------------------------------------------------- 1 | [command-point] 2 | function = 135 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | tmux/.config/tmux/plugins/ 3 | en.dict 4 | vim-plug 5 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/gitcommit.vim: -------------------------------------------------------------------------------- 1 | setlocal colorcolumn=72 2 | -------------------------------------------------------------------------------- /nvim/.config/nvim/ftdetect/dosini.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.fio set filetype=dosini 2 | -------------------------------------------------------------------------------- /nvim/.config/nvim/ftdetect/groovy.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile .ci,Jenkinsfile set filetype=groovy 2 | -------------------------------------------------------------------------------- /tmux/.config/tmux/disk_status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | df "$PWD" --human-readable | awk ' NR==2 { print $3"/"$2 } ' 4 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/tmux.zsh: -------------------------------------------------------------------------------- 1 | alias ta='tmux new-session -s' 2 | alias tA='tmux attach-session -t' 3 | alias tk='tmux kill-session -t' 4 | alias tK='tmux kill-server' 5 | alias tls='tmux list-sessions' 6 | -------------------------------------------------------------------------------- /tmux/.config/tmux/themes/github_dark_transparent.conf: -------------------------------------------------------------------------------- 1 | set -g @MY_TRANSPARENT_COLOR 'default' 2 | set -g @MY_BLUE_COLOR '#71b7ff' 3 | set -g @MY_BLACK_COLOR '#2a2b3c' 4 | set -g @MY_ACTIVE_COLOR '#d50000' 5 | -------------------------------------------------------------------------------- /nnn/.config/nnn/plugins/nnn_file_name_yank: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 4 | printf "%s" "$1" | setsid -f wl-copy 5 | else 6 | printf "%s" "$1" | setsid -f xclip -i -selection clipboard 7 | fi 8 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/npm.zsh: -------------------------------------------------------------------------------- 1 | alias nn='npm run start' 2 | alias npmin='npm install' 3 | alias npmrm='npm uninstall' 4 | alias npmls='npm list' 5 | alias npming='npm install -g' 6 | alias npmrmg='npm uninstall -g' 7 | alias npmlsg='npm list -g' 8 | -------------------------------------------------------------------------------- /desktop/.config/waybar/info-ssh-sessions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sessions="$(ls /tmp/.ssh_* 2>/dev/null || true)" 4 | 5 | if [ -n "$sessions" ]; then 6 | count=$(echo "$sessions" | wc -l) 7 | echo "󰒍($count)" 8 | else 9 | echo "" 10 | fi 11 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/text.vim: -------------------------------------------------------------------------------- 1 | " tpope/vim-surround 2 | " echo char2nr(" ") 3 | " Sb: bold 4 | let b:surround_98 = "[b]\r[/b]" 5 | " Si: italics 6 | let b:surround_105 = "[i]\r[/i]" 7 | " Sh: hide 8 | let b:surround_104 = "[spoiler]\r[/spoiler]" 9 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/python.zsh: -------------------------------------------------------------------------------- 1 | alias p='python3' 2 | alias pv='my-create-pyton-env' 3 | alias pin='pipx install' 4 | alias pls='pipx list' 5 | alias prm='pipx uninstall' 6 | alias pipin='pip install' 7 | alias piprm='pip uninstall' 8 | alias pipls='pip list' 9 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/qf.vim: -------------------------------------------------------------------------------- 1 | nnoremap h :colder 2 | nnoremap l :cnewer 3 | nnoremap d :cclose 4 | nnoremap q :cclose 5 | nnoremap s HopLine 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tmux/.config/tmux/plugins/tpm"] 2 | path = tmux/.config/tmux/plugins/tpm 3 | url = https://github.com/tmux-plugins/tpm 4 | branch = master 5 | [submodule "zsh/.zsh/zinit"] 6 | path = zsh/.zsh/zinit 7 | url = https://github.com/zdharma-continuum/zinit 8 | branch = main 9 | -------------------------------------------------------------------------------- /nnn/.config/nnn/plugins/nnn_file_path_yank: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 4 | printf "%s/%s" "$2/$1" | tr -d '\n' | sed 's/.$//' | setsid -f wl-copy 5 | else 6 | printf "%s/%s" "$2/$1" | tr -d '\n' | sed 's/.$//' | setsid -f xclip -i -selection clipboard 7 | fi 8 | -------------------------------------------------------------------------------- /tmux/.config/tmux/ram_status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ram_available () 4 | { 5 | ALL=$(free --total --human | awk -e '$1 ~ /:/ && FNR == 4 {print $2}') 6 | USED=$(free --total --human | awk -e '$1 ~ /:/ && FNR == 4 {print $3}') 7 | echo "${USED}/${ALL}" 8 | } 9 | 10 | printf "%s" "$(ram_available)" 11 | -------------------------------------------------------------------------------- /desktop/.config/waybar/systemd_show_failed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FAILED=$(systemctl --quiet --failed | wc -l) 4 | USER_FAILED=$(systemctl --quiet --user --failed | wc -l) 5 | TOTAL=$((FAILED + USER_FAILED)) 6 | 7 | if [[ $TOTAL -gt 0 ]]; then 8 | echo -e "($TOTAL)\nUser: $USER_FAILED; System: $FAILED" 9 | fi 10 | -------------------------------------------------------------------------------- /nnn/.config/nnn/plugins/nnn_clipboard_file_path_cd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . "$(dirname "$0")"/.nnn-plugin-helper 4 | export CUR_CTX=1 5 | 6 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 7 | DIR=$(wl-paste) 8 | else 9 | DIR=$(xclip -o -selection clipboard) 10 | fi 11 | 12 | nnn_cd "${DIR/#\~/$HOME}" 13 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: local 3 | hooks: 4 | - id: trufflehog 5 | name: TruffleHog 6 | description: Detect secrets in your data. 7 | entry: bash -c 'trufflehog git file://. --no-update --since-commit HEAD --fail' 8 | language: system 9 | stages: ["commit", "push"] 10 | -------------------------------------------------------------------------------- /nnn/.config/nnn/plugins/nnn_file_dir_yank: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if [ -z "$2" ]; then 4 | DIR="$1" 5 | else 6 | DIR="$2" 7 | fi 8 | 9 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 10 | printf "%s" "$DIR" | tr -d '\n' | setsid -f wl-copy 11 | else 12 | printf "%s" "$DIR" | tr -d '\n' | setsid -f xclip -i -selection clipboard 13 | fi 14 | -------------------------------------------------------------------------------- /desktop/.config/waybar/updates-arch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then 4 | updates_arch=0 5 | fi 6 | 7 | all_count=$(pacman -Q | wc -l) 8 | threshold=$((20 * all_count / 100)) 9 | 10 | if [ "$updates_arch" -gt "$threshold" ]; then 11 | echo "($updates_arch)" 12 | else 13 | echo "" 14 | fi 15 | -------------------------------------------------------------------------------- /desktop/.config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | kb-secondary-copy: ""; 3 | kb-row-left: "Control+h"; 4 | kb-row-right: "Control+l"; 5 | kb-remove-char-back: "BackSpace"; 6 | kb-remove-to-eol: ""; 7 | kb-accept-entry: "Return"; 8 | kb-mode-complete: ""; 9 | kb-row-up: "Control+k,Up"; 10 | kb-row-down: "Control+j,Down"; 11 | kb-cancel: "Escape,Control+c"; 12 | } 13 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/my-functions.zsh: -------------------------------------------------------------------------------- 1 | alias e='my-eval-var' 2 | if ! alias m >/dev/null 2>&1; then 3 | alias m='my-man-fzf' 4 | fi 5 | alias v='my-editor-open' 6 | alias c='my-vscode-open' 7 | alias vv='my-create-edit-tmp' 8 | alias vt='my-create-edit-tmp' 9 | alias vx='my-create-script' 10 | alias cpf='my-yank-to-clipboard' 11 | alias pss='my-processes-search' 12 | alias -g Y='| my-yank-to-clipboard' 13 | -------------------------------------------------------------------------------- /desktop/.config/waybar/scratchpad_is_empty.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # if scratchpad not empty => show how many windows in scratchpad 4 | 5 | if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then 6 | hyprctl -j workspaces | jq '.[] | (select(.name == "special:magic")) | .windows' 7 | elif [ -n "$SWAYSOCK" ]; then 8 | swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | length | select(. >= 1)' 9 | fi 10 | -------------------------------------------------------------------------------- /zsh/.zsh/functions/networking.zsh: -------------------------------------------------------------------------------- 1 | function my-networking-server-notify-alive() { 2 | until ping -w 10 -c 2 $1 > /dev/null 2>&1 3 | do 4 | done 5 | notify-send "$1 is alive" 6 | } 7 | compdef my-networking-server-notify-alive=ping 8 | 9 | function my-networking-ssh-server-notify-alive() { 10 | until ssh $1 'exit' > /dev/null 2>&1 11 | do 12 | done 13 | notify-send "$1 is alive" 14 | } 15 | compdef my-networking-ssh-server-notify-alive=ping 16 | -------------------------------------------------------------------------------- /desktop/.config/waybar/info-tmux-sessions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if sessionlist=$(tmux ls 2>/dev/null); then 4 | session_count=0 5 | attached_count=0 6 | 7 | while read -r line; do 8 | session_count=$((session_count + 1)) 9 | if echo "$line" | grep -q "(attached)"; then 10 | attached_count=$((attached_count + 1)) 11 | fi 12 | done < <(echo "$sessionlist") 13 | 14 | printf "(%s/%s)" "$attached_count" "$session_count" 15 | else 16 | printf "" 17 | fi 18 | -------------------------------------------------------------------------------- /tmux/.config/tmux/themes/nightfox_blue.conf: -------------------------------------------------------------------------------- 1 | set -g @MY_FG_COLOR '#719cd6' 2 | set -g @MY_FG_COLOR_1 '#5b7ba6' 3 | set -g @MY_FG_COLOR_2 '#43566F' 4 | set -g @MY_FG_COLOR_2_INVERSE '#aeafb0' 5 | set -g @MY_FG_COLOR_3 '#293441' 6 | set -g @MY_FG_COLOR_4 '#212832' 7 | set -g @MY_BG_COLOR '#131a24' 8 | set -g @MY_BG_COLOR_LIGHT '#2a2b3c' 9 | set -g @MY_RED_COLOR '#d50000' 10 | set -g @MY_ACTIVE_BORDER '#719cd6' 11 | -------------------------------------------------------------------------------- /tmux/.config/tmux/themes/github_dark_high_contrast.conf: -------------------------------------------------------------------------------- 1 | set -g @MY_FG_COLOR '#71b7ff' 2 | set -g @MY_FG_COLOR_1 '#48739f' 3 | set -g @MY_FG_COLOR_2 '#1f2e40' 4 | set -g @MY_FG_COLOR_2_INVERSE '#3a7ccc' 5 | set -g @MY_FG_COLOR_3 '#192535' 6 | set -g @MY_FG_COLOR_4 '#131C28' 7 | set -g @MY_BG_COLOR '#0b0e12' 8 | set -g @MY_BG_COLOR_LIGHT '#2a2b3c' 9 | set -g @MY_RED_COLOR '#d50000' 10 | set -g @MY_ACTIVE_BORDER '#d50000' 11 | -------------------------------------------------------------------------------- /desktop/.config/waybar/detect_xwayland.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$HYPRLAND_INSTANCE_SIGNATURE" ]; then 4 | if [[ $(hyprctl activewindow | grep -i -e "xwayland" | cut -d ':' -f 2 | grep -oP '\s\K[0-9]+') == "1" ]]; then 5 | DISPLAY_SERVER_TYPE="xwayland" 6 | fi 7 | elif [ -n "$SWAYSOCK" ]; then 8 | DISPLAY_SERVER_TYPE=$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true) | .shell') 9 | fi 10 | 11 | if [[ "$DISPLAY_SERVER_TYPE" == "xwayland" ]]; then 12 | echo "X11" 13 | else 14 | echo "" 15 | fi 16 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/vim.vim: -------------------------------------------------------------------------------- 1 | setlocal foldmethod=marker 2 | setlocal foldlevel=0 3 | 4 | function s:vimSectionFolds() 5 | let l:filename = expand('%') 6 | let l:lines = getbufline('%', 0, '$') 7 | let l:lines = map(l:lines, {index, value -> {"lnum": index + 1, "text": value, "filename": l:filename}}) 8 | call filter(l:lines, {_, value -> value.text =~# '^".*{{{.*$'}) 9 | call setqflist(l:lines) 10 | Telescope quickfix 11 | endfunction 12 | 13 | nnoremap Ff :call vimSectionFolds() 14 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/distro.zsh: -------------------------------------------------------------------------------- 1 | if command -v pacman > /dev/null; then 2 | alias pacup='sudo pacman -Syu' 3 | alias pacin="my-packages-install" 4 | alias pacinstall="sudo pacman -S" 5 | alias pacrm="sudo pacman -Rns" 6 | alias pacse="pacman -F" 7 | alias pacown="pacman -Qo" 8 | alias pacls="my-packages-list" 9 | alias paclsa="pacman -Q" 10 | alias yain="yay --aur -Sl | fzf --multi --preview-window=wrap --preview 'cat <(yay -Si {2})' | cut -d' ' -f2 | xargs -ro yay -S" 11 | alias yainstall="yay -S" 12 | alias yaup="yay --sudoloop -Su" 13 | fi 14 | -------------------------------------------------------------------------------- /desktop/.config/alacritty/themes/nightfox_blue.toml: -------------------------------------------------------------------------------- 1 | [[colors.indexed_colors]] 2 | color = "#f4a261" 3 | index = 16 4 | 5 | [[colors.indexed_colors]] 6 | color = "#d67ad2" 7 | index = 17 8 | 9 | [colors.bright] 10 | black = "#575860" 11 | red = "#d16983" 12 | green = "#8ebaa4" 13 | yellow = "#e0c989" 14 | blue = "#86abdc" 15 | magenta = "#baa1e2" 16 | cyan = "#7ad4d6" 17 | white = "#e4e4e5" 18 | 19 | [colors.normal] 20 | black = "#393b44" 21 | red = "#c94f6d" 22 | green = "#81b29a" 23 | yellow = "#dbc074" 24 | blue = "#719cd6" 25 | magenta = "#9d79d6" 26 | cyan = "#63cdcf" 27 | white = "#dfdfe0" 28 | 29 | [colors.primary] 30 | background = "#192330" 31 | foreground = "#cdcecf" 32 | -------------------------------------------------------------------------------- /nvim/.config/nvim/init.vim-debug/init.vim: -------------------------------------------------------------------------------- 1 | let g:my_plug_dir = $HOME . '/.tmp/init.vim-debug' 2 | if !filereadable(g:my_plug_dir . '/autoload/plug.vim') 3 | silent execute '!curl -fLo '.g:my_plug_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' 4 | execute 'source ' . g:my_plug_dir . '/autoload/plug.vim' 5 | end 6 | 7 | call plug#begin(g:my_plug_dir . '/vim-plug') 8 | 9 | call plug#end() 10 | 11 | if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) 12 | echom 'Some modules are missing, running :PlugInstall' 13 | PlugInstall 14 | endif 15 | 16 | lua <a : 21 | -------------------------------------------------------------------------------- /desktop/.config/alacritty/themes/github_dark_high_contrast.toml: -------------------------------------------------------------------------------- 1 | [[colors.indexed_colors]] 2 | color = "#d18616" 3 | index = 16 4 | 5 | [[colors.indexed_colors]] 6 | color = "#ffa198" 7 | index = 17 8 | 9 | [colors.bright] 10 | black = "#6e7681" 11 | blue = "#79c0ff" 12 | cyan = "#56d4dd" 13 | green = "#56d364" 14 | magenta = "#d2a8ff" 15 | red = "#ffa198" 16 | white = "#f0f6fc" 17 | yellow = "#e3b341" 18 | 19 | [colors.normal] 20 | black = "#484f58" 21 | blue = "#58a6ff" 22 | cyan = "#39c5cf" 23 | green = "#3fb950" 24 | magenta = "#bc8cff" 25 | red = "#ff7b72" 26 | white = "#b1bac4" 27 | yellow = "#d29922" 28 | 29 | [colors.primary] 30 | background = "#0a0c10" 31 | foreground = "#dfdfdf" 32 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | nnoremap K 2 | " decrease/increase headers in visual selection 3 | xnoremap - :s/^#//ggv 4 | xnoremap + :s/^\(.*#\)/\1#/ggv 5 | 6 | " tpope/vim-surround 7 | " echo char2nr(" ") 8 | " Sb: bold 9 | let b:surround_98 = "**\r**" 10 | " Si: italics 11 | let b:surround_105 = "*\r*" 12 | " Sl: link 13 | let b:surround_108 = "[[\r]]" 14 | 15 | " iamcco/markdown-preview.nvim 16 | nnoremap .p :MarkdownPreview 17 | let g:mkdp_auto_close = 0 18 | 19 | " dhruvasagar/vim-table-mode 20 | " enter '|' to create new row/align existing table 21 | nnoremap Fa :TableModeRealign 22 | nnoremap Ft :TableModeToggle 23 | -------------------------------------------------------------------------------- /zsh/.zsh/functions/programming.zsh: -------------------------------------------------------------------------------- 1 | function my-create-pyton-env() { 2 | if [[ -d $PWD/.venv ]]; then 3 | >&2 echo -e "ERROR: $PWD/.venv already exist. Exiting..." 4 | return 1 5 | fi 6 | python3 -m venv .venv 7 | 8 | if [[ -f $PWD/.envrc ]]; then 9 | >&2 echo -e "ERROR: $PWD/.envrc already exist. Exiting..." 10 | return 1 11 | fi 12 | cat << EOF > .envrc 13 | source .venv/bin/activate 14 | EOF 15 | direnv allow . && exec zsh 16 | } 17 | 18 | function my-shared-libs-fzf() { 19 | declare -A shared_libs 20 | shared_libs=() 21 | for filename in /proc/[0-9]*; do 22 | local libs=(`cat "$filename"/maps 2>/dev/null | awk '{print $6;}' | grep '\.so' | uniq`) 23 | for i in "${libs[@]}" 24 | do 25 | ((shared_libs[$i]++)) 26 | done 27 | done 28 | print -l ${(k)shared_libs} | fzf --preview-label="Processes opened shared lib:" --preview='lsof -H {}' | xargs --no-run-if-empty lsof -H 29 | } 30 | -------------------------------------------------------------------------------- /zsh/.zsh/functions/desktop.zsh: -------------------------------------------------------------------------------- 1 | function my-notfiy-wrapper() { 2 | start=$(date +%s) 3 | "$@" 4 | if command -v notify-send > /dev/null; then 5 | notify-send "Command \"$(echo $@)\" completed" "duration: $(($(date +%s) - start)) seconds" 6 | fi 7 | } 8 | compdef _command_names my-notfiy-wrapper 9 | 10 | function my-vscode-open () { 11 | if [ $# -eq 0 ]; then 12 | if command -v "windsurf" > /dev/null 2>&1 ; then 13 | windsurf . &! 14 | elif command -v "code" > /dev/null 2>&1 ; then 15 | code . 16 | else 17 | my-editor-open 18 | fi 19 | else 20 | local size 21 | size=$(wc -c < $1) 22 | if (( size > 1000000 )); then 23 | nvim -u NONE $1 24 | return 25 | fi 26 | if command -v "windsurf" > /dev/null 2>&1 ; then 27 | windsurf --goto $1 &! 28 | elif command -v "code" > /dev/null 2>&1 ; then 29 | code --goto $1 30 | else 31 | my-editor-open $1 32 | fi 33 | fi 34 | } 35 | -------------------------------------------------------------------------------- /desktop/.config/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | [general] 2 | import = ["~/.config/alacritty/themes/github_dark_high_contrast.toml"] 3 | 4 | [debug] 5 | log_level = "Off" 6 | 7 | [env] 8 | LANG = "en_US.UTF-8" 9 | LC_CTYPE = "en_US.UTF-8" 10 | TERM = "alacritty" 11 | 12 | [terminal] 13 | shell = "/bin/zsh" 14 | 15 | [window] 16 | opacity = 0.90 17 | 18 | [font] 19 | # size = 16.5 20 | size = 16.0 21 | 22 | [font.bold] 23 | family = "JetBrainsMono NF" 24 | style = "Bold" 25 | 26 | [font.bold_italic] 27 | family = "JetBrainsMono NF" 28 | style = "Bold Italic" 29 | 30 | [font.italic] 31 | family = "JetBrainsMono NF" 32 | style = "Italic" 33 | 34 | [font.normal] 35 | family = "JetBrainsMono NF" 36 | style = "Regular" 37 | 38 | [[keyboard.bindings]] 39 | action = "Paste" 40 | key = "V" 41 | mods = "Shift|Control" 42 | 43 | [[keyboard.bindings]] 44 | action = "None" 45 | key = "Space" 46 | mode = "~Search" 47 | mods = "Shift|Control" 48 | -------------------------------------------------------------------------------- /desktop/.config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | # See dunst(5) for all configuration options 2 | 3 | [global] 4 | width = 500 5 | origin = top-center 6 | offset = 10x10 7 | padding = 20 8 | notification_limit = 5 9 | progress_bar_max_width = 500 10 | progress_bar_corner_radius = 50 11 | horizontal_padding = 30 12 | frame_width = 3 13 | gap_size = 10 14 | frame_color = "#aaaaaa" 15 | idle_threshold = 60 16 | font = Noto Sans 16 17 | format = "%a\n%s\n%b" 18 | enable_recursive_icon_lookup = true 19 | history_length = 50 20 | corner_radius = 40 21 | mouse_left_click = do_action 22 | mouse_middle_click = close_all 23 | mouse_right_click = close_current 24 | [urgency_low] 25 | background = "#222222d9" 26 | foreground = "#ffffffd9" 27 | timeout = 5 28 | [urgency_normal] 29 | background = "#222222d9" 30 | foreground = "#ffffffd9" 31 | frame_color = "#ff0000" 32 | timeout = 5 33 | [urgency_critical] 34 | background = "#900000" 35 | foreground = "#ffffff" 36 | frame_color = "#ff0000" 37 | timeout = 0 38 | 39 | # vim: ft=cfg 40 | -------------------------------------------------------------------------------- /desktop/.config/hypr/move.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Decides whether to issue 'movewindoworgroup' or 'movegroupwindow' when moving left or right to emulate sway/i3 behaviour 4 | 5 | WINDOW_INFO=$(hyprctl -j activewindow) 6 | GROUP_WINDOWS_IDS=$(echo "$WINDOW_INFO" | jq '.grouped') 7 | GROUP_LENGTH=$(echo "$WINDOW_INFO" | jq '.grouped | length') 8 | CURRENT_WINDOW_ID=$(echo "$WINDOW_INFO" | jq '.address') 9 | CURRENT_WINDOW_INDEX=$(echo "$GROUP_WINDOWS_IDS" | jq "index($CURRENT_WINDOW_ID)") 10 | 11 | echo "GROUP_WINDOWS_IDS: $GROUP_WINDOWS_IDS" 12 | echo "CURRENT_WINDOW: $CURRENT_WINDOW_ID" 13 | echo "CURRENT_WINDOW index: $CURRENT_WINDOW_INDEX" 14 | 15 | if [[ "$1" == "r" ]]; then 16 | if [[ $((CURRENT_WINDOW_INDEX + 1)) -eq $GROUP_LENGTH ]]; then 17 | # we are in the rightmost window in a group and need to move right => move out of group 18 | hyprctl dispatch movewindoworgroup "$1" 19 | else 20 | hyprctl dispatch movegroupwindow f 21 | fi 22 | elif [[ "$1" == "l" ]]; then 23 | if [[ $CURRENT_WINDOW_INDEX -eq 0 ]]; then 24 | # we are in the leftmost window in a group and need to move left => move out of group 25 | hyprctl dispatch movewindoworgroup "$1" 26 | else 27 | hyprctl dispatch movegroupwindow b 28 | fi 29 | fi 30 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/systemd.zsh: -------------------------------------------------------------------------------- 1 | alias scenable='sudo systemctl enable --now' 2 | alias scdisable='sudo systemctl disable' 3 | alias scstatus='systemctl status' 4 | alias sclist='systemctl list-unit-files' 5 | alias sctimers='systemctl list-timers --all' 6 | alias scshow='systemctl show' 7 | alias scfail='systemctl --failed' 8 | alias sclogs='journalctl -u' 9 | alias scfollow='journalctl --follow -u' 10 | alias scstart='sudo systemctl start' 11 | alias scstop='sudo systemctl stop' 12 | alias screload='sudo systemctl reload' 13 | alias screloadall='sudo systemctl daemon-reload' 14 | alias screstart='sudo systemctl restart' 15 | alias scfailr='sudo systemctl reset-failed' 16 | alias scedit='sudo EDITOR=vim systemctl edit' 17 | alias scuenable='systemctl --user enable --now' 18 | alias scudisable='systemctl --user disable' 19 | alias scustatus='systemctl status --user' 20 | alias sculist='systemctl --user list-unit-files' 21 | alias scutimers='systemctl --user list-timers --all' 22 | alias scushow='systemctl --user show' 23 | alias scufail='systemctl --user --failed' 24 | alias sculogs='journalctl --user-unit=' 25 | alias scufollow='journalctl --follow --user-unit=' 26 | alias scustart='systemctl --user start' 27 | alias scustop='systemctl --user stop' 28 | alias scureload='systemctl --user reload' 29 | alias scureloadall='systemctl --user daemon-reload' 30 | alias scurestart='systemctl --user restart' 31 | alias scufailr='systemctl --user reset-failed' 32 | alias scuedit='systemctl --user edit' 33 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | ### direnv: load and unload environment variables from .envrc file depending on the current directory 2 | # https://github.com/romkatv/powerlevel10k#how-do-i-initialize-direnv-when-using-instant-prompt 3 | (( ${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)" 4 | 5 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 6 | # Initialization code that may require console input (password prompts, [y/n] 7 | # confirmations, etc.) must go above this block; everything else may go below. 8 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 9 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 10 | fi 11 | 12 | ### load and unload environment variables from .envrc file depending on the current directory 13 | # https://github.com/direnv/direnv 14 | (( ${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)" 15 | 16 | # my dotfiles 17 | # NOTE: might have problems when reordering 18 | [ -f $HOME/.zsh/configs.zsh ] && source $HOME/.zsh/configs.zsh 19 | [ -f $HOME/.zsh/plugins.zsh ] && source $HOME/.zsh/plugins.zsh 20 | [ -d $HOME/.zsh/functions ] && for f in $HOME/.zsh/functions/*.zsh; do source $f; done 21 | [ -d $HOME/.zsh/aliases ] && for f in $HOME/.zsh/aliases/*.zsh; do source $f; done 22 | [ -f $HOME/.zsh/keymaps.zsh ] && source $HOME/.zsh/keymaps.zsh 23 | 24 | # To update prompt, run 'p10k configure' or edit ~/.p10k.zsh. 25 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 26 | -------------------------------------------------------------------------------- /desktop/.config/waybar/config_hyprland: -------------------------------------------------------------------------------- 1 | { 2 | // run: waybar --config $HOME/.dotfiles/desktop/.config/waybar/config_hyprland 3 | // get class of applications: hyprctl clients 4 | 5 | "modules-right": ["hyprland/workspaces", "pulseaudio", "hyprland/language", "clock"], 6 | 7 | "include": [ 8 | "~/.config/waybar/config_base" 9 | ], 10 | 11 | "hyprland/workspaces": { 12 | "format": "{windows}", 13 | "window-rewrite-default": "", 14 | // WARN: change in ./config_sway as well 15 | "window-rewrite": { 16 | "class": "", 17 | "class": "󰌆", 18 | "class": "󰈹", 19 | "class title<.*github.*>": "", 20 | "class": "󰋩", 21 | "class": "", 22 | "class": "", 23 | "class": "", 24 | "class": "", 25 | "class": "", 26 | "class": "", 27 | "class": "", 28 | "class": "󰖄", 29 | "class": "", 30 | "class": "", 31 | "class": "", 32 | "class": "", 33 | "class": "", 34 | "class": "", 35 | "class": "󰏪", 36 | "class": "", 37 | "class": "", 38 | "class": "", 39 | } 40 | }, 41 | "hyprland/language": { 42 | "format": "{}", 43 | "format-en": "🇺🇸", 44 | "format-ru": "RU", 45 | } 46 | } 47 | 48 | // # vim: ft=jsonc 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # My linux dotfiles ⌨ 3 | 4 | ![Screenshot_20250507171013](https://github.com/user-attachments/assets/fc3d9994-d0cd-4d00-8420-f27c53dff0e4) 5 | 6 | *Includes configuration files for*: 7 | 8 | | **Window manager** | **[sway](https://github.com/swaywm/sway), [hyprland](https://github.com/hyprwm/Hyprland)** | 9 | |:-------------------------|:-------------------------------------------------------------------------------------------| 10 | | **Status bar** | **[waybar](https://github.com/Alexays/Waybar)** | 11 | | **Application launcher** | **[rofi](https://github.com/in0ni/rofi-wayland)** | 12 | | **Notification daemon** | **[dunst](https://github.com/dunst-project/dunst)** | 13 | | **Terminal** | **[alacritty](https://github.com/alacritty/alacritty)** | 14 | | **File manager** | **[nnn](https://github.com/jarun/nnn)** | 15 | | **Editor** | **[neovim](https://github.com/neovim/neovim)** | 16 | | **Terminal multiplexer** | **[tmux](https://github.com/tmux/tmux.git)** | 17 | | **Shell** | **[zsh](https://github.com/zsh-users/zsh.git)** | 18 | 19 | ```bash 20 | # Link configuration files to $HOME using GNU Stow 21 | ./install.sh 22 | ``` 23 | -------------------------------------------------------------------------------- /desktop/.config/waybar/config_sway: -------------------------------------------------------------------------------- 1 | { 2 | // run: waybar --config $HOME/.dotfiles/desktop/.config/waybar/config_hyprland 3 | // get class of applications: swaymsg -t get_tree 4 | 5 | "modules-right": ["sway/workspaces", "pulseaudio", "sway/language", "clock"], 6 | 7 | "include": [ 8 | "~/.config/waybar/config_base" 9 | ], 10 | 11 | "sway/workspaces": { 12 | "format": "{windows}", 13 | "format-window-separator": " ", 14 | "window-rewrite-default": "{name}", 15 | "window-format": "{name}", 16 | // WARN: change in ./config_hyprland as well 17 | "window-rewrite": { 18 | "class": "", 19 | "class": "󰌆", 20 | "class": "󰈹", 21 | "class title<.*github.*>": "", 22 | "class": "󰋩", 23 | "class": "", 24 | "class": "", 25 | "class": "", 26 | "class": "", 27 | "class": "", 28 | "class": "", 29 | "class": "", 30 | "class": "󰖄", 31 | "class": "", 32 | "class": "", 33 | "class": "", 34 | "class": "", 35 | "class": "", 36 | "class": "", 37 | "class": "󰏪", 38 | "class": "", 39 | "class": "", 40 | "class": "", 41 | }, 42 | "disable-scroll": true 43 | }, 44 | "sway/language": { 45 | "format": "{flag}" 46 | } 47 | } 48 | 49 | // # vim: ft=jsonc 50 | -------------------------------------------------------------------------------- /nnn/.config/nnn/plugins/nnn_my_opener: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Description: Workaround to open files, determined by $MIMETYPE as not 'text/*', in neovim in current terminal 4 | 5 | set -euf -o noclobber -o noglob -o nounset 6 | IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n 7 | 8 | FILE_PATH="$1" 9 | MIMETYPE="$( file -bL --mime-type -- "${FILE_PATH}" )" 10 | 11 | open_neovim () { 12 | local size 13 | size=$(wc -c < "${FILE_PATH}") 14 | # do not apply nvim plugins to file > 1MB 15 | if (( size > 1000000 )); then 16 | nvim -u NONE "${FILE_PATH}" 17 | else 18 | nvim "${FILE_PATH}" 19 | fi 20 | } 21 | 22 | handle_text() { 23 | mimetype="${1}" 24 | case "${mimetype}" in 25 | # application/vnd.hp-HPGL = Makefile 26 | text/* | application/vnd.hp-HPGL | application/json | application/x-ndjson | application/javascript) 27 | open_neovim 28 | exit 0;; 29 | esac 30 | } 31 | 32 | handle_blocked() { 33 | case "${MIMETYPE}" in 34 | application/x-sharedlib | application/x-shared-library-la | application/x-executable | application/x-pie-executable | application/octet-stream | application/pdf | application/epub+zip) 35 | if ! which xxxd > /dev/null 2>&1; then 36 | xxd -d -u -g 1 -c 8 "${FILE_PATH}" 2>/dev/null | less 37 | else 38 | >&2 echo "xxd is missing" 39 | fi 40 | exit 0 41 | esac 42 | } 43 | 44 | handle_fallback() { 45 | if type xdg-open >/dev/null 2>&1; then 46 | nohup xdg-open "${FILE_PATH}" >/dev/null 2>&1 & 47 | exit 0 48 | fi 49 | } 50 | 51 | handle_text "${MIMETYPE}" 52 | handle_blocked "${MIMETYPE}" 53 | handle_fallback 54 | 55 | echo "ERROR: Reached end of nnn_my_opener" >&2 56 | exit 1 57 | -------------------------------------------------------------------------------- /desktop/.config/waybar/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | font-family: 'NotoSans Nerd Font'; 3 | font-size: 17px; 4 | font-style: normal; 5 | font-variant: normal; 6 | font-weight: bold; 7 | border: none; 8 | border-radius: 0; 9 | min-height: 0; 10 | min-width: 0; 11 | margin-top: 0; 12 | margin-right: 0; 13 | margin-bottom: 0; 14 | margin-left: 0; 15 | padding-top: 0; 16 | padding-right: 0; 17 | padding-bottom: 0; 18 | padding-left: 0; 19 | } 20 | /* color for everything except .modules-center group */ 21 | window#waybar { 22 | background-color: #000000; 23 | color: #E6E6E6; 24 | } 25 | 26 | /* .modules-left group */ 27 | #tray { 28 | margin-left: 0; 29 | } 30 | #bluetooth { 31 | margin-left: 5px; 32 | color: #5BBEFF; 33 | } 34 | #network { 35 | margin-left: 5px; 36 | color: #71FF5B; 37 | } 38 | #custom-vpn { 39 | color: #71FF5B; 40 | } 41 | #custom-info_tmux { 42 | margin-left: 5px; 43 | } 44 | #custom-info_ssh { 45 | margin-left: 5px; 46 | } 47 | #custom-scratchpad-indicator { 48 | margin-left: 5px; 49 | } 50 | #custom-info_acrhlinux { 51 | margin-left: 5px; 52 | color: #A8B7FF; 53 | } 54 | #custom-systemd_failed { 55 | margin-left: 5px; 56 | color: #FF0000; 57 | } 58 | #custom-detect_xwayland { 59 | margin-left: 5px; 60 | color: #FF0000; 61 | } 62 | #custom-info-snapshot { 63 | margin-left: 5px; 64 | color: #FFB300; 65 | } 66 | 67 | /* .modules-right group */ 68 | #workspaces { 69 | margin-right: 10px; 70 | } 71 | #workspaces button { 72 | color: #E6E6E6; 73 | margin-right: 20px; 74 | } 75 | #workspaces button.visible { 76 | color: #d50000; 77 | } 78 | #workspaces button.urgent { 79 | color: #95EBFF; 80 | } 81 | #pulseaudio { 82 | margin-right: 10px; 83 | } 84 | #language { 85 | margin-right: 5px; 86 | } 87 | #clock { 88 | margin-right: 5px; 89 | } 90 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/external.zsh: -------------------------------------------------------------------------------- 1 | alias q='qalc' 2 | alias fm='nautilus $PWD >/dev/null 2>&1 &!' 3 | alias mt='my_time.sh -t 10' 4 | alias ea='direnv allow . && src' 5 | alias eb='direnv block .' 6 | alias vd='nvim -u $HOME/.config/nvim/init.vim-debug/init.vim' 7 | alias vn='nvim -u none' 8 | alias qr='qrencode -m 2 -t UTF8 <<<' 9 | alias hx='hexdump -C' 10 | alias ff='plocate --ignore-case' 11 | alias ffu='sudo updatedb' 12 | alias rg='rg --hidden --no-ignore 2>/dev/null ""' 13 | alias rga='rga --hidden --no-ignore 2>/dev/null ""' 14 | alias spl="codespell --summary --write-changes" 15 | alias nls="cat $HOME/.config/nnn/.selection | tr \"\0\" \"\n\"" 16 | alias myip='curl -s https://ipinfo.io' 17 | alias my_networking_ports='sudo ss -lntup' 18 | alias my_networking_connections='lsof -Pni' 19 | alias TP='task projects' 20 | alias TA='task project: add' 21 | alias TL='task project: next' 22 | alias TE='task modify' 23 | alias TD='task done' 24 | # Disk Usage Tui 25 | alias dut='gdu' 26 | alias dua='gdu -n /' 27 | alias curl='curl --tlsv1.3 --location --proto https' 28 | alias emj="emoji-fzf preview --prepend | fzf | awk '{ print \$1 }' | my-yank-to-clipboard" 29 | if command -v exa > /dev/null; then 30 | alias l='exa -aglbh --git --icons --color always' 31 | alias ll='ls -lAFh --color=tty' 32 | alias tree='exa -glbh --git --icons -T -I ".git" --git-ignore -a --color always | less -r' 33 | fi 34 | if command -v duf > /dev/null; then 35 | alias df='\duf' 36 | fi 37 | if command -v bat > /dev/null; then 38 | alias cat='bat --theme="ansi"' 39 | alias catp='bat --theme="ansi" --paging=never' 40 | alias ccat='\cat' 41 | fi 42 | if command -v batman > /dev/null; then 43 | alias m='batman' 44 | fi 45 | if command -v jiq > /dev/null; then 46 | alias -g J='| jiq -q' 47 | fi 48 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/default.zsh: -------------------------------------------------------------------------------- 1 | alias l='ls -lAFh --color=tty' 2 | alias h='sha256sum' 3 | alias u='uptime --pretty' 4 | alias k='kill' 5 | alias K='kill -9' 6 | alias ln='ln -s -n -f ' 7 | alias cp='cp -i' 8 | alias mv='mv -i' 9 | alias md='mkdir -p' 10 | alias ip='ip -color=auto' 11 | alias dd='dd status=progress' 12 | alias src='exec zsh' 13 | alias rmr='rm -rf' 14 | alias rmf='shred -uz' 15 | alias ddr='dd if=/dev/urandom bs=4K count=1 | base64 > output.dat' 16 | # mnemonic: disk usage directories 17 | alias dud='du -d 1 -ch --apparent-size | sort --human-numeric-sort' 18 | # mnemonic: disk usage files 19 | alias duf='find . -type f -exec du -csh --apparent-size {} + | sort --human-numeric-sort' 20 | alias diff='diff --color=auto' 21 | alias grep='grep --color=auto' 22 | alias dmesg='sudo dmesg --color=auto --follow' 23 | alias makej="make --jobs=$(nproc --ignore=2)" 24 | alias psa='ps aux' 25 | alias pscpu='ps -e -o pid,ppid,cmd:100,%mem,%cpu --sort=-%cpu | head' 26 | alias psmem='ps -e -o user,pid,%cpu,%mem,args --sort=-%mem | head -n 20' 27 | alias s='TERM=xterm-256color ssh' 28 | alias st='TERM=xterm-256color ssh -Y' 29 | alias sshk='ssh-copy-id -i' 30 | alias sshr='ssh-keygen -R' 31 | alias sshx='ssh -O exit' 32 | alias sshls='l /tmp/.ssh_*' 33 | alias kern='uname --kernel-release --machine' 34 | alias kerncfg='zless /proc/config.gz' 35 | alias kernparam='cat /proc/cmdline' 36 | alias genstr="LC_ALL=C tr -dc 'A-Za-z0-9_' /dev/null; then 4 | if [[ -n $1 ]]; then 5 | local package=$1 6 | if ! pacman -Qi $package >/dev/null 2>&1; then 7 | >&2 echo -e "ERROR: Package $package not found. Exiting..." 8 | return 1 9 | fi 10 | else 11 | local package=$(pacman -Qq | fzf --preview-window=wrap --preview 'pacman -Qil {}' --layout=reverse) 12 | if [[ -z $package ]]; then 13 | return 14 | fi 15 | fi 16 | 17 | local package_files=$(pacman -Qlq $package | grep -v "/$") 18 | local package_files_listed 19 | if command -v exa > /dev/null; then 20 | package_files_listed=$(echo "$package_files" | xargs -r -d "\n" exa --sort=size --reverse -aglbh --icons --color always) 21 | else 22 | package_files_listed=$(echo "$package_files" | xargs -r -d "\n" ls -lAFh --color=tty) 23 | fi 24 | 25 | { pacman -Qi $package; echo $package_files_listed; } | less -r 26 | fi 27 | } 28 | 29 | function my-packages-install () 30 | { 31 | if command -v pacman > /dev/null; then 32 | all_pkgs=($(pacman -Slq)) 33 | 34 | if [[ $# -gt 0 ]]; then 35 | local pkgs=("$@") 36 | for pkg in "${pkgs[@]}" 37 | do 38 | if ! (($all_pkgs[(Ie)$pkg])); then 39 | >&2 echo -e "ERROR: Package $pkg not found. Exiting..." 40 | return 1 41 | fi 42 | done 43 | else 44 | local pkgs=($( printf '%s\n' "${all_pkgs[@]}" | fzf --multi --preview-window=wrap --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")')) 45 | if [[ -z $pkgs ]]; then 46 | return 47 | fi 48 | fi 49 | 50 | sudo pacman -S "${pkgs[@]}" 51 | fi 52 | } 53 | 54 | function my-packages-latest() 55 | { 56 | if command -v pacman > /dev/null 2>&1 ; then 57 | pacman -Qe | expac --timefmt='%Y-%m-%d %T' '%l\t%n' - | sort 58 | fi 59 | } 60 | 61 | function my-packages-orphan() 62 | { 63 | if command -v pacman > /dev/null 2>&1 ; then 64 | pacman -Qtdq 65 | fi 66 | } 67 | 68 | function my-packages-not-in-repo() 69 | { 70 | if command -v pacman > /dev/null 2>&1 ; then 71 | pacman -Qm 72 | fi 73 | } 74 | 75 | function my-package-dependencies() 76 | { 77 | if command -v pacman > /dev/null 2>&1 ; then 78 | if ! command -v "pactree" > /dev/null 2>&1 ; then 79 | >&2 echo "ERROR: pactree not found. Install pacman-contrib package. Exiting..." 80 | return 1 81 | fi 82 | pactree $1 83 | fi 84 | } 85 | function my-package-dependencies-reverse() 86 | { 87 | if command -v pacman > /dev/null 2>&1 ; then 88 | if ! command -v "pactree" > /dev/null 2>&1 ; then 89 | >&2 echo "ERROR: pactree not found. Install pacman-contrib package. Exiting..." 90 | return 1 91 | fi 92 | pactree -r $1 93 | fi 94 | } 95 | _JJD-my-packages() { 96 | compadd "${(@f)$(pacman -Qq)}" 97 | } 98 | compdef _JJD-my-packages my-package-dependencies 99 | compdef _JJD-my-packages my-package-dependencies-reverse 100 | -------------------------------------------------------------------------------- /zsh/.zsh/plugins.zsh: -------------------------------------------------------------------------------- 1 | # plugin manager: https://github.com/zdharma-continuum/zinit 2 | # plugins location: $ZINIT[PLUGINS_DIR] 3 | # Delete old(not sourced) plugins: zinit delete --clean 4 | ZINIT_HOME="$HOME/.zsh/zinit" 5 | source "${ZINIT_HOME}/zinit.zsh" 6 | autoload -Uz _zinit 7 | (( ${+_comps} )) && _comps[zinit]=_zinit 8 | 9 | ### create archives ### 10 | zinit ice lucid wait'0' 11 | zinit light 0rtz/mkarch 12 | 13 | ### CTRL-R shell history ### 14 | zinit ice lucid wait'0' 15 | zinit light joshskidmore/zsh-fzf-history-search 16 | ZSH_FZF_HISTORY_SEARCH_END_OF_LINE=true 17 | ZSH_FZF_HISTORY_SEARCH_DATES_IN_SEARCH=false 18 | ZSH_FZF_HISTORY_SEARCH_REMOVE_DUPLICATES=true 19 | 20 | ### show tab-completion items with fzf ### 21 | zinit light Aloxaf/fzf-tab 22 | # use tmux popup to show results 23 | zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup 24 | # a prefix to indicate the color. (set it to '' to activate ':completion:*:descriptions' format '[%d]') 25 | zstyle ':fzf-tab:*' prefix '' 26 | # switch groups 27 | zstyle ':fzf-tab:*' switch-group 'ctrl-h' 'ctrl-l' 28 | # additional mapping to pass to fzf 29 | zstyle ':fzf-tab:*' fzf-bindings 'ctrl-s:jump' 'ctrl-a:toggle-all' 30 | 31 | ### show autosuggestions as-you-type ### 32 | ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(backward-kill-line) 33 | zinit light zsh-users/zsh-autosuggestions 34 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=8,bold" 35 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 36 | 37 | ### auto-instert pairs ### 38 | zinit ice wait"1" lucid # loading is done 1 second after prompt (hide Loaded message) 39 | zinit light hlissner/zsh-autopair 40 | 41 | ### git with fzf ### 42 | export FORGIT_NO_ALIASES=true 43 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 44 | export FORGIT_COPY_CMD='wl-copy' 45 | else 46 | export FORGIT_COPY_CMD='xclip -i -selection clipboard' 47 | fi 48 | export FORGIT_FZF_DEFAULT_OPTS="--bind ctrl-s:jump" 49 | zinit ice lucid wait'0' 50 | zinit load wfxr/forgit 51 | 52 | ### highlight shell syntax ### 53 | zinit light zdharma-continuum/fast-syntax-highlighting 54 | 55 | ### theme ### 56 | zinit ice depth"1" # git clone depth 57 | zinit light romkatv/powerlevel10k 58 | 59 | ### vi-mode ### 60 | ZVM_VI_ESCAPE_BINDKEY=kj 61 | zinit light jeffreytse/zsh-vi-mode 62 | # normal/visual mode mappings 63 | function my_zvm_after_lazy_keybindings() { 64 | zvm_bindkey vicmd 'H' beginning-of-line 65 | zvm_bindkey vicmd 'L' end-of-line 66 | zvm_bindkey visual 'v' zvm_exit_visual_mode 67 | zvm_bindkey visual 'x' zvm_vi_delete 68 | # overwrite jeffreytse/zsh-vi-mode keymaps 69 | bindkey -M vicmd 's' my-widget-toggle-sudo 70 | bindkey -M vicmd 'k' up-line 71 | bindkey -M vicmd 'j' down-line 72 | bindkey -M visual 'k' up-line 73 | bindkey -M visual 'j' down-line 74 | } 75 | # execute commands when first entering normal mode (shell started with insert mode) 76 | zvm_after_lazy_keybindings_commands+=(my_zvm_after_lazy_keybindings) 77 | function my_zvm_after_init() { 78 | my-init-mappings 79 | # insert mode mappings 80 | # need ^U as backward-kill-line in order for ZSH_AUTOSUGGEST_CLEAR_WIDGETS to clear prompt 81 | bindkey -M viins '^U' backward-kill-line 82 | } 83 | zvm_after_init_commands+=(my_zvm_after_init) 84 | -------------------------------------------------------------------------------- /zsh/.zsh/configs.zsh: -------------------------------------------------------------------------------- 1 | # Do not highlight pasted text 2 | zle_highlight=('paste:none') 3 | 4 | # Treat symbols as part of a word 5 | WORDCHARS='*?$_-[]\&;.!#%^(){}<>|' 6 | 7 | # vi mode 8 | bindkey -v 9 | 10 | # Disable ctrl-s in interactive shells 11 | [[ -o interactive ]] && unsetopt flow_control 12 | 13 | # Show hidden files in completion 14 | setopt globdots 15 | 16 | # man zshoptions(1) 17 | setopt HIST_IGNORE_ALL_DUPS 18 | setopt HIST_EXPIRE_DUPS_FIRST 19 | setopt HIST_IGNORE_SPACE 20 | setopt HIST_SAVE_NO_DUPS 21 | export HISTSIZE=50000 22 | export SAVEHIST=50000 23 | export HISTFILE=$HOME/.zsh_history 24 | 25 | # Activate completion system 26 | autoload -Uz compinit && compinit 27 | # pipx completion 28 | autoload -U bashcompinit 29 | bashcompinit 30 | eval "$(register-python-argcomplete pipx)" 31 | 32 | # Colored output 33 | function _my-print-heading-blue() { 34 | print -P "%B%F{blue}$1%f%b" 35 | } 36 | 37 | # Disable sort when completing `git checkout` 38 | zstyle ':completion:*:git-checkout:*' sort false 39 | # Set descriptions format to enable group support (external command, builtin command, etc...) 40 | zstyle ':completion:*:descriptions' format '[%d]' 41 | # Set list-colors to enable filename colorizing during completion 42 | export LS_COLORS='fi=0:di=34:ln=36:pi=33:so=35:bd=93:' 43 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 44 | 45 | # Environment variables used by programs: 46 | typeset -U path 47 | path+=($HOME/bin $HOME/usr/bin) 48 | path+=($HOME/.local/bin $HOME/.cargo/bin $HOME/go/bin $HOME/npm/bin) 49 | if command -v ruby > /dev/null; then 50 | path+=($(ruby -r rubygems -e 'puts Gem.user_dir')/bin) 51 | fi 52 | export PATH 53 | typeset -U fpath 54 | fpath=(~/.zsh.d/ $fpath) 55 | export FPATH 56 | export XDG_CONFIG_HOME=$HOME/.config 57 | export LANG=en_US.UTF-8 58 | export EDITOR='nvim' 59 | export PAGER='less -R' 60 | # ssh-agent: 61 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 62 | # fuzzy finder: 63 | export FZF_DEFAULT_OPTS="-m \ 64 | --bind ctrl-d:preview-page-down,\ 65 | ctrl-u:preview-page-up,\ 66 | ctrl-s:jump,\ 67 | ctrl-space:toggle,\ 68 | ctrl-a:toggle-all,\ 69 | 'ctrl-v:transform-query:echo -n {q}; if [ \"\$XDG_SESSION_TYPE\" = \"wayland\" ]; then wl-paste; else xclip -o -selection clipboard; fi'" 70 | export FZF_DEFAULT_COMMAND='rg --files --hidden -g "!.git"' 71 | export COLUMNS 72 | export FZF_PREVIEW_COLUMNS 73 | # nnn file manager: 74 | export NNN_INCLUDE_HIDDEN=1 75 | NNN_PLUG_BUNDLED='f:fzcd;p:preview-tui;r:gitroot;n:fixname;D:diffs' 76 | NNN_PLUG_CMDS='s:-!sudoedit "$nnn"*;g:-!neovide "$nnn" >/dev/null 2>&1 & disown*' 77 | NNN_PLUG_YANK='y:-nnn_file_path_yank;Y:-nnn_file_name_yank;d:-nnn_file_dir_yank' 78 | NNN_PLUG_CD='c:nnn_clipboard_file_path_cd' 79 | export NNN_PLUG="$NNN_PLUG_BUNDLED;$NNN_PLUG_CMDS;$NNN_PLUG_YANK;$NNN_PLUG_CD;" 80 | MY_NNN_TMP=$(mktemp -d) 81 | export NNN_BMS="\ 82 | d:$HOME/.dotfiles;c:$HOME/.config;n:$HOME/.notes;\ 83 | v:$HOME/.local/share/nvim;z:$HOME/.local/share/zinit/plugins;\ 84 | b:$HOME/build;p:$HOME/backed;A:$HOME/.tmp;\ 85 | a:$MY_NNN_TMP;t:$HOME/.local/share/Trash;\ 86 | " 87 | export NNN_TRASH=1 88 | export NNN_OPENER="${XDG_CONFIG_HOME}/nnn/plugins/nnn_my_opener" 89 | export NNN_ARCHIVE="\\.(7z|bz2|gz|xz|lzo|rar|zst|lz4|lrz|tar|tgz|zip|xpi|jar)$" 90 | # cd on quit 91 | export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" 92 | -------------------------------------------------------------------------------- /zsh/.zsh/keymaps.zsh: -------------------------------------------------------------------------------- 1 | ################################################## 2 | ### widgets ###################################### 3 | ################################################## 4 | 5 | function my-widget-globalias() { 6 | zle _expand_alias 7 | zle self-insert 8 | } 9 | zle -N my-widget-globalias 10 | 11 | function my-widget-magic-enter() { 12 | if [[ -z "$BUFFER" ]]; then 13 | if command git rev-parse --is-inside-work-tree &>/dev/null; then 14 | BUFFER="git status" 15 | else 16 | if command -v exa > /dev/null; then 17 | BUFFER="exa -aglbh --git --icons -F --color always" 18 | else 19 | BUFFER="ls -lAFh --color=tty" 20 | fi 21 | fi 22 | fi 23 | zle end-of-line 24 | zle accept-line 25 | } 26 | zle -N my-widget-magic-enter 27 | # zsh-users/zsh-autosuggestions plugin 28 | # clear suggestion string 29 | ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(my-widget-magic-enter) 30 | 31 | function my-widget-toggle-sudo { 32 | if [[ $BUFFER != "sudo "* ]]; then 33 | BUFFER="sudo $BUFFER"; CURSOR+=5 34 | else 35 | BUFFER=$(echo "$BUFFER" | cut -d' ' -f2-) 36 | fi 37 | # 'jeffreytse/zsh-vi-mode' 38 | zvm_enter_insert_mode 39 | } 40 | zle -N my-widget-toggle-sudo 41 | 42 | function my-copybuffer { 43 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 44 | printf "%s" "$BUFFER" | wl-copy 45 | else 46 | printf "%s" "$BUFFER" | xclip -i -selection clipboard 47 | fi 48 | } 49 | zle -N my-copybuffer 50 | 51 | function my-pastebuffer { 52 | if [ "$XDG_SESSION_TYPE" = "wayland" ]; then 53 | LBUFFER="$LBUFFER$(wl-paste)" 54 | else 55 | LBUFFER="$LBUFFER$(xclip -o -selection clipboard)" 56 | fi 57 | zle reset-prompt 58 | } 59 | zle -N my-pastebuffer 60 | 61 | function my-widg-list-aliases() { 62 | declare -a res 63 | # collect array from alias command by newlines 64 | aliases_key=("${(@f)$(alias -r | cut -d'=' -f1)}") 65 | aliases_val=("${(@f)$(alias -r | cut -d'=' -f2-)}") 66 | aliases_key+=("${(@f)$(alias -g | cut -d'=' -f1)}") 67 | aliases_val+=("${(@f)$(alias -g | cut -d'=' -f2-)}") 68 | for ((i = 1; i <= $#aliases_key; i++)) do 69 | res[i]=$(printf '%s : %s\n' $aliases_key[i] $aliases_val[i]) 70 | done 71 | local sel 72 | sel=$(printf '%s\n' "${res[@]}" | fzf --query="$LBUFFER" | awk -F" : " '{print $1}') 73 | if [[ ! -z "$sel" ]]; then 74 | LBUFFER="$sel" 75 | fi 76 | } 77 | zle -N my-widg-list-aliases 78 | 79 | zle -N my-ripgrep-fzf 80 | 81 | # edit current command in $EDITOR 82 | autoload -U edit-command-line 83 | zle -N edit-command-line 84 | 85 | ################################################## 86 | ### zle keymaps ################################## 87 | ################################################## 88 | 89 | function my-init-mappings() { 90 | bindkey -M viins "^t" edit-command-line 91 | bindkey -M viins "^ " magic-space 92 | bindkey -M viins "^y" my-copybuffer 93 | bindkey -M viins "^v" my-pastebuffer 94 | bindkey -M viins "^j" my-widget-magic-enter 95 | bindkey -M viins "^f" my-widg-list-aliases 96 | bindkey -M viins " " my-widget-globalias 97 | bindkey -M viins "^s" my-ripgrep-fzf 98 | # unbind tab 99 | bindkey -M viins -r '^i' 100 | # bind tab completion to 'Aloxaf/fzf-tab' 101 | bindkey -M viins "^k" fzf-tab-complete 102 | 103 | bindkey -M vicmd "s" my-widget-toggle-sudo 104 | } 105 | my-init-mappings 106 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/MyConfigs/statusline.lua: -------------------------------------------------------------------------------- 1 | local function trailing_whitespace() 2 | return vim.fn.search([[\s\+$]], 'nw') ~= 0 and 'TW' or '' 3 | end 4 | 5 | local lualine_theme_transparent = { 6 | normal = { 7 | a = { bg = 'None', gui = 'bold' }, 8 | b = { bg = 'None', gui = 'bold' }, 9 | c = { bg = 'None', gui = 'bold' }, 10 | x = { bg = 'None', gui = 'bold' }, 11 | y = { bg = 'None', gui = 'bold' }, 12 | z = { bg = 'None', gui = 'bold' }, 13 | }, 14 | insert = { 15 | a = { bg = 'None', fg = '#00FF11', gui = 'bold' }, 16 | b = { bg = 'None', gui = 'bold' }, 17 | c = { bg = 'None', gui = 'bold' }, 18 | x = { bg = 'None', gui = 'bold' }, 19 | y = { bg = 'None', gui = 'bold' }, 20 | z = { bg = 'None', gui = 'bold' }, 21 | }, 22 | visual = { 23 | a = { bg = 'None', fg = '#71b7ff', gui = 'bold' }, 24 | b = { bg = 'None', gui = 'bold' }, 25 | c = { bg = 'None', gui = 'bold' }, 26 | x = { bg = 'None', gui = 'bold' }, 27 | y = { bg = 'None', gui = 'bold' }, 28 | z = { bg = 'None', gui = 'bold' }, 29 | }, 30 | replace = { 31 | a = { bg = 'None', gui = 'bold' }, 32 | b = { bg = 'None', gui = 'bold' }, 33 | c = { bg = 'None', gui = 'bold' }, 34 | x = { bg = 'None', gui = 'bold' }, 35 | y = { bg = 'None', gui = 'bold' }, 36 | z = { bg = 'None', gui = 'bold' }, 37 | }, 38 | command = { 39 | a = { bg = 'None', gui = 'bold' }, 40 | b = { bg = 'None', gui = 'bold' }, 41 | c = { bg = 'None', gui = 'bold' }, 42 | x = { bg = 'None', gui = 'bold' }, 43 | y = { bg = 'None', gui = 'bold' }, 44 | z = { bg = 'None', gui = 'bold' }, 45 | }, 46 | inactive = { 47 | a = { bg = 'None', gui = 'bold' }, 48 | b = { bg = 'None', gui = 'bold' }, 49 | c = { bg = 'None', gui = 'bold' }, 50 | x = { bg = 'None', gui = 'bold' }, 51 | y = { bg = 'None', gui = 'bold' }, 52 | z = { bg = 'None', gui = 'bold' }, 53 | }, 54 | } 55 | 56 | require'lualine'.setup { 57 | options = { 58 | theme = lualine_theme_transparent, 59 | component_separators = { left = '', right = '' }, 60 | section_separators = { left = '', right = '' }, 61 | disabled_filetypes = { 'GV' }, 62 | globalstatus = true, 63 | }, 64 | sections = { 65 | lualine_a = { 66 | { 67 | 'filename', 68 | }, 69 | }, 70 | lualine_b = { 71 | { 72 | 'branch', 73 | }, 74 | { 75 | 'diff', 76 | colored = true, 77 | }, 78 | }, 79 | lualine_c = { 80 | { 81 | 'diagnostics', 82 | colored = true, 83 | sources = {'nvim_diagnostic'}, 84 | }, 85 | { 86 | trailing_whitespace, 87 | }, 88 | { 89 | -- current language 90 | 'vim.opt.keymap._value', 91 | cond = function() 92 | if vim.opt.keymap._value ~= "" then 93 | return true 94 | end 95 | end, 96 | color = { fg = "#000000", bg = "#d50000" }, 97 | }, 98 | { 99 | 'grepper#statusline', 100 | color = { fg = "#000000", bg = "#d50000" }, 101 | }, 102 | }, 103 | lualine_x = { 104 | { 105 | 'filetype', 106 | colored = true, 107 | }, 108 | }, 109 | lualine_y = { 110 | { 111 | "'%l:%c'", 112 | }, 113 | }, 114 | lualine_z = { 115 | { 116 | 'filesize', 117 | }, 118 | { 119 | "'LOC:%L'", 120 | }, 121 | }, 122 | }, 123 | extensions = {'nvim-tree', 'fugitive', 'symbols-outline', 'trouble'}, 124 | } 125 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/MyConfigs/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp = require('cmp') 2 | -- Vscode-like icons for completion menu items 3 | local lspkind = require('lspkind') 4 | -- Snippets engine 5 | local luasnip = require("luasnip") 6 | -- Load 'rafamadriz/friendly-snippets' to luasnip 7 | require("luasnip.loaders.from_vscode").lazy_load() 8 | 9 | cmp.setup({ 10 | enabled = function() 11 | return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt" 12 | end, 13 | formatting = { 14 | format = lspkind.cmp_format({mode = 'symbol_text'}) 15 | }, 16 | snippet = { 17 | expand = function(args) 18 | luasnip.lsp_expand(args.body) 19 | end, 20 | }, 21 | mapping = { 22 | [""] = cmp.mapping.scroll_docs(-4), 23 | [""] = cmp.mapping.scroll_docs(4), 24 | [""] = cmp.mapping.complete(), 25 | [""] = cmp.mapping.close(), 26 | [""] = cmp.mapping.abort(), 27 | -- Super-Tab like mapping: https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip 28 | [""] = cmp.mapping(function(fallback) 29 | if cmp.visible() then 30 | cmp.select_next_item() 31 | elseif luasnip.locally_jumpable(1) then 32 | luasnip.jump(1) 33 | else 34 | fallback() 35 | end 36 | end), 37 | [""] = cmp.mapping(function(fallback) 38 | if cmp.visible() then 39 | cmp.select_prev_item() 40 | elseif luasnip.locally_jumpable(-1) then 41 | luasnip.jump(-1) 42 | else 43 | fallback() 44 | end 45 | end), 46 | [""] = cmp.mapping({ 47 | i = cmp.mapping.confirm({ select = false }), 48 | c = function(fallback) 49 | if cmp.visible() then 50 | if luasnip.expandable() then 51 | luasnip.expand() 52 | else 53 | cmp.confirm({ 54 | select = true, 55 | }) 56 | end 57 | else 58 | fallback() 59 | end 60 | end 61 | }), 62 | }, 63 | sources = { 64 | { name = "nvim_lsp" }, 65 | { name = "luasnip" }, 66 | { name = "buffer" }, 67 | { name = "path" }, 68 | { 69 | name = "dictionary", 70 | keyword_length = 2, 71 | }, 72 | } 73 | }) 74 | 75 | -- :getcmdtype() = get cmdline type 76 | -- cmdline type specific configurations: 77 | cmp.setup.cmdline('/', { 78 | mapping = { 79 | [""] = cmp.mapping(cmp.mapping.select_next_item(), { 'c' }), 80 | [""] = cmp.mapping(cmp.mapping.select_prev_item(), { 'c' }), 81 | }, 82 | sources = { { name = "buffer" } } } 83 | ) 84 | cmp.setup.cmdline(':', { 85 | mapping = { 86 | [""] = cmp.mapping(cmp.mapping.select_next_item(), { 'c' }), 87 | [""] = cmp.mapping(cmp.mapping.select_prev_item(), { 'c' }), 88 | }, 89 | sources = { { name = "cmdline" } } 90 | }) 91 | cmp.setup.cmdline('@', { 92 | mapping = { 93 | [""] = cmp.mapping(cmp.mapping.select_next_item(), { 'c' }), 94 | [""] = cmp.mapping(cmp.mapping.select_prev_item(), { 'c' }), 95 | [""] = cmp.mapping(cmp.mapping.complete(), { 'c' }), 96 | [""] = cmp.mapping(cmp.mapping.complete(), { 'c' }), 97 | }, 98 | sources = { { name = "path" } } 99 | }) 100 | 101 | -- Source for words in custom dictionary 102 | local dict = { 103 | ["*"] = { os.getenv("HOME").."/.config/nvim/en.dict" }, 104 | } 105 | require("cmp_dictionary").setup({ 106 | paths = dict["*"], 107 | exact_length = 2, 108 | -- ignore the case of the first character in dictionary 109 | first_case_insensitive = true, 110 | }) 111 | -------------------------------------------------------------------------------- /desktop/.config/waybar/config_base: -------------------------------------------------------------------------------- 1 | { 2 | "layer": "top", 3 | "position": "bottom", 4 | 5 | // ################################################## 6 | "modules-left": ["tray", "bluetooth", "network", "custom/vpn", "custom/info_tmux", "custom/info_ssh", "custom/scratchpad-indicator", "custom/info_acrhlinux", "custom/systemd_failed", "custom/detect_xwayland", "custom/info-snapshot"], 7 | "tray": { 8 | "icon-size": 17, 9 | "spacing": 10 10 | }, 11 | "bluetooth": { 12 | "format-disabled": "", 13 | "format-connected": "({num_connections})", 14 | "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", 15 | "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", 16 | "on-click": "blueman-manager" 17 | }, 18 | "network": { 19 | "format": "{ifname}", 20 | "interval": 1, 21 | "format-wifi": "󰖩", 22 | "format-ethernet": "󰈀", 23 | "format-disconnected": "", 24 | "tooltip-format-wifi": " {essid}\n\nSignal strength: {signalStrength}%\nFrequency: {frequency}\nIP: {ipaddr}/{cidr}\n {bandwidthDownBytes}  {bandwidthUpBytes}", 25 | "tooltip-format-ethernet": " {ifname}\n\nIP: {ipaddr}/{cidr}\n {bandwidthDownBytes}  {bandwidthUpBytes}", 26 | "tooltip-format-disconnected": "Disconnected", 27 | "max-length": 50 28 | }, 29 | "custom/vpn": { 30 | "exec": "~/.config/waybar/info-vpn.sh", 31 | "interval": 1 32 | }, 33 | "custom/info_tmux": { 34 | "exec": "~/.config/waybar/info-tmux-sessions.sh", 35 | "on-click": "alacritty --command $SHELL --interactive -c 'tmux attach-session' & disown", 36 | "interval": 1 37 | }, 38 | "custom/info_ssh": { 39 | "exec": "~/.config/waybar/info-ssh-sessions.sh", 40 | "interval": 1 41 | }, 42 | "custom/scratchpad-indicator": { 43 | "interval": 1, 44 | "exec": "~/.config/waybar/scratchpad_is_empty.sh", 45 | "format": " ({})" 46 | }, 47 | "custom/info_acrhlinux": { 48 | "exec": "~/.config/waybar/updates-arch.sh", 49 | "on-click": "alacritty --command $SHELL --interactive -c 'my-tmux-session-create-run-cmd my_system_update.sh'", 50 | "interval": 60 51 | }, 52 | "custom/systemd_failed": { 53 | "exec": "~/.config/waybar/systemd_show_failed.sh", 54 | "interval": 1 55 | }, 56 | "custom/detect_xwayland": { 57 | "exec": "~/.config/waybar/detect_xwayland.sh", 58 | "interval": 1 59 | }, 60 | "custom/info-snapshot": { 61 | "exec": "~/.config/waybar/info-snapshot.sh", 62 | "on-click": "alacritty --command $SHELL --interactive -c 'my-tmux-session-create-run-cmd my_snapshot.sh'", 63 | "interval": 3 64 | }, 65 | // ################################################## 66 | 67 | // ################################################## 68 | "pulseaudio": { 69 | "format": "{icon} {volume}%", 70 | "format-bluetooth": "{icon} {volume}%", 71 | "format-muted": "󰝟 ", 72 | "format-icons": { 73 | "headphone": "", 74 | "hands-free": "󰋋", 75 | "headset": "󰋎", 76 | "phone": "", 77 | "portable": "", 78 | "car": "", 79 | "default": ["", ""] 80 | }, 81 | "scroll-step": 1, 82 | "smooth-scrolling-threshold": 0.3, 83 | "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", 84 | "on-click-right": "pactl set-sink-mute @DEFAULT_SINK@ toggle", 85 | "ignored-sinks": ["Easy Effects Sink"] 86 | }, 87 | "clock": { 88 | "format-alt": "{:%a, %d. %b %H:%M}", 89 | "on-click-right": "gnome-calendar" 90 | } 91 | // ################################################## 92 | } 93 | 94 | // # vim: ft=jsonc 95 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function check_prog() { 4 | for prg in "$@" 5 | do 6 | if ! hash "$prg" > /dev/null 2>&1; then 7 | echo "Command not found: $prg. Aborting..." 8 | exit 1 9 | fi 10 | done 11 | } 12 | 13 | term_configs=(zsh nnn nvim tmux) 14 | desktop_configs=(desktop) 15 | 16 | function install_term() { 17 | echo -e "\n\n======================================== Linking cli programs dotfiles ========================================\n" 18 | for e in "${term_configs[@]}"; do 19 | stow --verbose=2 --target "$HOME" "$e"|| { echo -e "\n\nError: stow terminal failed" >&2; exit 1; } 20 | done 21 | 22 | echo -e "\n\n======================================== Installing neovim plugins ========================================\n" 23 | nvim --headless -c "PlugInstall --sync" +qall 24 | 25 | echo -e "\n\n======================================== Installing tmux plugins ========================================\n" 26 | ./tmux/.config/tmux/plugins/tpm/bin/install_plugins 27 | 28 | echo -e "\n\n======================================== Installing zsh plugins ========================================\n" 29 | zsh -ic "fast-theme XDG:overlay" 30 | } 31 | 32 | function install_desktop() { 33 | echo -e "\n\n======================================== Linking desktop programs dotfiles ========================================\n" 34 | for e in "${desktop_configs[@]}"; do 35 | stow --verbose=2 --target "$HOME" "$e" || { echo -e "\n\nError: stow desktop failed" >&2; exit 1; } 36 | done 37 | } 38 | 39 | function update() { 40 | local -a submodules_paths 41 | local is_init=true 42 | cd "$(dirname "$0")" || { echo "cd failure" >&2; exit 1; } 43 | IFS=$'\n' read -r -d '' -a submodules_paths < <( git config --file .gitmodules --path --get-regexp 'submodule.*.path$' | cut -d " " -f 2 ) 44 | for i in "${submodules_paths[@]}" 45 | do 46 | if ! ls "$i"/.git >/dev/null 2>&1 ; then 47 | echo >&2 "$i module not initialized." 48 | is_init=false 49 | fi 50 | done 51 | if [ "$is_init" = true ]; then 52 | if [ -f "$HOME/.config/nvim/init.vim" ]; then 53 | echo -e "\n\nvim plugins:\n" 54 | nvim --headless -c "PlugUpdate --sync" +qall 55 | fi 56 | if [ -f "$HOME/.config/tmux/tmux.conf" ]; then 57 | echo -e "\n\ntmux plugins:\n" 58 | ./tmux/.config/tmux/plugins/tpm/bin/update_plugins all 59 | fi 60 | if [ -f "$HOME/.zshrc" ]; then 61 | echo -e "\n\nzsh plugins:\n" 62 | zsh -i -c "zinit update --parallel | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g'" 63 | zsh -i -c "zinit self-update | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g'" 64 | fi 65 | echo -e "\n\nVim updated. Do not forget:\n1) ':Mason' -> 'Shift+U' to update outdated LSPs\n2) my_vim_check_plugins.sh" 66 | else 67 | echo "Initializing repo submodules..." 68 | git submodule update --checkout --init --jobs "$(nproc)" --depth 1 69 | fi 70 | } 71 | 72 | function clear() { 73 | for e in "${term_configs[@]}"; do 74 | stow --verbose=2 -D --target "$HOME" "$e" 75 | done 76 | for e in "${desktop_configs[@]}"; do 77 | stow --verbose=2 -D --target "$HOME" "$e" 78 | done 79 | } 80 | 81 | function check_health() { 82 | printf "Lines of colors should be continuous:\n" 83 | curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash 84 | zsh -i -c "echo 123 | my-yank-to-clipboard " 85 | } 86 | 87 | usage=" 88 | $(basename "$0") [OPTION] 89 | 90 | Script to install dotfiles 91 | 92 | OPTION: 93 | -t | --term 94 | link dotfiles only for programs that are available through terminal interface 95 | install plugins with (nvim, tmux, zsh) plugin manager 96 | 97 | -d | --desktop 98 | link dotfiles only for desktop programs 99 | 100 | -u | --update 101 | update: 102 | nvim plugins 103 | tmux plugins 104 | zsh plugins 105 | or initialize git submodules if they are not initialized already 106 | 107 | -c | --clear 108 | unlink configuration files from \$HOME 109 | 110 | --checkhealth 111 | check whether everything set up right 112 | " 113 | 114 | CLI=1 115 | DESK=1 116 | while (( $# )); do 117 | case "$1" in 118 | -t|--term) 119 | DESK=0 120 | shift 121 | ;; 122 | -d|--desktop) 123 | CLI=0 124 | shift 125 | ;; 126 | -h|--help) 127 | echo "$usage" 128 | exit 129 | ;; 130 | -u|--update) 131 | update 132 | exit 133 | ;; 134 | --checkhealth) 135 | check_health 136 | exit 137 | ;; 138 | -c|--clear) 139 | clear 140 | exit 141 | ;; 142 | -*) 143 | echo "Error: Unsupported flag $1" >&2 144 | exit 1 145 | ;; 146 | esac 147 | done 148 | 149 | if [[ $CLI -eq 0 && $DESK -eq 0 ]] 150 | then 151 | echo "Error: specify --term or --desktop flags" >&2 152 | exit 1 153 | fi 154 | 155 | check_prog stow curl zsh nvim tmux 156 | 157 | if [[ $CLI -ne 0 ]] 158 | then 159 | install_term 160 | fi 161 | if [[ $DESK -ne 0 ]] 162 | then 163 | install_desktop 164 | fi 165 | -------------------------------------------------------------------------------- /zsh/.zsh/aliases/git.zsh: -------------------------------------------------------------------------------- 1 | alias gst='git status' 2 | # clone 3 | alias gcl='git clone --recurse-submodules --jobs $(nproc)' 4 | alias gcls='git clone --depth 1' 5 | # add/stage 6 | alias ga='forgit::add' 7 | alias gaa='git add --all' 8 | alias guna='forgit::reset::head' 9 | alias gat='git add -u' # only add already tracked modified files 10 | # diff 11 | alias gd='forgit::diff' 12 | alias gds='forgit::diff --staged' 13 | alias gdl='forgit::diff HEAD~1 HEAD' 14 | # stash changes 15 | alias gstp='forgit::stash::push' 16 | alias gsto='git stash pop' 17 | alias gstls='git stash list' 18 | alias gstf='forgit::stash::show' 19 | alias gstrm='git stash drop' 20 | # commit 21 | alias gc='git commit -v && git config user.name && git config user.email' 22 | alias gcm='git commit -m ""' 23 | alias gac='git add --all && git commit -v; git config user.name; git config user.email' 24 | alias gacp='git add --all && git commit -v; git config user.name; git config user.email; git push' 25 | alias gacm='git add --all && git commit -m ""' 26 | alias gcca='git commit -v --amend --no-edit --author="$(git config user.name) <$(git config user.email)>"' 27 | alias gccmsg='git commit -v --amend' 28 | alias gcrice="git add --all && git commit -m 'ricing...'" 29 | alias gsq='my-git-commit-and-squash-into-prev' 30 | alias gasq='git add --all && my-git-commit-and-squash-into-prev' 31 | # checkout 32 | alias gco='git checkout' 33 | alias gcb='git checkout -b' 34 | alias gb='forgit::checkout::branch' 35 | alias gctf='forgit::checkout::tag' 36 | alias gccf='forgit::checkout::commit' 37 | # branches 38 | alias gba='my-git-create-branch-remote ()' 39 | alias gbls="git branch --sort=committerdate --format '%(HEAD) %(color:yellow)%(refname:short)%(color:reset) -> %(color:cyan)%(upstream:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) => \"%(contents:subject)\" (%(color:green)%(committerdate:relative)%(color:reset))'" 40 | alias gblsr="git branch --remotes --sort=committerdate --format '%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) => \"%(contents:subject)\" (%(color:green)%(committerdate:relative)%(color:reset))'" 41 | alias gbrm='forgit::branch::delete' 42 | alias gbrmr='my-git-delete-branch-remote' 43 | alias gbrn='git branch -m ' 44 | alias gbd='my-git-main-branch-diff' 45 | alias gbmv='git branch --force []' 46 | alias gbmvcp='my-git-move-on-current-cherrypick-last ' 47 | # history 48 | alias glg='forgit::log' 49 | alias glgfull='git log --graph --decorate --format=full --pretty=fuller' 50 | alias glgol='git-foresta --style=15 2>&1 | less --use-color -r' 51 | alias glgb='git log --graph --decorate --pretty=oneline --abbrev-commit --all' 52 | alias glgfunc='git log -L:":"' 53 | alias gblm='forgit::blame' 54 | # cherry-pick 55 | alias gcp='forgit::cherry::pick ' 56 | alias gcpa='git cherry-pick --abort' 57 | alias gcpc='git cherry-pick --continue' 58 | # rebase 59 | alias grb='git rebase ' 60 | alias grbi='forgit::rebase' 61 | alias grba='git rebase --abort' 62 | alias grbc='git rebase --continue' 63 | # merge 64 | alias gm='git merge' 65 | alias gma='git merge --abort' 66 | # submodules 67 | alias gsub='git submodule init; git submodule update' 68 | alias gsu='git submodule update --checkout --init --jobs "$(nproc)" --depth 1' 69 | alias gsa='git submodule add -b ' 70 | alias gsrm='git rm ' 71 | # search repo 72 | alias glggrep='my-git-log-grep-commit-messages ' 73 | alias ggrep='my-git-grep ' 74 | # repository config 75 | alias gcfg="my-git-edit-config \"$(git config user.name)\" \"$(git config user.email)\"" 76 | alias gia='forgit::ignore >> .gitignore' 77 | alias gignore='git update-index --assume-unchanged' 78 | alias gunignore='git update-index --no-assume-unchanged' 79 | alias gkeep='echo >> .gitkeep' 80 | alias gignorels='git ls-files --others --i --exclude-standard' # list ignored files 81 | # git objects 82 | alias gso='git show' 83 | # tags 84 | alias gtls='git tag | sort -V' 85 | # revert changes 86 | alias gunmodify='git checkout --' 87 | alias grh='git reset --hard' 88 | alias gclean='forgit::clean' 89 | alias gundo='git reflog' 90 | alias grv='git revert' # works with reflog 91 | alias grvc='forgit::revert::commit' 92 | # remote 93 | alias grup='git remote update' 94 | alias grls='git remote -v' 95 | alias grrm='git remote remove' 96 | alias gra='my-add-git-remote ' 97 | # push 98 | alias gp='git push' 99 | alias gpf='git push --force-with-lease' 100 | alias gpu='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)' # set branches remote to 'origin' and push branch 101 | # pull 102 | alias gl='git pull' 103 | alias glr='git pull --rebase' 104 | alias gla='my-git-checkout-all-branches' 105 | alias gf='git fetch' 106 | alias gprune='git fetch origin --prune' 107 | -------------------------------------------------------------------------------- /desktop/.config/rofi/desktop_apps.rasi: -------------------------------------------------------------------------------- 1 | /*****----- Configuration -----*****/ 2 | configuration { 3 | modi: "drun"; 4 | show-icons: true; 5 | display-drun: ""; 6 | drun-display-format: "{name}"; 7 | } 8 | 9 | /*****----- Global Properties -----*****/ 10 | * { 11 | background: #141b1eFF; 12 | background-alt: #232a2dFF; 13 | foreground: #dadadaFF; 14 | selected: #6cbfbfff; 15 | active: #67b0e8FF; 16 | urgent: #E06C75FF; 17 | } 18 | * { 19 | font: "NotoSans Nerd Font 16"; 20 | } 21 | * { 22 | bgcolor: #141b1e95; 23 | } 24 | /*****----- Main Window -----*****/ 25 | window { 26 | transparency: "real"; 27 | location: center; 28 | anchor: center; 29 | fullscreen: true; 30 | width: 1920px; 31 | height: 1080px; 32 | x-offset: 0px; 33 | y-offset: 0px; 34 | 35 | enabled: true; 36 | margin: 0px; 37 | padding: 0px; 38 | border: 0px solid; 39 | border-radius: 0px; 40 | border-color: @selected; 41 | background-color: @bgcolor; 42 | cursor: "default"; 43 | } 44 | 45 | /*****----- Main Box -----*****/ 46 | mainbox { 47 | enabled: true; 48 | spacing: 100px; 49 | margin: 0px; 50 | padding: 100px 225px; 51 | border: 0px solid; 52 | border-radius: 0px 0px 0px 0px; 53 | border-color: @selected; 54 | background-color: @bgcolor; 55 | children: [ "inputbar", "listview" ]; 56 | } 57 | 58 | /*****----- Inputbar -----*****/ 59 | inputbar { 60 | enabled: true; 61 | spacing: 10px; 62 | margin: 0% 28%; 63 | padding: 10px; 64 | border: 1px solid; 65 | border-radius: 6px; 66 | border-color: white / 25%; 67 | background-color: white / 5%; 68 | text-color: @foreground; 69 | children: [ "prompt", "entry" ]; 70 | } 71 | 72 | prompt { 73 | enabled: true; 74 | background-color: transparent; 75 | text-color: inherit; 76 | } 77 | textbox-prompt-colon { 78 | enabled: true; 79 | expand: false; 80 | str: "::"; 81 | background-color: transparent; 82 | text-color: inherit; 83 | } 84 | entry { 85 | enabled: true; 86 | background-color: transparent; 87 | text-color: inherit; 88 | cursor: text; 89 | placeholder: "Search"; 90 | placeholder-color: inherit; 91 | } 92 | 93 | /*****----- Listview -----*****/ 94 | listview { 95 | enabled: true; 96 | columns: 7; 97 | lines: 4; 98 | cycle: true; 99 | dynamic: true; 100 | scrollbar: false; 101 | layout: vertical; 102 | reverse: false; 103 | fixed-height: true; 104 | fixed-columns: true; 105 | 106 | spacing: 0px; 107 | margin: 0px; 108 | padding: 0px; 109 | border: 0px solid; 110 | border-radius: 0px; 111 | border-color: @selected; 112 | background-color: transparent; 113 | text-color: @foreground; 114 | cursor: "default"; 115 | } 116 | scrollbar { 117 | handle-width: 5px ; 118 | handle-color: @selected; 119 | border-radius: 0px; 120 | background-color: @background-alt; 121 | } 122 | 123 | /*****----- Elements -----*****/ 124 | element { 125 | enabled: true; 126 | spacing: 15px; 127 | margin: 0px; 128 | padding: 35px 10px; 129 | border: 0px solid; 130 | border-radius: 15px; 131 | border-color: @selected; 132 | background-color: transparent; 133 | text-color: @foreground; 134 | orientation: vertical; 135 | cursor: pointer; 136 | } 137 | element normal.normal { 138 | background-color: transparent; 139 | text-color: @foreground; 140 | } 141 | element selected.normal { 142 | background-color: white / 25%; 143 | text-color: @foreground; 144 | } 145 | element-icon { 146 | background-color: transparent; 147 | text-color: inherit; 148 | size: 72px; 149 | cursor: inherit; 150 | } 151 | element-text { 152 | background-color: transparent; 153 | text-color: inherit; 154 | highlight: inherit; 155 | cursor: inherit; 156 | vertical-align: 0.5; 157 | horizontal-align: 0.5; 158 | } 159 | 160 | /*****----- Message -----*****/ 161 | error-message { 162 | padding: 100px; 163 | border: 0px solid; 164 | border-radius: 0px; 165 | border-color: @selected; 166 | background-color: black / 10%; 167 | text-color: @foreground; 168 | } 169 | textbox { 170 | background-color: transparent; 171 | text-color: @foreground; 172 | vertical-align: 0.5; 173 | horizontal-align: 0.0; 174 | highlight: none; 175 | } 176 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/spec.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin 2 | " Language: spec file 3 | " Maintainer: Guillaume Rousse 4 | " URL: http://www.zarb.org/~guillomovitch/linux/spec.vim 5 | " Version: $Id: spec.vim 181 2005-07-21 18:37:45Z guillaume $ 6 | 7 | if exists("b:did_ftplugin") 8 | finish 9 | endif 10 | let b:did_ftplugin = 1 11 | 12 | " Add mappings, unless user doesn't want 13 | if !exists("no_plugin_maps") && !exists("no_spec_maps") 14 | if !hasmapto("AddChangelogEntry") 15 | map Fl AddChangelogEntry 16 | endif 17 | if !hasmapto("AddChangelogItem") 18 | map FL AddChangelogItem 19 | endif 20 | if !hasmapto("ExpandMacro") 21 | map Fm ExpandMacro 22 | endif 23 | noremap