Compare commits
66 Commits
abaefa1aaa
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 45e1e6f235 | |||
| 36a51d8127 | |||
| 35abfa07bc | |||
| a4faab3db1 | |||
| c2377c584e | |||
| d82b37376e | |||
| f98883bf34 | |||
| 4f595cae5b | |||
| 28d7111aee | |||
| 89fb2a1b56 | |||
| 1dd35ed47a | |||
| c93c4e25d7 | |||
| 232952f9ec | |||
| 69d4a237e9 | |||
| 99fe1caf19 | |||
| 4464b3ad06 | |||
| acab55b91e | |||
| cc52d282be | |||
| 4146633c84 | |||
| 16915d86a0 | |||
| 50c21d3233 | |||
| 95ad4c7c5f | |||
| 6aa8d00242 | |||
| e2cf533da4 | |||
| b38320b190 | |||
| 2598bcef39 | |||
| 0b612782bf | |||
| cf35805f68 | |||
| 12bcba518d | |||
| 874f14afee | |||
| 68ffd61147 | |||
| 4fd1b70a5c | |||
| 009c896650 | |||
| 4e7bcf405e | |||
| a2acab1fed | |||
| d683a0698a | |||
| 6e285c455c | |||
| d15b486a6f | |||
| 4c7a3c1a95 | |||
| a2d8cddefe | |||
| ae1ee3bcfc | |||
| d798128e2c | |||
| 26df51eb9d | |||
| fbcdaa4c0e | |||
| 350aaf8690 | |||
| f69fcdf744 | |||
| c6ce0dd503 | |||
| 896ca95ce1 | |||
| 1b3afa092b | |||
| 099d617895 | |||
| bc79913088 | |||
| 413c9be5ce | |||
| 2b8b39dbc2 | |||
| 5ae3bac9ad | |||
| 0481a74e46 | |||
| 7d5ff4d004 | |||
| 44241a0e42 | |||
| 84e3c9d89a | |||
| ce24cd5e38 | |||
| 69b457fa02 | |||
| 0e96acc8a9 | |||
| f220a40935 | |||
| 282b32e7ad | |||
| 279d90df27 | |||
| 2c9f2134cf | |||
| d337afb250 |
@@ -0,0 +1 @@
|
||||
home
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
# This is Git's per-user configuration file.
|
||||
[user]
|
||||
# Please adapt and uncomment the following lines:
|
||||
name = Jay
|
||||
email = jay@lawsnote.com
|
||||
[merge]
|
||||
tool = vimdiff
|
||||
[diff]
|
||||
tool = vimdiff
|
||||
trustExitCode = true
|
||||
[difftool]
|
||||
prompt = false
|
||||
[alias]
|
||||
d = difftool
|
||||
co = checkout
|
||||
ci = commit
|
||||
l = log --oneline --graph --all
|
||||
ls = log --graph --pretty=format:\"%h <%an> %ar %s\" --all
|
||||
st = status
|
||||
br = branch
|
||||
[mergetool]
|
||||
keepBackup = false
|
||||
[core]
|
||||
editor = vim
|
||||
@@ -1,437 +0,0 @@
|
||||
filetype off
|
||||
call plug#begin('~/.vim/Plugged')
|
||||
|
||||
Plug 'prabirshrestha/async.vim'
|
||||
Plug 'prabirshrestha/vim-lsp'
|
||||
Plug 'prabirshrestha/asyncomplete.vim'
|
||||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||
|
||||
" autocompleter
|
||||
Plug 'prabirshrestha/asyncomplete-gocode.vim'
|
||||
Plug 'runoshun/tscompletejob'
|
||||
Plug 'prabirshrestha/asyncomplete-tscompletejob.vim'
|
||||
|
||||
Plug 'tomasr/molokai'
|
||||
Plug 'scrooloose/nerdcommenter'
|
||||
Plug 'vim-scripts/DrawIt'
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'mattn/emmet-vim'
|
||||
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
||||
Plug 'pangloss/vim-javascript'
|
||||
" tagbar
|
||||
" golang install go get -u github.com/jstemmer/gotags
|
||||
Plug 'majutsushi/tagbar'
|
||||
Plug 'w0rp/ale'
|
||||
Plug 'connorholyday/vim-snazzy'
|
||||
Plug 'hzchirs/vim-material'
|
||||
Plug 'kadekillary/Turtles'
|
||||
Plug 'phanviet/vim-monokai-pro'
|
||||
Plug 'sickill/vim-monokai'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
Plug 'ctrlpvim/ctrlp.vim'
|
||||
|
||||
" defx file explorer
|
||||
" require python package pynvim
|
||||
" install `pip3 install --user pynvim`
|
||||
Plug 'Shougo/defx.nvim'
|
||||
Plug 'roxma/nvim-yarp'
|
||||
Plug 'roxma/vim-hug-neovim-rpc'
|
||||
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'kien/tabman.vim'
|
||||
|
||||
" for git
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'christoomey/vim-conflicted'
|
||||
|
||||
" for mark
|
||||
Plug 'inkarkat/vim-ingo-library'
|
||||
Plug 'inkarkat/vim-mark'
|
||||
|
||||
Plug 'rking/ag.vim'
|
||||
Plug 'terryma/vim-multiple-cursors'
|
||||
|
||||
" temp plugin
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'buoto/gotests-vim'
|
||||
Plug 'chr4/nginx.vim'
|
||||
Plug 'cespare/vim-toml'
|
||||
Plug 'zah/nim.vim'
|
||||
Plug 'rust-lang/rust.vim'
|
||||
Plug 'danilo-augusto/vim-afterglow'
|
||||
Plug 'vim-scripts/TaskList.vim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
syntax on
|
||||
set number
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
set nofoldenable
|
||||
|
||||
set pastetoggle=<F2>
|
||||
" always show status
|
||||
set laststatus=2
|
||||
" show cursor position
|
||||
set ruler
|
||||
set cursorline
|
||||
set cursorcolumn
|
||||
set hlsearch
|
||||
" no wrap line
|
||||
set nowrap
|
||||
" enable backspace
|
||||
set backspace=indent,eol,start
|
||||
set encoding=utf-8
|
||||
" set font
|
||||
" set guifont=Hack\ Nerd\ Font:h11
|
||||
|
||||
set background=dark
|
||||
|
||||
function! AdaptColorscheme()
|
||||
highlight clear CursorLine
|
||||
highlight Normal ctermbg=none
|
||||
highlight LineNr ctermbg=none
|
||||
highlight Folded ctermbg=none
|
||||
highlight NonText ctermbg=none
|
||||
highlight SpecialKey ctermbg=none
|
||||
highlight VertSplit ctermbg=none
|
||||
highlight SignColumn ctermbg=none
|
||||
endfunction
|
||||
autocmd ColorScheme * call AdaptColorscheme()
|
||||
|
||||
" colorscheme turtles
|
||||
colorscheme afterglow
|
||||
|
||||
" define leader key
|
||||
let mapleader=";"
|
||||
filetype indent on
|
||||
" 開啟檔案類型偵測
|
||||
filetype on
|
||||
" 根據檔案類型載入plugin
|
||||
filetype plugin on
|
||||
|
||||
autocmd BufWritePost $MYVIMRC source $MYVIMRC
|
||||
|
||||
" split window
|
||||
nmap <leader>sw <c-w>
|
||||
nmap <leader>sww <c-w>k
|
||||
nmap <leader>sws <c-w>j
|
||||
nmap <leader>swa <c-w>h
|
||||
nmap <leader>swd <c-w>l
|
||||
|
||||
nmap <leader>aa gT
|
||||
nmap <leader>dd gt
|
||||
|
||||
" defx settings
|
||||
call defx#custom#option('_', {
|
||||
\ 'winwidth': 40,
|
||||
\ 'split': 'vertical',
|
||||
\ 'direction': 'topleft',
|
||||
\ 'buffer_name': '',
|
||||
\ 'toggle': 1,
|
||||
\ 'resume': 1,
|
||||
\ })
|
||||
nmap <F3> :Defx<CR>
|
||||
nmap <leader>me :Defx<CR>
|
||||
autocmd FileType defx call s:defx_my_settings()
|
||||
function! s:defx_my_settings() abort
|
||||
" Define mappings
|
||||
nnoremap <silent><buffer><expr> <CR>
|
||||
\ defx#is_directory() ?
|
||||
\ defx#do_action('open_tree', 'toggle') :
|
||||
\ defx#do_action('drop')
|
||||
nnoremap <silent><buffer><expr> T
|
||||
\ defx#do_action('open', 'tabe')
|
||||
nnoremap <silent><buffer><expr> s
|
||||
\ defx#do_action('drop', 'vsplit')
|
||||
nnoremap <silent><buffer><expr> mc
|
||||
\ defx#do_action('copy')
|
||||
nnoremap <silent><buffer><expr> mm
|
||||
\ defx#do_action('move')
|
||||
nnoremap <silent><buffer><expr> mp
|
||||
\ defx#do_action('paste')
|
||||
nnoremap <silent><buffer><expr> P
|
||||
\ defx#do_action('preview')
|
||||
nnoremap <silent><buffer><expr> o
|
||||
\ defx#do_action('open_tree', 'toggle')
|
||||
nnoremap <silent><buffer><expr> ma
|
||||
\ defx#do_action('new_file')
|
||||
nnoremap <silent><buffer><expr> C
|
||||
\ defx#do_action('toggle_columns',
|
||||
\ 'mark:indent:icon:filename:type:size:time')
|
||||
nnoremap <silent><buffer><expr> S
|
||||
\ defx#do_action('toggle_sort', 'time')
|
||||
nnoremap <silent><buffer><expr> md
|
||||
\ defx#do_action('remove')
|
||||
nnoremap <silent><buffer><expr> mr
|
||||
\ defx#do_action('rename')
|
||||
nnoremap <silent><buffer><expr> !
|
||||
\ defx#do_action('execute_command')
|
||||
nnoremap <silent><buffer><expr> x
|
||||
\ defx#do_action('execute_system')
|
||||
nnoremap <silent><buffer><expr> yy
|
||||
\ defx#do_action('yank_path')
|
||||
nnoremap <silent><buffer><expr> .
|
||||
\ defx#do_action('toggle_ignored_files')
|
||||
nnoremap <silent><buffer><expr> ;
|
||||
\ defx#do_action('repeat')
|
||||
nnoremap <silent><buffer><expr> h
|
||||
\ defx#do_action('cd', ['..'])
|
||||
nnoremap <silent><buffer><expr> ~
|
||||
\ defx#do_action('cd')
|
||||
nnoremap <silent><buffer><expr> q
|
||||
\ defx#do_action('quit')
|
||||
nnoremap <silent><buffer><expr> <Space>
|
||||
\ defx#do_action('toggle_select') . 'j'
|
||||
nnoremap <silent><buffer><expr> *
|
||||
\ defx#do_action('toggle_select_all')
|
||||
nnoremap <silent><buffer><expr> j
|
||||
\ line('.') == line('$') ? 'gg' : 'j'
|
||||
nnoremap <silent><buffer><expr> k
|
||||
\ line('.') == 1 ? 'G' : 'k'
|
||||
nnoremap <silent><buffer><expr> r
|
||||
\ defx#do_action('redraw')
|
||||
nnoremap <silent><buffer><expr> <C-g>
|
||||
\ defx#do_action('print')
|
||||
nnoremap <silent><buffer><expr> cd
|
||||
\ defx#do_action('change_vim_cwd')
|
||||
endfunction
|
||||
|
||||
" tagbar
|
||||
nmap <F8> :TagbarToggle<CR>
|
||||
|
||||
" NeoComplete
|
||||
let g:neocomplete#enable_at_startup = 1
|
||||
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
" <Leader>f{char} to move to {char}
|
||||
map <Leader>f <Plug>(easymotion-bd-f)
|
||||
nmap <Leader>f <Plug>(easymotion-overwin-f)
|
||||
" s{char}{char} to move to {char}{char}
|
||||
nmap s <Plug>(easymotion-overwin-f2)
|
||||
" Move to line
|
||||
map <Leader>L <Plug>(easymotion-bd-jk)
|
||||
nmap <Leader>L <Plug>(easymotion-overwin-line)
|
||||
" Move to word
|
||||
map <Leader>w <Plug>(easymotion-bd-w)
|
||||
nmap <Leader>w <Plug>(easymotion-overwin-w)
|
||||
|
||||
" lint
|
||||
let g:ale_linters = {
|
||||
\ 'javascript': ['standard'],
|
||||
\ 'go': ['gopls'],
|
||||
\ 'rust': ['analyzer'],
|
||||
\}
|
||||
let g:ale_fixers = {'javascript': ['standard']}
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_fix_on_save = 1
|
||||
nmap <leader>= <Plug>(ale_fix)
|
||||
|
||||
" NERDCommenter
|
||||
let g:NERDSpaceDelims=1
|
||||
let g:NERDDefaultAlign='left'
|
||||
|
||||
function! MergeTab()
|
||||
let bufnums = tabpagebuflist()
|
||||
hide tabclose
|
||||
topleft vsplit
|
||||
for n in bufnums
|
||||
execute 'sbuffer ' . n
|
||||
wincmd _
|
||||
endfor
|
||||
wincmd t
|
||||
quit
|
||||
wincmd =
|
||||
endfunction
|
||||
command! MergeTab call MergeTab()
|
||||
|
||||
" LSP Settings
|
||||
" key binding
|
||||
nmap <silent> <Leader>gd :LspDefinition<CR>
|
||||
nmap <silent> <Leader>gt :tab split<CR>:LspDefinition<CR>
|
||||
nmap <silent> <Leader>p :LspHover<CR>
|
||||
nmap <silent> <Leader>gr :LspReferences<CR>
|
||||
nmap <silent> <Leader>rr :LspStopServer<CR>
|
||||
nmap <silent> <Leader>i :LspImplementation<CR>
|
||||
nmap <silent> <Leader>gs :split \| :LspDefinition <CR>
|
||||
nmap <silent> <Leader>gv :vsplit \| :LspDefinition <CR>
|
||||
nmap <silent> <Leader>gf :LspDocumentFormat<CR>
|
||||
|
||||
let g:lsp_diagnostics_enabled = 0 " disable diagnostics support
|
||||
let g:lsp_diagnostics_float_cursor = 0
|
||||
let g:lsp_diagnostics_echo_cursor = 1
|
||||
|
||||
" require node module
|
||||
" npm i -g dockerfile-language-server-nodejs
|
||||
if executable('docker-langserver')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'docker-langserver',
|
||||
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'docker-langserver --stdio']},
|
||||
\ 'whitelist': ['dockerfile'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
" require golang app
|
||||
" go get -u github.com/sourcegraph/go-langserver
|
||||
" Setting >>>>
|
||||
" 'cmd': {server_info->['go-langserver', '-gocodecompletion']},
|
||||
" 'cmd': {server_info->['gopls', '-mode', 'stdio']},
|
||||
if executable('gopls')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'gopls',
|
||||
\ 'cmd': {server_info->['gopls']},
|
||||
\ 'whitelist': ['go'],
|
||||
\ })
|
||||
autocmd FileType go setlocal omnifunc=lsp#complete
|
||||
endif
|
||||
|
||||
if executable('deno')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'deno',
|
||||
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'deno lsp']},
|
||||
\ 'whitelist': ['typescript', 'typescript.tsx', 'typescriptreact'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
" rustup update
|
||||
" rustup component add rls rust-analysis rust-src
|
||||
" if executable('rls')
|
||||
" au User lsp_setup call lsp#register_server({
|
||||
" \ 'name': 'rls',
|
||||
" \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
|
||||
" \ 'workspace_config': {'rust': {'clippy_preference': 'on'}},
|
||||
" \ 'whitelist': ['rust'],
|
||||
" \ })
|
||||
" endif
|
||||
if executable('rust-analyzer')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'rust-analyzer',
|
||||
\ 'cmd': {server_info->['rust-analyzer']},
|
||||
\ 'workspace_config': {'rust': {'clippy_preference': 'on'}},
|
||||
\ 'whitelist': ['rust'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
" LSP
|
||||
" JS/TS require
|
||||
" npm install -g typescript typescript-language-server
|
||||
if executable('typescript-language-server')
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'javascript support using typescript-language-server',
|
||||
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
|
||||
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'package.json'))},
|
||||
\ 'whitelist': ['javascript', 'javascript.jsx'],
|
||||
\ })
|
||||
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'typescript support using typescript-language-server',
|
||||
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
|
||||
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))},
|
||||
\ 'whitelist': ['typescript', 'typescript.tsx', 'typescriptreact'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
" auto completer
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
|
||||
|
||||
" set completeopt+=preview
|
||||
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
|
||||
let g:asyncomplete_auto_popup = 0
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ asyncomplete#force_refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
call asyncomplete#register_source(asyncomplete#sources#gocode#get_source_options({
|
||||
\ 'name': 'gocode',
|
||||
\ 'whitelist': ['go'],
|
||||
\ 'completor': function('asyncomplete#sources#gocode#completor'),
|
||||
\ }))
|
||||
|
||||
call asyncomplete#register_source(asyncomplete#sources#tscompletejob#get_source_options({
|
||||
\ 'name': 'tscompletejob',
|
||||
\ 'whitelist': ['typescript'],
|
||||
\ 'completor': function('asyncomplete#sources#tscompletejob#completor'),
|
||||
\ }))
|
||||
|
||||
let g:tagbar_type_go = {
|
||||
\ 'ctagstype' : 'go',
|
||||
\ 'kinds' : [
|
||||
\ 'p:package',
|
||||
\ 'i:imports:1',
|
||||
\ 'c:constants',
|
||||
\ 'v:variables',
|
||||
\ 't:types',
|
||||
\ 'n:interfaces',
|
||||
\ 'w:fields',
|
||||
\ 'e:embedded',
|
||||
\ 'm:methods',
|
||||
\ 'r:constructor',
|
||||
\ 'f:functions'
|
||||
\ ],
|
||||
\ 'sro' : '.',
|
||||
\ 'kind2scope' : {
|
||||
\ 't' : 'ctype',
|
||||
\ 'n' : 'ntype'
|
||||
\ },
|
||||
\ 'scope2kind' : {
|
||||
\ 'ctype' : 't',
|
||||
\ 'ntype' : 'n'
|
||||
\ },
|
||||
\ 'ctagsbin' : 'gotags',
|
||||
\ 'ctagsargs' : '-sort -silent'
|
||||
\ }
|
||||
|
||||
" vim-go setting
|
||||
autocmd FileType go nmap tgd <Plug>(go-def-tab)
|
||||
autocmd FileType go nmap <leader>err <Plug>(go-iferr)
|
||||
let g:go_fmt_fail_silently = 1
|
||||
let g:go_fmt_command = "goimports"
|
||||
let g:go_def_mode = 'godef'
|
||||
let g:go_decls_includes = "func,type"
|
||||
let g:go_highlight_types = 1
|
||||
let g:go_highlight_fields = 1
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_function_calls = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_extra_types = 1
|
||||
|
||||
" for rust-vim
|
||||
let g:rust_recommended_style = 0
|
||||
let g:rustfmt_autosave = 1
|
||||
let g:syntastic_rust_checkers = ['cargo']
|
||||
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tabline#show_buffers = 0
|
||||
let g:airline#extensions#tabline#show_splits = 0
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
let g:airline#extensions#tabline#show_tab_nr = 0
|
||||
let g:airline#extensions#tabline#show_tab_type = 0
|
||||
let g:airline#extensions#tabline#close_symbol = '×'
|
||||
let g:airline#extensions#tabline#show_close_button = 0
|
||||
|
||||
let g:multi_cursor_use_default_mapping=0
|
||||
|
||||
" Default mapping
|
||||
let g:multi_cursor_start_word_key = "<C-n>"
|
||||
let g:multi_cursor_select_all_word_key = '<A-n>'
|
||||
let g:multi_cursor_start_key = "g<C-n>"
|
||||
let g:multi_cursor_select_all_key = 'g<A-n>'
|
||||
let g:multi_cursor_next_key = "<C-n>"
|
||||
" let g:multi_cursor_prev_key = '<C-p>'
|
||||
let g:multi_cursor_skip_key = '<C-x>'
|
||||
let g:multi_cursor_quit_key = '<Esc>'
|
||||
|
||||
let g:javascript_plugin_jsdoc = 1
|
||||
@@ -0,0 +1,58 @@
|
||||
{{- $email := "" -}}
|
||||
{{- if hasKey . "email" -}}
|
||||
{{- $email = .email -}}
|
||||
{{- else -}}
|
||||
{{- $email = promptStringOnce . "email" "email address" -}}
|
||||
{{ end }}
|
||||
|
||||
{{- $gitUser := "" -}}
|
||||
{{- if hasKey . "gitUser" -}}
|
||||
{{- $gitUser = .gitUser -}}
|
||||
{{- else -}}
|
||||
{{- $gitUser = promptStringOnce . "gitUser" "git username" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $jsLinter := promptStringOnce . "jsLinter" "js linter" "standard" -}}
|
||||
{{- if eq $jsLinter "" -}}
|
||||
{{- $jsLinter = "standard" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $jsFixer := promptStringOnce . "jsFixer" "js fixer" "standard" -}}
|
||||
{{- if eq $jsFixer "" -}}
|
||||
{{- $jsFixer = "standard" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $installGo := promptBoolOnce . "installGo" "install golang bin" true -}}
|
||||
{{- $installNode := promptBoolOnce . "installNode" "install nodejs bin" true -}}
|
||||
{{- $installRust := promptBoolOnce . "installRust" "install rust bin" true -}}
|
||||
{{- $enableTmux := promptBoolOnce . "enableTmux" "install enable tmux autostart" true -}}
|
||||
{{- $enableSSHAgent := promptBoolOnce . "enableSSHAgent" "install enable ssh agent autostart" true -}}
|
||||
{{- $enableUI := promptBoolOnce . "enableUI" "install enable ui" true -}}
|
||||
{{- $systemd := promptBoolOnce . "systemd" "is systemd init" true -}}
|
||||
|
||||
[data.settings]
|
||||
systemd = {{ $systemd }}
|
||||
|
||||
[data.ui]
|
||||
enable = {{ $enableUI }}
|
||||
|
||||
[data.shell]
|
||||
tmux = {{ $enableTmux }}
|
||||
ssh_agent = {{ $enableSSHAgent }}
|
||||
|
||||
[data.gitconfig]
|
||||
email = {{ $email | quote }}
|
||||
username = {{ $gitUser | quote }}
|
||||
|
||||
[data.nvim]
|
||||
js_linter = {{ $jsLinter | quote }}
|
||||
js_fixer = {{ $jsFixer | quote }}
|
||||
|
||||
[data.dev]
|
||||
golang = {{ $installGo }}
|
||||
nodejs = {{ $installNode }}
|
||||
rust = {{ $installRust }}
|
||||
|
||||
[merge]
|
||||
command = "nvim"
|
||||
args = ["-d", "{{ "{{" }} .Destination {{ "}}" }}", "{{ "{{" }} .Source {{ "}}" }}", "{{ "{{" }} .Target {{ "}}" }}"]
|
||||
@@ -0,0 +1,19 @@
|
||||
# ignore template
|
||||
|
||||
{{- if not .shell.tmux }}
|
||||
.tmux.conf
|
||||
{{- end }}
|
||||
|
||||
{{- if not .ui.enable }}
|
||||
.pam_environment
|
||||
.config/alacrtty/
|
||||
.config/environment.d/
|
||||
.config/hypr/
|
||||
.config/mako/
|
||||
.config/sway/
|
||||
.config/swaylock/
|
||||
.config/systemd/
|
||||
.config/waybar/
|
||||
.config/wofi/
|
||||
.config/xdg-desktop-portal-wlr/
|
||||
{{- end }}
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -d "$HOME/.zinit/bin" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin; then
|
||||
>&2 echo "clone zinit into ~/.zinit/bin failed"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
PATH="$HOME/apps/go/bin:$HOME/apps/node/bin:$PATH"
|
||||
|
||||
if command -v npm > /dev/null; then
|
||||
npm i -g typescript typescript-language-server dockerfile-language-server-nodejs svelte-language-server
|
||||
fi
|
||||
|
||||
if command -v go > /dev/null; then
|
||||
go install github.com/sourcegraph/go-langserver@latest
|
||||
go install github.com/cweill/gotests/gotests@latest
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
{{ if .shell.tmux }}
|
||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||
{{ end }}
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
readonly wanted_packages=(
|
||||
git
|
||||
svn
|
||||
zsh
|
||||
nvim
|
||||
tmux
|
||||
curl
|
||||
wget
|
||||
)
|
||||
|
||||
missing_packages=()
|
||||
|
||||
for package in "${wanted_packages[@]}"; do
|
||||
if ! command -v "${package}" > /dev/null ; then
|
||||
missing_packages+=("${package}")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#missing_packages[@]} -gt 0 ]]; then
|
||||
>&2 echo "missing packages ${missing_packages[*]}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,130 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
GO_VERSION="1.22.0"
|
||||
NODE_VERSION="20.5.1"
|
||||
|
||||
|
||||
ARCH="{{ .chezmoi.arch }}"
|
||||
OSTYPE="{{ .chezmoi.os }}"
|
||||
|
||||
if [ ! -d "$HOME/apps" ]; then
|
||||
if ! mkdir -p "$HOME/apps" ; then
|
||||
>&2 echo "make directory failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
function install_golang {
|
||||
#if command -v go ; then
|
||||
# return 0
|
||||
#fi
|
||||
|
||||
local tmpDir=$(mktemp -d)
|
||||
local url="https://go.dev/dl/go$GO_VERSION.$OSTYPE-$ARCH.tar.gz"
|
||||
|
||||
# download
|
||||
if ! wget -O "$tmpDir/go.tar.gz" "$url" ; then
|
||||
rm -rf "$tmpDir"
|
||||
>&2 echo "download golang binary failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! tar zxf "$tmpDir/go.tar.gz" -C "$tmpDir" ;then
|
||||
rm -rf "$tmpDir"
|
||||
>&2 echo "untar golang binary failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mv "$tmpDir/go" "$HOME/apps/go-${GO_VERSION}"
|
||||
|
||||
if [ -L "$HOME/apps/go" ]; then
|
||||
#rm -rf `readlink -f "$HOME/apps/go"`
|
||||
unlink "$HOME/apps/go"
|
||||
fi
|
||||
|
||||
ln -sf "$HOME/apps/go-${GO_VERSION}" "$HOME/apps/go"
|
||||
|
||||
rm -rf "$tmpDir"
|
||||
}
|
||||
|
||||
function install_nodejs {
|
||||
#if command -v node ; then
|
||||
# return 0
|
||||
#fi
|
||||
local tmpDir=$(mktemp -d)
|
||||
|
||||
local arch=""
|
||||
|
||||
case "$ARCH" in
|
||||
"amd64")
|
||||
arch="x64"
|
||||
;;
|
||||
"arm64")
|
||||
arch="arm64"
|
||||
;;
|
||||
*)
|
||||
>&2 echo "arch ($ARCH) not support"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local url="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${OSTYPE}-${arch}.tar.xz"
|
||||
|
||||
if ! wget -O "$tmpDir/node.tar.xz" "$url" ; then
|
||||
rm -rf "$tmpDir"
|
||||
>&2 echo "download nodejs binary failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! tar xJf "$tmpDir/node.tar.xz" -C "$tmpDir" ; then
|
||||
rm -rf "$tmpDir"
|
||||
>&2 echo "untar nodejs binary failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
dirs=$(find "$tmpDir" -type d -mindepth 1 -maxdepth 1 -name 'node*')
|
||||
|
||||
mv "$dirs" "$HOME/apps/node-v${NODE_VERSION}"
|
||||
|
||||
if [ -L "$HOME/apps/node" ]; then
|
||||
#rm -rf `readlink -f "$HOME/apps/node"`
|
||||
unlink "$HOME/apps/node"
|
||||
fi
|
||||
|
||||
ln -sf "$HOME/apps/node-v${NODE_VERSION}" "$HOME/apps/node"
|
||||
|
||||
rm -rf "$tmpDir"
|
||||
}
|
||||
|
||||
function install_rust {
|
||||
if command -v cargo ; then
|
||||
return 0
|
||||
fi
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile default -y
|
||||
}
|
||||
|
||||
{{ if .dev.golang }}
|
||||
echo "start install golang ${GO_VERSION}..."
|
||||
if ! install_golang ; then
|
||||
>&2 echo "install golang failed"
|
||||
exit 1
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
{{ if .dev.nodejs }}
|
||||
echo "start install nodejs v${NODE_VERSION}..."
|
||||
if ! install_nodejs ; then
|
||||
>&2 echo "install nodejs failed"
|
||||
exit 1
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
{{ if .dev.rust }}
|
||||
echo "start install rust..."
|
||||
if ! install_rust ; then
|
||||
>&2 echo "install rust failed"
|
||||
exit 1
|
||||
fi
|
||||
{{ end }}
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# filename format datetime YYYYMMDD-HHMMSS.png
|
||||
filename=$(date +%Y%m%d-%H%M%S).png
|
||||
|
||||
# Get the picture from maim
|
||||
# flameshot gui -r > $HOME/.cache/src.png &
|
||||
grim -g "0,0 1920x1200" "$HOME/ramdisk/$filename" &
|
||||
wait $!
|
||||
|
||||
# add shadow, round corner, border and watermark
|
||||
# convert $HOME/ramdisk/src.png \
|
||||
# \( +clone -alpha extract \
|
||||
# -draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
|
||||
# \( +clone -flip \) -compose Multiply -composite \
|
||||
# \( +clone -flop \) -compose Multiply -composite \
|
||||
# \) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
|
||||
|
||||
# convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
|
||||
# +swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
|
||||
|
||||
# # composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
|
||||
|
||||
# # Send the Picture to clipboard
|
||||
# # xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
|
||||
# wl-copy -t image/png < $HOME/ramdisk/des.png
|
||||
|
||||
# # remove the other pictures
|
||||
# rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
|
||||
notify-send "screenshot success"
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F ' ' '{print $2}')
|
||||
|
||||
if [ $muted == "yes" ]; then
|
||||
echo "{\"alt\": \"mute\", \"class\": \"muted\", \"tooltip\": \"muted\"}"
|
||||
exit
|
||||
fi
|
||||
|
||||
VOL=$(pactl get-sink-volume @DEFAULT_SINK@ | grep Volume | awk -F' ' '{print $5}' | sed -e 's/%$//')
|
||||
|
||||
echo "{\"percentage\": $VOL, \"tooltip\": \"$VOL%\"}"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "請輸入檔案名稱"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "file not exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILENAME="${1##*/}"
|
||||
DIRNAME="${FILENAME%.*}"
|
||||
EXTNAME="${FILENAME##*.}"
|
||||
|
||||
echo "$DIRNAME"
|
||||
|
||||
mkdir "$DIRNAME"
|
||||
|
||||
# gen key
|
||||
openssl rand 16 > "$DIRNAME/enc.key"
|
||||
|
||||
# new key info file
|
||||
echo "enc.key" > keyinfo
|
||||
echo "$DIRNAME/enc.key" >> keyinfo
|
||||
openssl rand 16 -hex >> keyinfo
|
||||
|
||||
# convert
|
||||
ffmpeg -i "$1" -f hls -hls_time 10 -hls_list_size 0 -vn -hls_segment_filename "$DIRNAME/segment%d.ts" -hls_key_info_file keyinfo -hls_playlist_type vod "$DIRNAME/playlist.m3u8"
|
||||
|
||||
# move origin file
|
||||
cp "$1" "$DIRNAME/origin.$EXTNAME"
|
||||
|
||||
# clean tmp file
|
||||
rm keyinfo
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <go-version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# chezmoi will replace the OS and ARCH variables
|
||||
ARCH="{{ .chezmoi.arch }}"
|
||||
OS="{{ .chezmoi.os }}"
|
||||
|
||||
if [ ! -d "$HOME/apps" ]; then
|
||||
if ! mkdir -p "$HOME/apps"; then
|
||||
>&2 echo "Failed to create $HOME/apps"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
deleteTmpDir() {
|
||||
if [ -d "$1" ]; then
|
||||
rm -rf "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
|
||||
trap 'deleteTmpDir '"$TMP_DIR"'' EXIT
|
||||
|
||||
install_go() {
|
||||
|
||||
local url="https://go.dev/dl/go$1.$OS-$ARCH.tar.gz"
|
||||
|
||||
if ! wget -O "$TMP_DIR/go.tar.gz" "$url"; then
|
||||
>&2 echo "Failed to download $url"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! tar zxf "$TMP_DIR/go.tar.gz" -C "$TMP_DIR"; then
|
||||
>&2 echo "Failed to extract $TMP_DIR/go.tar.gz"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mv "$TMP_DIR/go" "$HOME/apps/go-$1"
|
||||
|
||||
# relink go folder to the new version
|
||||
if [ -L "$HOME/apps/go" ]; then
|
||||
unlink "$HOME/apps/go"
|
||||
fi
|
||||
|
||||
ln -s "$HOME/apps/go-$1" "$HOME/apps/go"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_go "$1"
|
||||
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xe
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <node-version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# chezmoi will replace the OS and ARCH variables
|
||||
ARCH="{{ .chezmoi.arch }}"
|
||||
OS="{{ .chezmoi.os }}"
|
||||
|
||||
if [ ! -d "$HOME/apps" ]; then
|
||||
if ! mkdir -p "$HOME/apps"; then
|
||||
>&2 echo "Failed to create $HOME/apps"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
deleteTmpDir() {
|
||||
if [ -d "$1" ]; then
|
||||
rm -rf "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
|
||||
trap 'deleteTmpDir '"$TMP_DIR"'' EXIT
|
||||
|
||||
install_nodejs() {
|
||||
local arch=""
|
||||
|
||||
NODE_VERSION=$1
|
||||
|
||||
case "$ARCH" in
|
||||
"amd64")
|
||||
arch="x64"
|
||||
;;
|
||||
"arm64")
|
||||
arch="arm64"
|
||||
;;
|
||||
*)
|
||||
>&2 echo "arch ($ARCH) not support"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local url="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${OS}-${arch}.tar.xz"
|
||||
|
||||
if ! wget -O "$TMP_DIR/node.tar.xz" "$url"; then
|
||||
>&2 echo "Failed to download $url"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! tar xf "$TMP_DIR/node.tar.xz" -C "$TMP_DIR"; then
|
||||
>&2 echo "Failed to extract $TMP_DIR/node.tar.xz"
|
||||
return 1
|
||||
fi
|
||||
|
||||
dirs=$(find "$TMP_DIR" -maxdepth 1 -type d -name "node*")
|
||||
|
||||
if [ -z "$dirs" ]; then
|
||||
>&2 echo "Failed to find node folder"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mv "$dirs" "$HOME/apps/node-v$NODE_VERSION"
|
||||
|
||||
if [ -L "$HOME/apps/node" ]; then
|
||||
unlink "$HOME/apps/node"
|
||||
fi
|
||||
|
||||
ln -s "$HOME/apps/node-v$NODE_VERSION" "$HOME/apps/node"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install_require_dep() {
|
||||
PATH="$HOME/apps/go/bin:$HOME/apps/node/bin:$PATH"
|
||||
|
||||
if command -v npm > /dev/null; then
|
||||
npm i -g typescript typescript-language-server dockerfile-language-server-nodejs svelte-language-server
|
||||
fi
|
||||
}
|
||||
install_nodejs "$1"
|
||||
install_require_dep
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xe
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <src-folder-path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tmpFolder=$(mktemp -d)
|
||||
|
||||
deleteTmpFolder() {
|
||||
rm -rf $tmpFolder
|
||||
}
|
||||
|
||||
trap deleteTmpFolder EXIT
|
||||
|
||||
wd=$(pwd)
|
||||
encName="lbk-$(date +%Y%m%d)-enc.zip"
|
||||
|
||||
# 7z a -tzip -p -mem=AES256 archive.zip file1 file2 directory/
|
||||
|
||||
# compress Source.zip without encryption
|
||||
cd $1
|
||||
|
||||
zip -r "$tmpFolder/Source.zip" .
|
||||
|
||||
# generate Source.zip md5
|
||||
md5sum "$tmpFolder/Source.zip" | cut -d' ' -f1 | tee "$tmpFolder/Vendor_Src_MD5.txt"
|
||||
|
||||
# compress with encryption
|
||||
cd $tmpFolder
|
||||
|
||||
7z a -tzip -pLb1234567890 -mem=AES256 "$tmpFolder/$encName" Source.zip Vendor_Src_MD5.txt
|
||||
|
||||
# copy to pwd folder
|
||||
cp "$tmpFolder/$encName" $wd
|
||||
cd $wd
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
|
||||
# usage: pack-magneto2-source <image repo> [output folder]
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <image repo> [output folder]"
|
||||
exit 1
|
||||
fi
|
||||
IMAGE_REPO=$1
|
||||
OUTPUT_FOLDER=$(realpath "${2:-.}")
|
||||
|
||||
# echo "Packing Magento 2 source code from $IMAGE_REPO to $OUTPUT_FOLDER"
|
||||
uid=$(id -u)
|
||||
|
||||
docker run -it --rm -v "$OUTPUT_FOLDER:/out" -e "HOST_UID=$uid" \
|
||||
"$IMAGE_REPO" \
|
||||
bash -c 'cd /app && \
|
||||
find /app -type f -iname "*test*" -exec rm -f {} \; && \
|
||||
rm -rf /app/node_modules && \
|
||||
rm -rf /app/system/modules/swagger/public/swagger-ui/* && \
|
||||
chown -R $HOST_UID /app && \
|
||||
tar -cvf /out/magneto2.tar . && \
|
||||
chown $HOST_UID /out/magneto2.tar'
|
||||
|
||||
# vim : set ft=sh :
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Get the picture from maim
|
||||
# flameshot gui -r > $HOME/.cache/src.png &
|
||||
grim -g "$(slurp)" $HOME/ramdisk/src.png &
|
||||
wait $!
|
||||
|
||||
# add shadow, round corner, border and watermark
|
||||
convert $HOME/ramdisk/src.png \
|
||||
\( +clone -alpha extract \
|
||||
-draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
|
||||
\( +clone -flip \) -compose Multiply -composite \
|
||||
\( +clone -flop \) -compose Multiply -composite \
|
||||
\) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
|
||||
|
||||
convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
|
||||
+swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
|
||||
|
||||
# composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
|
||||
|
||||
# Send the Picture to clipboard
|
||||
# xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
|
||||
wl-copy -t image/png < $HOME/ramdisk/des.png
|
||||
|
||||
# remove the other pictures
|
||||
rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
|
||||
notify-send "screenshot success"
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Get the picture from maim
|
||||
# flameshot gui -r > $HOME/.cache/src.png &
|
||||
grim -g "$(slurp -or)" $HOME/ramdisk/src.png &
|
||||
wait $!
|
||||
|
||||
# add shadow, round corner, border and watermark
|
||||
convert $HOME/ramdisk/src.png \
|
||||
\( +clone -alpha extract \
|
||||
-draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
|
||||
\( +clone -flip \) -compose Multiply -composite \
|
||||
\( +clone -flop \) -compose Multiply -composite \
|
||||
\) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
|
||||
|
||||
convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
|
||||
+swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
|
||||
|
||||
# composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
|
||||
|
||||
# Send the Picture to clipboard
|
||||
# xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
|
||||
wl-copy -t image/png < $HOME/ramdisk/des.png
|
||||
|
||||
# remove the other pictures
|
||||
rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
|
||||
notify-send "screenshot success"
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 檢查是否為 root user,如果不是則使用 sudo 切換
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
exec sudo "$0" "$@"
|
||||
exit
|
||||
fi
|
||||
|
||||
# WireGuard 設定檔案資料夾
|
||||
wg_conf_folder="/etc/wireguard/"
|
||||
|
||||
# 列出所有可使用的設定檔案
|
||||
function list_conf_files() {
|
||||
echo "可用的 WireGuard 設定檔案:"
|
||||
ls -1 $wg_conf_folder | grep ".conf$"
|
||||
}
|
||||
|
||||
# 連線到指定的 VPN
|
||||
function connect() {
|
||||
local intf=$1
|
||||
# 切斷其他已連線的 VPN
|
||||
if [[ $1 == "--disconnect-others" ]] || [[ $1 == "-d" ]] ; then
|
||||
wg-quick down "$(wg show | grep "interface:" | awk '{print $2}')"
|
||||
intf=$2
|
||||
fi
|
||||
|
||||
# 確認設定檔案是否存在
|
||||
if [[ ! -f "$wg_conf_folder/$intf.conf" ]]; then
|
||||
echo "找不到 $wg_conf_folder/$intf.conf"
|
||||
exit
|
||||
fi
|
||||
|
||||
# 連線 VPN
|
||||
wg-quick up "$wg_conf_folder/$intf.conf"
|
||||
echo "已連線到 $intf"
|
||||
}
|
||||
|
||||
# 斷開指定的 VPN,若未指定則斷開所有 VPN
|
||||
function disconnect() {
|
||||
if [[ -n "$1" ]]; then
|
||||
wg-quick down "$1"
|
||||
echo "已斷開 $1"
|
||||
else
|
||||
wg-quick down "$(wg show | grep "interface:" | awk '{print $2}')"
|
||||
echo "已斷開所有 VPN"
|
||||
fi
|
||||
}
|
||||
|
||||
# 列出已連線的 VPN
|
||||
function list_connections() {
|
||||
echo "已連線的 VPN:"
|
||||
wg show | grep "interface:" | awk '{print $2}'
|
||||
}
|
||||
|
||||
# 判斷參數是否為空
|
||||
if [[ -z $1 ]]; then
|
||||
echo "使用方式:"
|
||||
echo " $0 list - 列出所有可使用的設定檔案"
|
||||
echo " $0 connect [-d|--disconnect-others] <config> - 連線到指定的 VPN"
|
||||
echo " $0 disconnect [interface] - 斷開指定的 VPN,若未指定則斷開所有 VPN"
|
||||
echo " $0 list-connections - 列出已連線的 VPN"
|
||||
exit
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
list_conf_files
|
||||
;;
|
||||
connect)
|
||||
if [[ -n $2 ]]; then
|
||||
connect "$2" "$3"
|
||||
else
|
||||
echo "請輸入要連線的 VPN 設定檔案名稱"
|
||||
fi
|
||||
;;
|
||||
disconnect)
|
||||
disconnect "$2"
|
||||
;;
|
||||
list-connections)
|
||||
list_connections
|
||||
;;
|
||||
*)
|
||||
echo "無效的參數:$1"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: set ft=sh :
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
[colors.bright]
|
||||
black = "#6272a4"
|
||||
blue = "#d6acff"
|
||||
cyan = "#a4ffff"
|
||||
green = "#69ff94"
|
||||
magenta = "#ff92df"
|
||||
red = "#ff6e6e"
|
||||
white = "#ffffff"
|
||||
yellow = "#ffffa5"
|
||||
|
||||
[colors.cursor]
|
||||
cursor = "CellForeground"
|
||||
text = "CellBackground"
|
||||
|
||||
[colors.footer_bar]
|
||||
background = "#282a36"
|
||||
foreground = "#f8f8f2"
|
||||
|
||||
[colors.hints.end]
|
||||
background = "#282a36"
|
||||
foreground = "#f1fa8c"
|
||||
|
||||
[colors.hints.start]
|
||||
background = "#f1fa8c"
|
||||
foreground = "#282a36"
|
||||
|
||||
[colors.line_indicator]
|
||||
background = "None"
|
||||
foreground = "None"
|
||||
|
||||
[colors.normal]
|
||||
black = "#21222c"
|
||||
blue = "#bd93f9"
|
||||
cyan = "#8be9fd"
|
||||
green = "#50fa7b"
|
||||
magenta = "#ff79c6"
|
||||
red = "#ff5555"
|
||||
white = "#f8f8f2"
|
||||
yellow = "#f1fa8c"
|
||||
|
||||
[colors.primary]
|
||||
bright_foreground = "#ffffff"
|
||||
foreground = "#f8f8f2"
|
||||
|
||||
[colors.search.focused_match]
|
||||
background = "#ffb86c"
|
||||
foreground = "#44475a"
|
||||
|
||||
[colors.search.matches]
|
||||
background = "#50fa7b"
|
||||
foreground = "#44475a"
|
||||
|
||||
[colors.selection]
|
||||
background = "#5e68ab"
|
||||
text = "CellForeground"
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
cursor = "CellForeground"
|
||||
text = "CellBackground"
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
|
||||
[font]
|
||||
size = 12.0
|
||||
|
||||
[font.normal]
|
||||
family = "Agave Nerd Font"
|
||||
|
||||
[font.offset]
|
||||
x = 0
|
||||
y = 0
|
||||
|
||||
[scrolling]
|
||||
history = 20000
|
||||
multiplier = 3
|
||||
|
||||
[window]
|
||||
opacity = 0.85
|
||||
|
||||
[window.padding]
|
||||
x = 5
|
||||
y = 5
|
||||
|
||||
[general]
|
||||
live_config_reload = true
|
||||
@@ -0,0 +1,9 @@
|
||||
# Sway essential session variables
|
||||
XDG_CURRENT_DESKTOP=sway
|
||||
XDG_SESSION_DESKTOP=sway
|
||||
XDG_SESSION_TYPE=wayland
|
||||
|
||||
# Toolkits and Compatibility
|
||||
ELECTRON_OZONE_PLATFORM_HINT=auto
|
||||
_JAVA_AWT_WM_NONREPARENTING=1
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||
@@ -0,0 +1,16 @@
|
||||
XIM=fcitx
|
||||
GTK_IM_MODULE=fcitx
|
||||
QT_IM_MODULE=fcitx
|
||||
XMODIFIERS=@im=fcitx
|
||||
GLFW_IM_MODULE=fcitx
|
||||
SDL_IM_MODULE=fcitx
|
||||
MOZ_ENABLE_WAYLAND=1
|
||||
RTC_USE_PIPEWIRE=true
|
||||
IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
|
||||
|
||||
GDK_BACKEND=wayland,x11
|
||||
QT_QPA_PLATFORM=wayland;xcb
|
||||
CLUTTER_BACKEND=wayland
|
||||
SDL_VIDEODRIVER=wayland
|
||||
EDITOR=nvim
|
||||
ELECTRON_OZONE_PLATFORM_HINT=auto
|
||||
@@ -0,0 +1,158 @@
|
||||
$bg: #1e1e2e;
|
||||
$fg: #cdd6f4;
|
||||
$blue: #89b4fa;
|
||||
$surface: #313244;
|
||||
$crust: #11111b;
|
||||
$yellow: #f9e2af;
|
||||
|
||||
* {
|
||||
font-family: "sans-serif";
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
button {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
background-color: $bg;
|
||||
color: $fg;
|
||||
border-radius: 8px;
|
||||
padding: 2px 5px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.ws-focused {
|
||||
background-color: $blue;
|
||||
color: $crust;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ws-inactive {
|
||||
color: #cdd6f4;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ffffff;
|
||||
}
|
||||
|
||||
.ws-inactive:hover {
|
||||
background-color: $surface;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.date-time {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.date-time:hover {
|
||||
background-color: $surface;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.battery-widget, .volume-widget, .brightness-widget, .caffeine {
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.tray-button {
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.tray-button:hover {
|
||||
background-color: $surface;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
background-color: $bg;
|
||||
color: $fg;
|
||||
padding: 15px;
|
||||
border: 1px solid $blue;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.vol-bar trough, .br-bar trough {
|
||||
background-color: $surface;
|
||||
border-radius: 10px;
|
||||
min-height: 4px;
|
||||
}
|
||||
|
||||
.vol-bar highlight {
|
||||
background-color: $blue;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.br-bar highlight {
|
||||
background-color: $yellow;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.caffeine {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.caffeine-on {
|
||||
color: $yellow;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.caffeine-off {
|
||||
color: $fg;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.tray-container {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.calendar-box {
|
||||
background-color: $bg;
|
||||
color: $fg;
|
||||
padding: 15px;
|
||||
border: 1px solid $blue;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
calendar {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: $blue;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.popup-subtitle {
|
||||
font-size: 12px;
|
||||
color: $fg;
|
||||
opacity: 0.8;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.profile-active {
|
||||
background-color: $blue;
|
||||
color: $crust;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.profile-inactive {
|
||||
background-color: $surface;
|
||||
color: $fg;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.profile-inactive:hover {
|
||||
background-color: lighten($surface, 5%);
|
||||
border: 1px solid $blue;
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
(defpoll time :interval "1s" "date '+%Y/%m/%d %H:%M:%S'")
|
||||
(defpoll inhibit_status :interval "1s" "[ -f /tmp/eww-inhibit.pid ] && echo 'on' || echo 'off'")
|
||||
(defpoll vol :interval "1s" :initial "0" "bash ~/.config/eww/scripts/volume.sh get")
|
||||
(defpoll vol_icon :interval "1s" :initial "🔉" "bash ~/.config/eww/scripts/volume.sh icon")
|
||||
(defpoll br :interval "1s" :initial "50" "bash ~/.config/eww/scripts/brightness.sh get")
|
||||
(defpoll br_icon :interval "1s" :initial "☀️" "bash ~/.config/eww/scripts/brightness.sh icon")
|
||||
(defpoll battery :interval "10s" :initial "100" "cat /sys/class/power_supply/BAT*/capacity 2>/dev/null || echo 100")
|
||||
(defpoll battery_status :interval "10s" :initial "Unknown" "cat /sys/class/power_supply/BAT*/status 2>/dev/null || echo Unknown")
|
||||
(defpoll power_profile :interval "5s" :initial "balanced" "bash ~/.config/eww/scripts/power-profile.sh get")
|
||||
(defpoll power_profile_icon :interval "5s" :initial "⚖️" "bash ~/.config/eww/scripts/power-profile.sh icon")
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces.sh")
|
||||
|
||||
(defwidget workspaces_widget []
|
||||
(box :class "workspaces" :orientation "h" :space-evenly false :spacing 5
|
||||
(for ws in workspaces
|
||||
(button :onclick "swaymsg workspace ${ws.name}"
|
||||
:class {ws.focused ? "ws-focused" : "ws-inactive"}
|
||||
"${ws.name}"))))
|
||||
|
||||
(defwidget date_widget []
|
||||
(box :class "date-time"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh calendar"
|
||||
time)))
|
||||
|
||||
(defwidget volume_widget []
|
||||
(box :class "volume-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh volume_popup"
|
||||
:onrightclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
:class "tray-button"
|
||||
"${vol_icon} ${vol}%")))
|
||||
|
||||
(defwidget brightness_widget []
|
||||
(box :class "brightness-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh brightness_popup"
|
||||
:class "tray-button"
|
||||
"${br_icon} ${br}%")))
|
||||
|
||||
(defwidget caffeine_widget []
|
||||
(box :class "caffeine"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-inhibit.sh"
|
||||
:class "tray-button ${inhibit_status == 'on' ? 'caffeine-on' : 'caffeine-off'}"
|
||||
{inhibit_status == "on" ? "☕" : "🌙"})))
|
||||
|
||||
(defwidget battery_widget []
|
||||
(box :class "battery-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
:tooltip "Battery: ${battery}% (${battery_status})\nPower Profile: ${power_profile}"
|
||||
:class "tray-button"
|
||||
"${battery_status == 'Charging' ? '🔌' :
|
||||
battery >= 80 ? '🔋' :
|
||||
battery >= 50 ? '🔋' :
|
||||
battery >= 20 ? '🪫' :
|
||||
'🪫'} ${battery}% ${power_profile_icon}")))
|
||||
|
||||
(defwidget tray_widget []
|
||||
(box :halign "end" :class "tray-container" :space-evenly false :spacing 10
|
||||
(battery_widget)
|
||||
(brightness_widget)
|
||||
(volume_widget)
|
||||
(caffeine_widget)
|
||||
(systray :orientation "h" :spacing 5 :icon-size 20 :prepend-new true)))
|
||||
|
||||
(defwidget bar_layout []
|
||||
(box :class "main-container"
|
||||
(centerbox :orientation "h"
|
||||
(workspaces_widget)
|
||||
(date_widget)
|
||||
(tray_widget))))
|
||||
|
||||
(defwindow bar
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "0%" :y "0%" :width "99%" :height "30px" :anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:focusable false
|
||||
(bar_layout))
|
||||
|
||||
(defwindow calendar
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "0%" :y "15px" :width "250px" :height "250px" :anchor "top center")
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
(box :class "calendar-box"
|
||||
(calendar)))
|
||||
|
||||
(defwindow volume_popup
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "15px" :y "15px" :width "300px" :height "60px" :anchor "top right")
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
(box :class "popup-box" :space-evenly false :spacing 15
|
||||
(button :onclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" vol_icon)
|
||||
(scale :class "vol-bar" :min 0 :max 101 :value {vol == "" ? 0 : vol} :width 150 :onchange "wpctl set-volume @DEFAULT_AUDIO_SINK@ {}%")
|
||||
(label :text "${vol}%")))
|
||||
|
||||
(defwindow brightness_popup
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "15px" :y "15px" :width "300px" :height "60px" :anchor "top right")
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
(box :class "popup-box" :space-evenly false :spacing 15
|
||||
(label :text br_icon)
|
||||
(scale :class "br-bar" :min 0 :max 101 :value {br == "" ? 0 : br} :width 150 :onchange "brightnessctl s {}%")
|
||||
(label :text "${br}%")))
|
||||
|
||||
(defwindow power_profile_popup
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "15px" :y "15px" :width "300px" :height "180px" :anchor "top right")
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
(box :class "popup-box" :orientation "v" :space-evenly false :spacing 10
|
||||
(label :class "popup-title" :text "Power Profile")
|
||||
(box :orientation "v" :spacing 8
|
||||
(button :class {power_profile == "power-saver" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set power-saver && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"🐢 Power Saver")
|
||||
(button :class {power_profile == "balanced" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set balanced && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"⚖️ Balanced")
|
||||
(button :class {power_profile == "performance" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set performance && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"🚀 Performance"))
|
||||
(label :class "popup-subtitle" :text "Current: ${power_profile}")))
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! eww ping >/dev/null 2>&1; then
|
||||
eww daemon
|
||||
fi
|
||||
|
||||
eww close-all
|
||||
eww open bar --screen 'eDP-1'
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 獲取目前亮度百分比
|
||||
get_brightness() {
|
||||
brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}'
|
||||
}
|
||||
|
||||
case $1 in
|
||||
get)
|
||||
get_brightness
|
||||
;;
|
||||
icon)
|
||||
BR=$(get_brightness)
|
||||
if [ "$BR" -gt 66 ]; then echo "☀️";
|
||||
elif [ "$BR" -gt 33 ]; then echo "🌤️";
|
||||
else echo "🔅"; fi
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# 需安裝 jq
|
||||
get_workspaces() {
|
||||
swaymsg -t get_workspaces | jq -c 'sort_by(.num)'
|
||||
}
|
||||
|
||||
# 初始輸出
|
||||
get_workspaces
|
||||
|
||||
# 監聽事件並更新
|
||||
swaymsg -t subscribe '["workspace"]' -m | while read -r line; do
|
||||
get_workspaces
|
||||
done
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定義 PID 檔案路徑
|
||||
PID_FILE="/tmp/eww-inhibit.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
# 讀取 PID 並殺掉程序
|
||||
PID=$(cat "$PID_FILE")
|
||||
kill "$PID" 2>/dev/null
|
||||
rm "$PID_FILE"
|
||||
else
|
||||
# 啟動並記錄 PID
|
||||
systemd-inhibit --what=idle --mode=block sleep infinity &
|
||||
echo $! > "$PID_FILE"
|
||||
fi
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 目標視窗名稱
|
||||
TARGET=$1
|
||||
|
||||
# 獲取目前所有已開啟的視窗名稱 (提取冒號前文字並去空格)
|
||||
OPENED_WINDOWS=$(eww active-windows | cut -d: -f1 | tr -d ' ')
|
||||
|
||||
# 所有受管理的彈出視窗清單
|
||||
MANAGED_WINDOWS=("calendar" "volume_popup" "brightness_popup")
|
||||
|
||||
# 遍歷目前已開啟的視窗
|
||||
for win in $OPENED_WINDOWS; do
|
||||
# 檢查該視窗是否在受管名單內,且不是目標視窗
|
||||
# 我們不關閉 "bar" 視窗
|
||||
if [[ " ${MANAGED_WINDOWS[@]} " =~ " ${win} " ]] && [ "$win" != "$TARGET" ]; then
|
||||
eww close "$win"
|
||||
fi
|
||||
done
|
||||
|
||||
# 如果有目標視窗,則切換其顯示狀態
|
||||
if [ -n "$TARGET" ]; then
|
||||
eww open --toggle "$TARGET"
|
||||
fi
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 獲取預設輸出裝置的音量資訊 (輸出範例: Volume: 0.50 [MUTED])
|
||||
GET_VOL=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||
|
||||
# 提取數值並轉換為百分比 (0-100)
|
||||
# 使用 printf %.0f 將小數四捨五入為整數
|
||||
VOL=$(echo "$GET_VOL" | awk '{print $2 * 100}' | xargs printf "%.0f")
|
||||
|
||||
if [ "$1" == "get" ]; then
|
||||
echo "$VOL"
|
||||
elif [ "$1" == "icon" ]; then
|
||||
# 檢查是否含有 [MUTED] 字樣
|
||||
if echo "$GET_VOL" | grep -q "\[MUTED\]"; then
|
||||
echo "🔇"
|
||||
else
|
||||
if [ "$VOL" -gt 60 ]; then echo "🔊";
|
||||
elif [ "$VOL" -gt 30 ]; then echo "🔉";
|
||||
else echo "🔈"; fi
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,63 @@
|
||||
# This is the configuration file for Ghostty.
|
||||
#
|
||||
# This template file has been automatically created at the following
|
||||
# path since Ghostty couldn't find any existing config files on your system:
|
||||
#
|
||||
# /home/jay/.config/ghostty/config
|
||||
#
|
||||
# The template does not set any default options, since Ghostty ships
|
||||
# with sensible defaults for all options. Users should only need to set
|
||||
# options that they want to change from the default.
|
||||
#
|
||||
# Run `ghostty +show-config --default --docs` to view a list of
|
||||
# all available config options and their default values.
|
||||
#
|
||||
# Additionally, each config option is also explained in detail
|
||||
# on Ghostty's website, at https://ghostty.org/docs/config.
|
||||
#
|
||||
# Ghostty can reload the configuration while running by using the menu
|
||||
# options or the bound key (default: Command + Shift + comma on macOS and
|
||||
# Control + Shift + comma on other platforms). Not all config options can be
|
||||
# reloaded while running; some only apply to new windows and others may require
|
||||
# a full restart to take effect.
|
||||
|
||||
# Config syntax crash course
|
||||
# ==========================
|
||||
# # The config file consists of simple key-value pairs,
|
||||
# # separated by equals signs.
|
||||
font-family = "FiraMono Nerd Font Mono"
|
||||
font-size = 10
|
||||
|
||||
#window-padding-x = 2
|
||||
#window-padding-y = 2
|
||||
|
||||
#
|
||||
# # Spacing around the equals sign does not matter.
|
||||
# # All of these are identical:
|
||||
# key=value
|
||||
# key= value
|
||||
# key =value
|
||||
# key = value
|
||||
#
|
||||
# # Any line beginning with a # is a comment. It's not possible to put
|
||||
# # a comment after a config option, since it would be interpreted as a
|
||||
# # part of the value. For example, this will have a value of "#123abc":
|
||||
# background = #123abc
|
||||
#
|
||||
# # Empty values are used to reset config keys to default.
|
||||
# key =
|
||||
#
|
||||
# # Some config options have unique syntaxes for their value,
|
||||
# # which is explained in the docs for that config option.
|
||||
# # Just for example:
|
||||
# resize-overlay-duration = 4s 200ms
|
||||
|
||||
theme = "moonfly-default"
|
||||
|
||||
background-opacity = 0.9
|
||||
|
||||
confirm-close-surface = false
|
||||
|
||||
app-notifications = no-clipboard-copy,config-reload
|
||||
|
||||
keybind = ctrl+,=unbind
|
||||
@@ -0,0 +1,22 @@
|
||||
background = #0b0e14
|
||||
foreground = #bfbdb6
|
||||
selection-background = #1b3a5b
|
||||
selection-foreground = #bfbdb6
|
||||
cursor-color = #bfbdb6
|
||||
cursor-text = #0b0e14
|
||||
palette = 0=#1e232b
|
||||
palette = 1=#ea6c73
|
||||
palette = 2=#7fd962
|
||||
palette = 3=#f9af4f
|
||||
palette = 4=#53bdfa
|
||||
palette = 5=#cda1fa
|
||||
palette = 6=#90e1c6
|
||||
palette = 7=#c7c7c7
|
||||
palette = 8=#686868
|
||||
palette = 9=#f07178
|
||||
palette = 10=#aad94c
|
||||
palette = 11=#ffb454
|
||||
palette = 12=#59c2ff
|
||||
palette = 13=#d2a6ff
|
||||
palette = 14=#95e6cb
|
||||
palette = 15=#ffffff
|
||||
@@ -0,0 +1,23 @@
|
||||
palette = 0=#51576d
|
||||
palette = 1=#e78284
|
||||
palette = 2=#a6d189
|
||||
palette = 3=#e5c890
|
||||
palette = 4=#8caaee
|
||||
palette = 5=#f4b8e4
|
||||
palette = 6=#81c8be
|
||||
palette = 7=#a5adce
|
||||
palette = 8=#626880
|
||||
palette = 9=#e78284
|
||||
palette = 10=#a6d189
|
||||
palette = 11=#e5c890
|
||||
palette = 12=#8caaee
|
||||
palette = 13=#f4b8e4
|
||||
palette = 14=#81c8be
|
||||
palette = 15=#b5bfe2
|
||||
background = 303446
|
||||
foreground = c6d0f5
|
||||
cursor-color = f2d5cf
|
||||
cursor-text = 232634
|
||||
selection-background = 44495d
|
||||
selection-foreground = c6d0f5
|
||||
split-divider-color = 414559
|
||||
@@ -0,0 +1,23 @@
|
||||
palette = 0=#5c5f77
|
||||
palette = 1=#d20f39
|
||||
palette = 2=#40a02b
|
||||
palette = 3=#df8e1d
|
||||
palette = 4=#1e66f5
|
||||
palette = 5=#ea76cb
|
||||
palette = 6=#179299
|
||||
palette = 7=#acb0be
|
||||
palette = 8=#6c6f85
|
||||
palette = 9=#d20f39
|
||||
palette = 10=#40a02b
|
||||
palette = 11=#df8e1d
|
||||
palette = 12=#1e66f5
|
||||
palette = 13=#ea76cb
|
||||
palette = 14=#179299
|
||||
palette = 15=#bcc0cc
|
||||
background = eff1f5
|
||||
foreground = 4c4f69
|
||||
cursor-color = dc8a78
|
||||
cursor-text = eff1f5
|
||||
selection-background = d8dae1
|
||||
selection-foreground = 4c4f69
|
||||
split-divider-color = ccd0da
|
||||
@@ -0,0 +1,23 @@
|
||||
palette = 0=#494d64
|
||||
palette = 1=#ed8796
|
||||
palette = 2=#a6da95
|
||||
palette = 3=#eed49f
|
||||
palette = 4=#8aadf4
|
||||
palette = 5=#f5bde6
|
||||
palette = 6=#8bd5ca
|
||||
palette = 7=#a5adcb
|
||||
palette = 8=#5b6078
|
||||
palette = 9=#ed8796
|
||||
palette = 10=#a6da95
|
||||
palette = 11=#eed49f
|
||||
palette = 12=#8aadf4
|
||||
palette = 13=#f5bde6
|
||||
palette = 14=#8bd5ca
|
||||
palette = 15=#b8c0e0
|
||||
background = 24273a
|
||||
foreground = cad3f5
|
||||
cursor-color = f4dbd6
|
||||
cursor-text = 181926
|
||||
selection-background = 3a3e53
|
||||
selection-foreground = cad3f5
|
||||
split-divider-color = 363a4f
|
||||
@@ -0,0 +1,23 @@
|
||||
palette = 0=#45475a
|
||||
palette = 1=#f38ba8
|
||||
palette = 2=#a6e3a1
|
||||
palette = 3=#f9e2af
|
||||
palette = 4=#89b4fa
|
||||
palette = 5=#f5c2e7
|
||||
palette = 6=#94e2d5
|
||||
palette = 7=#a6adc8
|
||||
palette = 8=#585b70
|
||||
palette = 9=#f38ba8
|
||||
palette = 10=#a6e3a1
|
||||
palette = 11=#f9e2af
|
||||
palette = 12=#89b4fa
|
||||
palette = 13=#f5c2e7
|
||||
palette = 14=#94e2d5
|
||||
palette = 15=#bac2de
|
||||
background = 1e1e2e
|
||||
foreground = cdd6f4
|
||||
cursor-color = f5e0dc
|
||||
cursor-text = 11111b
|
||||
selection-background = 353749
|
||||
selection-foreground = cdd6f4
|
||||
split-divider-color = 313244
|
||||
@@ -0,0 +1,22 @@
|
||||
background = #080808
|
||||
foreground = #bdbdbd
|
||||
selection-background = #b2ceee
|
||||
selection-foreground = #080808
|
||||
cursor-color = #9e9e9e
|
||||
cursor-text = #080808
|
||||
palette = 0=#323437
|
||||
palette = 1=#ff5454
|
||||
palette = 2=#8cc85f
|
||||
palette = 3=#e3c78a
|
||||
palette = 4=#80a0ff
|
||||
palette = 5=#cf87e8
|
||||
palette = 6=#79dac8
|
||||
palette = 7=#c6c6c6
|
||||
palette = 8=#949494
|
||||
palette = 9=#ff5189
|
||||
palette = 10=#36c692
|
||||
palette = 11=#c6c684
|
||||
palette = 12=#74b2ff
|
||||
palette = 13=#ae81ff
|
||||
palette = 14=#85dc85
|
||||
palette = 15=#e4e4e4
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 MiB |
@@ -0,0 +1,324 @@
|
||||
# This is an example Hyprland config file.
|
||||
# Refer to the wiki for more information.
|
||||
# https://wiki.hyprland.org/Configuring/
|
||||
|
||||
# Please note not all available settings / options are set here.
|
||||
# For a full list, see the wiki
|
||||
|
||||
# You can split this configuration into multiple files
|
||||
# Create your files separately and then link them to this file like this:
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
|
||||
|
||||
################
|
||||
### MONITORS ###
|
||||
################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=,preferred,auto,auto
|
||||
monitor=eDP-1,preferred,auto,1.2
|
||||
|
||||
|
||||
###################
|
||||
### MY PROGRAMS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
|
||||
# Set programs that you use
|
||||
$terminal = alacritty
|
||||
$fileManager = dolphin
|
||||
$menu = wofi --show drun
|
||||
|
||||
|
||||
#################
|
||||
### AUTOSTART ###
|
||||
#################
|
||||
|
||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
# exec-once = $terminal
|
||||
# exec-once = nm-applet &
|
||||
# exec-once = waybar & hyprpaper & firefox
|
||||
|
||||
|
||||
#############################
|
||||
### ENVIRONMENT VARIABLES ###
|
||||
#############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||
|
||||
env = XCURSOR_SIZE,24
|
||||
env = HYPRCURSOR_SIZE,24
|
||||
|
||||
|
||||
###################
|
||||
### PERMISSIONS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Permissions/
|
||||
# Please note permission changes here require a Hyprland restart and are not applied on-the-fly
|
||||
# for security reasons
|
||||
|
||||
# ecosystem {
|
||||
# enforce_permissions = 1
|
||||
# }
|
||||
|
||||
# permission = /usr/(bin|local/bin)/grim, screencopy, allow
|
||||
# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
|
||||
# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
|
||||
|
||||
|
||||
#####################
|
||||
### LOOK AND FEEL ###
|
||||
#####################
|
||||
|
||||
# Refer to https://wiki.hyprland.org/Configuring/Variables/
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#general
|
||||
general {
|
||||
gaps_in = 5
|
||||
gaps_out = 20
|
||||
|
||||
border_size = 2
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
|
||||
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
col.inactive_border = rgba(595959aa)
|
||||
|
||||
# Set to true enable resizing windows by clicking and dragging on borders and gaps
|
||||
resize_on_border = false
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = false
|
||||
|
||||
layout = dwindle
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
||||
decoration {
|
||||
rounding = 10
|
||||
rounding_power = 2
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0
|
||||
inactive_opacity = 1.0
|
||||
|
||||
shadow {
|
||||
enabled = true
|
||||
range = 4
|
||||
render_power = 3
|
||||
color = rgba(1a1a1aee)
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||
blur {
|
||||
enabled = true
|
||||
size = 3
|
||||
passes = 1
|
||||
|
||||
vibrancy = 0.1696
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#animations
|
||||
animations {
|
||||
enabled = yes, please :)
|
||||
|
||||
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = easeOutQuint,0.23,1,0.32,1
|
||||
bezier = easeInOutCubic,0.65,0.05,0.36,1
|
||||
bezier = linear,0,0,1,1
|
||||
bezier = almostLinear,0.5,0.5,0.75,1.0
|
||||
bezier = quick,0.15,0,0.1,1
|
||||
|
||||
animation = global, 1, 10, default
|
||||
animation = border, 1, 5.39, easeOutQuint
|
||||
animation = windows, 1, 4.79, easeOutQuint
|
||||
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
|
||||
animation = windowsOut, 1, 1.49, linear, popin 87%
|
||||
animation = fadeIn, 1, 1.73, almostLinear
|
||||
animation = fadeOut, 1, 1.46, almostLinear
|
||||
animation = fade, 1, 3.03, quick
|
||||
animation = layers, 1, 3.81, easeOutQuint
|
||||
animation = layersIn, 1, 4, easeOutQuint, fade
|
||||
animation = layersOut, 1, 1.5, linear, fade
|
||||
animation = fadeLayersIn, 1, 1.79, almostLinear
|
||||
animation = fadeLayersOut, 1, 1.39, almostLinear
|
||||
animation = workspaces, 1, 1.94, almostLinear, fade
|
||||
animation = workspacesIn, 1, 1.21, almostLinear, fade
|
||||
animation = workspacesOut, 1, 1.94, almostLinear, fade
|
||||
}
|
||||
|
||||
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
|
||||
# "Smart gaps" / "No gaps when only"
|
||||
# uncomment all if you wish to use that.
|
||||
# workspace = w[tv1], gapsout:0, gapsin:0
|
||||
# workspace = f[1], gapsout:0, gapsin:0
|
||||
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
|
||||
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
|
||||
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
|
||||
# windowrule = rounding 0, floating:0, onworkspace:f[1]
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
dwindle {
|
||||
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = true # You probably want this
|
||||
}
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
master {
|
||||
new_status = master
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
||||
misc {
|
||||
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :(
|
||||
}
|
||||
|
||||
|
||||
#############
|
||||
### INPUT ###
|
||||
#############
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#input
|
||||
input {
|
||||
kb_layout = us
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options =
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
|
||||
touchpad {
|
||||
scroll_factor = 0.6
|
||||
natural_scroll = false
|
||||
tap-to-click = true
|
||||
drag_lock = true
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||
gestures {
|
||||
workspace_swipe = false
|
||||
}
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
||||
device {
|
||||
name = epic-mouse-v1
|
||||
sensitivity = -0.5
|
||||
}
|
||||
|
||||
|
||||
###################
|
||||
### KEYBINDINGS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
$mainMod = SUPER
|
||||
$altMod = ALT
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
bind = $altMod SHIFT, C, exec, ~/bin/screenshot
|
||||
bind = $altMod SHIFT, M, exec, ~/bin/screenshot-monitor
|
||||
|
||||
bind = $mainMod, Return, exec, alacritty
|
||||
bind = $mainMod SHIFT, Q, killactive,
|
||||
bind = $mainMod SHIFT, E, exit,
|
||||
bind = $mainMod SHIFT, SPACE, togglefloating,
|
||||
bind = $mainMod, D, exec, wofi --show drun
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod SHIFT, J, togglesplit, # dwindle
|
||||
bind = $mainMod SHIFT, P, exec, ~/.config/wofi/wofi-power.sh
|
||||
bind = $mainMod SHIFT, X, exec, swaylock -f -i ~/.config/swaylock/bg.png -s fill
|
||||
|
||||
bind = $mainMod, F, fullscreen, 1
|
||||
bind = $mainMod SHIFT, F, fullscreen, 0
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
# when move focus key released, set active window to top
|
||||
bindr = $mainMod, left, bringactivetotop
|
||||
bindr = $mainMod, right, bringactivetotop
|
||||
bindr = $mainMod, up, bringactivetotop
|
||||
bindr = $mainMod, down, bringactivetotop
|
||||
|
||||
binde = $mainMod SHIFT, left, movewindow, l
|
||||
binde = $mainMod SHIFT, right, movewindow, r
|
||||
binde = $mainMod SHIFT, up, movewindow, u
|
||||
binde = $mainMod SHIFT, down, movewindow, d
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, togglespecialworkspace, magic
|
||||
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
bind = $mainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
# Laptop multimedia keys for volume and LCD brightness
|
||||
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
|
||||
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
||||
bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+
|
||||
bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-
|
||||
|
||||
# Requires playerctl
|
||||
bindl = , XF86AudioNext, exec, playerctl next
|
||||
bindl = , XF86AudioPause, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||
|
||||
##############################
|
||||
### WINDOWS AND WORKSPACES ###
|
||||
##############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
# Example windowrule
|
||||
# windowrule = float,class:^(kitty)$,title:^(kitty)$
|
||||
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
windowrule = suppressevent maximize, class:.*
|
||||
|
||||
# Fix some dragging issues with XWayland
|
||||
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||
@@ -0,0 +1,2 @@
|
||||
font=JetBrainsMono Nerd Font 10
|
||||
default-timeout=5000
|
||||
@@ -0,0 +1,9 @@
|
||||
-- HELPERS ----------------------------------------------------
|
||||
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
|
||||
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
|
||||
local g = vim.g -- a table to access global variables
|
||||
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
|
||||
-- Set CMD ----------------------------------------------------
|
||||
require("basic")
|
||||
-- Load Plugins ------------------------------------------------
|
||||
require("plugins")
|
||||
@@ -0,0 +1,2 @@
|
||||
require("basic.setup")
|
||||
require('basic.mapping')
|
||||
@@ -0,0 +1,27 @@
|
||||
-- HELPERS ----------------------------------------------------
|
||||
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
|
||||
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
|
||||
local g = vim.g -- a table to access global variables
|
||||
local keymap = vim.keymap -- keymap
|
||||
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
|
||||
|
||||
g.mapleader = ';'
|
||||
|
||||
keymap.set('n', '<leader>sw', '<c-w>')
|
||||
keymap.set('n', '<leader>sww', '<c-w>k')
|
||||
keymap.set('n', '<leader>sws', '<c-w>j')
|
||||
keymap.set('n', '<leader>swa', '<c-w>h')
|
||||
keymap.set('n', '<leader>swd', '<c-w>l')
|
||||
|
||||
keymap.set('n', '<leader><leader>a', 'gT')
|
||||
keymap.set('n', '<leader><leader>d', 'gt')
|
||||
|
||||
keymap.set('n', '<F9>', ':%!jq .<CR>')
|
||||
|
||||
keymap.set('n', '<leader>sg', ':lua vim.diagnostic.open_float(0, {scope="line"})<CR>')
|
||||
|
||||
if vim.api.nvim_win_get_option(0, "diff") then
|
||||
keymap.set('n', '<leader>1', ':diffget LOCAL<CR>')
|
||||
keymap.set('n', '<leader>2', ':diffget REMOTE<CR>')
|
||||
keymap.set('n', '<leader>3', ':%diffget LOCAL<CR>')
|
||||
end
|
||||
@@ -0,0 +1,66 @@
|
||||
-- HELPERS ----------------------------------------------------
|
||||
local opt = vim.opt
|
||||
|
||||
-- SYNTAX & FILETYPE ------------------------------------------
|
||||
vim.cmd "syntax on"
|
||||
vim.cmd "filetype plugin indent on"
|
||||
|
||||
-- BASIC SETTINGS ---------------------------------------------
|
||||
opt.number = true -- 顯示行號
|
||||
opt.relativenumber = true -- 顯示相對行號
|
||||
opt.tabstop = 2 -- Tab 寬度
|
||||
opt.shiftwidth = 2 -- 縮排寬度
|
||||
opt.expandtab = true -- 將 Tab 轉為空格
|
||||
opt.foldenable = false -- 預設不折疊
|
||||
|
||||
opt.laststatus = 2 -- 始終顯示狀態列
|
||||
opt.ruler = true -- 顯示游標位置
|
||||
opt.cursorline = true -- 高亮當前行
|
||||
opt.cursorcolumn = true -- 高亮當前列
|
||||
opt.hlsearch = true -- 高亮搜尋結果
|
||||
opt.wrap = false -- 不自動換行
|
||||
|
||||
opt.backspace = { "indent", "eol", "start" }
|
||||
opt.encoding = "utf-8"
|
||||
opt.completeopt = { "menu", "menuone", "noselect" }
|
||||
opt.swapfile = false -- 不產生 swap 檔案
|
||||
opt.mouse = "" -- 禁用滑鼠
|
||||
|
||||
opt.background = "dark"
|
||||
|
||||
-- 自動命令 (Auto-commands) -----------------------------------
|
||||
|
||||
-- 處理配色方案與背景透明度
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.cmd([[
|
||||
highlight clear CursorLine
|
||||
highlight Normal ctermbg=none
|
||||
highlight LineNr ctermbg=none
|
||||
highlight Folded ctermbg=none
|
||||
highlight NonText ctermbg=none
|
||||
highlight SpecialKey ctermbg=none
|
||||
highlight VertSplit ctermbg=none
|
||||
highlight SignColumn ctermbg=none
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
||||
-- chezmoi 自動套用
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = vim.fn.expand("~/.local/share/chezmoi/*"),
|
||||
command = [[ ! chezmoi apply --source-path % ]],
|
||||
})
|
||||
|
||||
-- 診斷設定
|
||||
vim.diagnostic.config({ virtual_text = false, signs = true })
|
||||
|
||||
-- 特定語言設定
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "rust",
|
||||
callback = function()
|
||||
vim.opt_local.shiftwidth = 4
|
||||
vim.opt_local.tabstop = 4
|
||||
end
|
||||
})
|
||||
@@ -0,0 +1,48 @@
|
||||
return {
|
||||
"stevearc/aerial.nvim",
|
||||
keys = {
|
||||
{'<F8>', '<cmd>AerialToggle<CR>', desc = 'toggle aerial window', mode = 'n'},
|
||||
},
|
||||
opts = {
|
||||
backends = {"lsp", "treesitter"},
|
||||
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
|
||||
on_attach = function(bufnr)
|
||||
-- Jump forwards/backwards with '{' and '}'
|
||||
vim.keymap.set('n', '{', '<cmd>AerialPrev<CR>', {buffer = bufnr})
|
||||
vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', {buffer = bufnr})
|
||||
end,
|
||||
-- filter_kind = false,
|
||||
filter_kind = {
|
||||
"Class",
|
||||
"Constructor",
|
||||
"Enum",
|
||||
"Function",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Method",
|
||||
"Struct",
|
||||
"Variable",
|
||||
"Namespace",
|
||||
"Package",
|
||||
"Field",
|
||||
"Constant",
|
||||
},
|
||||
--manage_folds = true,
|
||||
link_tree_to_folds = false,
|
||||
-- Show box drawing characters for the tree hierarchy
|
||||
show_guides = true,
|
||||
|
||||
-- Customize the characters used when show_guides = true
|
||||
guides = {
|
||||
-- When the child item has a sibling below it
|
||||
mid_item = "├─",
|
||||
-- When the child item is the last in the list
|
||||
last_item = "└─",
|
||||
-- When there are nested child guides to the right
|
||||
nested_top = "│ ",
|
||||
-- Raw indentation
|
||||
whitespace = " ",
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
return {
|
||||
"w0rp/ale",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{'<leader>=', '<Plug>(ale_fix)', mode = 'n'},
|
||||
},
|
||||
config = function ()
|
||||
local g = vim.g
|
||||
|
||||
g.ale_linters = {
|
||||
javascript = {'{{ if .nvim.js_linter }}{{ .nvim.js_linter }}{{ else }}eslint{{ end }}'},
|
||||
typescript = {'{{ if .nvim.js_linter }}{{ .nvim.js_linter }}{{ else }}eslint{{ end }}'},
|
||||
go = {'gopls'},
|
||||
rust = {'analyzer'},
|
||||
sh = {'shellcheck'},
|
||||
zig = {'zls'},
|
||||
}
|
||||
|
||||
g.ale_fixers = {
|
||||
javascript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
||||
typescript = {'{{ if .nvim.js_fixer }}{{ .nvim.js_fixer }}{{ else }}eslint{{ end }}'},
|
||||
zig = {'zigfmt'},
|
||||
c = {'clang-format'},
|
||||
sh = {'shfmt'},
|
||||
}
|
||||
|
||||
g.ale_linters_explicit = 1
|
||||
g.ale_lint_on_save = 1
|
||||
g.ale_fix_on_save = 1
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "v4.*",
|
||||
opts = {
|
||||
options = {
|
||||
mode = 'tabs',
|
||||
diagnostics = 'nvim_lsp',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
return {
|
||||
"olimorris/codecompanion.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
ft = { "markdown", "codecompanion" }
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.diff",
|
||||
config = function()
|
||||
local diff = require("mini.diff")
|
||||
diff.setup({
|
||||
-- Disabled by default
|
||||
source = diff.gen_source.none(),
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
opts = {
|
||||
filetypes = {
|
||||
codecompanion = {
|
||||
prompt_for_file_name = false,
|
||||
template = "[Image]($FILE_PATH)",
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function ()
|
||||
local codecompanion = require("codecompanion")
|
||||
|
||||
codecompanion.setup({
|
||||
ignore_warnings = true,
|
||||
display = {
|
||||
action_palette = {
|
||||
width = 95,
|
||||
height = 10,
|
||||
prompt = "Prompt ",
|
||||
provider = "default",
|
||||
opts = {
|
||||
show_default_actions = true,
|
||||
show_default_prompt_library = true,
|
||||
title = "CodeCompanion actions",
|
||||
},
|
||||
},
|
||||
},
|
||||
memory = {
|
||||
opts = {
|
||||
chat = { enabled = true, },
|
||||
},
|
||||
},
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
inline = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
},
|
||||
adapters = {
|
||||
http = {
|
||||
copilot = function()
|
||||
return require('codecompanion.adapters').extend('copilot', {
|
||||
schema = {
|
||||
model = {
|
||||
default = 'claude-sonnet-4.5',
|
||||
-- default = 'claude-haiku-4.5',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
return {
|
||||
"junegunn/fzf.vim",
|
||||
dependencies = {
|
||||
"junegunn/fzf",
|
||||
},
|
||||
config = function ()
|
||||
local g = vim.g
|
||||
local keymap = vim.keymap
|
||||
|
||||
g.fzf_action = {
|
||||
['ctrl-t'] = 'tab split',
|
||||
['ctrl-x'] = 'split',
|
||||
['ctrl-v'] = 'vsplit',
|
||||
}
|
||||
|
||||
g.fzf_colors = {
|
||||
fg = {'fg', 'Normal'},
|
||||
bg = {'bg', 'Normal'},
|
||||
hl = {'fg', 'Comment'},
|
||||
['fg+'] = {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
|
||||
['bg+'] = {'bg', 'CursorLine', 'CursorColumn'},
|
||||
['hl+'] = {'fg', 'Statement'},
|
||||
info = {'fg', 'PreProc'},
|
||||
prompt = {'fg', 'Conditional'},
|
||||
pointer = {'fg', 'Exception'},
|
||||
marker = {'fg', 'Keyword'},
|
||||
spinner = {'fg', 'Label'},
|
||||
header = {'fg', 'Comment'},
|
||||
}
|
||||
|
||||
g.fzf_history_dir = '~/.local/share/fzf-history'
|
||||
|
||||
keymap.set('n', '<leader>fl', ':Lines ')
|
||||
keymap.set('n', '<leader>fb', ':BLines ')
|
||||
keymap.set('n', '<leader>ff', ':Files ')
|
||||
keymap.set('n', '<leader>fg', ':GFiles ')
|
||||
keymap.set('n', '<leader>f?', ':GFiles? ')
|
||||
keymap.set('n', '<leader>ft', ':Tags<cr>')
|
||||
keymap.set('n', '<leader>fa', ':Ag ')
|
||||
keymap.set('n', '<leader>fc', ':Commits ')
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
return {
|
||||
"fatih/vim-go",
|
||||
lazy = false,
|
||||
keys = {},
|
||||
config = function ()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = 'go',
|
||||
callback = function ()
|
||||
vim.keymap.set('n', '<leader>err', '<Plug>(go-iferr)')
|
||||
end
|
||||
})
|
||||
|
||||
local g = vim.g
|
||||
|
||||
g.go_gopls_enabled = 0
|
||||
g.go_def_mapping_enabled = 0
|
||||
g.go_code_completion_enabled = 0
|
||||
g.go_doc_keywordprg_enabled = 0
|
||||
g.go_fmt_fail_silently = 1
|
||||
g.go_fmt_command = "goimports"
|
||||
g.go_def_mode = ''
|
||||
g.go_info_mode = ''
|
||||
g.go_decls_includes = "func,type"
|
||||
g.go_highlight_types = 1
|
||||
g.go_highlight_fields = 1
|
||||
g.go_highlight_functions = 1
|
||||
g.go_highlight_function_calls = 1
|
||||
g.go_highlight_operators = 1
|
||||
g.go_highlight_extra_types = 1
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"phaazon/hop.nvim",
|
||||
config = function ()
|
||||
local hop = require('hop')
|
||||
local keymap = vim.keymap
|
||||
|
||||
hop.setup()
|
||||
|
||||
keymap.set('', '<leader><leader>f', function ()
|
||||
hop.hint_char1()
|
||||
end)
|
||||
keymap.set('', '<leader><leader>s', function ()
|
||||
hop.hint_char2()
|
||||
end)
|
||||
keymap.set('', '<leader><leader>w', function ()
|
||||
hop.hint_words()
|
||||
end)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
show_end_of_line = true,
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
},
|
||||
config = function ()
|
||||
vim.opt.list = true
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup("plugins.list", {
|
||||
defaults = {
|
||||
lazy = false
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,153 @@
|
||||
return {
|
||||
require('plugins.nvim_cmp'),
|
||||
require('plugins.lsp'),
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
opts = {
|
||||
hint_enable = true,
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"scrooloose/nerdcommenter",
|
||||
config = function ()
|
||||
vim.g.NERDSpaceDelims=1
|
||||
vim.g.NERDDefaultAlign='left'
|
||||
end
|
||||
},
|
||||
"vim-scripts/DrawIt",
|
||||
|
||||
-- easymotion alternative
|
||||
require('plugins.hop'),
|
||||
|
||||
require('plugins.ale'),
|
||||
"mattn/emmet-vim",
|
||||
require('plugins.go'),
|
||||
|
||||
{
|
||||
"pangloss/vim-javascript",
|
||||
config = function ()
|
||||
vim.g.javascript_plugin_jsdoc = 1
|
||||
end
|
||||
},
|
||||
|
||||
"godlygeek/tabular",
|
||||
"plasticboy/vim-markdown",
|
||||
|
||||
-- fzf
|
||||
require('plugins.fzf'),
|
||||
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
require('plugins.nvim_tree'),
|
||||
|
||||
"kien/tabman.vim",
|
||||
|
||||
-- for git
|
||||
"tpope/vim-fugitive",
|
||||
"christoomey/vim-conflicted",
|
||||
"sindrets/diffview.nvim",
|
||||
|
||||
-- for mark
|
||||
"inkarkat/vim-ingo-library",
|
||||
"inkarkat/vim-mark",
|
||||
|
||||
"rking/ag.vim",
|
||||
|
||||
{
|
||||
"terryma/vim-multiple-cursors",
|
||||
config = function ()
|
||||
local g = vim.g
|
||||
g.multi_cursor_use_default_mapping=0
|
||||
|
||||
-- Default mapping
|
||||
g.multi_cursor_start_word_key = "<C-n>"
|
||||
g.multi_cursor_select_all_word_key = '<A-n>'
|
||||
g.multi_cursor_start_key = "g<C-n>"
|
||||
g.multi_cursor_select_all_key = 'g<A-n>'
|
||||
g.multi_cursor_next_key = "<C-n>"
|
||||
g.multi_cursor_skip_key = '<C-x>'
|
||||
g.multi_cursor_quit_key = '<Esc>'
|
||||
end
|
||||
},
|
||||
|
||||
require('plugins.lualine'),
|
||||
require('plugins.bufferline'),
|
||||
|
||||
--require('plugins.indent_blankline'),
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
},
|
||||
|
||||
{
|
||||
"bluz71/vim-nightfly-colors",
|
||||
config = function ()
|
||||
vim.g.nightflyTransparent = true
|
||||
vim.cmd[[ colorscheme nightfly ]]
|
||||
end
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
branch = "main",
|
||||
},
|
||||
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
|
||||
-- code outline
|
||||
require('plugins.aerial'),
|
||||
|
||||
"tpope/vim-surround",
|
||||
-- "buoto/gotests-vim",
|
||||
"cespare/vim-toml",
|
||||
{
|
||||
"rust-lang/rust.vim",
|
||||
config = function ()
|
||||
local g = vim.g
|
||||
g.rust_recommended_style = 0
|
||||
g.rustfmt_autosave = 1
|
||||
g.syntastic_rust_checkers = {'cargo'}
|
||||
end
|
||||
},
|
||||
"vim-scripts/TaskList.vim",
|
||||
"google/vim-jsonnet",
|
||||
|
||||
{
|
||||
"github/copilot.vim",
|
||||
keys = {
|
||||
{'<c-j>', 'copilot#Accept("<CR>")', mode = 'i', silent = true, expr = true, noremap = true, replace_keycodes = false},
|
||||
},
|
||||
lazy = false,
|
||||
init = function ()
|
||||
vim.g.copilot_no_tab_map = true
|
||||
end
|
||||
},
|
||||
|
||||
-- temp plugins
|
||||
"elkowar/yuck.vim",
|
||||
"towolf/vim-helm",
|
||||
|
||||
"evanleck/vim-svelte",
|
||||
"AndrewRadev/linediff.vim",
|
||||
|
||||
-- themes
|
||||
"tomasr/molokai",
|
||||
|
||||
{
|
||||
"vimwiki/vimwiki",
|
||||
init = function ()
|
||||
vim.g.vimwiki_list = {
|
||||
{
|
||||
path = '~/vimwiki/',
|
||||
syntax = 'markdown',
|
||||
ext = '.md',
|
||||
custom_wiki2html = "~/bin/wiki2html.sh",
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
-- require('plugins.vim-ai'),
|
||||
-- ai 助手
|
||||
-- require('plugins.avante'),
|
||||
require('plugins.codecompanion'),
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
-- 統一處理 LspAttach (當 LSP 連接到緩衝區時觸發)
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
local bufnr = ev.buf
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
|
||||
-- 啟動 lsp_signature
|
||||
require('lsp_signature').on_attach({}, bufnr)
|
||||
|
||||
-- 啟用 omnifunc
|
||||
vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- 按鍵對映優化
|
||||
local opts = { buffer = bufnr, noremap = true, silent = true }
|
||||
local map = vim.keymap.set
|
||||
|
||||
map('n', '<leader>gd', vim.lsp.buf.definition, opts)
|
||||
map('n', '<leader>gt', '<cmd>tab split<CR><cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
map('n', '<leader>gv', '<cmd>vsplit<CR><cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
map('n', 'K', vim.lsp.buf.hover, opts)
|
||||
map('n', '<leader>gi', vim.lsp.buf.implementation, opts)
|
||||
map('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
map('n', '<leader>D', vim.lsp.buf.type_definition, opts)
|
||||
map('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
||||
map('n', '<leader>ca', vim.lsp.buf.code_action, opts)
|
||||
map('n', '<leader>gr', vim.lsp.buf.references, opts)
|
||||
map('n', '<leader>ge', vim.diagnostic.open_float, opts) -- 使用現代 API
|
||||
map('n', '<leader>do', vim.diagnostic.open_float, opts)
|
||||
map('n', '<leader>d[', vim.diagnostic.goto_prev, opts)
|
||||
map('n', '<leader>d]', vim.diagnostic.goto_next, opts)
|
||||
map('n', '<leader>gf', function() vim.lsp.buf.format { async = true } end, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- 伺服器列表
|
||||
local servers = {
|
||||
'gopls', 'ts_ls', 'rust_analyzer', 'bashls', 'svelte',
|
||||
'pylsp', 'zls', 'lua_ls', 'clangd', 'pyright'
|
||||
}
|
||||
|
||||
-- 批量配置伺服器能力
|
||||
for _, lsp in ipairs(servers) do
|
||||
vim.lsp.config(lsp, {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
-- 批量啟用伺服器
|
||||
vim.lsp.enable(servers)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true,
|
||||
newfile_status = true,
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
function()
|
||||
return require('nvim-treesitter').statusline({
|
||||
})
|
||||
end,
|
||||
'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
|
||||
-- for vsnip users
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/vim-vsnip",
|
||||
},
|
||||
opts = function ()
|
||||
local cmp = require('cmp')
|
||||
return {
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
-- behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
-- ['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }),
|
||||
}),
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
||||
end,
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
}, {
|
||||
{name = 'buffer'},
|
||||
}),
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
keys = {
|
||||
{"<leader>me", '<cmd>NvimTreeToggle<CR>', desc = 'open / close nvim tree', mode = 'n'},
|
||||
{"<F3>", '<cmd>NvimTreeToggle<CR>', desc = 'open / close nvim tree', mode = 'n'}
|
||||
},
|
||||
opts = {
|
||||
disable_netrw = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sort = {
|
||||
sorter = "name",
|
||||
},
|
||||
view = {
|
||||
width = 40,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
item = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_root = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
return {
|
||||
"madox2/vim-ai",
|
||||
config = function ()
|
||||
vim.g.vim_ai_roles_config_file = '/home/jay/.config/nvim/vim-ai-roles.ini'
|
||||
|
||||
local vim_ai_endpoint_url = "http://localhost:11434/v1/chat/completions"
|
||||
-- local vim_ai_endpoint_url = "http://192.168.88.11:11434/v1/chat/completions"
|
||||
local vim_ai_model = "gemma3:12b"
|
||||
local vim_ai_model_large = "deepseek-r1"
|
||||
local vim_ai_temperature = 0.3
|
||||
|
||||
local vim_ai_chat_config = {
|
||||
engine = "chat",
|
||||
options = {
|
||||
model = vim_ai_model,
|
||||
temperature = vim_ai_temperature,
|
||||
endpoint_url = vim_ai_endpoint_url,
|
||||
auth_type = "none",
|
||||
max_tokens = 0,
|
||||
request_timeout = 180,
|
||||
},
|
||||
ui = {
|
||||
code_syntax_enabled = 1,
|
||||
},
|
||||
}
|
||||
|
||||
local vim_ai_edit_config = {
|
||||
engine = "chat",
|
||||
options = {
|
||||
model = vim_ai_model,
|
||||
temperature = vim_ai_temperature,
|
||||
endpoint_url = vim_ai_endpoint_url,
|
||||
auth_type = "none",
|
||||
max_tokens = 0,
|
||||
request_timeout = 180,
|
||||
},
|
||||
ui = {
|
||||
paste_mode = 1,
|
||||
},
|
||||
}
|
||||
|
||||
vim.g.vim_ai_chat = vim_ai_chat_config
|
||||
vim.g.vim_ai_complete = vim_ai_edit_config
|
||||
vim.g.vim_ai_edit = vim_ai_edit_config
|
||||
|
||||
function git_commit_message_fn(model, intent)
|
||||
model = model or vim_ai_model
|
||||
intent = intent or ""
|
||||
local diff = vim.fn.system('git --no-pager diff --staged')
|
||||
local initial_prompt = [[
|
||||
You are a Senior Software Engineer responsible for crafting clear and informative Git commit messages. Your goal is to ensure that every commit message contributes to the maintainability and understandability of the codebase. A well-written commit message allows other developers to quickly grasp the purpose and impact of the changes.
|
||||
|
||||
**Here's the structure we'll use for all commit messages:**
|
||||
|
||||
1. **Subject Line (Required):**
|
||||
* Use a conventional prefix: `feat:`, `fix:`, `chore:`, `refactor:`, `docs:`, `test:`, `style:`, `perf:`, `build:`
|
||||
* Keep it concise – 50 characters or less.
|
||||
* Use an imperative verb (e.g., "Add...", "Fix...", "Update...", "Remove...").
|
||||
|
||||
2. **Body (Optional, but recommended):**
|
||||
* Start with a blank line after the subject line.
|
||||
* Provide a brief explanation (3-4 bullet points) of *why* the change was made, not *what* was changed.
|
||||
* Keep lines under 72 characters.
|
||||
* Avoid implementation details.
|
||||
|
||||
**Do not include:** Markdown, emojis, or overly detailed code descriptions.
|
||||
|
||||
]]
|
||||
local prompt = [["\n" .. "**Now, generate a Git commit message based on the following changes:**\n```" ]] .. diff .. [[```]]
|
||||
local range = 0
|
||||
|
||||
if not (intent == "")
|
||||
then
|
||||
prompt = [[Short Description:\n"]] .. intent .. prompt
|
||||
end
|
||||
|
||||
local config = {
|
||||
engine = "chat",
|
||||
options = {
|
||||
model = model,
|
||||
initial_prompt = initial_prompt,
|
||||
endpoint_url = vim_ai_endpoint_url,
|
||||
auth_type = "none",
|
||||
temperature = 0.8,
|
||||
request_timeout = 240,
|
||||
},
|
||||
}
|
||||
vim.api.nvim_call_function("vim_ai#AIRun", { range, config, prompt })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("GitCommitMessage", function(opts)
|
||||
git_commit_message_fn(vim_ai_model, opts.args)
|
||||
end, {nargs = '?'})
|
||||
vim.api.nvim_create_user_command("GitCommitMessageL", function(opts)
|
||||
git_commit_message_fn(vim_ai_model_large, opts.args)
|
||||
end, {nargs = '?'})
|
||||
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
# vi: ft=dosini
|
||||
[main]
|
||||
|
||||
# Enables context sensitive auto-completion. If this is disabled, all
|
||||
# possible completions will be listed.
|
||||
smart_completion = True
|
||||
|
||||
# Display the completions in several columns. (More completions will be
|
||||
# visible.)
|
||||
wider_completion_menu = False
|
||||
|
||||
# Multi-line mode allows breaking up the sql statements into multiple lines. If
|
||||
# this is set to True, then the end of the statements must have a semi-colon.
|
||||
# If this is set to False then sql statements can't be split into multiple
|
||||
# lines. End of line (return) is considered as the end of the statement.
|
||||
multi_line = True
|
||||
|
||||
# If multi_line_mode is set to "psql", in multi-line mode, [Enter] will execute
|
||||
# the current input if the input ends in a semicolon.
|
||||
# If multi_line_mode is set to "safe", in multi-line mode, [Enter] will always
|
||||
# insert a newline, and [Esc] [Enter] or [Alt]-[Enter] must be used to execute
|
||||
# a command.
|
||||
multi_line_mode = psql
|
||||
|
||||
# Destructive warning mode will alert you before executing a sql statement
|
||||
# that may cause harm to the database such as "drop table", "drop database",
|
||||
# "shutdown", "delete", or "update".
|
||||
# Possible values:
|
||||
# "all" - warn on data definition statements, server actions such as SHUTDOWN, DELETE or UPDATE
|
||||
# "moderate" - skip warning on UPDATE statements, except for unconditional updates
|
||||
# "off" - skip all warnings
|
||||
destructive_warning = all
|
||||
|
||||
# Enables expand mode, which is similar to `\x` in psql.
|
||||
expand = False
|
||||
|
||||
# Enables auto expand mode, which is similar to `\x auto` in psql.
|
||||
auto_expand = False
|
||||
|
||||
# If set to True, table suggestions will include a table alias
|
||||
generate_aliases = False
|
||||
|
||||
# log_file location.
|
||||
# In Unix/Linux: ~/.config/pgcli/log
|
||||
# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\log
|
||||
# %USERPROFILE% is typically C:\Users\{username}
|
||||
log_file = default
|
||||
|
||||
# keyword casing preference. Possible values: "lower", "upper", "auto"
|
||||
keyword_casing = auto
|
||||
|
||||
# casing_file location.
|
||||
# In Unix/Linux: ~/.config/pgcli/casing
|
||||
# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\casing
|
||||
# %USERPROFILE% is typically C:\Users\{username}
|
||||
casing_file = default
|
||||
|
||||
# If generate_casing_file is set to True and there is no file in the above
|
||||
# location, one will be generated based on usage in SQL/PLPGSQL functions.
|
||||
generate_casing_file = False
|
||||
|
||||
# Casing of column headers based on the casing_file described above
|
||||
case_column_headers = True
|
||||
|
||||
# history_file location.
|
||||
# In Unix/Linux: ~/.config/pgcli/history
|
||||
# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\history
|
||||
# %USERPROFILE% is typically C:\Users\{username}
|
||||
history_file = default
|
||||
|
||||
# Default log level. Possible values: "CRITICAL", "ERROR", "WARNING", "INFO"
|
||||
# and "DEBUG". "NONE" disables logging.
|
||||
log_level = INFO
|
||||
|
||||
# Order of columns when expanding * to column list
|
||||
# Possible values: "table_order" and "alphabetic"
|
||||
asterisk_column_order = table_order
|
||||
|
||||
# Whether to qualify with table alias/name when suggesting columns
|
||||
# Possible values: "always", "never" and "if_more_than_one_table"
|
||||
qualify_columns = if_more_than_one_table
|
||||
|
||||
# When no schema is entered, only suggest objects in search_path
|
||||
search_path_filter = False
|
||||
|
||||
# Default pager.
|
||||
# By default 'PAGER' environment variable is used
|
||||
# pager = less -SRXF
|
||||
|
||||
# Timing of sql statements and table rendering.
|
||||
timing = True
|
||||
|
||||
# Show/hide the informational toolbar with function keymap at the footer.
|
||||
show_bottom_toolbar = True
|
||||
|
||||
# Table format. Possible values: psql, plain, simple, grid, fancy_grid, pipe,
|
||||
# ascii, double, github, orgtbl, rst, mediawiki, html, latex, latex_booktabs,
|
||||
# textile, moinmoin, jira, vertical, tsv, csv.
|
||||
# Recommended: psql, fancy_grid and grid.
|
||||
table_format = psql
|
||||
|
||||
# Syntax Style. Possible values: manni, igor, xcode, vim, autumn, vs, rrt,
|
||||
# native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark,
|
||||
# colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity
|
||||
syntax_style = default
|
||||
|
||||
# Keybindings:
|
||||
# When Vi mode is enabled you can use modal editing features offered by Vi in the REPL.
|
||||
# When Vi mode is disabled emacs keybindings such as Ctrl-A for home and Ctrl-E
|
||||
# for end are available in the REPL.
|
||||
vi = False
|
||||
|
||||
# Error handling
|
||||
# When one of multiple SQL statements causes an error, choose to either
|
||||
# continue executing the remaining statements, or stopping
|
||||
# Possible values "STOP" or "RESUME"
|
||||
on_error = STOP
|
||||
|
||||
# Set threshold for row limit. Use 0 to disable limiting.
|
||||
row_limit = 1000
|
||||
|
||||
# Truncate long text fields to this value for tabular display (does not apply to csv).
|
||||
# Leave unset to disable truncation. Example: "max_field_width = "
|
||||
# Be aware that formatting might get slow with values larger than 500 and tables with
|
||||
# lots of records.
|
||||
max_field_width = 500
|
||||
|
||||
# Skip intro on startup and goodbye on exit
|
||||
less_chatty = False
|
||||
|
||||
# Postgres prompt
|
||||
# \t - Current date and time
|
||||
# \u - Username
|
||||
# \h - Short hostname of the server (up to first '.')
|
||||
# \H - Hostname of the server
|
||||
# \d - Database name
|
||||
# \p - Database port
|
||||
# \i - Postgres PID
|
||||
# \# - "@" sign if logged in as superuser, '>' in other case
|
||||
# \n - Newline
|
||||
# \dsn_alias - name of dsn alias if -D option is used (empty otherwise)
|
||||
# \x1b[...m - insert ANSI escape sequence
|
||||
# eg: prompt = '\x1b[35m\u@\x1b[32m\h:\x1b[36m\d>'
|
||||
prompt = '\u@\h:\d> '
|
||||
|
||||
# Number of lines to reserve for the suggestion menu
|
||||
min_num_menu_lines = 4
|
||||
|
||||
# Character used to left pad multi-line queries to match the prompt size.
|
||||
multiline_continuation_char = ''
|
||||
|
||||
# The string used in place of a null value.
|
||||
null_string = '<null>'
|
||||
|
||||
# manage pager on startup
|
||||
enable_pager = False
|
||||
|
||||
# Use keyring to automatically save and load password in a secure manner
|
||||
keyring = True
|
||||
|
||||
# Custom colors for the completion menu, toolbar, etc.
|
||||
[colors]
|
||||
completion-menu.completion.current = 'bg:#ffffff #000000'
|
||||
completion-menu.completion = 'bg:#008888 #ffffff'
|
||||
completion-menu.meta.completion.current = 'bg:#44aaaa #000000'
|
||||
completion-menu.meta.completion = 'bg:#448888 #ffffff'
|
||||
completion-menu.multi-column-meta = 'bg:#aaffff #000000'
|
||||
scrollbar.arrow = 'bg:#003333'
|
||||
scrollbar = 'bg:#00aaaa'
|
||||
selected = '#ffffff bg:#6666aa'
|
||||
search = '#ffffff bg:#4444aa'
|
||||
search.current = '#ffffff bg:#44aa44'
|
||||
bottom-toolbar = 'bg:#222222 #aaaaaa'
|
||||
bottom-toolbar.off = 'bg:#222222 #888888'
|
||||
bottom-toolbar.on = 'bg:#222222 #ffffff'
|
||||
search-toolbar = 'noinherit bold'
|
||||
search-toolbar.text = 'nobold'
|
||||
system-toolbar = 'noinherit bold'
|
||||
arg-toolbar = 'noinherit bold'
|
||||
arg-toolbar.text = 'nobold'
|
||||
bottom-toolbar.transaction.valid = 'bg:#222222 #00ff5f bold'
|
||||
bottom-toolbar.transaction.failed = 'bg:#222222 #ff005f bold'
|
||||
# These three values can be used to further refine the syntax highlighting.
|
||||
# They are commented out by default, since they have priority over the theme set
|
||||
# with the `syntax_style` setting and overriding its behavior can be confusing.
|
||||
# literal.string = '#ba2121'
|
||||
# literal.number = '#666666'
|
||||
# keyword = 'bold #008000'
|
||||
|
||||
# style classes for colored table output
|
||||
output.header = "#00ff5f bold"
|
||||
output.odd-row = ""
|
||||
output.even-row = ""
|
||||
output.null = "#808080"
|
||||
|
||||
# Named queries are queries you can execute by name.
|
||||
[named queries]
|
||||
|
||||
# DSN to call by -D option
|
||||
[alias_dsn]
|
||||
# example_dsn = postgresql://[user[:password]@][netloc][:port][/dbname]
|
||||
local = postgresql://postgres:chuxu7ec@localhost
|
||||
home-lab = postgresql://postgres:pass.ok=1@192.168.200.16
|
||||
ln-prod = postgresql://postgres:CyMrS127VIx@10.140.0.90
|
||||
ln-lab = postgresql://postgres:eKZJFdG9L5vaREXN@192.168.88.15:32014
|
||||
professorx-dev = postgresql://postgres:e8b960296e22@192.168.88.6
|
||||
k8s-gcp-dev = postgresql://postgres:eKZJFdG9L5vaREXN@10.140.0.51:32008
|
||||
k8s-log-collector = postgresql://postgres:j88ArUndbrAe@192.168.88.23:5432
|
||||
lab-pg = postgresql://postgres:f87fa2a74009f9b63acf65762b89b411@192.168.200.71:32750
|
||||
|
||||
# Format for number representation
|
||||
# for decimal "d" - 12345678, ",d" - 12,345,678
|
||||
# for float "g" - 123456.78, ",g" - 123,456.78
|
||||
[data_formats]
|
||||
decimal = ""
|
||||
float = ""
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
@@ -0,0 +1,24 @@
|
||||
# vim: ft=swayconfig
|
||||
|
||||
### Input configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# input "2:14:SynPS/2_Synaptics_TouchPad" {
|
||||
# dwt enabled
|
||||
# tap enabled
|
||||
# natural_scroll enabled
|
||||
# middle_emulation enabled
|
||||
# }
|
||||
|
||||
input type:touchpad {
|
||||
drag enabled
|
||||
drag_lock enabled
|
||||
tap enabled
|
||||
scroll_factor 0.6
|
||||
}
|
||||
#
|
||||
# You can get the names of your inputs by running: swaymsg -t get_inputs
|
||||
# Read `man 5 sway-input` for more information about this section.
|
||||
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
# vim: ft=swayconfig
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
bindsym $alt+Shift+c exec ~/bin/screenshot
|
||||
bindsym $alt+Shift+m exec ~/bin/screenshot-monitor
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# Find cursor
|
||||
bindsym $mod+Shift+f exec ~/.config/sway/scripts/scale-cursor.sh $cursor_theme $cursor_big_size $cursor_size
|
||||
|
||||
# Start your launcher
|
||||
bindsym $mod+d exec $menu
|
||||
bindsym $alt+space exec $menu
|
||||
bindsym $mod+Shift+w exec $window_switcher
|
||||
bindsym $mod+w exec $window_workspace_switcher
|
||||
bindsym $mod+Shift+v exec ~/.config/wofi/wofi-control-panel.sh
|
||||
bindsym $mod+Shift+t exec ~/.config/wofi/wofi-totp-menu.sh
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
bindsym $mod+Shift+x exec swaylock -f -i ~/.config/sway/bg2.png -s fill
|
||||
|
||||
# Exit sway (logs you out of your Wayland session)
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||
|
||||
bindsym $mod+Shift+p exec ~/.config/wofi/wofi-power.sh
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume @DEFAULT_SINK@ +5%; pkill -RTMIN+8 waybar"
|
||||
bindsym XF86AudioLowerVolume exec "pactl set-sink-volume @DEFAULT_SINK@ -5%; pkill -RTMIN+8 waybar"
|
||||
bindsym XF86AudioMute exec "pactl set-sink-mute @DEFAULT_SINK@ toggle; pkill -RTMIN+8 waybar"
|
||||
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
bindsym XF86MonBrightnessUp exec "brightnessctl set 5%+"
|
||||
bindsym XF86MonBrightnessDown exec "brightnessctl set 5%-"
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace number 1
|
||||
bindsym $mod+2 workspace number 2
|
||||
bindsym $mod+3 workspace number 3
|
||||
bindsym $mod+4 workspace number 4
|
||||
bindsym $mod+5 workspace number 5
|
||||
bindsym $mod+6 workspace number 6
|
||||
bindsym $mod+7 workspace number 7
|
||||
bindsym $mod+8 workspace number 8
|
||||
bindsym $mod+9 workspace number 9
|
||||
bindsym $mod+0 workspace number 10
|
||||
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+b splith
|
||||
bindsym $mod+v splitv
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+t layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 10px
|
||||
bindsym Down resize grow height 10px
|
||||
bindsym Up resize shrink height 10px
|
||||
bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# show sov
|
||||
#bindsym --no-repeat $mod+Shift+w exec "echo 1 > /tmp/sovpipe"
|
||||
#bindsym --release $mod+Shift+w exec "echo 0 > /tmp/sovpipe"
|
||||
|
||||
# show bindsym help
|
||||
bindsym $mod+Ctrl+h exec cat ~/.config/sway/conf.d/keybinding.conf |grep bindsym |grep -v "#"| sed 's/^[[:space:]]*//'| wofi --dmenu
|
||||
@@ -0,0 +1,13 @@
|
||||
# vim: ft=swayconfig
|
||||
output eDP-1 scale 1.3
|
||||
# set workspace monitor
|
||||
workspace 1 output eDP-1
|
||||
workspace 2 output eDP-1
|
||||
workspace 3 output eDP-1
|
||||
workspace 4 output HDMI-A-1 DP-1 DP-9 eDP-1
|
||||
workspace 5 output HDMI-A-1 DP-1 DP-9 eDP-1
|
||||
workspace 6 output HDMI-A-1 DP-1 DP-9 eDP-1
|
||||
workspace 7 output HDMI-A-1 DP-1 DP-9 eDP-1
|
||||
workspace 8 output HDMI-A-1 DP-1 DP-9 eDP-1
|
||||
workspace 9 output eDP-1
|
||||
workspace 10 output eDP-1
|
||||
@@ -0,0 +1,113 @@
|
||||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
font Agave Nerd Font 12
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $alt Mod1
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
# set $term env WAYLAND_DISPLAY= WINIT_X11_SCALE_FACTOR=1.0 alacritty
|
||||
# set $term alacritty
|
||||
set $term ghostty
|
||||
# set $term env WAYLAND_DISPLAY= WINIT_X11_SCALE_FACTOR=1.0 WINIT_UNIX_BACKEND=x11 alacritty
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
# set $menu dmenu_path | dmenu | xargs swaymsg exec --
|
||||
set $menu wofi --show drun
|
||||
set $window_switcher ~/.config/wofi/wofi-window-switch.sh
|
||||
set $window_workspace_switcher ~/.config/wofi/wofi-current-workspace.sh
|
||||
|
||||
set $cursor_theme Sweet-cursors
|
||||
set $cursor_size 24
|
||||
set $cursor_big_size 64
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
# output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
output * bg /home/jay/.config/sway/wallpaper.png fill
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
# output HDMI-A-1 resolution 1920x1080 position 1920,0
|
||||
#
|
||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||
|
||||
exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE
|
||||
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
|
||||
# exec systemctl --user restart xdg-desktop-portal xdg-desktop-portal-wlr
|
||||
# exec_always xdg-desktop-portal -r
|
||||
# exec_always /usr/libexec/xdg-desktop-portal-wlr
|
||||
# exec env XDG_CONFIG_HOME=/home/jay/.config gentoo-pipewire-launcher restart &
|
||||
exec_always kanshi
|
||||
exec dex -a -e sway -s /etc/xdg/autostart/:~/.config/autostart/
|
||||
exec mako
|
||||
exec udiskie -t
|
||||
exec_always ~/.config/eww/open-main.sh
|
||||
|
||||
|
||||
# for sway overview
|
||||
#exec_always rm -f /tmp/sovpipe && mkfifo /tmp/sovpipe && tail -f /tmp/sovpipe | sov -t 100
|
||||
|
||||
### Idle configuration
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
exec swayidle -w \
|
||||
timeout 300 'swaylock -f -i ~/.config/sway/bg2.png -s fill' \
|
||||
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
before-sleep 'swaylock -f -i ~/.config/sway/bg2.png -s fill'
|
||||
|
||||
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||
# your displays after another 300 seconds, and turn your screens back on when
|
||||
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
# Read `man 5 sway-bar` for more information about this section.
|
||||
# bar {
|
||||
# # position top
|
||||
|
||||
# # When the status_command prints a new line to stdout, swaybar updates.
|
||||
# # The default just shows the current date and time.
|
||||
# # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
|
||||
# # status_command ~/.config/waybar/launch.sh
|
||||
# swaybar_command waybar
|
||||
|
||||
# colors {
|
||||
# statusline #ffffff
|
||||
# background #323232
|
||||
# inactive_workspace #32323200 #32323200 #5c5c5c
|
||||
# }
|
||||
# }
|
||||
seat seat0 {
|
||||
xcursor_theme Adwaita 24
|
||||
}
|
||||
|
||||
gaps outer 5
|
||||
gaps inner 5
|
||||
|
||||
# default_border pixel 5
|
||||
for_window [app_id="^.*"] border pixel 4
|
||||
for_window [class="^.*"] border pixel 4
|
||||
for_window [workspace=8] floating enable
|
||||
for_window [workspace=9] floating enable
|
||||
|
||||
focus_follows_mouse no
|
||||
|
||||
xwayland enable
|
||||
# include @sysconfdir@/sway/config.d/*
|
||||
include ~/.config/sway/conf.d/*
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
cursorTheme=$(swaymsg -t get_inputs | jq -r '.[] | select(.type == "pointer") | .xcursor_theme' | head -n 1)
|
||||
|
||||
echo "Current cursor theme: $cursorTheme"
|
||||
# swaymsg "seat seat0 xcursor_theme "
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# usage: scale-cursor.sh <cursor-theme> <bigSize> <originalSize>
|
||||
if [ "$#" -ne 3 ]; then
|
||||
echo "Usage: $0 <cursor-theme> <bigSize> <originalSize>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURSOR_THEME="$1"
|
||||
BIG_SIZE="$2"
|
||||
ORIGINAL_SIZE="$3"
|
||||
|
||||
swaymsg "seat seat0 xcursor_theme $CURSOR_THEME $BIG_SIZE"
|
||||
sleep 1
|
||||
swaymsg "seat seat0 xcursor_theme $CURSOR_THEME $ORIGINAL_SIZE"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 332 KiB |
@@ -0,0 +1,5 @@
|
||||
[Unit]
|
||||
ConditionEnvironment=WAYLAND_DISPLAY
|
||||
Description=sway.target
|
||||
Requires=graphical-session.target
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
// vim: set ft=jsonc :
|
||||
{
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "top", // Waybar position (top|bottom|left|right)
|
||||
// "height": 30, // Waybar height (to be removed for auto height)
|
||||
"margin": "3 3 0 3",
|
||||
// "width": 1280, // Waybar width
|
||||
// "spacing": 1, // Gaps between modules (4px)
|
||||
// Choose the order of the modules
|
||||
// "modules-left": ["wlr/workspaces", "custom/sep", "hyprland/window", "hyprland/submap"],
|
||||
"modules-left": ["sway/workspaces", "custom/sep", "sway/window", "sway/mode"],
|
||||
"modules-center": ["clock"],
|
||||
"modules-right": [
|
||||
"idle_inhibitor",
|
||||
"custom/sep",
|
||||
"network",
|
||||
"custom/sep",
|
||||
"bluetooth",
|
||||
"custom/sep",
|
||||
"custom/pipewire",
|
||||
"cpu",
|
||||
"memory",
|
||||
"backlight",
|
||||
"battery",
|
||||
"custom/sep",
|
||||
"tray"
|
||||
],
|
||||
// Modules configuration
|
||||
"custom/sep": {
|
||||
"format": "|",
|
||||
"interval": "once",
|
||||
"tooltip": false
|
||||
},
|
||||
"wlr/workspaces": {
|
||||
"format": "{name}",
|
||||
// "on-click": "activate",
|
||||
"disable-scroll": true
|
||||
},
|
||||
"sway/window": {
|
||||
"max-length": 100
|
||||
},
|
||||
"custom/pipewire": {
|
||||
"exec": "/home/jay/bin/get-volume.sh",
|
||||
"interval": 2,
|
||||
"return-type": "json",
|
||||
"signal": 8,
|
||||
"format": "{icon} {percentage}%",
|
||||
"format-icons": {
|
||||
"mute": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
"hyprland/window": {
|
||||
"max-length": 30
|
||||
},
|
||||
"hyprland/submap": {
|
||||
"format": "{}",
|
||||
"tooltip": false
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
},
|
||||
"tray": {
|
||||
// "icon-size": 21,
|
||||
"spacing": 10,
|
||||
"show-passive-items": true
|
||||
},
|
||||
"clock": {
|
||||
// "timezone": "America/New_York",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"format": "{:%Y-%m-%d %H:%M:%S %a}",
|
||||
"format-alt": "{:%Y-%m-%d}",
|
||||
"interval": 1
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage}%({load})",
|
||||
"interval": 2,
|
||||
"tooltip": false
|
||||
},
|
||||
"memory": {
|
||||
"interval": 10,
|
||||
"format": " {used}G",
|
||||
"tooltip-format": "{percentage}% used"
|
||||
},
|
||||
"temperature": {
|
||||
// "thermal-zone": 2,
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon4/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
// "format-critical": "{temperatureC}°C {icon}",
|
||||
"format": " {temperatureC}°C",
|
||||
"format-icons": ["", "", ""]
|
||||
},
|
||||
"backlight": {
|
||||
// "device": "acpi_video1",
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": ["", "", "", "", "", "", "", "", ""]
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
// "good": 95,
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-charging": " {capacity}%",
|
||||
"format-plugged": " {capacity}%",
|
||||
"format-alt": "{icon} {time}",
|
||||
// "format-good": "", // An empty format will hide the module
|
||||
// "format-full": "",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
},
|
||||
"battery#bat2": {
|
||||
"bat": "BAT2"
|
||||
},
|
||||
"network": {
|
||||
// "interface": "wlp2*", // (Optional) To force the use of this interface
|
||||
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-disconnected": "Disconnected ⚠",
|
||||
"format-alt": "{ifname}: {ipaddr}/{cidr}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG_FILES="$HOME/.config/waybar/config $HOME/.config/waybar/style.css"
|
||||
|
||||
trap "killall waybar" EXIT
|
||||
|
||||
while true; do
|
||||
waybar &
|
||||
inotifywait -e create,modify $CONFIG_FILES
|
||||
killall waybar
|
||||
done
|
||||
@@ -0,0 +1,170 @@
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: 'Agave Nerd Font';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
#custom-sep {
|
||||
color: #9399b2;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding-left: 5px;
|
||||
transition: none;
|
||||
border-radius: 15px 0px 0px 15px;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
transition: ease-out;
|
||||
transition-duration: 0.1s;
|
||||
color: #6c7086;
|
||||
background: transparent;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
#workspaces button.persistent {
|
||||
color: #6c7086;
|
||||
}
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button:hover {
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
transition: ease-in;
|
||||
transition-duration: 0.1s;
|
||||
color: #f5c2e7;
|
||||
}
|
||||
|
||||
#workspaces button.active, #workspaces button.focused {
|
||||
color: #ea76cb;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #d20f39;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
border-radius: 0px 15px 15px 0px;
|
||||
transition: none;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
#submap, #mode {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-right: 3px;
|
||||
border-radius: 15px 15px 15px 15px;
|
||||
transition: none;
|
||||
background: #f38ba8;
|
||||
color: #313244;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding-left: 10px;
|
||||
padding-right: 5px;
|
||||
border-radius: 15px 15px 15px 15px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#custom-pipewire, #wireplumber {
|
||||
padding-left: 10px;
|
||||
padding-right: 5px;
|
||||
transition: ease-in;
|
||||
transition-duration: 0.2s;
|
||||
color: white;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#custom-pipewire.muted, #wireplumber.muted {
|
||||
background-color: rgba(17, 17, 27, 0.9);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
padding-left: 5px;
|
||||
transition: none;
|
||||
color: white;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
border-radius: 15px 0px 0px 15px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
transition: ease-in;
|
||||
transition-duration: 0.1s;
|
||||
color: white;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ff4879;
|
||||
}
|
||||
|
||||
#cpu,
|
||||
#memory,
|
||||
#network,
|
||||
#bluetooth {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#battery {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
transition: none;
|
||||
color: white;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: #f38ba8;
|
||||
}
|
||||
|
||||
#battery.warning:not(.charging) {
|
||||
color: #cba6f7;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #11111b;
|
||||
color: #f38ba8;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f38ba8;
|
||||
color: #313244;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.2s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
#tray {
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
border-radius: 0px 15px 15px 0px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: rgba(17, 17, 27, 0.9);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
width=600
|
||||
height=400
|
||||
mode=drun
|
||||
filter_rate=100
|
||||
matching=contains
|
||||
insensitive=true
|
||||
term=alacritty
|
||||
allow_images=true
|
||||
allow_markup=true
|
||||
dmenu-parse_action=true
|
||||
drun-display_generic=true
|
||||
key_down=Tab
|
||||
key_expand=Right
|
||||
key_forward=Down
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 1. 取得目前 focused workspace 的名稱
|
||||
CURRENT_WS=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused).name')
|
||||
|
||||
# 如果沒抓到 workspace,直接退出
|
||||
if [ -z "$CURRENT_WS" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 2. 列出該 workspace 內的所有視窗 (con 與 floating_con)
|
||||
# 直接從 get_tree 找對應名稱的 workspace 節點並遞迴出視窗資訊
|
||||
entries=$(swaymsg -t get_tree | jq -r --arg WS "$CURRENT_WS" '
|
||||
.. |
|
||||
select(.type? == "workspace" and .name == $WS) |
|
||||
recurse(.nodes[]?, .floating_nodes[]?) |
|
||||
select(.type == "con" or .type == "floating_con") |
|
||||
select(.name != null) |
|
||||
(.id | tostring) + " [" + (.app_id // .window_properties.class // "Unknown") + "] " + .name')
|
||||
|
||||
# 如果沒有視窗,直接結束
|
||||
if [ -z "$entries" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 3. 透過 wofi 顯示選單,並取得選擇視窗的 id (第一個欄位)
|
||||
selected=$(echo "$entries" | wofi --width 600 --height 400 --dmenu --cache-file /dev/null | awk '{print $1}')
|
||||
|
||||
# 如果有選擇,則切換焦點到該視窗
|
||||
if [ -n "$selected" ]; then
|
||||
swaymsg "[con_id=$selected]" focus
|
||||
fi
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown"
|
||||
|
||||
selected=$(echo -e $entries|wofi --width 350 --height 250 --dmenu --cache-file /dev/null | awk '{print tolower($2)}')
|
||||
|
||||
cmd="{{- if .settings.systemd }}systemctl{{ else }}loginctl{{ end }}"
|
||||
|
||||
case $selected in
|
||||
logout)
|
||||
swaymsg exit;;
|
||||
suspend)
|
||||
exec ${cmd} suspend;;
|
||||
reboot)
|
||||
exec ${cmd} reboot;;
|
||||
shutdown)
|
||||
exec ${cmd} poweroff -i;;
|
||||
esac
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
entries=$(swaymsg -t get_tree | jq -r -c '
|
||||
recurse(.nodes[]?) |
|
||||
recurse(.floating_nodes[]?) |
|
||||
select(.type=="con"), select(.type=="floating_con") |
|
||||
(.id | tostring) + " " + (.window_properties.class // .app_id) + ": " + .name')
|
||||
|
||||
echo "$entries"
|
||||
|
||||
selected=$(echo -e "$entries" | wofi --width 450 --height 350 --dmenu --cache-file /dev/null | awk '{print $1}')
|
||||
|
||||
if [ -n "$selected" ]; then
|
||||
swaymsg "[con_id=$selected]" focus
|
||||
fi
|
||||
@@ -0,0 +1,62 @@
|
||||
window {
|
||||
margin: 5px;
|
||||
background-color: #282a36;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 5px;
|
||||
border: 2px solid #44475a;
|
||||
background-color: #282a36;
|
||||
}
|
||||
|
||||
#input {
|
||||
margin: 5px;
|
||||
border: 2px solid #6272a4;
|
||||
background-color: #44475a;
|
||||
color: #f8f8f2;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
margin: 5px;
|
||||
background-color: #282a36;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
margin: 5px;
|
||||
border: 2px solid #6272a4;
|
||||
background-color: #282a36;
|
||||
font-size: 16px;
|
||||
color: #f8f8f2;
|
||||
}
|
||||
|
||||
#scroll label {
|
||||
margin: 2px 0px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
margin: 5px;
|
||||
background-color: #282a36;
|
||||
}
|
||||
#entry:selected {
|
||||
background-color: #44475a;
|
||||
border: 2px solid #BD93F9;
|
||||
}
|
||||
|
||||
#img {
|
||||
margin: 5px;
|
||||
}
|
||||
#img:selected {
|
||||
background-color: #44475a;
|
||||
}
|
||||
|
||||
#text {
|
||||
margin: 5px;
|
||||
border: none;
|
||||
color: #f8f8f2;
|
||||
}
|
||||
#text:selected {
|
||||
background-color: #44475a;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
[screencast]
|
||||
output_name=
|
||||
max_fps=60
|
||||
chooser_cmd=slurp -f %o -or
|
||||
chooser_type=simple
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
--langmap=javascript:.js.es6.es.jsx.mjs
|
||||
--javascript-kinds=-mpvC
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\[/\1/A,Array,Arrays/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\[/\1/A,Array,Arrays/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\[/\1/A,Array,Arrays/b
|
||||
|
||||
--regex-javascript=/^[ \t]*class[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/c,Class,Classes/b
|
||||
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\5/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\7/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}function[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}async[ \t]\{1,\}function[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\5/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}\({[ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\7/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}function[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
--regex-javascript=/^[ \t]*export[ \t]\{1,\}default[ \t]\{1,\}const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[^,]\{1,\},[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/E,Export,Exports/b
|
||||
|
||||
--regex-javascript=/^[ \t]*function[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t(]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*[(]function[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t(]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*async[ \t]function[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t(]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*[(]async[ \t]function[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t(]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\(async[ \t]\{1,\}\)*function[^\*][^\*]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\(async[ \t]\{1,\}\)*function[^\*][^\*]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*\(async[ \t]\{1,\}\)*function[^\*][^\*]/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*([^)]*$/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*([^)]*$/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*([^)]*$/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/f,Function,Functions/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/f,Function,Functions/b
|
||||
|
||||
--regex-javascript=/^[ \t]*function[ \t]*\*[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\1/G,Generator,Generators/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*function\([ \t]*\*\)/\1/G,Generator,Generators/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*function\([ \t]*\*\)/\1/G,Generator,Generators/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*function\([ \t]*\*\)/\1/G,Generator,Generators/b
|
||||
--regex-javascript=/^[ \t]*\(\*[ \t]\)\([A-Za-z0-9_$]\{1,\}\)[ \t]*(.*)[ \t]*[{]/\2/G,Generator,Generators/b
|
||||
|
||||
--regex-javascript=/^[ \t]*import[ \t]\{1,\}\([{][ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\3/I,Import,Imports/b
|
||||
--regex-javascript=/^[ \t]*import[ \t]\{1,\}\([{][ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\5/I,Import,Imports/b
|
||||
--regex-javascript=/^[ \t]*import[ \t]\{1,\}\([{][ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)*\([A-Za-z0-9_]\{1,\}\),[ \t]*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\7/I,Import,Imports/b
|
||||
--regex-javascript=/^[ \t]*import[ \t]\{1,\}type[ \t]\{1,\}\([{][ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\3/I,Import,Imports/b
|
||||
--regex-javascript=/^[ \t]*import[ \t]\{1,\}typeof[ \t]\{1,\}\([{][ \t]*\)*\([A-Za-z0-9_\*]*[ \t]as[ \t]\)\([A-Za-z0-9_]\{1,\}\)/\3/I,Import,Imports/b
|
||||
--regex-javascript=/^[ \t]*[A-Za-z0-9_]\{1,\}[ \t]as[ \t]\([A-Za-z0-9_]\{1,\}\)/\1/I,Import,Imports/b
|
||||
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*function/\2/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*(/\2/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*function/\3/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*(/\3/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[:=][ \t]*[(]*function[ \t]*(/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[:=][ \t](\{1,\}/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[:=][ \t]\{1,\}async[ \t](\{1,\}/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*static[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*(/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*async[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*(/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)(.*)[ \t]*[{]/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*get[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*(/\1/M,Method,Methods/b
|
||||
--regex-javascript=/^[ \t]*set[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*(/\1/M,Method,Methods/b
|
||||
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)\.\([A-Za-z0-9_$]\{1,\}\)[ \t]*[=][ \t]*{/\2/P,Property,Properties/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*:[ \t]*[{"\/\[]/\1/P,Property,Properties/b
|
||||
--regex-javascript=/^[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*:[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t,]*$/\1/P,Property,Properties/b
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[{]/\1/O,Object,Objects/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[{]/\1/O,Object,Objects/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[{]/\1/O,Object,Objects/b
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*styled/\1/S,StyledComponent,StyledComponents/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*styled/\1/S,StyledComponent,StyledComponents/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*styled/\1/S,StyledComponent,StyledComponents/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*createGlobalStyle/\1/S,StyledComponent,StyledComponents/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*createGlobalStyle/\1/S,StyledComponent,StyledComponents/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*createGlobalStyle/\1/S,StyledComponent,StyledComponents/b
|
||||
|
||||
--regex-javascript=/\/\/[ \t]*\(FIXME\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(TODO\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(BUG\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(NOBUG\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(???\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(!!!\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(HACK\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
--regex-javascript=/\/\/[ \t]*\(XXX\)[ \t]*:*\(.*\)/\1/T,Tag,Tags/b
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[0-9\"'\/]/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[0-9\"'\/]/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*[0-9\"'\/]/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*new/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*new/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*=[ \t]*new/\1/V,Variable,Variables/b
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[,;]/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*[,;]/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)/\3/V,Variable,Variables/b
|
||||
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\4/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\4/V,Variable,Variables/b
|
||||
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\4/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*var[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\4/V,Variable,Variables/b
|
||||
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}{[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[^}]*}[ \t]*=/\4/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\2/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\3/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\[[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\)[ \t]*,[ \t]*\([A-Za-z0-9_$]\{1,\}\).*\][ \t]*=/\4/V,Variable,Variables/b
|
||||
|
||||
--regex-javascript=/^[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\),$/\1/V,Variable,Variables/b
|
||||
--regex-javascript=/^[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)$/\1/V,Variable,Variables/b
|
||||
|
||||
--langmap=typescript:.ts.tsx
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+([a-z]+[ \t]+)?)?class[ \t]+([a-zA-Z0-9_$]+)/\3/c,classes/
|
||||
--regex-typescript=/^[ \t]*(declare[ \t]+)?namespace[ \t]+([a-zA-Z0-9_$]+)/\2/c,modules/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?module[ \t]+([a-zA-Z0-9_$]+)/\2/n,modules/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?(default[ \t]+)?(async[ \t]+)?function(\*)?[ \t]+([a-zA-Z0-9_$]+)/\5/f,functions/
|
||||
--regex-typescript=/^[ \t]*export[ \t]+(var|let|const)[ \t]+([a-zA-Z0-9_$]+)/\2/v,variables/
|
||||
--regex-typescript=/^[ \t]*(var|let|const)[ \t]+([a-zA-Z0-9_$]+)[ \t]*=[ \t]*function[ \t]*[*]?[ \t]*\(\)/\2/v,varlambdas/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?(public|protected|private)?[ \t]*(static[ \t]+)?(abstract[ \t]+)?(((get|set|readonly)[ \t]+)|(async[ \t]+[*]*[ \t]*))?(#?[a-zA-Z1-9_$]+)[ \t]*[:(]/\9/m,members/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?interface[ \t]+([a-zA-Z0-9_$]+)/\2/i,interfaces/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?type[ \t]+([a-zA-Z0-9_$]+)/\2/t,types/
|
||||
--regex-typescript=/^[ \t]*(export[ \t]+)?enum[ \t]+([a-zA-Z0-9_$]+)/\2/e,enums/
|
||||
--regex-typescript=/^[ \t]*import[ \t]+([a-zA-Z0-9_$]+)/\1/I,imports/
|
||||
@@ -0,0 +1,36 @@
|
||||
[user]
|
||||
name = jay
|
||||
email = jay@lawsnote.com
|
||||
[merge]
|
||||
tool = vimdiff
|
||||
[diff]
|
||||
tool = vimdiff
|
||||
trustExitCode = true
|
||||
[difftool]
|
||||
prompt = true
|
||||
[alias]
|
||||
d = difftool
|
||||
co = checkout
|
||||
ci = commit -v
|
||||
l = log --oneline --graph --all
|
||||
ls = log --graph --pretty=format:\"%h <%an> %ar %s\" --all
|
||||
st = status
|
||||
br = branch
|
||||
wt = worktree
|
||||
wta = worktree add
|
||||
wtr = worktree remove
|
||||
wtl = worktree list
|
||||
[mergetool]
|
||||
keepBackup = false
|
||||
prompt = true
|
||||
[mergetool "vimdiff"]
|
||||
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
|
||||
[core]
|
||||
editor = nvim
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
# vim: ft=gitconfig
|
||||
@@ -0,0 +1,18 @@
|
||||
XIM=fcitx
|
||||
GTK_IM_MODULE=fcitx
|
||||
QT_IM_MODULE=fcitx
|
||||
XMODIFIERS=@im=fcitx
|
||||
GLFW_IM_MODULE=fcitx
|
||||
SDL_IM_MODULE=fcitx
|
||||
MOZ_ENABLE_WAYLAND=1
|
||||
RTC_USE_PIPEWIRE=true
|
||||
IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
|
||||
|
||||
GDK_BACKEND=wayland,x11
|
||||
QT_QPA_PLATFORM=wayland;xcb
|
||||
CLUTTER_BACKEND=wayland
|
||||
SDL_VIDEODRIVER=wayland
|
||||
|
||||
EDITOR=nvim
|
||||
|
||||
WINEPREFIX=/home/jay/.wine
|
||||
@@ -6,9 +6,14 @@ run-shell "tmux setenv -g TMUX_VERSION_29 $(awk 'BEGIN {print (\"'$(tmux -V | se
|
||||
# -----------------------------
|
||||
# Global settings
|
||||
# -----------------------------
|
||||
set -g default-terminal xterm-256color
|
||||
# set -g default-terminal xterm-256color
|
||||
set -g default-terminal screen-256color
|
||||
set-option -ga terminal-overrides ",*256col*:Tc"
|
||||
|
||||
set -g allow-passthrough on
|
||||
set -ga update-environment TERM
|
||||
set -ga update-environment TERM_PROGRAM
|
||||
|
||||
# scrollback buffer n lines
|
||||
set -g history-limit 10000
|
||||
|
||||
@@ -18,9 +23,6 @@ set -g bell-action any
|
||||
# start window indexing at 1 window so the <prefix> 1 is easier to reach
|
||||
set -g base-index 1
|
||||
|
||||
# tell tmux to use 256 colour terminal
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
# xterm-style function key sequences
|
||||
setw -g xterm-keys on
|
||||
|
||||
@@ -64,12 +66,12 @@ bind-key C-l select-window -t :+
|
||||
bind-key -n C-l select-window -t :+
|
||||
|
||||
# navigate panes
|
||||
bind-key j select-pane -t :.-
|
||||
bind-key C-j select-pane -t :.-
|
||||
bind-key -n C-j select-pane -t :.-
|
||||
bind-key k select-pane -t :.+
|
||||
bind-key C-k select-pane -t :.+
|
||||
bind-key -n C-k select-pane -t :.+
|
||||
# bind-key j select-pane -t :.-
|
||||
# bind-key C-j select-pane -t :.-
|
||||
# bind-key -n C-j select-pane -t :.-
|
||||
# bind-key k select-pane -t :.+
|
||||
# bind-key C-k select-pane -t :.+
|
||||
# bind-key -n C-k select-pane -t :.+
|
||||
|
||||
# Copy-mode (vi-mode)
|
||||
#
|
||||
@@ -140,10 +142,24 @@ if-shell -b '[ "$TMUX_VERSION_29" = 0 ]' \
|
||||
if-shell -b '[ "$TMUX_VERSION_29" = 1 ]' \
|
||||
"set -g message-style fg=white,bg=black,bright"
|
||||
|
||||
set -g @batt_icon_charge_tier8 '🌕'
|
||||
set -g @batt_icon_charge_tier7 '🌖'
|
||||
set -g @batt_icon_charge_tier6 '🌖'
|
||||
set -g @batt_icon_charge_tier5 '🌗'
|
||||
set -g @batt_icon_charge_tier4 '🌗'
|
||||
set -g @batt_icon_charge_tier3 '🌘'
|
||||
set -g @batt_icon_charge_tier2 '🌘'
|
||||
set -g @batt_icon_charge_tier1 '🌑'
|
||||
set -g @batt_icon_status_charged '🔋'
|
||||
set -g @batt_icon_status_charging '⚡'
|
||||
set -g @batt_icon_status_discharging '👎'
|
||||
set -g @batt_color_status_primary_charged '#3daee9'
|
||||
set -g @batt_color_status_primary_charging '#3daee9'
|
||||
|
||||
# what to be displayed on the right status
|
||||
set -g status-interval 1
|
||||
set -g status-right ' } %Y-%m-%d %H:%M:%S'
|
||||
set -g status-right-length 60
|
||||
set -g status-right ' } Batt: #{battery_icon} #{battery_percentage} | #( ~/bin/tmux-right.sh ) | %Y-%m-%d %H:%M:%S'
|
||||
set -g status-right-length 80
|
||||
|
||||
# what to be displayed on the left status
|
||||
set -g status-left-length 30
|
||||
@@ -154,3 +170,12 @@ set-option -g status-left "#[fg=green]#(echo $USER)#[default].#[fg=blue]#h#[defa
|
||||
# -----------------------------
|
||||
|
||||
if-shell "hash reattach-to-user-namespace 2> /dev/null" 'set-option -g default-command "reattach-to-user-namespace bash"'
|
||||
|
||||
#-----------------------------
|
||||
# Plugins
|
||||
#-----------------------------
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
@@ -0,0 +1,105 @@
|
||||
# vim: set ft=zsh :
|
||||
# `$HOME/bin/start-agent`
|
||||
SSH_ENV="$HOME/.ssh/agent-environment"
|
||||
|
||||
function escapeStr {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: escapeStr <string>"
|
||||
return 1
|
||||
fi
|
||||
echo $1 | sed -r 's/([\$"])/\\\1/g'
|
||||
}
|
||||
|
||||
function start_agent {
|
||||
echo "Initialising new SSH agent..."
|
||||
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
|
||||
echo succeeded
|
||||
chmod 600 "${SSH_ENV}"
|
||||
. "${SSH_ENV}" > /dev/null
|
||||
/usr/bin/ssh-add;
|
||||
}
|
||||
|
||||
{{ if .shell.ssh_agent }}
|
||||
# Source SSH settings, if applicable
|
||||
if [ -f "${SSH_ENV}" ]; then
|
||||
. "${SSH_ENV}" > /dev/null
|
||||
#ps ${SSH_AGENT_PID} doesn't work under cywgin
|
||||
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
|
||||
start_agent;
|
||||
}
|
||||
else
|
||||
start_agent;
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
function envf {
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "File $1 does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export $(cat $1 | grep -v '^#' | xargs)
|
||||
}
|
||||
|
||||
function ttySize {
|
||||
echo "-e COLUMNS=$(tput cols) -e LINES=$(tput lines)"
|
||||
}
|
||||
|
||||
export HISTORY_SUBSTRING_SEARCH_PREFIXED=1
|
||||
export GOPATH="$HOME/go"
|
||||
export GOROOT="$HOME/apps/go"
|
||||
export NODE_ROOT="$HOME/apps/node"
|
||||
|
||||
export PATH="$GOPATH/bin:$GOROOT/bin:$NODE_ROOT/bin:${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
|
||||
if [ -f "$HOME/.cargo/env" ]; then
|
||||
. "$HOME/.cargo/env"
|
||||
fi
|
||||
|
||||
if [ -d "$HOME/bin" ]; then
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
if [ -d "$HOME/.local/bin" ]; then
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
fi
|
||||
|
||||
function ln-image-tags {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: ln-image-tags <image-name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curlie -L https://registry.lawsnote.com/v2/$1/tags/list
|
||||
}
|
||||
|
||||
function ln-save-image {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: ln-save-image <image-name:tag>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
docker-save --rm -p -o . -i registry.lawsnote.com/$1
|
||||
}
|
||||
|
||||
function save-image {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: save-image <image-name>"
|
||||
return 1
|
||||
fi
|
||||
tag=$(ln-image-tags "$1" | jq -c -r 'del(.tags[] | select(. == "latest")) | .tags | sort | last') || return 1
|
||||
ln-save-image "$1:$tag"
|
||||
}
|
||||
|
||||
function minio-size {
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: minio-size <alias or alias/bucket-path>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mc ls -r --json $1 | jq -s 'map(.size) | add' | numfmt --to=iec-i --suffix=B --padding=7
|
||||
}
|
||||
|
||||
function zfs-usage {
|
||||
awk '/^size/ { print $1 " " $3 / 1048576 }' < /proc/spl/kstat/zfs/arcstats
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
# Vim-like keybind as default
|
||||
bindkey -v
|
||||
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
|
||||
bindkey '^[,' autosuggest-accept
|
||||
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
|
||||
bindkey -M viins '^X^E' edit-command-line
|
||||
# Add emacs-like keybind to viins mode
|
||||
bindkey -M viins '^F' forward-char
|
||||
bindkey -M viins '^B' backward-char
|
||||
# bindkey -M viins '^P' up-line-or-history
|
||||
# bindkey -M viins '^N' down-line-or-history
|
||||
bindkey -M viins '^A' beginning-of-line
|
||||
bindkey -M viins '^E' end-of-line
|
||||
bindkey -M viins '^K' kill-line
|
||||
bindkey -M viins '^R' history-incremental-pattern-search-backward
|
||||
# bindkey -M viins '\er' history-incremental-pattern-search-forward
|
||||
bindkey -M viins '^Y' yank
|
||||
bindkey -M viins '^W' backward-kill-word
|
||||
bindkey -M viins '^U' backward-kill-line
|
||||
bindkey -M viins '^H' backward-delete-char
|
||||
bindkey -M viins '^?' backward-delete-char
|
||||
bindkey -M viins '^G' send-break
|
||||
bindkey -M viins '^D' delete-char-or-list
|
||||
|
||||
bindkey -M vicmd '^A' beginning-of-line
|
||||
bindkey -M vicmd '^E' end-of-line
|
||||
bindkey -M vicmd '^K' kill-line
|
||||
# bindkey -M vicmd '^P' up-line-or-history
|
||||
# bindkey -M vicmd '^N' down-line-or-history
|
||||
bindkey -M vicmd '^Y' yank
|
||||
bindkey -M vicmd '^W' backward-kill-word
|
||||
bindkey -M vicmd '^U' backward-kill-line
|
||||
bindkey -M vicmd '/' vi-history-search-forward
|
||||
bindkey -M vicmd '?' vi-history-search-backward
|
||||
|
||||
bindkey -M vicmd 'gg' beginning-of-line
|
||||
bindkey -M vicmd 'G' end-of-line
|
||||
|
||||
if is-at-least 5.0.8; then
|
||||
autoload -Uz surround
|
||||
zle -N delete-surround surround
|
||||
zle -N change-surround surround
|
||||
zle -N add-surround surround
|
||||
bindkey -a cs change-surround
|
||||
bindkey -a ds delete-surround
|
||||
bindkey -a ys add-surround
|
||||
bindkey -a S add-surround
|
||||
fi
|
||||
@@ -0,0 +1,13 @@
|
||||
alias k="kubectl"
|
||||
alias nv="nvim"
|
||||
alias ls="ls --color=auto"
|
||||
|
||||
# alias docker="lima nerdctl"
|
||||
# alias ds="lima sudo nerdctl"
|
||||
|
||||
alias wgup="sudo wg-quick up"
|
||||
alias wgdown="sudo wg-quick down"
|
||||
alias wgc="wgvpn connect"
|
||||
alias wgd="wgvpn disconnect"
|
||||
|
||||
alias vm-system="virt-viewer -c qemu:///system"
|
||||
@@ -0,0 +1,160 @@
|
||||
# Do not print the directory stack after pushd or popd.
|
||||
#setopt pushd_silent
|
||||
# Replace 'cd -' with 'cd +'
|
||||
setopt pushd_minus
|
||||
|
||||
# Ignore duplicates to add to pushd
|
||||
setopt pushd_ignore_dups
|
||||
|
||||
# pushd no arg == pushd $HOME
|
||||
setopt pushd_to_home
|
||||
|
||||
# Check spell command
|
||||
# setopt correct
|
||||
|
||||
# Check spell all
|
||||
# setopt correct_all
|
||||
|
||||
# Prohibit overwrite by redirection(> & >>) (Use >! and >>! to bypass.)
|
||||
# setopt no_clobber
|
||||
|
||||
# Deploy {a-c} -> a b c
|
||||
setopt brace_ccl
|
||||
|
||||
# Enable 8bit
|
||||
setopt print_eight_bit
|
||||
|
||||
# sh_word_split
|
||||
setopt sh_word_split
|
||||
|
||||
# Change
|
||||
#~$ echo 'hoge' \' 'fuga'
|
||||
# to
|
||||
#~$ echo 'hoge '' fuga'
|
||||
setopt rc_quotes
|
||||
|
||||
# Case of multi redirection and pipe,
|
||||
# use 'tee' and 'cat', if needed
|
||||
# ~$ < file1 # cat
|
||||
# ~$ < file1 < file2 # cat 2 files
|
||||
# ~$ < file1 > file3 # copy file1 to file3
|
||||
# ~$ < file1 > file3 | cat # copy and put to stdout
|
||||
# ~$ cat file1 > file3 > /dev/stdin # tee
|
||||
setopt multios
|
||||
|
||||
# Automatically delete slash complemented by supplemented by inserting a space.
|
||||
setopt auto_remove_slash
|
||||
|
||||
# No Beep
|
||||
setopt no_beep
|
||||
setopt no_list_beep
|
||||
setopt no_hist_beep
|
||||
|
||||
# Expand '=command' as path of command
|
||||
# e.g.) '=ls' -> '/bin/ls'
|
||||
setopt equals
|
||||
|
||||
# Do not use Ctrl-s/Ctrl-q as flow control
|
||||
setopt no_flow_control
|
||||
|
||||
# Look for a sub-directory in $PATH when the slash is included in the command
|
||||
setopt path_dirs
|
||||
|
||||
# Show exit status if it's except zero.
|
||||
setopt print_exit_value
|
||||
|
||||
# Show expaning and executing in what way
|
||||
#setopt xtrace
|
||||
|
||||
# Confirm when executing 'rm *'
|
||||
# setopt rm_star_wait
|
||||
|
||||
# Let me know immediately when terminating job
|
||||
setopt notify
|
||||
|
||||
# Show process ID
|
||||
setopt long_list_jobs
|
||||
|
||||
# Resume when executing the same name command as suspended process name
|
||||
setopt auto_resume
|
||||
|
||||
# Disable Ctrl-d (Use 'exit', 'logout')
|
||||
#setopt ignore_eof
|
||||
|
||||
# Ignore case when glob
|
||||
setopt no_case_glob
|
||||
|
||||
# Use '*, ~, ^' as regular expression
|
||||
# Match without pattern
|
||||
# ex. > rm *~398
|
||||
# remove * without a file "398". For test, use "echo *~398"
|
||||
setopt extended_glob
|
||||
|
||||
# If the path is directory, add '/' to path tail when generating path by glob
|
||||
setopt mark_dirs
|
||||
|
||||
# Automaticall escape URL when copy and paste
|
||||
autoload -Uz url-quote-magic
|
||||
zle -N self-insert url-quote-magic
|
||||
|
||||
# Prevent overwrite prompt from output withour cr
|
||||
setopt no_prompt_cr
|
||||
|
||||
# Let me know mail arrival
|
||||
setopt mail_warning
|
||||
|
||||
# Do not record an event that was just recorded again.
|
||||
setopt hist_ignore_dups
|
||||
|
||||
# Delete an old recorded event if a new event is a duplicate.
|
||||
setopt hist_ignore_all_dups
|
||||
setopt hist_save_nodups
|
||||
|
||||
# Expire a duplicate event first when trimming history.
|
||||
setopt hist_expire_dups_first
|
||||
|
||||
# Do not display a previously found event.
|
||||
setopt hist_find_no_dups
|
||||
|
||||
# Shere history
|
||||
setopt share_history
|
||||
|
||||
# Pack extra blank
|
||||
setopt hist_reduce_blanks
|
||||
|
||||
# Write to the history file immediately, not when the shell exits.
|
||||
# setopt inc_append_history
|
||||
|
||||
# Remove comannd of 'hostory' or 'fc -l' from history list
|
||||
setopt hist_no_store
|
||||
|
||||
# Remove functions from history list
|
||||
setopt hist_no_functions
|
||||
|
||||
# Record start and end time to history file
|
||||
setopt extended_history
|
||||
|
||||
# Ignore the beginning space command to history file
|
||||
setopt hist_ignore_space
|
||||
|
||||
# Append to history file
|
||||
# setopt append_history
|
||||
|
||||
# Edit history file during call history before executing
|
||||
setopt hist_verify
|
||||
|
||||
# Enable history system like a Bash
|
||||
setopt bang_hist
|
||||
|
||||
setopt always_last_prompt
|
||||
# setopt auto_cd
|
||||
setopt auto_menu
|
||||
setopt auto_param_keys
|
||||
setopt auto_param_slash
|
||||
setopt auto_pushd
|
||||
setopt complete_in_word
|
||||
setopt globdots
|
||||
setopt interactive_comments
|
||||
setopt list_types
|
||||
setopt magic_equal_subst
|
||||
setopt monitor
|
||||
@@ -0,0 +1,46 @@
|
||||
# Important
|
||||
zstyle ':completion:*:default' menu select=2
|
||||
|
||||
# Completing Groping
|
||||
zstyle ':completion:*:options' description 'yes'
|
||||
zstyle ':completion:*:descriptions' format '%F{yellow}Completing %B%d%b%f'
|
||||
zstyle ':completion:*' group-name ''
|
||||
|
||||
# Completing misc
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||
zstyle ':completion:*' verbose yes
|
||||
zstyle ':completion:*' completer _expand _complete _match _prefix _approximate _list _history
|
||||
zstyle ':completion:*:*files' ignored-patterns '*?.o' '*?~' '*\#'
|
||||
zstyle ':completion:*' use-cache true
|
||||
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
||||
|
||||
# Directory
|
||||
zstyle ':completion:*:cd:*' ignore-parents parent pwd
|
||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||
|
||||
# default: --
|
||||
zstyle ':completion:*' list-separator '-->'
|
||||
zstyle ':completion:*:manuals' separate-sections true
|
||||
|
||||
# Menu select
|
||||
zmodload -i zsh/complist
|
||||
bindkey -M menuselect '^h' vi-backward-char
|
||||
bindkey -M menuselect '^j' vi-down-line-or-history
|
||||
bindkey -M menuselect '^k' vi-up-line-or-history
|
||||
bindkey -M menuselect '^l' vi-forward-char
|
||||
#bindkey -M menuselect '^k' accept-and-infer-next-history
|
||||
|
||||
autoload -Uz cdr
|
||||
autoload -Uz history-search-end
|
||||
autoload -Uz modify-current-argument
|
||||
autoload -Uz smart-insert-last-word
|
||||
autoload -Uz terminfo
|
||||
autoload -Uz vcs_info
|
||||
autoload -Uz zcalc
|
||||
autoload -Uz zmv
|
||||
autoload -Uz run-help-git
|
||||
autoload -Uz run-help-svk
|
||||
autoload -Uz run-help-svn
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
dir=$(dirname $0)
|
||||
|
||||
for i in $(ls $dir/*.zsh);
|
||||
do
|
||||
source "$i"
|
||||
done
|
||||
@@ -0,0 +1,54 @@
|
||||
{{ if .shell.tmux }}
|
||||
export ZSH_TMUX_AUTOSTART=true
|
||||
export ZSH_TMUX_AUTOSTART_ONCE=true
|
||||
export ZSH_TMUX_AUTOCONNECT=true
|
||||
{{ end }}
|
||||
export HISTFILE="$HOME/.zsh_history"
|
||||
#export HISTFILESIZE=100000
|
||||
export HISTSIZE=100000
|
||||
export SAVEHIST=100
|
||||
|
||||
# install zinit
|
||||
# git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin
|
||||
source ~/.zinit/bin/zinit.zsh
|
||||
|
||||
zinit light zsh-users/zsh-completions
|
||||
zinit snippet OMZ::lib/async_prompt.zsh
|
||||
zinit light zsh-users/zsh-autosuggestions
|
||||
zinit light mattbangert/kubectl-zsh-plugin
|
||||
|
||||
zinit light zdharma-continuum/fast-syntax-highlighting
|
||||
|
||||
zinit light zsh-users/zsh-history-substring-search
|
||||
|
||||
# OhMyZSH Plugs
|
||||
zinit snippet OMZ::lib/completion.zsh
|
||||
zinit snippet OMZ::lib/git.zsh
|
||||
zinit snippet OMZ::lib/theme-and-appearance.zsh
|
||||
zinit ice as="completion"
|
||||
zinit snippet OMZP::composer
|
||||
zinit snippet OMZP::aws
|
||||
zinit snippet OMZ::plugins/sudo/sudo.plugin.zsh
|
||||
zinit snippet OMZP::kubectl
|
||||
zinit ice lucid wait='1'
|
||||
zinit snippet OMZ::plugins/git/git.plugin.zsh
|
||||
|
||||
# Load OMZ extract folder
|
||||
#zinit ice svn
|
||||
zinit snippet OMZ::plugins/extract
|
||||
#zinit ice svn
|
||||
zinit snippet OMZ::plugins/tmux
|
||||
|
||||
# theme
|
||||
zinit light "otakukaze/zsh-ys-theme"
|
||||
|
||||
# auto load other zshfiles
|
||||
[ -f "$HOME/.zsh/zsh.sh" ] && source "$HOME/.zsh/zsh.sh"
|
||||
|
||||
[ -f "$HOME/.zprofile" ] && source "$HOME/.zprofile"
|
||||
|
||||
# vim: set ft=zsh:
|
||||
|
||||
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
export PATH="/usr/local/opt/openjdk/bin:$PATH"
|
||||
@@ -3,3 +3,4 @@ Host *
|
||||
UserKnownHostsFile /dev/null
|
||||
ForwardAgent yes
|
||||
|
||||
Include conf.d/*.conf
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# -e: exit on error
|
||||
# -u: exit on unset variables
|
||||
set -eu
|
||||
|
||||
if ! chezmoi="$(command -v chezmoi)"; then
|
||||
bin_dir="${HOME}/.local/bin"
|
||||
chezmoi="${bin_dir}/chezmoi"
|
||||
echo "Installing chezmoi to '${chezmoi}'" >&2
|
||||
if command -v curl >/dev/null; then
|
||||
chezmoi_install_script="$(curl -fsSL get.chezmoi.io)"
|
||||
elif command -v wget >/dev/null; then
|
||||
chezmoi_install_script="$(wget -qO- get.chezmoi.io)"
|
||||
else
|
||||
echo "To install chezmoi, you must have curl or wget installed." >&2
|
||||
exit 1
|
||||
fi
|
||||
sh -c "${chezmoi_install_script}" -- -b "${bin_dir}"
|
||||
unset chezmoi_install_script bin_dir
|
||||
fi
|
||||
|
||||
# POSIX way to get script's dir: https://stackoverflow.com/a/29834779/12156188
|
||||
script_dir="$(cd -P -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P)"
|
||||
|
||||
set -- init --apply --source="${script_dir}"
|
||||
|
||||
echo "Running 'chezmoi $*'" >&2
|
||||
# exec: replace current process with chezmoi
|
||||
exec "$chezmoi" "$@"
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f "$HOME/.vimrc" ]; then
|
||||
# backup old file
|
||||
mv "$HOME/.vimrc" "$HOME/.vimrc.old"
|
||||
fi
|
||||
|
||||
ln -sf "`pwd`/.vimrc" "$HOME/.vimrc"
|
||||
|
||||
if [ -f "$HOME/.gitconfig" ]; then
|
||||
# backup old file
|
||||
mv "$HOME/.gitconfig" "$HOME/.gitconfig.old"
|
||||
fi
|
||||
|
||||
ln -sf "`pwd`/.gitconfig" "$HOME/.gitconfig"
|
||||
|
||||
if [ -f "$HOME/.tmux.conf" ]; then
|
||||
# backup old file
|
||||
mv "$HOME/.tmux.conf" "$HOME/.tmux.conf.old"
|
||||
fi
|
||||
|
||||
ln -sf "`pwd`/.tmux.conf" "$HOME/.tmux.conf"
|
||||
|
||||
if [ ! -d "$HOME/.ssh" ]; then
|
||||
mkdir -p "$HOME/.ssh"
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.ssh/config" ]; then
|
||||
# backup old file
|
||||
mv "$HOME/.ssh/config" "$HOME/.ssh/config.old"
|
||||
fi
|
||||
|
||||
cp "`pwd`/.ssh/config" "$HOME/.ssh/config"
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
export XDG_CURRENT_DESKTOP=Hyprland # xdg-desktop-portal
|
||||
export XDG_SESSION_DESKTOP=Hyprland # systemd
|
||||
export XDG_SESSION_TYPE=wayland # xdg/systemd
|
||||
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
# without this, systemd starts xdg-desktop-portal without these environment variables,
|
||||
# and the xdg-desktop-portal does not start xdg-desktop-portal-wrl as expected
|
||||
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/39#issuecomment-638752975
|
||||
systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
|
||||
# use systemd-run here, because systemd units inherit variables from ~/.config/environment.d
|
||||
# shellcheck disable=SC2068
|
||||
systemd-run --quiet --unit=hypr --user --wait Hyprland $@
|
||||
systemctl --user stop hypr-session.target
|
||||
|
||||
# this teardown makes it easier to switch between compositors
|
||||
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
systemctl --user unset-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
export XDG_CURRENT_DESKTOP=sway # xdg-desktop-portal
|
||||
export XDG_SESSION_DESKTOP=sway # systemd
|
||||
export XDG_SESSION_TYPE=wayland # xdg/systemd
|
||||
|
||||
if [ -d "$HOME/.config/environment.d" ]; then
|
||||
for f in "$HOME"/.config/environment.d/*.conf; do
|
||||
[ -f "$f" ] || continue
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
# Skip empty lines and comments
|
||||
case "$line" in
|
||||
'' | '#'*) continue ;;
|
||||
esac
|
||||
# Export the variable
|
||||
export "$line"
|
||||
done <"$f"
|
||||
done
|
||||
fi
|
||||
|
||||
max_attempts=50
|
||||
attempt=0
|
||||
while [ ! -d "/run/user/$(id -u)" ]; do
|
||||
if [ "$attempt" -ge "$max_attempts" ]; then
|
||||
echo "Error: XDG_RUNTIME_DIR not available after $max_attempts attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 0.2
|
||||
attempt=$((attempt + 1))
|
||||
done
|
||||
|
||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
||||
|
||||
dbus-run-session sway "$@"
|
||||
|
||||
# this teardown makes it easier to switch between compositors
|
||||
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
export XDG_CURRENT_DESKTOP=sway # xdg-desktop-portal
|
||||
export XDG_SESSION_DESKTOP=sway # systemd
|
||||
export XDG_SESSION_TYPE=wayland # xdg/systemd
|
||||
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
# without this, systemd starts xdg-desktop-portal without these environment variables,
|
||||
# and the xdg-desktop-portal does not start xdg-desktop-portal-wrl as expected
|
||||
# https://github.com/emersion/xdg-desktop-portal-wlr/issues/39#issuecomment-638752975
|
||||
systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
|
||||
# use systemd-run here, because systemd units inherit variables from ~/.config/environment.d
|
||||
# shellcheck disable=SC2068
|
||||
systemd-run --quiet --unit=sway --user --wait sway $@
|
||||
systemctl --user stop sway-session.target
|
||||
|
||||
# this teardown makes it easier to switch between compositors
|
||||
unset DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
systemctl --user unset-environment DISPLAY SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
if command -v dbus-update-activation-environment >/dev/null; then
|
||||
dbus-update-activation-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user