Merge branch 'master' of https://git.lyte.dev/lytedev/dotfiles
This commit is contained in:
commit
08f2b769a5
29 changed files with 2080 additions and 348 deletions
9
apps/de/desktop/neovimterm.desktop
Executable file
9
apps/de/desktop/neovimterm.desktop
Executable file
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=Neovim-Term
|
||||
Comment=Edit files using Neovim in the Kitty terminal emulator
|
||||
Path=/usr/bin
|
||||
Exec=kitty nvim %f
|
||||
Icon=kitty
|
||||
Terminal=true
|
|
@ -8,6 +8,11 @@ set $dfpbin $HOME/.config/lytedev-dotfiles/bin
|
|||
set $mod Mod4
|
||||
set $default_gap 0
|
||||
|
||||
exec initctl set-env --global SWAYSOCK="$SWAYSOCK"
|
||||
exec initctl set-env --global I3SOCK="$I3SOCK"
|
||||
exec initctl set-env --global WAYLAND_DISPLAY="$WAYLAND_DISPLAY"
|
||||
exec initctl emit sway-session
|
||||
|
||||
focus_wrapping no
|
||||
gaps inner $default_gap
|
||||
smart_borders on|no_gaps
|
||||
|
|
0
apps/de/sway/mimeapps.list
Normal file
0
apps/de/sway/mimeapps.list
Normal file
|
@ -24,19 +24,26 @@
|
|||
prompt = false
|
||||
|
||||
[alias]
|
||||
d = difftool
|
||||
s = status
|
||||
co = checkout
|
||||
mm = merge master
|
||||
rim = rebase -i master
|
||||
a = add
|
||||
A = add -A
|
||||
ac = commit -a
|
||||
b = rev-parse --symbolic-full-name HEAD
|
||||
p = push
|
||||
pl = pull
|
||||
pf = push --force-with-lease
|
||||
a = add -A
|
||||
cnv = commit --no-verify
|
||||
canv = commit --no-verify
|
||||
c = commit
|
||||
cm = commit -m
|
||||
cnv = commit --no-verify
|
||||
co = checkout
|
||||
d = diff
|
||||
ds = diff --staged
|
||||
dt = difftool
|
||||
l = log --pretty=format:'%h %ad%x09%an%x09%s' --date=short
|
||||
ls = ls-files
|
||||
mm = merge master
|
||||
p = push
|
||||
pf = push --force-with-lease
|
||||
pl = pull
|
||||
rim = rebase -i master
|
||||
s = status
|
||||
sur = submodule update --remote
|
||||
|
||||
[merge]
|
||||
tool = nvimdiff
|
||||
|
|
2
apps/neovim/.gitignore
vendored
2
apps/neovim/.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
!/.gitignore
|
||||
!/init.vim
|
||||
!/lsp.lua
|
||||
!/nvim_lsp.lua
|
||||
|
|
|
@ -9,6 +9,7 @@ if empty(glob($vimdir.'/autoload/plug.vim'))
|
|||
autocmd VimEnter * PlugInstall --sync | source $vimdir.'init.vim'
|
||||
endif
|
||||
|
||||
let g:completion_enable_auto_popup = 0
|
||||
let g:indent_guide_auto_colors = 1
|
||||
let g:indent_guides_enable_on_vim_startup = 1
|
||||
let g:jsonnet_fmt_on_save = 0
|
||||
|
@ -18,11 +19,13 @@ call plug#begin($vimdir.'/plugged')
|
|||
Plug 'junegunn/vim-plug' " plugin manager should manage itself
|
||||
Plug 'sheerun/vim-polyglot' " handles language-specific configuration
|
||||
Plug 'neovim/nvim-lspconfig' " deeper language integration via language servers
|
||||
Plug 'nvim-lua/completion-nvim' " language server completion
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim' " helpers for using fzf in vim
|
||||
Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings
|
||||
Plug 'tpope/vim-sleuth' " try and detect indent method
|
||||
Plug 'vim-scripts/LargeFile' " gracefully handle very large files
|
||||
Plug 'vim-scripts/restore_view.vim' " persistent buffer views
|
||||
Plug 'nathanaelkane/vim-indent-guides' " indentation guides
|
||||
Plug 'christoomey/vim-tmux-navigator' " allow window navigation to play nicely with tmux
|
||||
Plug 'tpope/vim-commentary' " toggle comments in code easily
|
||||
|
@ -33,8 +36,13 @@ call plug#begin($vimdir.'/plugged')
|
|||
Plug 'wellle/targets.vim' " adds some more handy text objects
|
||||
Plug 'tpope/vim-obsession' " even better session handling
|
||||
Plug 'dhruvasagar/vim-prosession' " even better session handling
|
||||
Plug 'dhruvasagar/vim-prosession' " even better session handling
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
call plug#end()
|
||||
|
||||
" luafile $vimdir/lsp.lua
|
||||
" autocmd BufEnter * lua require('completion').on_attach()
|
||||
|
||||
filetype on
|
||||
filetype indent on
|
||||
filetype plugin on
|
||||
|
@ -53,14 +61,14 @@ set splitright splitbelow
|
|||
set noerrorbells visualbell t_vb=
|
||||
set nobackup nowritebackup noswapfile
|
||||
set timeout ttimeoutlen=100 timeoutlen=150
|
||||
set hidden shortmess+=Ia
|
||||
set hidden shortmess+=Iac
|
||||
set history=1000
|
||||
set undofile undodir=$vimdir/undo undolevels=1000 undoreload=10000
|
||||
set spellfile=$vimdir/spell/en.utf-8.add
|
||||
set ignorecase smartcase incsearch wrapscan hlsearch
|
||||
set foldmethod=syntax foldlevel=99 foldnestmax=10 foldlevelstart=99 " TODO: get good at folding
|
||||
set noautowrite autochdir autoread
|
||||
set nomodeline noshowmode noshowcmd laststatus=0 " TODO: custom modeline and buffer list?
|
||||
set nomodeline noshowmode noshowcmd laststatus=2 noruler
|
||||
set clipboard+=unnamedplus
|
||||
set t_Co=256
|
||||
let &fcs = 'eob: '
|
||||
|
@ -73,8 +81,11 @@ hi LineNr ctermbg=none ctermfg=8
|
|||
hi CursorLineNr ctermbg=18 ctermfg=gray
|
||||
hi IndentGuidesEven ctermbg=18
|
||||
hi Normal ctermbg=NONE
|
||||
hi ColorColumn ctermbg=15 ctermfg=0
|
||||
hi TooLongColorColumn ctermbg=1 ctermfg=0
|
||||
hi ColorColumn ctermbg=18
|
||||
hi TooLongColorColumn ctermbg=18 ctermfg=1
|
||||
hi ActiveBuffer ctermbg=4 ctermfg=0
|
||||
hi StatusLine ctermbg=18 ctermfg=7
|
||||
hi StatusLineNC ctermbg=18 ctermfg=7
|
||||
|
||||
call matchadd('ColorColumn', '\%81v', 100)
|
||||
call matchadd('TooLongColorColumn', '\%121v', 200)
|
||||
|
@ -119,23 +130,56 @@ cnoremap <c-p> <up>
|
|||
xnoremap < <gv
|
||||
xnoremap > >gv
|
||||
|
||||
" TODO: learn about the wildmenu `q:`
|
||||
|
||||
let mapleader = "\<Space>"
|
||||
nnoremap <silent> <leader>r :source $vimdir/init.vim<CR>:echo 'Reloaded init.vim'<CR>
|
||||
nnoremap <silent> <leader>w :bd<CR>
|
||||
nnoremap <leader>h :b#<CR>
|
||||
nnoremap <leader>k :bnext<CR>
|
||||
nnoremap <leader>j :bprevious<CR>
|
||||
nnoremap <silent> <leader>h :b#<CR>
|
||||
nnoremap <silent> <leader>k :bnext<CR>
|
||||
nnoremap <silent> <leader>j :bprevious<CR>
|
||||
nnoremap <leader>/ :let @/ = ""<CR>:<BACKSPACE>
|
||||
|
||||
nnoremap <leader>t :split<CR>:term<CR>:resize 24<CR>:startinsert<CR>
|
||||
tnoremap <C-w> <C-\><C-n>:q!<CR>
|
||||
|
||||
au BufReadPost *
|
||||
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
|
||||
\ | exe "normal! g'\""
|
||||
\ | endif
|
||||
au FileType fzf tnoremap <Esc> <C-c><C-c>
|
||||
function! NeatFoldText()
|
||||
" TODO: WIP
|
||||
let lines_count = v:foldend - v:foldstart + 1
|
||||
let foldchar = matchstr(&fillchars, 'fold:\zs.')
|
||||
let foldtextstart = strpart('^' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
|
||||
let foldtextend = printf("%s %".(winwidth(0)-20)."dL", foldtextstart, getline(v:foldstart), lines_count)
|
||||
let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
|
||||
return printf("%s%d", substitute(getline(v:foldstart), "^.", ">"), lines_count)
|
||||
endfunction
|
||||
set foldtext=NeatFoldText()
|
||||
|
||||
luafile $vimdir/lsp.lua
|
||||
" TODO: only update this portion when needed?
|
||||
function! StatusLineBufferByNum(_, bufnum)
|
||||
let l:prefix = '%#InactiveBuffer#'
|
||||
let l:suffix = '%* '
|
||||
let l:bufinfo = getbufinfo(a:bufnum)[0]
|
||||
if l:bufinfo.listed == 0
|
||||
return '%*'
|
||||
end
|
||||
if l:bufinfo['hidden'] == 0 && index(l:bufinfo['windows'], g:statusline_winid) >= 0
|
||||
let l:prefix = '%#ActiveBuffer# '
|
||||
let l:suffix = ' %* '
|
||||
endif
|
||||
return l:prefix . fnamemodify(bufname(a:bufnum), ':t') . l:suffix
|
||||
endfunction
|
||||
|
||||
" TODO: learn about the wildmenu `q:`
|
||||
au BufReadPost * | if stridx(&ft, 'commit') >= 0 | exe "startinsert!" | endif
|
||||
|
||||
function! StatusLineBuffers()
|
||||
return join(map(nvim_list_bufs(), function("StatusLineBufferByNum")), '')
|
||||
endfunction
|
||||
|
||||
function! StatusLine()
|
||||
return StatusLineBuffers() . '%*%=%c,%l/%L (%p%%)'
|
||||
endfunction
|
||||
|
||||
" set laststatus=0 showtabline tabline=%!StatusLine()
|
||||
set statusline=%!StatusLine()
|
||||
|
||||
imap <silent> <c-n> <Plug>(completion_trigger)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
local homedir = os.getenv('HOME')
|
||||
require 'nvim_lsp'.elixirls.setup{
|
||||
cmd = { homedir..'/../code/open-source/elixir-ls/release/language_server.sh' };
|
||||
}
|
6
apps/neovim/nvim_lsp.lua
Normal file
6
apps/neovim/nvim_lsp.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- local completion = require('completion')
|
||||
local lsp = require('lspconfig')
|
||||
|
||||
lsp.elixirls.setup{}
|
||||
lsp.sumneko_lua.setup{}
|
||||
lsp.vimls.setup{}
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# ls aliases
|
||||
# TODO: exa?
|
||||
alias lk 'ls -lSr' # order by filesize reversed
|
||||
alias lt 'ls -ltr' # order by file modified time
|
||||
alias lc 'ls -ltcr' # order by filectime
|
||||
|
@ -10,9 +10,10 @@ alias l 'ls -h --color --group-directories-first' # same as above
|
|||
alias ll 'ls -lv --group-directories-first' # non-flat view
|
||||
alias la 'll -A' # show all
|
||||
|
||||
# other file aliases
|
||||
# TODO: cat > bat
|
||||
alias tree 'tree -Csuh'
|
||||
alias f fzf
|
||||
alias t "tmux"
|
||||
alias rcp 'rsync -r -ah --progress'
|
||||
|
||||
alias vltl "$EDITOR (ltl)"
|
||||
|
@ -57,47 +58,13 @@ alias ....... "d ../../../../../.."
|
|||
alias ........ "d ../../../../../../.."
|
||||
alias ......... "d ../../../../../../../.."
|
||||
|
||||
# tmux aliases
|
||||
alias tmnew "tmux new -s"
|
||||
alias tmls "tmux list-sessions | rg --color never -o '^(.*?):.*?\(.*?\)(.*)\$' -r '\$1\$2'"
|
||||
alias tmatt "tmux attach -t"
|
||||
alias tms "tmatt (tmls | fzf | field 1)"
|
||||
function tmux-attach-or-new
|
||||
tmux attach -t $argv || tmux new -s $argv
|
||||
end
|
||||
alias tu "tmux-attach-or-new utils"
|
||||
alias tmon "tmux-attach-or-new monitoring"
|
||||
alias tcom "tmux-attach-or-new comms"
|
||||
alias tm "tmux-attach-or-new music"
|
||||
alias tdf "tmux attach -t dotfiles || tmux new -s dotfiles -c $DOTFILES_PATH"
|
||||
alias tn "tmux attach -t notes || tmux new -s notes -c $NOTES_PATH"
|
||||
|
||||
# git aliases
|
||||
# TODO: make these git aliases in the gitconfig?
|
||||
function g
|
||||
function g -w git
|
||||
if scount $argv
|
||||
git $argv
|
||||
else
|
||||
git status
|
||||
end
|
||||
end
|
||||
alias gs "git status"
|
||||
alias gd "git diff"
|
||||
alias gds "gd --staged"
|
||||
# alias gdv "git dv" # TODO: what is this?
|
||||
alias gpl "git pull"
|
||||
alias ga "git add"
|
||||
alias gcm "git commit -m"
|
||||
alias gco "git checkout"
|
||||
alias gp "git push"
|
||||
alias gpa "git push --all && git push --tags"
|
||||
alias gpt "git push && git push --tags"
|
||||
alias gpf "git push --force-with-lease"
|
||||
alias gac "git add -A && git commit"
|
||||
alias gacnv "git add -A && git commit --no-verify"
|
||||
alias gsur "git submodule update --remote"
|
||||
alias glf "git ls-files"
|
||||
alias gl "git log --pretty=format:\"%h %ad%x09%an%x09%s\" --date=short"
|
||||
|
||||
# docker aliases
|
||||
alias dlf "docker logs --tail=500 -f"
|
||||
|
@ -111,11 +78,11 @@ function pp
|
|||
end
|
||||
end
|
||||
alias p "ping 8.8.8.8"
|
||||
alias C "clear && clear"
|
||||
alias r "ranger"
|
||||
alias C "clear && clear" # TODO: this should clear a tmux pane's scrollback/logs
|
||||
alias r "nnn"
|
||||
alias sctl "sudo systemctl"
|
||||
alias sctlu "systemctl --user"
|
||||
alias bt "sudo bluetoothctl"
|
||||
alias bt "sudo bluetoothctl" # TODO: a vi-like tui for bluetooth would be great
|
||||
alias btctl "bt"
|
||||
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish"
|
||||
alias sc "sc-im"
|
||||
|
@ -139,6 +106,10 @@ function rgl
|
|||
rg --color always $argv | less -r
|
||||
end
|
||||
|
||||
# kubernetes aliases
|
||||
alias k "kubectl"
|
||||
alias kg "k get"
|
||||
|
||||
# grep aliases
|
||||
alias rg "rg --text"
|
||||
alias grep "rg"
|
||||
|
|
7
apps/shell/fish/completions/fisher.fish
Normal file
7
apps/shell/fish/completions/fisher.fish
Normal file
|
@ -0,0 +1,7 @@
|
|||
complete -c fisher -x -l help -d "print usage help"
|
||||
complete -c fisher -x -l version -d "print fisher version"
|
||||
complete -c fisher -x -n "__fish_use_subcommand" -a install -d "install plugins"
|
||||
complete -c fisher -x -n "__fish_use_subcommand" -a update -d "update installed plugins"
|
||||
complete -c fisher -x -n "__fish_use_subcommand" -a remove -d "remove installed plugins"
|
||||
complete -c fisher -x -n "__fish_use_subcommand" -a list -d "list installed plugins matching <regex>"
|
||||
complete -c fisher -x -n "__fish_seen_subcommand_from update remove" -a "(fisher list)"
|
1654
apps/shell/fish/completions/kubectl.fish
Normal file
1654
apps/shell/fish/completions/kubectl.fish
Normal file
File diff suppressed because it is too large
Load diff
|
@ -25,7 +25,7 @@ has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --e
|
|||
|
||||
test -f ~/.fzf/shell/key-bindings.fish && source ~/.fzf/shell/key-bindings.fish
|
||||
|
||||
function fish_greeting; fortune; end
|
||||
function fish_greeting; date; end
|
||||
|
||||
# we assume the user uses "$HOME" to just store their mess of dotfiles and other
|
||||
# nonsense that clutters it up and that they have a preferred starting
|
||||
|
|
2
apps/shell/fish/fish_plugins
Normal file
2
apps/shell/fish/fish_plugins
Normal file
|
@ -0,0 +1,2 @@
|
|||
jorgebucaran/fisher
|
||||
evanlucas/fish-kubectl-completions
|
|
@ -9,9 +9,11 @@ function preprocess_pwd
|
|||
test (pwd) = / && echo "/" && return 1
|
||||
test (pwd) = $NICE_HOME && echo "~" && return 0
|
||||
# with ellipsis
|
||||
#echo "$(<<< "$p" cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{if(length(p[k])>'"$((MAX_PATH_PIECE_CHARS+1))"'){printf "/%.'"$((MAX_PATH_PIECE_CHARS))"'s…",p[k]}else{printf "/%s",p[k]}}}}')"
|
||||
# echo "$(<<< "$p" cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{if(length(p[k])>'"
|
||||
# $((MAX_PATH_PIECE_CHARS+1))"'){printf "/%.'"$((MAX_PATH_PIECE_CHARS))"'s…",p[k]}else{printf "/%s",p[k]}}}}')"
|
||||
# without ellipsis
|
||||
echo (pwd) | cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{printf "/%.'$MAX_PATH_PIECE_CHARS[1]'s",p[k]}}}'
|
||||
echo (pwd) | cut -c2- | \
|
||||
awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{printf "/%.'$MAX_PATH_PIECE_CHARS[1]'s",p[k]}}}'
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
|
@ -29,7 +31,7 @@ function fish_prompt
|
|||
else
|
||||
set_color red
|
||||
end
|
||||
printf "$USER@$hostname"
|
||||
printf %s@%s $USER (echo $hostname | cut -d '.' -f1)
|
||||
end
|
||||
set_color normal
|
||||
printf " "
|
||||
|
|
|
@ -1,90 +1,45 @@
|
|||
# ^s as prefix
|
||||
unbind C-b
|
||||
set -g prefix C-s
|
||||
bind-key s send-prefix
|
||||
|
||||
# reload tmux.conf
|
||||
bind-key T source-file "$HOME/.tmux.conf" \; display-message "source-file done"
|
||||
unbind r
|
||||
bind r source-file "$HOME/.tmux.conf"
|
||||
|
||||
# set -as terminal-overrides ",xterm*:smxx=\E[9m"
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
# sane defaults
|
||||
set -g mouse on
|
||||
|
||||
# honestly not exactly sure?
|
||||
# set -sg escape-time 1
|
||||
set -g escape-time 0
|
||||
|
||||
# show window activity
|
||||
# TODO: this needs to be properly setup - presumably with tmux-session-list
|
||||
setw -g monitor-activity on
|
||||
setw -g visual-bell on
|
||||
setw -g bell-action other
|
||||
|
||||
# common window sizes
|
||||
bind-key W resize-pane -x 100
|
||||
bind-key f resize-pane -x 120
|
||||
bind-key F resize-pane -x 125
|
||||
bind-key 8 resize-pane -x 80
|
||||
bind-key 2 resize-pane -y 20
|
||||
|
||||
# splitting
|
||||
bind-key v split-window -h
|
||||
bind-key b split-window
|
||||
bind-key h split-window
|
||||
|
||||
# show tmux status bar by default with (C-s, H) to toggle it
|
||||
set -g status on
|
||||
set -g history-limit 102400000
|
||||
bind-key T source-file "$HOME/.tmux.conf" \; display-message "Reloaded $HOME/.tmux.conf"
|
||||
bind-key O display-message "#(~/.config/lytedev-dotfiles/bin/tmux-save-buffer #S)"
|
||||
bind-key H set -s status
|
||||
bind-key -n C-l select-pane -R
|
||||
bind-key -n C-k select-pane -U
|
||||
bind-key -n C-j select-pane -D
|
||||
bind-key -n C-h select-pane -L
|
||||
bind s run "tmux split-window -l 12 'sh -c ~/.config/lytedev-dotfiles/bin/tmuxswitcher'"
|
||||
|
||||
# simple session switching
|
||||
bind-key j switch-client -p
|
||||
bind-key h switch-client -p
|
||||
bind-key k switch-client -n
|
||||
bind-key l switch-client -n
|
||||
# bind s run-shell "tmux new-window sh -c "$DOTFILES_PATH/bin/tmuxswitcher""
|
||||
bind s run-shell "tmux new-window \"sh -c ~/.config/lytedev-dotfiles/bin/tmuxswitcher\""
|
||||
bind M-l source-file "$XDG_CONFIG_HOME/tmux/layouts/dev.tmux"
|
||||
|
||||
# reset the working directory of the current session
|
||||
bind-key P attach-session -t . -c "#{pane_current_path}" \; display-message "Reset session dir to #{pane_current_path}"
|
||||
|
||||
# status bar and messages
|
||||
set -g default-terminal "screen-256color"
|
||||
set -g mouse on
|
||||
set -g escape-time 0
|
||||
set -g monitor-activity on
|
||||
set -g visual-bell on
|
||||
set -g bell-action other
|
||||
set -g mode-keys vi
|
||||
set -g history-limit 102400000
|
||||
set -g status on
|
||||
set -g status-position bottom
|
||||
set -g status-bg colour0
|
||||
set -g status-fg colour8
|
||||
set -g status-interval 5
|
||||
set -g status-right-length 80
|
||||
set -g status-right "#[fg=colour4]#W#[fg=default]#[bg=default] #H"
|
||||
set -g status-left-length 200
|
||||
set -g status-left "#[fg=colour7]#(~/.config/lytedev-dotfiles/bin/tmux-session-list #S)"
|
||||
set -g status-left-length 50
|
||||
set -g status-left "#h:#S.#W"
|
||||
set -g status-right-length 280
|
||||
set -g status-right "#(kubeline && printf ' ')#{pane_current_path} #(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")#{pane_current_command}"
|
||||
set -g message-style "fg=colour7 bg=colour18"
|
||||
|
||||
bind-key O display-message "#(~/.config/lytedev-dotfiles/bin/tmux-save-buffer #S)"
|
||||
|
||||
# pane split line colors
|
||||
set -g pane-active-border-style bg=black,fg=blue
|
||||
set -g pane-border-style bg=black,fg=colour18
|
||||
|
||||
# cLocK mOdE Is sUpEr 3LeEt
|
||||
set -g clock-mode-colour colour8
|
||||
|
||||
# windows (which I don't use much...?)
|
||||
# TODO: do I have a use case for windows?
|
||||
setw -g window-status-current-format ""
|
||||
|
||||
# vim copying
|
||||
setw -g mode-keys vi
|
||||
|
||||
# 1-based indexing for key binding simplicity
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
|
||||
# custom predefined layouts
|
||||
bind M-l source-file "$XDG_CONFIG_HOME/tmux/layouts/dev.tmux"
|
||||
set -g window-status-current-format ""
|
||||
|
||||
# present a menu of urls to open from the visible pane
|
||||
# TODO: fzf-ify this
|
||||
|
@ -92,62 +47,11 @@ bind-key u capture-pane \;\
|
|||
save-buffer /tmp/tmux-buffer \;\
|
||||
split-window -l 10 "urlscan /tmp/tmux-buffer"
|
||||
|
||||
# seamlessly handle pane switching in and out of vim panes
|
||||
# see GitHub repos tmux-plugins/vim-tmux-focus-events and christoomey/vim-tmux-navigator
|
||||
is_vim="ps -o state= -o comm= -t \"#{pane_tty}\" \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
||||
bind-key -T copy-mode-vi "C-h" send -X "cancel select-pane -L"
|
||||
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
||||
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
||||
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
||||
# not sure about this binding? possibly switch to previous pane...?
|
||||
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
||||
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel 'wl-copy'
|
||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'; \
|
||||
|
||||
# YANKING
|
||||
# bind-key -T copy-mode-vi "y" send -X copy-selection
|
||||
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel -X 'clip'
|
||||
|
||||
# various control binds
|
||||
bind-key n command-prompt -p "New Session:" "new-session -s '%1'"
|
||||
bind-key K kill-pane
|
||||
bind-key C-S-k kill-session -C
|
||||
|
||||
set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.config/tmux/plugins/"
|
||||
|
||||
# list of plugins
|
||||
set -g @plugin "tmux-plugins/tpm"
|
||||
set -g @plugin "tmux-plugins/tmux-sensible"
|
||||
set -g @plugin "lytedev/tmux-resurrect"
|
||||
set -g @plugin "lytedev/tmux-continuum"
|
||||
|
||||
# prefix+[ for select mode
|
||||
# v for visual mode
|
||||
# yank to clipboard with y
|
||||
# paste with prefix+]
|
||||
set -g @plugin "tmux-plugins/tmux-yank"
|
||||
|
||||
set -g @plugin "tmux-plugins/tmux-copycat"
|
||||
set -g @plugin "tmux-plugins/tmux-sessionist"
|
||||
set -g @plugin "christoomey/vim-tmux-navigator"
|
||||
|
||||
# plugin options
|
||||
|
||||
# enable continuum
|
||||
set -g @continuum-restore "on"
|
||||
|
||||
# let continuum startup on boot
|
||||
# NOTE: disabled this due to it starting up before sway socket is up and then
|
||||
# sway commands do not work from within tmux
|
||||
# TODO: maybe sway (or any wm) can start continuum?
|
||||
# set -g @continuum-boot "on"
|
||||
|
||||
# bindings for tmux-resurrect
|
||||
set -g @resurrect-save "C-v"
|
||||
set -g @resurrect-restore "R"
|
||||
|
||||
# initialize tmux plugin manager
|
||||
run "~/.config/tmux/plugins/tpm/tpm"
|
||||
bind-key C-S-k kill-window
|
||||
|
||||
# attempt at integrating nested tmux sessions nicely
|
||||
# bind -T root F12 \
|
||||
|
@ -162,7 +66,3 @@ run "~/.config/tmux/plugins/tpm/tpm"
|
|||
# set -u key-table \;\
|
||||
# set status on \;\
|
||||
# refresh-client -S
|
||||
|
||||
unbind-key C-p
|
||||
|
||||
set -g @resurrect-hook-pre-restore-pane-processes 'tmux switch-client -n && tmux kill-session -t 0'
|
||||
|
|
|
@ -58,6 +58,7 @@ pv_tags = "notify_private"
|
|||
raw_messages = 256
|
||||
server_buffer = merge_with_core
|
||||
smart_filter = on
|
||||
smart_filter_account = on
|
||||
smart_filter_chghost = on
|
||||
smart_filter_delay = 5
|
||||
smart_filter_join = on
|
||||
|
@ -74,6 +75,7 @@ item_channel_modes = default
|
|||
item_lag_counting = default
|
||||
item_lag_finished = yellow
|
||||
item_nick_modes = default
|
||||
message_account = cyan
|
||||
message_chghost = brown
|
||||
message_join = green
|
||||
message_kick = red
|
||||
|
@ -156,3 +158,132 @@ usermode = ""
|
|||
username = "daniel"
|
||||
|
||||
[server]
|
||||
soupwhale.addresses = "irc.soupwhale.com"
|
||||
soupwhale.proxy
|
||||
soupwhale.ipv6
|
||||
soupwhale.ssl
|
||||
soupwhale.ssl_cert
|
||||
soupwhale.ssl_password
|
||||
soupwhale.ssl_priorities
|
||||
soupwhale.ssl_dhkey_size
|
||||
soupwhale.ssl_fingerprint
|
||||
soupwhale.ssl_verify
|
||||
soupwhale.password
|
||||
soupwhale.capabilities
|
||||
soupwhale.sasl_mechanism
|
||||
soupwhale.sasl_username
|
||||
soupwhale.sasl_password
|
||||
soupwhale.sasl_key
|
||||
soupwhale.sasl_timeout
|
||||
soupwhale.sasl_fail
|
||||
soupwhale.autoconnect
|
||||
soupwhale.autoreconnect
|
||||
soupwhale.autoreconnect_delay
|
||||
soupwhale.nicks
|
||||
soupwhale.nicks_alternate
|
||||
soupwhale.username
|
||||
soupwhale.realname
|
||||
soupwhale.local_hostname
|
||||
soupwhale.usermode
|
||||
soupwhale.command
|
||||
soupwhale.command_delay
|
||||
soupwhale.autojoin
|
||||
soupwhale.autorejoin
|
||||
soupwhale.autorejoin_delay
|
||||
soupwhale.connection_timeout
|
||||
soupwhale.anti_flood_prio_high
|
||||
soupwhale.anti_flood_prio_low
|
||||
soupwhale.away_check
|
||||
soupwhale.away_check_max_nicks
|
||||
soupwhale.msg_kick
|
||||
soupwhale.msg_part
|
||||
soupwhale.msg_quit
|
||||
soupwhale.notify
|
||||
soupwhale.split_msg_max_length
|
||||
soupwhale.charset_message
|
||||
soup.addresses = "irc.soupwhale.com"
|
||||
soup.proxy
|
||||
soup.ipv6
|
||||
soup.ssl
|
||||
soup.ssl_cert
|
||||
soup.ssl_password
|
||||
soup.ssl_priorities
|
||||
soup.ssl_dhkey_size
|
||||
soup.ssl_fingerprint
|
||||
soup.ssl_verify
|
||||
soup.password
|
||||
soup.capabilities
|
||||
soup.sasl_mechanism
|
||||
soup.sasl_username
|
||||
soup.sasl_password
|
||||
soup.sasl_key
|
||||
soup.sasl_timeout
|
||||
soup.sasl_fail
|
||||
soup.autoconnect
|
||||
soup.autoreconnect
|
||||
soup.autoreconnect_delay
|
||||
soup.nicks
|
||||
soup.nicks_alternate
|
||||
soup.username
|
||||
soup.realname
|
||||
soup.local_hostname
|
||||
soup.usermode
|
||||
soup.command
|
||||
soup.command_delay
|
||||
soup.autojoin
|
||||
soup.autorejoin
|
||||
soup.autorejoin_delay
|
||||
soup.connection_timeout
|
||||
soup.anti_flood_prio_high
|
||||
soup.anti_flood_prio_low
|
||||
soup.away_check
|
||||
soup.away_check_max_nicks
|
||||
soup.msg_kick
|
||||
soup.msg_part
|
||||
soup.msg_quit
|
||||
soup.notify
|
||||
soup.split_msg_max_length
|
||||
soup.charset_message
|
||||
freenode.addresses = "irc.freenode.net"
|
||||
freenode.proxy
|
||||
freenode.ipv6
|
||||
freenode.ssl
|
||||
freenode.ssl_cert
|
||||
freenode.ssl_password
|
||||
freenode.ssl_priorities
|
||||
freenode.ssl_dhkey_size
|
||||
freenode.ssl_fingerprint
|
||||
freenode.ssl_verify
|
||||
freenode.password
|
||||
freenode.capabilities
|
||||
freenode.sasl_mechanism
|
||||
freenode.sasl_username
|
||||
freenode.sasl_password
|
||||
freenode.sasl_key
|
||||
freenode.sasl_timeout
|
||||
freenode.sasl_fail
|
||||
freenode.autoconnect
|
||||
freenode.autoreconnect
|
||||
freenode.autoreconnect_delay
|
||||
freenode.nicks
|
||||
freenode.nicks_alternate
|
||||
freenode.username
|
||||
freenode.realname
|
||||
freenode.local_hostname
|
||||
freenode.usermode
|
||||
freenode.command
|
||||
freenode.command_delay
|
||||
freenode.autojoin
|
||||
freenode.autorejoin
|
||||
freenode.autorejoin_delay
|
||||
freenode.connection_timeout
|
||||
freenode.anti_flood_prio_high
|
||||
freenode.anti_flood_prio_low
|
||||
freenode.away_check
|
||||
freenode.away_check_max_nicks
|
||||
freenode.msg_kick
|
||||
freenode.msg_part
|
||||
freenode.msg_quit
|
||||
freenode.notify
|
||||
freenode.split_msg_max_length
|
||||
freenode.charset_message
|
||||
|
|
|
@ -27,12 +27,16 @@ text_selected = white
|
|||
[network]
|
||||
allow_empty_password = off
|
||||
allowed_ips = ""
|
||||
auth_timeout = 60
|
||||
bind_address = ""
|
||||
clients_purge_delay = 0
|
||||
compression_level = 6
|
||||
ipv6 = on
|
||||
max_clients = 5
|
||||
nonce_size = 16
|
||||
password = ""
|
||||
password_hash_algo = "*"
|
||||
password_hash_iterations = 100000
|
||||
ssl_cert_key = "%h/ssl/relay.pem"
|
||||
ssl_priorities = "NORMAL:-VERS-SSL3.0"
|
||||
totp_secret = ""
|
||||
|
|
|
@ -247,6 +247,7 @@ save_config_on_unload = on
|
|||
|
||||
[bar]
|
||||
buflist.color_bg = default
|
||||
buflist.color_bg_inactive = default
|
||||
buflist.color_delim = default
|
||||
buflist.color_fg = default
|
||||
buflist.conditions = ""
|
||||
|
@ -261,6 +262,7 @@ buflist.size = 0
|
|||
buflist.size_max = 0
|
||||
buflist.type = root
|
||||
fset.color_bg = default
|
||||
fset.color_bg_inactive = default
|
||||
fset.color_delim = cyan
|
||||
fset.color_fg = default
|
||||
fset.conditions = "${buffer.full_name} == fset.fset"
|
||||
|
@ -275,6 +277,7 @@ fset.size = 3
|
|||
fset.size_max = 3
|
||||
fset.type = window
|
||||
input.color_bg = default
|
||||
input.color_bg_inactive = default
|
||||
input.color_delim = cyan
|
||||
input.color_fg = default
|
||||
input.conditions = ""
|
||||
|
@ -289,6 +292,7 @@ input.size = 1
|
|||
input.size_max = 0
|
||||
input.type = window
|
||||
nicklist.color_bg = default
|
||||
nicklist.color_bg_inactive = default
|
||||
nicklist.color_delim = cyan
|
||||
nicklist.color_fg = default
|
||||
nicklist.conditions = "${nicklist}"
|
||||
|
@ -303,6 +307,7 @@ nicklist.size = 0
|
|||
nicklist.size_max = 10
|
||||
nicklist.type = window
|
||||
status.color_bg = 0
|
||||
status.color_bg_inactive = default
|
||||
status.color_delim = cyan
|
||||
status.color_fg = default
|
||||
status.conditions = ""
|
||||
|
@ -317,6 +322,7 @@ status.size = 1
|
|||
status.size_max = 0
|
||||
status.type = window
|
||||
title.color_bg = 0
|
||||
title.color_bg_inactive = default
|
||||
title.color_delim = cyan
|
||||
title.color_fg = default
|
||||
title.conditions = ""
|
||||
|
@ -397,6 +403,7 @@ meta-9 = "/buffer *9"
|
|||
meta-< = "/input jump_previously_visited_buffer"
|
||||
meta-= = "/filter toggle"
|
||||
meta-> = "/input jump_next_visited_buffer"
|
||||
meta-B = "/buflist toggle"
|
||||
meta-OA = "/input history_global_previous"
|
||||
meta-OB = "/input history_global_next"
|
||||
meta-OC = "/input move_next_word"
|
||||
|
|
3
bin/fzfy
Executable file
3
bin/fzfy
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
fish -c (history | head -n 1 | grep -v history) | fzf
|
11
bin/glancepath
Executable file
11
bin/glancepath
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env -S awk -f
|
||||
{
|
||||
split(substr($0, 2), p, "/");
|
||||
for (k in p) {
|
||||
if (k == length(p)) {
|
||||
printf "/%s", p[k]
|
||||
} else {
|
||||
printf "/%.3s", p[k]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,124 +1,109 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# NOTE: run this from inside a Linux installation, not from the live USB/CD
|
||||
# TODO: detect if in a live image
|
||||
|
||||
head /etc/os-release --lines 1 | grep 'NixOS$' &>/dev/null; test $? -eq 1; is_nixos=$?
|
||||
head /etc/os-release --lines 1 | grep 'Arch Linux' &>/dev/null; test $? -eq 1; is_arch_linux=$?
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# NOTE: run this from inside a Linux installation, not from the live USB/CD
|
||||
# TODO: detect OS and perform OS-specific setup
|
||||
|
||||
root_home="/root"
|
||||
daniel_home="/home/daniel/.home"
|
||||
nice_home="/home/daniel"
|
||||
dotfiles="/.config/lytedev-dotfiles"
|
||||
|
||||
add_unstable_channel() {
|
||||
nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
|
||||
nix-channel --update
|
||||
run_via_dotfiles_if_necessary() {
|
||||
# clone dotfiles and re-run from repo if we're not in the repo
|
||||
pushd "$(dirname "$0")"
|
||||
if git remote get-url origin | grep 'lytedev/dotfiles'; then
|
||||
echo "Already in dotfiles repo!"
|
||||
else
|
||||
echo "Setting up dotfiles for $EUID..."
|
||||
d="$HOME/.config/lytedev-dotfiles"
|
||||
mkdir --parents "$d"
|
||||
rm --recursive --force "$d"
|
||||
git clone "https://git.lyte.dev/lytedev/dotfiles" "$d"
|
||||
exec "$d/bin/init-dotfiles"
|
||||
exit 0
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
clone_dotfiles() {
|
||||
echo "Setting up dotfiles for $USER..."
|
||||
mkdir --parents "$1"
|
||||
rm --recursive --force "$1"
|
||||
git clone "https://git.lyte.dev/lytedev/dotfiles" "$1"
|
||||
}
|
||||
|
||||
symlink_nixos() {
|
||||
symlink_nixos_config() {
|
||||
rm --force "/etc/nixos/lytedev"
|
||||
ln --symbolic "$1" "/etc/nixos/lytedev"
|
||||
}
|
||||
|
||||
setup_wallpaper() {
|
||||
mkdir --parents "$nice_home/img/walls"
|
||||
curl --silent --output "$nice_home/img/walls/clouds_by_souredapply.png" \
|
||||
"https://art.ngfiles.com/images/530000/530895_souredapple_clouds.png"
|
||||
rm --recursive --force "$daniel_home/.wallpaper"
|
||||
ln --symbolic "$nice_home/img/walls/clouds_by_souredapply.png" "$daniel_home/.wallpaper"
|
||||
}
|
||||
|
||||
generate_ssh_key() {
|
||||
mkdir --mode 600 --parents "$daniel_home/.ssh"
|
||||
keyfile="$daniel_home/.ssh/$(hostname --short)"
|
||||
if ! [ -f "$keyfile" ]; then
|
||||
ssh-keygen -N '' -t ed25519 -f "$keyfile"
|
||||
mkdir --mode 640 --parents "$nice_home/public"
|
||||
cp "$keyfile.pub" "$nice_home/public"
|
||||
fi
|
||||
}
|
||||
|
||||
fix_dotfiles_origin() {
|
||||
pushd "$daniel_home$dotfiles"
|
||||
git remote set-url origin "ssh://git@git.lyte.dev:2222/lytedev/dotfiles.git"
|
||||
popd
|
||||
}
|
||||
|
||||
setup_home_manager() {
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
nix-shell '<home-manager>' -A install
|
||||
}
|
||||
|
||||
setup_dotfiles() {
|
||||
pushd "$daniel_home$dotfiles"
|
||||
./bin/setup-dotfiles
|
||||
popd
|
||||
}
|
||||
|
||||
distro_specific_root_setup() {
|
||||
if test $is_nixos -eq 1; then
|
||||
symlink_nixos "$root_home$dotfiles/env/nix/"
|
||||
add_unstable_channel
|
||||
nixos-rebuild switch # this should create the `daniel` user
|
||||
elif test $is_arch_linux -eq 1; then
|
||||
"$root_home$dotfiles/env/arch-linux/provision.d/00-add-user.bash"
|
||||
fi
|
||||
}
|
||||
|
||||
distro_specific_user_setup() {
|
||||
if test $is_nixos -eq 1; then
|
||||
FUNC=$(declare -f symlink_nixos)
|
||||
sudo sh -c "$FUNC; symlink_nixos \"$daniel_home$dotfiles/env/nix/\""
|
||||
elif test $is_arch_linux -eq 1; then
|
||||
"$root_home$dotfiles/env/arch-linux/provision.sh"
|
||||
fi
|
||||
}
|
||||
|
||||
init_for_root() {
|
||||
clone_dotfiles "$root_home$dotfiles"
|
||||
distro_specific_root_setup
|
||||
clone_dotfiles "$daniel_home$dotfiles"
|
||||
chown daniel:users -R "$daniel_home"
|
||||
echo "Re-running as user daniel..."
|
||||
sudo --user daniel "$daniel_home$dotfiles/bin/init-dotfiles"
|
||||
}
|
||||
|
||||
init_for_daniel() {
|
||||
set +x
|
||||
clone_dotfiles "$daniel_home$dotfiles"
|
||||
generate_ssh_key
|
||||
distro_specific_user_setup
|
||||
setup_wallpaper
|
||||
# TODO: setup ssh/gpg keys
|
||||
# TODO: setup password store
|
||||
fix_dotfiles_origin
|
||||
setup_dotfiles
|
||||
# TODO: fetch password store
|
||||
# TODO: fetch notes database
|
||||
}
|
||||
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
if test $is_arch_linux -eq 1; then
|
||||
pacman -S --needed git inetutils
|
||||
pacman -Sy --needed --noconfirm git inetutils openssh sudo
|
||||
fi
|
||||
init_for_root
|
||||
run_via_dotfiles_if_necessary
|
||||
pushd "$(dirname "$0")/.."
|
||||
if test $is_nixos -eq 1; then
|
||||
symlink_nixos_config "$HOME/.config/lytedev-dotfiles/env/nix/"
|
||||
nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
|
||||
nix-channel --update
|
||||
nixos-rebuild switch # this should create the `daniel` user
|
||||
elif test $is_arch_linux -eq 1; then
|
||||
ls -la
|
||||
"env/arch-linux/provision.d/00-add-user.bash"
|
||||
fi
|
||||
c=/home/daniel/.home/.config/
|
||||
mkdir --parents "$c"
|
||||
chown -R daniel:users "$c"
|
||||
cp --recursive . "$c/lytedev-dotfiles"
|
||||
sudo --user daniel "$c/bin/init-dotfiles"
|
||||
popd
|
||||
exit 0
|
||||
else
|
||||
init_for_daniel
|
||||
run_via_dotfiles_if_necessary
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo "PREPARING TO GENERATE SSH KEY FOR USER"
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
pushd "$HOME"
|
||||
keyfile=".ssh/$(hostname --short)"
|
||||
echo $keyfile
|
||||
if ! [ -f "$keyfile" ]; then
|
||||
mkdir --mode 700 --parents .ssh
|
||||
chmod 700 .ssh
|
||||
ls -la .ssh
|
||||
ssh-keygen -N '' -t ed25519 -f "$keyfile"
|
||||
mkdir --mode 755 --parents "$NICE_HOME/public"
|
||||
cp "$keyfile.pub" "$NICE_HOME/public"
|
||||
fi
|
||||
popd
|
||||
if test $is_nixos -eq 1; then
|
||||
FUNC=$(declare -f symlink_nixos_config)
|
||||
sudo sh -c "$FUNC; symlink_nixos_config \"$HOME/.config/lytedev-dotfiles/env/nix/\""
|
||||
elif test $is_arch_linux -eq 1; then
|
||||
sudo "$HOME/.config/lytedev-dotfiles/env/arch-linux/provision.sh"
|
||||
fi
|
||||
mkdir --parents "$NICE_HOME/img/walls"
|
||||
curl --silent --output "$NICE_HOME/img/walls/clouds_by_souredapply.png" \
|
||||
"https://art.ngfiles.com/images/530000/530895_souredapple_clouds.png"
|
||||
rm --recursive --force "$HOME/.wallpaper"
|
||||
ln --symbolic "$NICE_HOME/img/walls/clouds_by_souredapply.png" "$HOME/.wallpaper"
|
||||
|
||||
# TODO: setup ssh/gpg keys
|
||||
# TODO: setup password store
|
||||
|
||||
pushd "$HOME/.config/lytedev-dotfiles"
|
||||
git remote set-url origin "ssh://git@git.lyte.dev:2222/lytedev/dotfiles.git"
|
||||
./bin/setup-dotfiles
|
||||
popd
|
||||
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
# nix-shell '<home-manager>' -A install
|
||||
|
||||
# TODO: fetch password store
|
||||
# TODO: fetch notes database
|
||||
fi
|
||||
|
||||
echo "Here is this machine's public SSH key:"
|
||||
echo " $(cat "$daniel_home/.ssh/$(hostname --short).pub")"
|
||||
echo " $(cat "$HOME/.ssh/$(hostname --short).pub")"
|
||||
echo "It needs to be added to existing cloud-based git accounts"
|
||||
echo "and other machines before proceeding."
|
||||
echo
|
||||
|
|
9
bin/kubeline
Executable file
9
bin/kubeline
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env sh
|
||||
c="$(kubectl config current-context | tr -d "\n")"
|
||||
if [ -n "$c" ]; then
|
||||
printf "$c"
|
||||
fi
|
||||
a="$(kubectl config view --minify --output 'jsonpath={..namespace}')"
|
||||
if [ -n "$a" ]; then
|
||||
printf ".%s" "$a"
|
||||
fi
|
9
bin/kubfc
Executable file
9
bin/kubfc
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env sh
|
||||
kubectl config get-contexts --no-headers | \
|
||||
uniq | \
|
||||
sort | \
|
||||
tr -s ' ' | \
|
||||
sed -E 's/^\*?[[:space:]]*//g' | \
|
||||
cut -d ' ' -f1 | \
|
||||
fzf | \
|
||||
xargs -I{} kubectl config use-context '{}'
|
7
bin/kubfn
Executable file
7
bin/kubfn
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
kubectl get namespaces --show-labels | \
|
||||
uniq | \
|
||||
sort | \
|
||||
cut -d ' ' -f1 | \
|
||||
fzf | \
|
||||
xargs -I{} kubectl config set-context --current --namespace='{}'
|
|
@ -19,20 +19,12 @@ done
|
|||
|
||||
links=(
|
||||
# desktop environment files
|
||||
"apps/de/bspwm/rc" "$XDG_CONFIG_HOME/bspwm/bspwmrc"
|
||||
"apps/de/bspwm/wallpapers" "$HOME/.fehbg"
|
||||
"apps/de/sway/config" "$XDG_CONFIG_HOME/sway/config"
|
||||
"apps/de/sway/lock" "$XDG_CONFIG_HOME/swaylock/config"
|
||||
"apps/de/sxhkd/rc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc"
|
||||
"apps/de/x/resources" "$HOME/.Xresources"
|
||||
"apps/de/x/init" "$HOME/.xinitrc"
|
||||
"apps/de/x/init" "$HOME/.vnc/xstartup"
|
||||
"apps/de/x/profile" "$HOME/.xprofile"
|
||||
"apps/de/x/modmap" "$HOME/.xmodmap"
|
||||
"apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf"
|
||||
"apps/de/dunst/rc" "$XDG_CONFIG_HOME/dunst/dunstrc"
|
||||
"apps/de/mako/" "$XDG_CONFIG_HOME/mako"
|
||||
"env/common/colors/xresources" "$HOME/.Xresources.colors"
|
||||
"apps/de/sway/mimeapps.list" "$XDG_CONFIG_HOME/mimeapps.list"
|
||||
"apps/de/sway/mimeapps.list" "$XDG_CONFIG_HOME/sway-mimeapps.list"
|
||||
"apps/de/sway/mimeapps.list" "$HOME/.local/share/applications/mimeapps.list"
|
||||
|
||||
# shell files
|
||||
"apps/shell/bash/rc" "$HOME/.bashrc"
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
echo "${USER_LOGS_PATH}"
|
||||
|
||||
sess="$1"; shift
|
||||
d="$(date +%Y-%m-%d_%H-%M-%S)"
|
||||
f="${USER_LOGS_PATH}/${d}.${sess}.tmux-buffer.log"
|
||||
mkdir -p "$(dirname "$f")"
|
||||
touch "$f"
|
||||
chmod 600 "$f"
|
||||
tmux capture-pane -pS -1000000000 > "$f"
|
||||
echo "Saved output to $f"
|
||||
echo "Saved pane output to $f"
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ANY_SESSION_PREFIX="#[bg=colour18]#[fg=colour7]"
|
||||
ANY_SESSION_SUFFIX="#[bg=default]#[fg=default] "
|
||||
CUR_SESSION_PREFIX="#[bg=colour4]#[fg=colour0]"
|
||||
CUR_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
||||
# TODO: implement urgent session highlighting
|
||||
# URG_SESSION_SUFFIX="${ANY_SESSION_SUFFIX}"
|
||||
# URG_SESSION_PREFIX="#[bg=colour1]#[fg=colour0]"
|
||||
|
||||
CUR_TMUX_SESSION="$1"
|
||||
if [ -z "$1" ]; then
|
||||
CUR_TMUX_SESSION="$(tmux display-message -p '#S')"
|
||||
fi
|
||||
export CUR_TMUX_SESSION
|
||||
|
||||
TMUX_SESSION_LIST="$(tmux list-sessions | awk \
|
||||
-v curSesh="${CUR_TMUX_SESSION}" \
|
||||
-v aspre="${ANY_SESSION_PREFIX}" \
|
||||
-v assuf="${ANY_SESSION_SUFFIX}" \
|
||||
-v cspre="${CUR_SESSION_PREFIX}" \
|
||||
-v cssuf="${CUR_SESSION_SUFFIX}" \
|
||||
'{s=substr($1,0,length($1)-1);
|
||||
if(s==curSesh){
|
||||
s=cspre" "s" "cssuf
|
||||
}else{
|
||||
s=aspre" "s" "assuf
|
||||
}printf s}')"
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
echo "${TMUX_SESSION_LIST//\s*$/}" | sed -e 's/\s*$//'
|
5
env/arch-linux/provision.d/00-add-user.bash
vendored
5
env/arch-linux/provision.d/00-add-user.bash
vendored
|
@ -6,12 +6,11 @@ ud="/home/$u"
|
|||
# user exists - we will assume setup has already run
|
||||
if getent passwd "$u"; then exit 0; fi
|
||||
|
||||
pacman -S --needed sudo openssh
|
||||
# TODO: enable admin group to sudo
|
||||
echo '%admin ALL=(ALL) ALL' >> /etc/sudoers.d/admin-group-sudoers
|
||||
groupadd admin 2>/dev/null
|
||||
mkdir --parents "$ud/.home" "$ud/dl"
|
||||
useradd --home-dir "$ud/.home" \
|
||||
--groups "admin,users" \
|
||||
--groups "admin,users,uucp,lock" \
|
||||
--shell "/bin/bash" \
|
||||
"$u"
|
||||
chown --recursive "$u:$u" "$ud"
|
||||
|
|
|
@ -64,6 +64,7 @@ yay -Sy \
|
|||
alsa-plugins `# Plugins for ALSA` \
|
||||
pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \
|
||||
neovim `# Text Editors` \
|
||||
sc-im `# Spreadsheets` \
|
||||
unzip `# Simple Unzipping` \
|
||||
tmux `# Terminal Multiplexer` \
|
||||
kitty `# Almost Better Terminal Emulator` \
|
||||
|
@ -73,6 +74,9 @@ yay -Sy \
|
|||
kanshi-git `# Monitor Management for Sway` \
|
||||
waybar-git mako-git `# Sway Bar & Notifications` \
|
||||
slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \
|
||||
pipewire pipewire-pulse libpipewire02 `# Pipewire` \
|
||||
xdg-desktop-portal xdg-desktop-portal-wlr `# Screensharing` \
|
||||
obs-studio-wayland obs-xdg-portal `# OBS` \
|
||||
ttf-iosevka `# Primary Fonts` \
|
||||
ttf-font-awesome `# Icon Font` \
|
||||
curl `# HTTP Utility` \
|
||||
|
|
Reference in a new issue