Compare commits
561 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96969ca538 | |||
| fea17f0609 | |||
| 98522f5056 | |||
| e3a9e470f5 | |||
| 45d25d6ac0 | |||
| e120928f50 | |||
| 24ab294f11 | |||
| 6c049fdcfc | |||
| 35231d8749 | |||
| def552033b | |||
| df7f625b4c | |||
| 1e8f2e0e57 | |||
| ebdab1ae44 | |||
| 50f0b33af3 | |||
| 160c06c661 | |||
| f42be40ce5 | |||
| 797fdb5b41 | |||
| 96b8add23e | |||
| 91adc03b90 | |||
| 61e71e1771 | |||
| 97ea54f2b2 | |||
| 342c6d186e | |||
| 5cd27fe13c | |||
| 4e6a0697a5 | |||
| 46ef972920 | |||
| f53dab6909 | |||
| 9589501580 | |||
| 8fbc4c98a9 | |||
| 4107446a1c | |||
| 2e9c444e09 | |||
| f64164b6ff | |||
| 7519995398 | |||
| 06e80254bd | |||
| 845f83c3e0 | |||
| 640fc6d089 | |||
| 9a36640df8 | |||
| 0790b3d363 | |||
| 0f131880b1 | |||
| 0df870b2a0 | |||
| 1db339be4a | |||
| 30fa651030 | |||
| 41be339450 | |||
| 2b9b903803 | |||
| 90c81c3043 | |||
| 7d4085784a | |||
| 8d9ba24d6c | |||
| 5414d49b01 | |||
| d511b9dedc | |||
| f63ba69d99 | |||
| cfb136da9c | |||
| ae3b33e945 | |||
| b68cc25014 | |||
| b01110dc91 | |||
| 9bc9cce6f6 | |||
| e67593582e | |||
| 2cd1a21cdb | |||
| 6ed951778b | |||
| c5cd1726dd | |||
| 02d234be3f | |||
| e30fd5d1d2 | |||
| 7374d444fe | |||
| 24f71239e2 | |||
| 38451f5dee | |||
| 32381a1c40 | |||
| 26ec6aff99 | |||
| 6c5fbd775c | |||
| 9bf180fdda | |||
| 00550ea45d | |||
| ee6e683a4f | |||
| aa14d4125c | |||
| 13f1c4c395 | |||
| e7091b0efc | |||
| 18da9279de | |||
| a2e5f996d9 | |||
| 48719600b2 | |||
| 7a8b0951d1 | |||
| a73a6e6ede | |||
| 4d063a44f4 | |||
| d8b349f0d8 | |||
| 4037dfa979 | |||
| 6db9f3b125 | |||
| d13361cf22 | |||
| 90bbeceb2d | |||
| 29f9bc507e | |||
| 84d40da737 | |||
| 004ef252b0 | |||
| e238460c7b | |||
| faf91675e1 | |||
| 5eac373c2a | |||
| 27170d452c | |||
| 86c638d665 | |||
| 0dfd08e3f5 | |||
| f6742657cc | |||
| 4b9d783284 | |||
| e4a7358443 | |||
| 84fb307256 | |||
| 87fd7fd7f7 | |||
| 036943bb93 | |||
| e32cadf434 | |||
| fc168c197f | |||
| 4f868d83c9 | |||
| f2dc60ba4d | |||
| 81e5d94af7 | |||
| 13bae9730c | |||
| 7e3bc88fc4 | |||
| e6d96c38ea | |||
| c279742cc2 | |||
| 8d289006a8 | |||
| c19b0ce18a | |||
| 2eb84883cd | |||
| 6a06ef5399 | |||
| 250174e5ff | |||
| e7e09b47df | |||
| 51f5010dc9 | |||
| d063d2b447 | |||
| 1b55d67110 | |||
| 9addfbd04e | |||
| cd92b78f23 | |||
| fc26afb9a6 | |||
| 1db4989005 | |||
| 5c96138aca | |||
| 1bc39c91c0 | |||
| 0220be6920 | |||
| 512034a05a | |||
| b50a1bcae2 | |||
| ee2ad8f08b | |||
| 0909b3afb7 | |||
| a585f989f5 | |||
| 6206502fd2 | |||
| e388290c67 | |||
| f0f2105b38 | |||
| b6c2953992 | |||
| 9ae72acb0e | |||
| d439428671 | |||
| 3574ec7f6e | |||
| 72ccbc8110 | |||
| 260ebc30eb | |||
| 55ed73161a | |||
| b2d291bb0a | |||
| 6c019632ba | |||
| 4048e16bbe | |||
| e5f3079c82 | |||
| 17164de6ad | |||
| c5618397dd | |||
| 64531b2113 | |||
| 73f1bda2bf | |||
| 41627767b9 | |||
| 1471013bd7 | |||
| 89b210f663 | |||
| 91e122af50 | |||
| f8f7831415 | |||
| 58e3a093f9 | |||
| f93b556789 | |||
| d547a8f1e0 | |||
| 99601082ce | |||
| 7b7b4094af | |||
| 4a88eb960d | |||
| 361d9ce065 | |||
| a534f5bdd1 | |||
| 99c6c50f42 | |||
| cf783051ad | |||
| 5a45b10698 | |||
| 8e184d2098 | |||
| fdb8fab853 | |||
| bdbf3f9359 | |||
| a55ffaa138 | |||
| 7c763d62e3 | |||
| 3b7f374057 | |||
| 3165c8d469 | |||
| 964f4f5480 | |||
| 947151dd4c | |||
| ead6118efb | |||
| 669ff43ec0 | |||
| c165357066 | |||
| ccc217d191 | |||
| 90c5d38c12 | |||
| adea5a27bb | |||
| 49bf6b287d | |||
| c7a894e5f0 | |||
| 354c1c2a6b | |||
| d859a28f9b | |||
| 28dc71a192 | |||
| 3fa73ef3b6 | |||
| 462c79c9c6 | |||
| 147422ab17 | |||
| ad390d00b6 | |||
| 91b7fc71a7 | |||
| 4b7abd9515 | |||
| c02fb05f22 | |||
| c85397220a | |||
| 10b4373bf0 | |||
| d6b8d7e0ae | |||
| f7b7a2a518 | |||
| b07cf3869e | |||
| 2312e66f1f | |||
| 0d6810f374 | |||
| f54bff0fda | |||
| 86cfba7187 | |||
| 0b99b04495 | |||
| 2c16752260 | |||
| 92792a09af | |||
| 045cf9ca1b | |||
| fa7221ecae | |||
| 334085ab32 | |||
| c8c0a2159e | |||
| 537e66cf20 | |||
| c3a1612b0f | |||
| ff3d5064b8 | |||
| 9081fef1ff | |||
| 20055deed0 | |||
| ec98e1b6b5 | |||
| c655e40f6d | |||
| 84350f5842 | |||
| 03848abdb3 | |||
| a10f949729 | |||
| 247fc36d98 | |||
| 922c614fd0 | |||
| a237eab58f | |||
| e09b56351d | |||
| 729f11cbd3 | |||
| 58c3b7db28 | |||
| 1d2563a49e | |||
| 34f194a91f | |||
| c5ed921348 | |||
| 90f902b715 | |||
| b6c0bed615 | |||
| c463244cc0 | |||
| 0d4cad56bb | |||
| 9679e2079b | |||
| 2fdda3a2e3 | |||
| 1855ecc35d | |||
| 3cd78ae74c | |||
| 3576cb2f20 | |||
| 370ec5fcd9 | |||
| b6f366f7d2 | |||
| 5774abe938 | |||
| 866f46967c | |||
| 3368a564b0 | |||
| 1b6e26c902 | |||
| e658228d3c | |||
| fa7aa567a6 | |||
| a63f591c59 | |||
| d1b587536e | |||
| 832502b1d5 | |||
| df8722644b | |||
| 0171dd5120 | |||
| da43e8cc09 | |||
| b9f5afa0b6 | |||
| a4ed26fdb3 | |||
| a00079c820 | |||
| e26e9f16d5 | |||
| f216ea9e5e | |||
| c2d4b02cb6 | |||
| 4213b395ea | |||
| 9c6b4b0ebf | |||
| 1b62c2a66f | |||
| 35477abe48 | |||
| 9fbf50a1b6 | |||
| d296aadcb5 | |||
| 9584cd0b4c | |||
| 9bcdb62015 | |||
| 749205acc0 | |||
| 59465469fa | |||
| 018874f060 | |||
| b41fe49004 | |||
| bf01e401d2 | |||
| 0f3b2024df | |||
| 46108c2f8d | |||
| 2761b19f1a | |||
| 1d30104340 | |||
| c67ea463e9 | |||
| a89bbc813c | |||
| fd867c892b | |||
| 8bf01c0e95 | |||
| 570db7724c | |||
| 6e9f690a9c | |||
| 5e7f15df2b | |||
| 1c8c0795a4 | |||
| 4b6cbc0f8d | |||
| 69b930d7f4 | |||
| 0d4515d8c3 | |||
| 9367aa7990 | |||
| a701cf558b | |||
| 5b08516319 | |||
| 18b705b718 | |||
| edcb67e9ee | |||
| 9440caf156 | |||
| 6fcf277359 | |||
| 9d2915895b | |||
| 667badeb9c | |||
| 43973a1d68 | |||
| 4b353e47be | |||
| 583b9ff6f7 | |||
| b62bdee1ed | |||
| 9465568b5f | |||
| 66b7dce3c2 | |||
| c1078672bf | |||
| 81bcd8dc3d | |||
| 0a66d62165 | |||
| 7beb5bc38b | |||
| a749f19422 | |||
| 00baf0f20e | |||
| 160cecbbef | |||
| 26e6bd40bb | |||
| e7bfa7fdf6 | |||
| ebb19ef63b | |||
| 3c27faae0e | |||
| 3d82b815b2 | |||
| 3c1b815582 | |||
| c45a39a419 | |||
| 429a4cb2fe | |||
| 74c0fdebb3 | |||
| 259593ba4f | |||
| 1c36a4e5f7 | |||
| cfd6ddee0d | |||
| 91bafdb221 | |||
| dfa0832f8a | |||
| 3aa127e7e6 | |||
| dd7123f98a | |||
| 4235971fb7 | |||
| b807be1587 | |||
| 4ea4da352f | |||
| a4d8e204f6 | |||
| 6bdfc3d812 | |||
| f410467a9a | |||
| 3755822796 | |||
| 1d136f1f64 | |||
| 695522d088 | |||
| c4a7194249 | |||
| 649ca37de8 | |||
| a93541b520 | |||
| a1f0d960e2 | |||
| 76568fa286 | |||
| 46faf1536b | |||
| c217b57e69 | |||
| 2bdf365300 | |||
| 251e88a000 | |||
| 89daf17b92 | |||
| 0734de3f67 | |||
| c25c6bf266 | |||
| a81b4ce279 | |||
| a1e01875de | |||
| 7ad907b609 | |||
| a66621f0a4 | |||
| 3b538ccaf4 | |||
| 09e1fe8b0a | |||
| b3d83a2d78 | |||
| 3775a9b8ec | |||
| 37e9ac2814 | |||
| b20f8aab0a | |||
| a5768d66d8 | |||
| 22b0280702 | |||
| 66681dd143 | |||
| 7cc90747ca | |||
| b159e60370 | |||
| 7761decfb2 | |||
| da9273d38e | |||
| dca27bca1f | |||
| bd473085a7 | |||
| 9cf28b8da9 | |||
| d744b66166 | |||
| 3a39401021 | |||
| e5fd71dcf0 | |||
| 4382797c25 | |||
| 44839849b6 | |||
| cf09544569 | |||
| 67417b09ef | |||
| 468b9b698f | |||
| 5c6f5fba0a | |||
| ac6d7a07ea | |||
| 5ce1ca4a42 | |||
| c180a23930 | |||
| ae5ff167ee | |||
| 9b303d5385 | |||
| 3f0fdef139 | |||
| baa87509da | |||
| 554c117812 | |||
| e26483c0b5 | |||
| 639c7a456d | |||
| 3a4ff6b5b9 | |||
| fc232c4f80 | |||
| c84367bf8c | |||
| 229fb1c863 | |||
| 0cecbd4e43 | |||
| 9e81d06b2e | |||
| bae26dbc66 | |||
| 9ec746a0e1 | |||
| ff5433e202 | |||
| 5819358ea7 | |||
| f64c9db247 | |||
| 8ffa514d22 | |||
| df9852994c | |||
| 2d6735f3ec | |||
| 1766802248 | |||
| 0e698d4f3b | |||
| a1343f2db6 | |||
| 967143bf5a | |||
| e364188ba9 | |||
| 08b8449fe5 | |||
| a79dd142d8 | |||
| 77067e8ff1 | |||
| 7f217ecbd7 | |||
| 9d43f6262d | |||
| 10c7e768a5 | |||
| e98e06cc87 | |||
| 11d26ecad1 | |||
| 7fee966adf | |||
| c4f2513cf5 | |||
| 25ed18fda1 | |||
| bd53de094a | |||
| cca2037d2c | |||
| 94ef205cf7 | |||
| 3e4e42e509 | |||
| c541529016 | |||
| 7c52569f97 | |||
| e4aa9aee25 | |||
| cab6652a51 | |||
| c06d9b4a38 | |||
| 31c636c147 | |||
| 855009b507 | |||
| 4461341ccf | |||
| f9dbce3b07 | |||
| 65ae6b15ad | |||
| 8c346b1729 | |||
| a6b93d3a2f | |||
| 38ab46fa2a | |||
| 5522704219 | |||
| ba1dddb5aa | |||
| 40c6cbce70 | |||
| cb67414281 | |||
| 1ab3bfe01d | |||
| 09dbd61d1b | |||
| 318436053a | |||
| 0ae714129f | |||
| c1ea72f4e6 | |||
| 9db677d2b5 | |||
| 19a1762d9b | |||
| c0d34945eb | |||
| 91d8bd8de2 | |||
| b938586945 | |||
| 816235e298 | |||
| 9cd5e17a5d | |||
| d561b07417 | |||
| 3f7edf97ec | |||
| 9ab8a59193 | |||
| fe80a79846 | |||
| e3ef76a626 | |||
| 61407b51f5 | |||
| 5c6ac9cbcd | |||
| 45a0e43cc1 | |||
| af97f24988 | |||
| 58fe1ab39d | |||
| 4beb245aa4 | |||
| 79ccb183ef | |||
| 7a86d25fb4 | |||
| f657e8be74 | |||
| bf79895ea8 | |||
| 59f8ab46ea | |||
| ccca6a92f9 | |||
| 6f13de7d44 | |||
| 82d9a032ab | |||
| 88e48662a3 | |||
| 2a250daa34 | |||
| fbc3db337e | |||
| 1499c8ff5f | |||
| 882e774bf7 | |||
| ad0b47e6e0 | |||
| 84f508d216 | |||
| 11ca0b250f | |||
| 569d457db6 | |||
| bd1c90c4a3 | |||
| 2dd8b6d5a7 | |||
| 1706e7bda9 | |||
| 0fc4f945bc | |||
| 1c508c6f39 | |||
| 2fe15385e9 | |||
| f8298cfc30 | |||
| e978486393 | |||
| 7f66492f2a | |||
| d1c1287399 | |||
| 5c82197471 | |||
| 6f0c0047d0 | |||
| 0d41b5b5cb | |||
| c7f4925084 | |||
| d3731cb198 | |||
| ed8739aa70 | |||
| 737027bf54 | |||
| 1947b3410b | |||
| f96b5fe783 | |||
| 6ba34f7c69 | |||
| ee275b24b6 | |||
| 4e7ed7fa86 | |||
| a6b8205df1 | |||
| 7a76792eac | |||
| 88de2e74ff | |||
| 321544578e | |||
| 6b5241fb09 | |||
| d365bdc6ff | |||
| dc0ab73547 | |||
| 17d463e424 | |||
| cb15d6404f | |||
| 3b6334581a | |||
| caf52539d1 | |||
| 575ff93131 | |||
| cb079679a8 | |||
| d82b59a56d | |||
| ba786afab4 | |||
| 4b71ffe3b9 | |||
| 3d6a08c9b5 | |||
| d6db0e4b48 | |||
| 3255b770d5 | |||
| 8cd848933f | |||
| 425d2c8789 | |||
| 033425f869 | |||
| 0f001c52d5 | |||
| 9d0568160d | |||
| 7621d1da3b | |||
| f69e8dc834 | |||
| a85249e473 | |||
| 2a4f583d33 | |||
| 436a86a1a4 | |||
| cd8da20d95 | |||
| 3bc1802657 | |||
| 5c6a78ae72 | |||
| 907f390899 | |||
| 8a718dfb3c | |||
| 3c0db2ae64 | |||
| fe2490fc56 | |||
| 8d9614c918 | |||
| c12dd2d0fa | |||
| 5423cd1bd1 | |||
| 76a911ffc9 | |||
| ba8dece09a | |||
| a41a064b4b | |||
| 6fd2f58f6c | |||
| 20e0ec5f7a | |||
| 9ab0d024a6 | |||
| 0c3baa45d4 | |||
| 43b0246b04 | |||
| c1ffdb9b27 | |||
| 3cefe591af | |||
| e5827e1789 | |||
| 1f23150937 | |||
| 4ebb0f6e4e | |||
| 3b52e572d4 | |||
| 1e7023cda2 | |||
| 7a49556d15 | |||
| d4d6e77ce3 | |||
| 6ded275dd3 | |||
| 2404c83783 | |||
| a1be3129ad | |||
| 82de8a8cd1 | |||
| 62dd4101e4 | |||
| a7cbd1112e | |||
| 26729882cb | |||
| dbe321a9fc | |||
| 6933160f7d | |||
| dc9260af5a | |||
| 2c66dbab44 | |||
| 31cf397c4e | |||
| a3404c3d78 |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@ -1,2 +0,0 @@
|
||||
|
||||
custom: ['https://www.blockchain.com/btc/address/bc1qgh2fyzqgyxgpstsmqwxyev2luzx7hwc4ezq03u', 'https://www.blockchain.com/eth/address/0x01931cf08BbbA74629c232DbEDB390798cDD121f']
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
@ -3,12 +3,15 @@ home/user/.config/zsh/plugins/*
|
||||
home/user/.config/nvim/plugin
|
||||
home/user/.config/nvim/spell
|
||||
|
||||
home/user/.config/bash/bashrc.d/*
|
||||
!home/user/.config/bash/bashrc.d/.gitkeep
|
||||
home/user/.config/zsh/zshrc.d/*
|
||||
!home/user/.config/zsh/zshrc.d/.gitkeep
|
||||
!home/user/.config/zsh/zshrc.d/00_zhashd.sh
|
||||
|
||||
home/user/.zshenv.d/*
|
||||
!home/user/.zshenv.d/.gitkeep
|
||||
|
||||
home/user/.config/zsh/.zcalc_history
|
||||
|
||||
.zcompdump
|
||||
*.zwc
|
||||
|
||||
home/user/.ssh/*
|
||||
@ -27,6 +30,20 @@ home/user/.termux/shell
|
||||
|
||||
home/user/.config/tmux/plugins
|
||||
home/user/.config/tmux/local.conf
|
||||
|
||||
home/user/.tmux/*
|
||||
!home/user/.tmux/01.sh
|
||||
!home/user/.tmux/10.sh
|
||||
!home/user/.tmux/dotfiles
|
||||
!home/user/.tmux/sandbox
|
||||
!home/user/.tmux/ssh
|
||||
!home/user/.tmux/example-background-job
|
||||
!home/user/.tmux/system-update
|
||||
!home/user/.tmux/music
|
||||
!home/user/.tmux/landing
|
||||
|
||||
home/user/.config/git/local
|
||||
|
||||
home/user/.config/sway/config.d/*
|
||||
!home/user/.config/sway/config.d/.gitkeep
|
||||
|
||||
home/user/.config/sway/variables.d/*
|
||||
!home/user/.config/sway/variables.d/.gitkeep
|
||||
|
||||
24
README.md
24
README.md
@ -20,14 +20,13 @@
|
||||
## Project description
|
||||
|
||||
Config files for:
|
||||
* bash
|
||||
* zsh
|
||||
* alacritty
|
||||
* tmux
|
||||
* ssh
|
||||
* git
|
||||
* ranger
|
||||
* i3
|
||||
* sway
|
||||
* vim
|
||||
* nvim
|
||||
|
||||
@ -37,17 +36,18 @@ Config files for:
|
||||
<img src=".assets/prompt.png" alt="Prompt">
|
||||
</p>
|
||||
|
||||
You can add your files to the `~/.config/bash/bashrc.d` directory for bash or `~/.config/zsh/zshrc.d` directory for zsh so that they automatically run in ascending order when you open a terminal.\
|
||||
You can add your files to the `~/.config/zsh/zshrc.d` directory for zsh so
|
||||
that they automatically run in ascending order when you open a terminal.\
|
||||
Example:\
|
||||
`~/.config/bash/bashrc.d/01_hello.sh`
|
||||
```bash
|
||||
`~/.config/zsh/zshrc.d/01_hello.sh`
|
||||
```sh
|
||||
echo "Hello $USER!"
|
||||
```
|
||||
|
||||
<a id="chapter-1"></a>
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://github.com/TheK4n/dotfiles
|
||||
cd dotfiles
|
||||
./install zsh nvim ...
|
||||
@ -64,17 +64,5 @@ Per-user dotfiles "package" manager
|
||||
4. Transaction based installation
|
||||
5. Does not overwrite your configs
|
||||
|
||||
### Dependencies
|
||||
* bash
|
||||
* coreutils
|
||||
* diffutils
|
||||
* grep
|
||||
|
||||
|
||||
### Optional dependencies
|
||||
* git
|
||||
* wget
|
||||
* unzip
|
||||
|
||||
|
||||
<h1 align="center"><a href="#top">▲</a></h1>
|
||||
52
TARGETS.sh
52
TARGETS.sh
@ -1,22 +1,30 @@
|
||||
declare -r -A TARGETS=(
|
||||
["colors"]=".config/terminal-colors.d"
|
||||
["tmux"]=".config/tmux .tmux .config/systemd/user/tmux.service"
|
||||
["bash"]=".config/bash .bashrc .profile %tmux %colors"
|
||||
["zsh"]="%bash .config/zsh .zshenv .inputrc"
|
||||
["alacritty"]=".config/alacritty"
|
||||
["nvim"]=".config/nvim .editorconfig .local/bin/vim_askpass_helper"
|
||||
["ssh"]=""
|
||||
["less"]=".lesskey"
|
||||
["git"]=".config/git"
|
||||
["ranger"]=".config/ranger"
|
||||
["gpg"]=""
|
||||
["i3"]=".xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/wifi .local/bin/bluetooth .local/bin/i3_switch_workspace.sh"
|
||||
["bat"]=".config/bat"
|
||||
["font"]=""
|
||||
["termux"]=".termux"
|
||||
["arch"]=""
|
||||
["psql"]=".psqlrc"
|
||||
["docker"]=".docker/cli-plugins"
|
||||
["ipython"]=".ipython/profile_default/ipython_config.py"
|
||||
["gdb"]=".config/gdb"
|
||||
)
|
||||
readonly TARGETS="\
|
||||
colors:.config/terminal-colors.d
|
||||
less:.lesskey .infokey
|
||||
tmux:.config/tmux .tmux .config/systemd/user/tmux.service %copypasta
|
||||
t:
|
||||
note:
|
||||
psw:
|
||||
zsh:.config/zsh .zshenv .zshenv.d .inputrc %copypasta %colors
|
||||
alacritty:.config/alacritty
|
||||
nvim:.config/nvim .editorconfig .editrc .local/bin/vim_askpass_helper
|
||||
ssh:
|
||||
git:.config/git .local/bin/ga
|
||||
ranger:.config/ranger
|
||||
gpg:
|
||||
sway:.config/sway .config/i3blocks .config/mako .config/mimeapps.list .config/rofi .local/bin/screenshot .config/swaylock .Xresources .local/bin/slm .local/bin/slm_rofi .local/bin/firefox_media %copypasta %pomodoro
|
||||
pomodoro:
|
||||
bat:.config/bat
|
||||
font:
|
||||
termux:.termux
|
||||
arch:
|
||||
psql:.psqlrc
|
||||
docker:.docker/cli-plugins
|
||||
ipython:.ipython/profile_default/ipython_config.py
|
||||
gdb:.config/gdb
|
||||
sandbox:
|
||||
chromium:.local/bin/pchromium .local/share/applications/pchromium.desktop
|
||||
scripts:.local/bin/httpstatus .local/bin/apco .local/bin/bb .local/bin/emoji .local/bin/mksh .local/bin/nato .local/bin/pastas .local/bin/timer .local/bin/tryna .local/bin/trynafail .local/bin/bak .local/bin/cleanup-directory .local/bin/cleanup-directory-log .local/bin/cleanup-downloads .local/bin/gobuild .local/bin/json .local/bin/open .local/bin/py .local/bin/sha .local/bin/showtips .local/bin/weather .local/bin/radio .local/bin/rmt .local/bin/scratch .local/bin/wake .local/bin/myip .local/bin/genpass .local/bin/gensalt .local/bin/django-create-project .local/bin/mirror-site .local/bin/split-file .local/bin/extract .local/bin/destroy .local/bin/serveit .local/bin/highlight-logs %copypasta
|
||||
music:.local/bin/mpv-service.sh .config/systemd/user/mpv.service .local/bin/player
|
||||
copypasta:.local/bin/copy .local/bin/pasta
|
||||
all:%less %t %note %tmux %zsh %nvim %git"
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
Section "Device"
|
||||
Identifier "Default nvidia Device"
|
||||
Driver "nvidia"
|
||||
Option "ForceFullCompositionPipeline" "true"
|
||||
EndSection
|
||||
@ -1,5 +0,0 @@
|
||||
#
|
||||
# ~/.bash_profile
|
||||
#
|
||||
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||
@ -1,26 +0,0 @@
|
||||
alias l.='ls -AF --ignore="*"'
|
||||
alias ll='ls -lhF'
|
||||
alias la='ls -AF'
|
||||
|
||||
alias lt='du -sh * | sort -h'
|
||||
|
||||
alias rm='rm -ir'
|
||||
alias mkdir='mkdir -pv'
|
||||
|
||||
alias cd..='cd ..'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias .3='cd ../../..'
|
||||
|
||||
alias path='echo -e ${PATH//:/\\n}'
|
||||
|
||||
# shorts
|
||||
alias c='clear'
|
||||
alias q='exit'
|
||||
alias h='history | less'
|
||||
alias j='jobs -l'
|
||||
|
||||
# utils
|
||||
alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .'
|
||||
|
||||
PS1="\n┌──(\u@\H)-[\w]\n└─\$ "
|
||||
@ -1,45 +0,0 @@
|
||||
set number "номер строки
|
||||
set ruler
|
||||
set laststatus=2
|
||||
set encoding=utf-8 "Ставит кодировку UTF-8
|
||||
set nocompatible "Отключает обратную совместимость с Vi
|
||||
syntax on "Включает подсветку синтаксиса
|
||||
|
||||
set expandtab
|
||||
set smarttab
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
set autoindent
|
||||
set smartindent
|
||||
set nowrap
|
||||
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
set showcmd
|
||||
set showtabline=2
|
||||
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set hlsearch
|
||||
set incsearch
|
||||
|
||||
set mousehide
|
||||
set mouse=a
|
||||
|
||||
set colorcolumn=120
|
||||
set scrolloff=7
|
||||
|
||||
set virtualedit=onemore " allow for cursor beyond last character
|
||||
|
||||
" f4 toggle hlsearch
|
||||
nnoremap <F4> :set invhlsearch<CR>
|
||||
|
||||
set ffs=unix,dos,mac
|
||||
set encoding=utf8
|
||||
|
||||
" tabs
|
||||
nnoremap <C-Left> :tabprevious<CR>
|
||||
nnoremap <C-Right> :tabnext<CR>
|
||||
nnoremap <C-h> :tabprevious<CR>
|
||||
nnoremap <C-l> :tabnext<CR>
|
||||
@ -1,2 +0,0 @@
|
||||
chmod 751 /home/user
|
||||
chmod 1777 /home/user/Public
|
||||
0
etc/skel/playground/.gitkeep
Normal file
0
etc/skel/playground/.gitkeep
Normal file
3
etc/skel/public/.permissions
Normal file
3
etc/skel/public/.permissions
Normal file
@ -0,0 +1,3 @@
|
||||
chmod 751 "${HOME}"
|
||||
mkdir "${HOME}/public"
|
||||
chmod 1777 "${HOME}/public"
|
||||
4
etc/systemd/system/getty@tty1.service.d/autologin.conf
Normal file
4
etc/systemd/system/getty@tty1.service.d/autologin.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --noreset --noclear --autologin thek4n - ${TERM}
|
||||
@ -1,3 +0,0 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty -o '-p -- %%USER%%' --noclear --skip-login - $TERM
|
||||
@ -1 +0,0 @@
|
||||
../getty@tty1.service.d/skip-username.conf
|
||||
@ -0,0 +1,3 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty -o '-p -- %%USER%%' --noclear --skip-login - $TERM
|
||||
4
etc/update-motd.d/10-figlet
Executable file
4
etc/update-motd.d/10-figlet
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
echo
|
||||
figlet -ct -f banner "welcome mr.kan"
|
||||
echo
|
||||
10
etc/update-motd.d/20-service-status.example
Executable file
10
etc/update-motd.d/20-service-status.example
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "wg0 status: $(systemctl is-active wg-quick@wg0.service)"
|
||||
|
||||
if ! systemctl is-active wg-quick@wg0.service 1>/dev/null; then
|
||||
#shellcheck disable=SC2016
|
||||
echo 'Executing this command may fix wireguard: "sudo apt update && sudo apt install linux-headers-$(uname -r) && sudo reboot"'
|
||||
fi
|
||||
|
||||
echo
|
||||
@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# https://github.com/TheK4n/dotfiles
|
||||
|
||||
if \
|
||||
[ "$(tty)" != "/dev/tty3" ] && \
|
||||
command -v tmux &>/dev/null && \
|
||||
[ -z "$TMUX" ] && \
|
||||
tmux -N -L "$USER" list-sessions &>/dev/null
|
||||
then
|
||||
exec tmux -N -L "$USER" new-session
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.config/bash/sourcer" ]; then
|
||||
source "$HOME/.config/bash/sourcer"
|
||||
fi
|
||||
|
||||
if \
|
||||
command -v tmux &>/dev/null && \
|
||||
[ -n "$TMUX" ] && \
|
||||
[ -n "$SSH_CLIENT" ]
|
||||
then
|
||||
tmux source-file "$XDG_CONFIG_HOME/tmux/remote.conf"
|
||||
fi
|
||||
@ -1,4 +1,3 @@
|
||||
live_config_reload = true
|
||||
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
@ -24,13 +23,16 @@ mods = "Control|Shift"
|
||||
hide_when_typing = true
|
||||
|
||||
[scrolling]
|
||||
history = 10000
|
||||
history = 3000
|
||||
multiplier = 3
|
||||
|
||||
[window]
|
||||
dynamic_title = true
|
||||
opacity = 1
|
||||
opacity = 0.92
|
||||
|
||||
[window.dimensions]
|
||||
columns = 150
|
||||
lines = 42
|
||||
|
||||
[general]
|
||||
live_config_reload = true
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
# vim: ft=bash
|
||||
|
||||
_d() { true ; }
|
||||
_f() { true ; }
|
||||
|
||||
# colors
|
||||
if [ -x "$(command -v dircolors)" ]; then
|
||||
export LS_OPTIONS="--color=auto"
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
|
||||
alias grep='grep $LS_OPTIONS'
|
||||
alias fgrep='fgrep $LS_OPTIONS'
|
||||
alias ls='ls -v $LS_OPTIONS'
|
||||
fi
|
||||
|
||||
alias l.='ls -AFv --ignore="*"'
|
||||
alias ll='ls -lhFv'
|
||||
alias la='ls -AFv'
|
||||
alias lla='ls -lhFAv'
|
||||
alias ll.='ls -lhFAv --ignore="*"'
|
||||
alias lsl='_d() { ls -lhFA --color=always "${1:-.}" | $PAGER ; }; _d'
|
||||
|
||||
|
||||
alias _='sudo'
|
||||
alias root='sudo -i TMOUT=450'
|
||||
|
||||
alias rm='rm -Ivr --one-file-system'
|
||||
alias mkdir='mkdir -pv'
|
||||
|
||||
alias cd..='cd ..'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias .3='cd ../../..'
|
||||
alias cl='_d() { cd "${1:-$HOME}" && ls; }; _d'
|
||||
|
||||
alias q='exit 0'
|
||||
|
||||
alias wp='cd $WORKING_PROJECT'
|
||||
|
||||
alias path='echo -e ${PATH//:/\\n}'
|
||||
|
||||
# shorts
|
||||
alias c='clear'
|
||||
alias h='history 0'
|
||||
alias j='jobs -l'
|
||||
|
||||
# utils
|
||||
alias sha='(shasum -a 256 | head -c 64)'
|
||||
alias genpass="openssl rand -base64 12"
|
||||
alias gensalt="dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64"
|
||||
alias diff='colordiff'
|
||||
alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .'
|
||||
alias man='MANWIDTH=$((COLUMNS > 80 ? 80 : COLUMNS)) man'
|
||||
|
||||
# time
|
||||
alias now='date +"%T"'
|
||||
alias nowdate='date +"%d-%m-%Y"'
|
||||
alias cal='cal -m'
|
||||
alias beeptime='beep -D 400 -l 400 -r "$(date +%I)" -f 440 -n -D 1000 -l 0 -n -D 800 -l 200 -f 880 -r "$(($(date +%M)/15))"'
|
||||
|
||||
# vim
|
||||
alias vi='nvim'
|
||||
alias svi="sudo -E nvim"
|
||||
|
||||
# net
|
||||
alias ports='ss -tlnp'
|
||||
alias wget='wget -c'
|
||||
# alias myip='curl ipinfo.io/ip'
|
||||
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
|
||||
alias sprunge='curl -F "sprunge=<-" http://sprunge.us 2>/dev/null' # CLI pastebin
|
||||
alias weather='(curl -4 wttr.in/$(cat) 2>/dev/null | head -n -1) <<<'
|
||||
alias ip='ip -c'
|
||||
alias fastping='ping -c 100 -i 0.1'
|
||||
|
||||
# starts web server
|
||||
alias www='python3 -m http.server 8080'
|
||||
|
||||
# hardware
|
||||
alias reboot='sudo /sbin/reboot'
|
||||
alias poweroff='sudo /sbin/poweroff'
|
||||
alias suspend='sudo systemctl suspend'
|
||||
alias halt='sudo /sbin/halt'
|
||||
alias shutdown='sudo /sbin/shutdown now'
|
||||
|
||||
alias meminfo='free -mlth'
|
||||
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
alias wake='((speaker-test -t sine -f 400 &>/dev/null)& local pid=$! ;sleep 0.2s; kill -9 $pid) &>/dev/null'
|
||||
elif [[ "$OSTYPE" == "linux-android"* ]]; then
|
||||
alias wake='termux-notification --sound --vibrate 500,1000,200'
|
||||
fi
|
||||
|
||||
# python
|
||||
alias pipir='python3 -m pip install -r requirements.txt'
|
||||
alias pipar='python3 -m pip freeze > requirements.txt'
|
||||
alias vd='deactivate'
|
||||
|
||||
# git
|
||||
alias watch-diff='watch --color "git diff --color=always"'
|
||||
|
||||
|
||||
# docker
|
||||
alias dcu='docker-compose up -d'
|
||||
alias dcd='docker-compose down'
|
||||
alias drmc='docker container prune'
|
||||
alias drmi='docker image prune'
|
||||
|
||||
|
||||
# tmux
|
||||
alias dt='tmux detach'
|
||||
|
||||
# x11
|
||||
alias caps='xdotool key Caps_Lock'
|
||||
alias CAPS='xdotool key Caps_Lock'
|
||||
|
||||
alias colors='for i in {0..255}; do printf "\x1b[38;5;${i}mcolor${i} - ██████████\n"; done'
|
||||
|
||||
|
||||
# clipboard
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
if [[ -n "$DISPLAY" ]]; then
|
||||
alias copy='xclip -selection clipboard -i'
|
||||
alias paste='xclip -selection clipboard -o'
|
||||
else
|
||||
alias copy='read -rd "EOF" TTYCLIPBOARD'
|
||||
alias paste='echo "$TTYCLIPBOARD"'
|
||||
fi
|
||||
elif [[ "$OSTYPE" == "linux-android"* ]]; then
|
||||
alias copy='termux-clipboard-set'
|
||||
alias paste='termux-clipboard-get'
|
||||
elif [[ "$OSTYPE" == "darwin" ]]; then
|
||||
alias copy='pbcopy'
|
||||
alias paste='pbpaste'
|
||||
fi
|
||||
|
||||
alias black='convert canvas:none PNG:- | feh -YF -'
|
||||
|
||||
# :)
|
||||
alias PINK='beep -f 233 -l 440 -n -f 349 -l 440 -n -f 196 -l 440 -n -f 330 -l 650'
|
||||
@ -1,12 +0,0 @@
|
||||
_workon() {
|
||||
local cur prev envs
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
envs=$(ls /opt/pythonenv/)
|
||||
|
||||
COMPREPLY=( $(compgen -W "${envs}" -- ${cur}) )
|
||||
}
|
||||
|
||||
complete -F _workon workon
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
# vim: ft=bash
|
||||
|
||||
umask 022
|
||||
|
||||
export EDITOR="nvim"
|
||||
export VISUAL="$EDITOR"
|
||||
|
||||
export PAGER="less"
|
||||
export LESS="-nMiSRx4 -# 1 -+X -+F"
|
||||
|
||||
if command -v "lesspipe.sh" &>/dev/null; then
|
||||
export LESSOPEN="| lesspipe.sh %s"
|
||||
fi
|
||||
|
||||
export CDPATH=:~:~/code
|
||||
|
||||
export HISTSIZE=100000
|
||||
export HISTFILESIZE="$HISTSIZE"
|
||||
export HISTCONTROL=ignoreboth:erasedups
|
||||
export HISTTIMEFORMAT="%F %T "
|
||||
export HISTIGNORE="&:l[lsa\.]:[bf]g:exit:q:clear:c:history:h"
|
||||
|
||||
export BROWSERCLI=w3m
|
||||
test -z "$BROWSER" && export BROWSER=firefox
|
||||
|
||||
if [ -d "$HOME/.local/bin" ] ; then
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
for TMPDIR in "$TMPDIR" "$TMP" /tmp /var/tmp
|
||||
do
|
||||
test -d "$TMPDIR" && break
|
||||
done
|
||||
|
||||
export TMPDIR
|
||||
|
||||
export FZF_DEFAULT_OPTS="\
|
||||
--cycle \
|
||||
--pointer='' \
|
||||
--marker='+' \
|
||||
--color='pointer:green' \
|
||||
--bind \
|
||||
ctrl-/:toggle-preview,\
|
||||
ctrl-a:toggle-all,\
|
||||
ctrl-p:preview-up,\
|
||||
ctrl-n:preview-down,\
|
||||
ctrl-u:clear-query,\
|
||||
tab:toggle+down,\
|
||||
shift-tab:toggle\
|
||||
"
|
||||
@ -1,230 +0,0 @@
|
||||
# vim: ft=bash
|
||||
|
||||
_sod() {
|
||||
if [ -d "$1" ] && [ -n "$(ls "$1")" ]; then
|
||||
for FILENAME in $(ls "$1" | sort -n)
|
||||
do
|
||||
source "$1/$FILENAME"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
lt() {
|
||||
du -h "${1:-.}" 2>/dev/null | sort -h
|
||||
}
|
||||
|
||||
destroy() {
|
||||
test -n "$1" || return 1
|
||||
test -e "$1" || return 1
|
||||
|
||||
echo -n "Sure want to destroy file '$1' with size $(du -hs "$1" | awk '{printf $1}') [y/N] "
|
||||
read -r response
|
||||
[[ $response == [yY] ]] && shred -zun 25 "$1"
|
||||
}
|
||||
|
||||
workon() {
|
||||
source "/opt/pythonenv/${1:-$(basename $PWD)}/bin/activate"
|
||||
}
|
||||
|
||||
py() {
|
||||
if [[ -z "$@" && -x "$(command -v ipython 2>/dev/null)" ]]; then
|
||||
ipython -i -c "q = exit"
|
||||
else
|
||||
python3 $@
|
||||
fi
|
||||
}
|
||||
|
||||
ve() {
|
||||
python3 -m virtualenv "${1:-venv}" && . "${1:-venv}/bin/activate"
|
||||
}
|
||||
|
||||
va() {
|
||||
local activate_venv
|
||||
|
||||
if [ -f "./venv/bin/activate" ]; then
|
||||
source "./venv/bin/activate"
|
||||
return 0
|
||||
fi
|
||||
|
||||
activate_venv="$(find -P . -maxdepth 3 -type f -wholename '*/bin/activate' | sort | head -n 1)"
|
||||
|
||||
if [ -n "$activate_venv" ]; then
|
||||
source "$activate_venv"
|
||||
return 0
|
||||
else
|
||||
echo "va: error: virtual environment not found, use python3 -m virtualenv venv" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
extract() (
|
||||
if [ -z "$1" ]; then
|
||||
echo "extract: error: usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
|
||||
return 2
|
||||
fi
|
||||
|
||||
if ! [ -f "$1" ]; then
|
||||
echo "extract: error: '$1' file does not exist" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local NAME
|
||||
NAME=${1%%.*} # removes extension from filename
|
||||
|
||||
|
||||
if [ -e "$NAME" ]; then
|
||||
echo "extract: error: '$NAME' exists" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
mkdir "$NAME" && cd "$NAME" || return 1
|
||||
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf ../"$1" ;;
|
||||
*.tar.gz) tar xzf ../"$1" ;;
|
||||
*.tar.xz) tar xJf ../"$1" ;;
|
||||
*.lzma) unlzma ../"$1" ;;
|
||||
*.bz2) bunzip2 ../"$1" ;;
|
||||
*.rar) unrar x -ad ../"$1" ;;
|
||||
*.gz) gunzip ../"$1" ;;
|
||||
*.tar) tar xf ../"$1" ;;
|
||||
*.tbz2) tar xjf ../"$1" ;;
|
||||
*.tgz) tar xzf ../"$1" ;;
|
||||
*.zip) unzip ../"$1" ;;
|
||||
*.Z) uncompress ../"$1" ;;
|
||||
*.7z) 7z x ../"$1" ;;
|
||||
*.xz) unxz ../"$1" ;;
|
||||
*.exe) cabextract ../"$1" ;;
|
||||
*) echo "extract: error: '$1' - unknown archive method" >&2 ;;
|
||||
esac
|
||||
)
|
||||
|
||||
|
||||
mcd() {
|
||||
if [ -z "$1" ]; then
|
||||
cd "$(mktemp -td "${USER:-user}.XXXX")"
|
||||
else
|
||||
mkdir -p "$1" && cd "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# toggle wireguard vpn with interface /etc/wireguard/wg0.conf
|
||||
# to allow sudo user toggle vpn without password:
|
||||
## sudo groupadd wireguard
|
||||
## sudo usermod -aG wireguard $USER
|
||||
vpn() {
|
||||
local STATUS SERVICE CONFIG CONFIGFILE
|
||||
CONFIG="${1:-wg0}"
|
||||
|
||||
CONFIGFILE="/etc/wireguard/$CONFIG.conf"
|
||||
|
||||
if [ ! -e "$CONFIGFILE" ]; then
|
||||
echo "Config '$CONFIGFILE' not exists" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
SERVICE="wg-quick@$CONFIG.service"
|
||||
|
||||
if systemctl --quiet is-active "$SERVICE"; then
|
||||
sudo systemctl stop "$SERVICE"
|
||||
echo "DOWN"
|
||||
else
|
||||
sudo systemctl start "$SERVICE" && ip -br a | grep "$CONFIG" | awk '{print $1":\t"$3}'
|
||||
fi
|
||||
}
|
||||
|
||||
toggle-ssh-proxy() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Proxy ssh server hostname not specified" 1>&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
SSH_PROXY_CONTROL_FILE="$XDG_RUNTIME_DIR/ssh_${1}_proxy.control"
|
||||
|
||||
|
||||
if [ -e "$SSH_PROXY_CONTROL_FILE" ]; then
|
||||
unset {http,https,ftp,rsync,no}_proxy
|
||||
ssh -S "$SSH_PROXY_CONTROL_FILE" -O exit "$1"
|
||||
unset SSH_PROXY_PID
|
||||
echo "Disabled"
|
||||
else
|
||||
ssh -nCTN -S "$SSH_PROXY_CONTROL_FILE" -D 1080 "$1"
|
||||
export {http,https,ftp,rsync}_proxy="socks5://127.0.0.1:1080" && \
|
||||
export no_proxy="localhost,127.0.0.1/8,localaddress,.localdomain.com,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12"
|
||||
echo "Enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
open() {
|
||||
test -e $1 || return 1
|
||||
nohup xdg-open $1 1>/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
split-file() {
|
||||
test -e "$1" || return 1
|
||||
local _size="${2:-1G}"
|
||||
|
||||
if [ -d "$1" ]; then
|
||||
(mkdir "$1.tar.gz.splitted" && cd "$1.tar.gz.splitted" && tar -cz "../$1" | split -d -b "$_size")
|
||||
else
|
||||
(mkdir "$1.splitted" && cd "$1.splitted" && split -d -b "$_size" "../$1")
|
||||
fi
|
||||
}
|
||||
|
||||
json() {
|
||||
if [ -t 0 ]; then # argument
|
||||
python -m json.tool <<< "$*"
|
||||
else # pipe
|
||||
python -m json.tool
|
||||
fi
|
||||
}
|
||||
|
||||
_get_full_file_extension() {
|
||||
local filename
|
||||
filename=$(basename "$1")
|
||||
if [ "${filename:0:1}" = "." ]; then
|
||||
filename="${filename:1}"
|
||||
fi
|
||||
echo ${filename#*.}
|
||||
}
|
||||
|
||||
rmt() {
|
||||
local TRASH
|
||||
TRASH=~/.trash
|
||||
|
||||
local filename
|
||||
for filename in $*
|
||||
do
|
||||
local filename_out_path="${TRASH}$(realpath "$filename")"
|
||||
mkdir -p "$(dirname "$filename_out_path")"
|
||||
mv "$filename" "${filename_out_path}_$(date +%s)"
|
||||
done
|
||||
}
|
||||
|
||||
showtips() {
|
||||
TIPS_DIR="$HOME/.tips"
|
||||
|
||||
if [ ! -d "$TIPS_DIR" ]; then
|
||||
mkdir "$TIPS_DIR" 2>/dev/null
|
||||
git init "$TIPS_DIR"
|
||||
fi
|
||||
|
||||
local content
|
||||
for filename in "$TIPS_DIR"/*
|
||||
do
|
||||
content="$(cat "$filename")"
|
||||
echo "$content"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
most-often-commands() {
|
||||
history 0 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn
|
||||
}
|
||||
|
||||
# Enable X11Forwarding and disable mux session
|
||||
sshx() {
|
||||
ssh -X -o ControlMaster=no -o ControlPath=none $@
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
|
||||
parse_git_branch() {
|
||||
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local branch status
|
||||
|
||||
# current branch
|
||||
branch="$(git branch --show-current 2> /dev/null)"
|
||||
|
||||
# current status
|
||||
# M = modified
|
||||
# A = added
|
||||
# D = deleted
|
||||
# R = renamed
|
||||
# C = copied
|
||||
# U = updated but unmerged
|
||||
|
||||
status="$(git status -s 2>/dev/null | cut -c 1 | sort -u | tr -d " \n?")"
|
||||
|
||||
if [ -n "$status" ]; then
|
||||
status="-[$status]"
|
||||
fi
|
||||
|
||||
if [[ -n "$branch" ]]; then
|
||||
echo "($branch)$status"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
virtualenv_info() {
|
||||
|
||||
# Get Virtual Env
|
||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||
# Strip out the path and just leave the env name
|
||||
echo "($(basename "$VIRTUAL_ENV"))"
|
||||
fi
|
||||
}
|
||||
|
||||
rightprompt()
|
||||
{
|
||||
if [[ $1 -ne 0 ]]; then
|
||||
printf "%*s" $COLUMNS "$1 ⨯"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
export PROMPT_COMMAND=__prompt_command
|
||||
|
||||
__prompt_command() {
|
||||
|
||||
local EXIT=${PIPESTATUS[-1]}
|
||||
|
||||
close_color='\[\e[m\]'
|
||||
red_color='\[\033[1;31m\]'
|
||||
|
||||
prompt_color='\[\033[;32m\]'
|
||||
info_color='\[\033[1;34m\]'
|
||||
prompt_symbol='@'
|
||||
end_symbol='$'
|
||||
|
||||
|
||||
if [ "$EUID" -eq 0 ]; then # Change prompt colors and symbols for root user
|
||||
prompt_color='\[\033[;94m\]'
|
||||
info_color='\[\033[1;31m\]'
|
||||
end_symbol='#'
|
||||
fi
|
||||
|
||||
|
||||
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
|
||||
prompt_symbol='📡'
|
||||
fi
|
||||
|
||||
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
|
||||
|
||||
local VENV_ BRANCH_ TERMINAL_NAME
|
||||
VENV_="\$(virtualenv_info)"
|
||||
BRANCH_="\$(parse_git_branch)"
|
||||
|
||||
TERMINAL_NAME=${0%%/*}
|
||||
TERMINAL_NAME="\[\e]2;${TERMINAL_NAME^^}\a\]"
|
||||
|
||||
_bottom_prompt="$(tput cup 999 0)"
|
||||
|
||||
if [ "$EXIT" != 0 ]; then
|
||||
PS1="$TERMINAL_NAME${_bottom_prompt}\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n\[$(tput sc; rightprompt $EXIT; tput rc)\]$prompt_color└─$close_color$info_color$end_symbol$close_color "
|
||||
else
|
||||
PS1="$TERMINAL_NAME${_bottom_prompt}\n$prompt_color┌─${VENV_}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color${BRANCH_}$close_color\n$prompt_color└─$close_color$info_color$end_symbol$close_color "
|
||||
fi
|
||||
|
||||
PS2="> "
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
|
||||
## Misc
|
||||
shopt -s histappend ## Appends hist on exit
|
||||
shopt -s cmdhist ## Save multi-line hist as one line
|
||||
shopt -s checkwinsize ## Update col/lines after commands
|
||||
|
||||
### Completion
|
||||
shopt -s cdspell ## Fixes minor spelling errors in cd paths
|
||||
shopt -s no_empty_cmd_completion ## Stops empty line tab comp
|
||||
shopt -s dirspell 2>/dev/null ## Tab comp can fix dir name typos
|
||||
|
||||
bind '"\e."':yank-last-arg
|
||||
@ -1,19 +0,0 @@
|
||||
_so() {
|
||||
[ -r "$1" ] && [ -f "$1" ] && source "$1"
|
||||
}
|
||||
|
||||
if [[ $0 == *bash ]]; then
|
||||
_so "$HOME/.config/bash/export"
|
||||
_so "$HOME/.config/bash/shopt"
|
||||
fi
|
||||
|
||||
if [[ $- == *i* ]]; then
|
||||
_so "$HOME/.config/bash/prompt"
|
||||
_so "$HOME/.config/bash/aliases"
|
||||
_so "$HOME/.config/bash/functions"
|
||||
_so "$HOME/.config/bash/completion"
|
||||
_so "$HOME/.config/bash/hosts/$HOSTNAME"
|
||||
fi
|
||||
|
||||
|
||||
_sod "$HOME/.config/bash/bashrc.d"
|
||||
63
home/user/.config/git/aliases
Normal file
63
home/user/.config/git/aliases
Normal file
@ -0,0 +1,63 @@
|
||||
# vim: ft=gitconfig
|
||||
|
||||
|
||||
[alias]
|
||||
a = "!ga"
|
||||
u = "!git diff --name-only --cached | fzf -1 -0 -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs -r git restore --staged"
|
||||
msg = log -1 --pretty=%B
|
||||
d = diff
|
||||
di = diff
|
||||
ds = diff --staged
|
||||
dno = diff --name-only
|
||||
dw = diff --word-diff=color
|
||||
dws = diff --word-diff=color --staged
|
||||
sw = switch
|
||||
swl = switch -
|
||||
swb = switch -c
|
||||
swc = switch -c
|
||||
co = checkout
|
||||
col = checkout @{-1}
|
||||
cob = checkout -b
|
||||
ci = commit
|
||||
cia = commit --all
|
||||
amend = commit --amend --no-edit
|
||||
amenda = commit --all --amend --no-edit
|
||||
fuck = commit --amend
|
||||
uncommit = reset --soft HEAD~1
|
||||
untrack = rm --cache --
|
||||
cim = "!_m() { git commit -m \"$*\"; }; _m"
|
||||
cima = "!_m() { git commit -am \"$*\"; }; _m"
|
||||
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"
|
||||
pst = "!git push origin --tags"
|
||||
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"
|
||||
pr = "pull --rebase"
|
||||
s = status
|
||||
st = status
|
||||
br = branch
|
||||
bm = branch --merged
|
||||
bn = branch --no-merged
|
||||
hist = log --pretty=format:'%Cgreen%h %Creset%cd %Cblue[%cn](%G?) %Creset%s%C(yellow)%d%C(reset)' --graph --date=relative --decorate --color=always
|
||||
history = hist --all
|
||||
hs = hist -n 10
|
||||
hsa = hist -n 10 --all
|
||||
last = log -1 HEAD
|
||||
lastd = diff HEAD^ HEAD
|
||||
today = hist --since=midnight
|
||||
df = "!_m() { git log --pretty=format:'%h %cd [%cn] %s%d' --date=relative | fzf --bind \"enter:execute(git diff --color=always $@ {1}^ {1} | ${PAGER})\" --preview-window=65% --preview=\"git diff --color=always $@ {1}^ {1}\"; }; _m"
|
||||
type = cat-file -t
|
||||
dump = cat-file -p
|
||||
unstage = "reset HEAD --"
|
||||
count = "rev-list --count --all"
|
||||
tags = "for-each-ref --sort=-creatordate --format '%(refname:strip=2)' refs/tags"
|
||||
initci = "commit --allow-empty -m 'Initial commit'"
|
||||
|
||||
# edit conflicted file on merge
|
||||
edit-unmerged = "!$EDITOR $(git ls-files --unmerged | cut -f2 | sort -u)"
|
||||
|
||||
# add conflicted file on merge
|
||||
add-unmerged = "!git add $(git ls-files --unmerged | cut -f2 | sort -u)"
|
||||
remove-remote-tag = "!f() { git tag -d $1 && git push origin :refs/tags/$1 }; f"
|
||||
aliases = "!git config -l | grep '^alias\\.' | cut -d. -f2-"
|
||||
|
||||
# git clone git://localhost/
|
||||
serve = daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/
|
||||
@ -2,23 +2,24 @@
|
||||
excludesfile = ~/.config/git/ignore
|
||||
editor = "$EDITOR"
|
||||
pager = "$PAGER -+C -F"
|
||||
fileMode = false
|
||||
hooksPath = ~/.config/git/hooks
|
||||
fileMode = true
|
||||
whitespace = fix,trailing-space,cr-at-eol
|
||||
autocrlf = input
|
||||
quotepath = false
|
||||
|
||||
[i18n]
|
||||
commitEncoding = utf-8
|
||||
logOutputEncoding = utf-8
|
||||
logOutputEncoding = utf-8
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
defaultBranch = main
|
||||
|
||||
[push]
|
||||
default = current
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
ff = only
|
||||
|
||||
[color]
|
||||
status = auto
|
||||
@ -37,81 +38,25 @@
|
||||
[apply]
|
||||
whitespace = fix
|
||||
|
||||
[rerere]
|
||||
enabled = true
|
||||
|
||||
[diff]
|
||||
mnemonicPrefix = true
|
||||
suppressBlankEmpty = true
|
||||
rename = copy
|
||||
submodule = short
|
||||
algorithm = histogram
|
||||
colormoved = default
|
||||
colormovedws = allow-indentation-change
|
||||
|
||||
[alias]
|
||||
a = "!git ls-files --exclude-standard -m --others -t | fzf -0 -m --bind load:last --preview 'git diff --color=always {2}' | cut -d' ' -f2 | xargs -r git add"
|
||||
u = "!git diff --name-only --cached | fzf -0 -m --bind load:last --preview 'git diff --staged --color=always {1}' | xargs -r git restore --staged"
|
||||
d = diff
|
||||
di = diff
|
||||
ds = diff --staged
|
||||
dno = diff --name-only
|
||||
dw = diff --word-diff=color
|
||||
co = checkout
|
||||
ci = commit
|
||||
cia = commit -a
|
||||
amend = commit --amend --no-edit
|
||||
amenda = commit --all --amend --no-edit
|
||||
cim = "!_m() { git commit -m \"$*\"; }; _m"
|
||||
cima = "!_m() { git commit -am \"$*\"; }; _m"
|
||||
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"
|
||||
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"
|
||||
pr = "pull --rebase"
|
||||
st = status
|
||||
br = branch
|
||||
bm = branch --merged
|
||||
bn = branch --no-merged
|
||||
hist = log --pretty=format:'%Cgreen%h %Creset%cd %Cblue[%cn](%G?) %Creset%s%C(yellow)%d%C(reset)' --graph --date=relative --decorate --color=always
|
||||
history = hist --all
|
||||
hs = hist -n 10
|
||||
hsa = hist -n 10 --all
|
||||
last = log -1 HEAD
|
||||
lastd = diff HEAD^ HEAD
|
||||
today = hist --since=midnight
|
||||
df = "!git log --pretty=format:'%h %cd [%cn] %s%d' --date=relative | fzf --preview='git diff --color=always {1}^ {1}' | awk '{print $1}' | xargs -I {} git diff {}^ {}"
|
||||
type = cat-file -t
|
||||
dump = cat-file -p
|
||||
unstage = "reset HEAD --"
|
||||
count = "rev-list --count --all"
|
||||
[include]
|
||||
path = ~/.config/git/url-aliases
|
||||
path = ~/.config/git/aliases
|
||||
path = ~/.config/git/local
|
||||
|
||||
# edit conflicted file on merge
|
||||
edit-unmerged = "!$EDITOR $(git ls-files --unmerged | cut -f2 | sort -u)"
|
||||
|
||||
# add conflicted file on merge
|
||||
add-unmerged = "!git add $(git ls-files --unmerged | cut -f2 | sort -u)"
|
||||
remove-remote-tag = "!f() { git tag -d $1 && git push origin :refs/tags/$1 }; f"
|
||||
|
||||
[github]
|
||||
user = "thek4n"
|
||||
email = "thek4n@yandex.ru"
|
||||
|
||||
[user]
|
||||
name = "thek4n"
|
||||
email = "thek4n@yandex.ru"
|
||||
signingkey = "thek4n"
|
||||
|
||||
[url "https://github.com/"]
|
||||
insteadOf = "gh:"
|
||||
|
||||
[url "https://gist.github.com/"]
|
||||
insteadOf = "gist:"
|
||||
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = "gl:"
|
||||
|
||||
[url "https://bitbucket.org/"]
|
||||
insteadOf = "bb:"
|
||||
|
||||
[url "git@github.com:"]
|
||||
pushInsteadOf = "https://github.com/"
|
||||
pushInsteadOf = "http://github.com/"
|
||||
pushInsteadOf = "gh:"
|
||||
|
||||
[url "git@gist.github.com:"]
|
||||
pushInsteadOf = "https://gist.github.com/"
|
||||
pushInsteadOf = "http://gist.github.com/"
|
||||
pushInsteadOf = "gist:"
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if command -v makepkg >/dev/null && [ -e PKGBUILD ]; then
|
||||
if [ -e VERSION ]; then
|
||||
sed -i "s/pkgver=.\+/pkgver=$(cat VERSION)/" PKGBUILD
|
||||
git add PKGBUILD
|
||||
fi
|
||||
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
git add .SRCINFO
|
||||
exit
|
||||
fi
|
||||
@ -15,6 +15,7 @@ __pycache__/
|
||||
*.spec
|
||||
|
||||
.env
|
||||
*.env
|
||||
*.log
|
||||
*.bak
|
||||
*~
|
||||
@ -36,6 +37,20 @@ CMakeFiles
|
||||
*.o
|
||||
a.out
|
||||
*.exe
|
||||
*.ipk
|
||||
|
||||
build/
|
||||
dist/
|
||||
node_modules/
|
||||
|
||||
.tns
|
||||
|
||||
.autoenv.zsh
|
||||
.autoenv_leave.zsh
|
||||
|
||||
*.tar
|
||||
*.gz
|
||||
*.zip
|
||||
|
||||
|
||||
.redo/
|
||||
|
||||
13
home/user/.config/git/local.example
Normal file
13
home/user/.config/git/local.example
Normal file
@ -0,0 +1,13 @@
|
||||
# vim: ft=gitconfig
|
||||
|
||||
[github]
|
||||
user = "thek4n"
|
||||
email = "thek4n@yandex.ru"
|
||||
|
||||
[user]
|
||||
name = "thek4n"
|
||||
email = "thek4n@yandex.ru"
|
||||
signingkey = "thek4n"
|
||||
|
||||
[url "git@github.com:TheK4n/notes"]
|
||||
insteadOf = "git@github.com:TheK4n/notes"
|
||||
41
home/user/.config/git/url-aliases
Normal file
41
home/user/.config/git/url-aliases
Normal file
@ -0,0 +1,41 @@
|
||||
# vim: ft=gitconfig
|
||||
|
||||
# alias gh:=https://github.com/
|
||||
[url "https://github.com/"]
|
||||
insteadOf = "gh:"
|
||||
|
||||
# alias gist:=https://gist.github.com/
|
||||
[url "https://gist.github.com/"]
|
||||
insteadOf = "gist:"
|
||||
|
||||
# alias gl:=https://gitlab.com/
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = "gl:"
|
||||
|
||||
# alias bb:=https://bitbucket.org/
|
||||
[url "https://bitbucket.org/"]
|
||||
insteadOf = "bb:"
|
||||
|
||||
|
||||
[url "git@github.com:"]
|
||||
pushInsteadOf = "https://github.com/"
|
||||
pushInsteadOf = "http://github.com/"
|
||||
pushInsteadOf = "git@github.com:"
|
||||
pushInsteadOf = "gh:"
|
||||
|
||||
[url "git@gist.github.com:"]
|
||||
pushInsteadOf = "https://gist.github.com/"
|
||||
pushInsteadOf = "http://gist.github.com/"
|
||||
pushInsteadOf = "gist:"
|
||||
|
||||
[url "git@gitlab.com:"]
|
||||
pushInsteadOf = "https://gitlab.com/"
|
||||
pushInsteadOf = "http://gitlab.com/"
|
||||
pushInsteadOf = "git@gitlab.com:"
|
||||
pushInsteadOf = "gl:"
|
||||
|
||||
; [url "https://github.com/"]
|
||||
; insteadOf = "git@github.com:"
|
||||
|
||||
[url "https://gitlab.com/"]
|
||||
insteadOf = "git@gitlab.com:"
|
||||
@ -1,238 +0,0 @@
|
||||
# screen layout
|
||||
exec --no-startup-id ~/.screenlayout/default.sh
|
||||
|
||||
for_window [tiling] border pixel 3
|
||||
smart_borders on
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
|
||||
# screensaver
|
||||
set $i3lock_cmd "i3lock -enf -c 1e1e1e"
|
||||
exec --no-startup-id xset +dpms dpms 600 0 0
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -enf -c 1e1e1e
|
||||
|
||||
exec_always --no-startup-id xset r rate 250 100
|
||||
exec_always --no-startup-id setxkbmap -model pc105 -layout us,ru -option grp:win_space_toggle -option ctrl:nocaps
|
||||
|
||||
# wallpapers
|
||||
exec --no-startup-id nitrogen --restore; sleep 1; picom -b --config ~/.config/picom/picom.conf
|
||||
exec --no-startup-id hsetroot
|
||||
exec --no-startup-id feh --randomize --no-fehbg --bg-scale $HOME/.wallpaper/*
|
||||
|
||||
set $font_size 11
|
||||
font xft:FiraCode $font_size
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
set $refresh_i3status killall -SIGUSR1 i3status
|
||||
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
||||
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
||||
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
||||
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioPause exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 20
|
||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 20
|
||||
|
||||
|
||||
bindsym $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
|
||||
bindsym --release $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
|
||||
|
||||
bindsym $mod+Shift+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||
|
||||
bindsym XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
|
||||
bindsym --release XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
|
||||
|
||||
bindsym XF86Go exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk, x1carb11
|
||||
bindsym --release XF86Go exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute, x1carb11
|
||||
|
||||
|
||||
bindsym $mod+XF86AudioMicMute exec --no-startup-id pactl list short sources | awk '/input.*RUNNING/ {system("pactl set-source-mute " $1 " toggle")}' ## Find and mute mics
|
||||
|
||||
|
||||
bindsym $mod+m exec i3-input -F 'mark %s' -l 1 -P 'Mark: '
|
||||
bindsym $mod+g exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Goto: '
|
||||
|
||||
focus_follows_mouse no
|
||||
popup_during_fullscreen smart
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec alacritty
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
bindsym $mod+d exec --no-startup-id rofi -show drun -m -1
|
||||
bindsym $mod+i exec --no-startup-id i3_switch_workspace.sh
|
||||
bindsym $mod+o exec --no-startup-id slm_rofi.sh
|
||||
bindsym $mod+p exec --no-startup-id power_rofi.sh
|
||||
|
||||
# change focus
|
||||
bindsym $mod+h focus left
|
||||
bindsym $mod+j focus down
|
||||
bindsym $mod+k focus up
|
||||
bindsym $mod+l focus right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+Shift+h move left
|
||||
bindsym $mod+Shift+j move down
|
||||
bindsym $mod+Shift+k move up
|
||||
bindsym $mod+Shift+l move right
|
||||
|
||||
bindsym $mod+Ctrl+Shift+l move workspace to output right
|
||||
bindsym $mod+Ctrl+Shift+h move workspace to output left
|
||||
bindsym $mod+Ctrl+Shift+k move workspace to output up
|
||||
bindsym $mod+Ctrl+Shift+j move workspace to output down
|
||||
|
||||
# alternatively, you can use the cursor 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
|
||||
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (tabbed, toggle split)
|
||||
bindsym $mod+t layout tabbed
|
||||
bindsym $mod+v layout toggle split
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+slash floating toggle
|
||||
bindsym $mod+Shift+comma sticky toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+slash focus mode_toggle
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1 Browser"
|
||||
set $ws2 "2 Code"
|
||||
set $ws3 "3 Code"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8💬Social"
|
||||
set $ws9 "9🎵Music"
|
||||
set $ws10 "10🍿Media"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace number $ws1
|
||||
bindsym $mod+2 workspace number $ws2
|
||||
bindsym $mod+3 workspace number $ws3
|
||||
bindsym $mod+4 workspace number $ws4
|
||||
bindsym $mod+5 workspace number $ws5
|
||||
bindsym $mod+6 workspace number $ws6
|
||||
bindsym $mod+7 workspace number $ws7
|
||||
bindsym $mod+8 workspace number $ws8
|
||||
bindsym $mod+9 workspace number $ws9
|
||||
bindsym $mod+0 workspace number $ws10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace number $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace number $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace number $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace number $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace number $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace number $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace number $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace number $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace number $ws10
|
||||
|
||||
bindsym $mod+u workspace prev
|
||||
bindsym $mod+Shift+u workspace next
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
bindsym $mod+r mode "resize"
|
||||
mode "resize" {
|
||||
bindsym h resize shrink width 10 px or 10 ppt
|
||||
bindsym j resize grow height 10 px or 10 ppt
|
||||
bindsym k resize shrink height 10 px or 10 ppt
|
||||
bindsym l resize grow width 10 px or 10 ppt
|
||||
|
||||
bindsym $mod+r mode "default"
|
||||
bindsym p mode "resize_precise"
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
mode "resize_precise" {
|
||||
bindsym h resize shrink width 1 px or 1 ppt
|
||||
bindsym j resize grow height 1 px or 1 ppt
|
||||
bindsym k resize shrink height 1 px or 1 ppt
|
||||
bindsym l resize grow width 1 px or 1 ppt
|
||||
|
||||
bindsym $mod+r mode "default"
|
||||
bindsym p mode "resize"
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
set $exitmode "Power: [e]xit, [r]eboot, [s]hutdown, s[u]spend, [l]ock, [b]lack"
|
||||
mode $exitmode {
|
||||
bindsym e exit
|
||||
bindsym r exec reboot
|
||||
bindsym s exec shutdown -h now
|
||||
bindsym u exec systemctl suspend; mode "default"
|
||||
bindsym l exec $i3lock_cmd; mode "default"
|
||||
bindsym b exec convert canvas:none PNG:- | feh -YF -; mode "default"
|
||||
|
||||
bindsym Escape mode "default"
|
||||
bindsym Return mode "default"
|
||||
}
|
||||
bindsym $mod+x mode $exitmode
|
||||
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
|
||||
bar {
|
||||
output primary
|
||||
output nonprimary
|
||||
tray_output primary
|
||||
status_command exec ~/.local/bin/i3status_wrapper
|
||||
}
|
||||
|
||||
# Screenshots
|
||||
bindsym Print exec --no-startup-id maim "$HOME/Pictures/Screenshots/$(date +'%d-%m-%Y-%T').png"
|
||||
bindsym $mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) "$HOME/Pictures/Screenshots/$(date +'%d-%m-%Y-%T').png"
|
||||
bindsym Shift+Print exec --no-startup-id maim --select "$HOME/Pictures/Screenshots/$(date +'%d-%m-%Y-%T').png"
|
||||
|
||||
## Clipboard Screenshots
|
||||
bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/png
|
||||
bindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
|
||||
bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
|
||||
|
||||
|
||||
# default workspaces for monitors in setup
|
||||
workspace $ws1 output primary
|
||||
workspace $ws2 output primary
|
||||
workspace $ws3 output primary
|
||||
workspace $ws9 output nonprimary
|
||||
workspace $ws10 output nonprimary
|
||||
|
||||
workspace hide1 output primary
|
||||
workspace hide2 output nonprimary
|
||||
bindsym $mod+q exec --no-startup-id i3-msg workspace hide1; workspace hide2
|
||||
|
||||
no_focus [title="^Peek preview$"]
|
||||
64
home/user/.config/i3blocks/config
Normal file
64
home/user/.config/i3blocks/config
Normal file
@ -0,0 +1,64 @@
|
||||
separator_block_width=15
|
||||
markup=pango
|
||||
|
||||
color=#FFFFFF
|
||||
|
||||
interval=5
|
||||
|
||||
[wireless]
|
||||
command=~/.config/i3blocks/scripts/builder.sh wireless
|
||||
interval=10
|
||||
|
||||
[ethernet]
|
||||
command=~/.config/i3blocks/scripts/builder.sh ethernet
|
||||
interval=10
|
||||
|
||||
[diskroot]
|
||||
command=~/.config/i3blocks/scripts/builder.sh disk_root
|
||||
interval=30
|
||||
|
||||
[diskhome]
|
||||
command=~/.config/i3blocks/scripts/builder.sh disk_home
|
||||
interval=30
|
||||
|
||||
[memory]
|
||||
command=~/.config/i3blocks/scripts/builder.sh memory
|
||||
interval=5
|
||||
|
||||
[cpu_usage]
|
||||
command=~/.config/i3blocks/scripts/builder.sh cpu_usage
|
||||
interval=5
|
||||
|
||||
[cpu_temp]
|
||||
command=~/.config/i3blocks/scripts/builder.sh cpu_temp
|
||||
interval=5
|
||||
|
||||
[bluetooth]
|
||||
command=~/.config/i3blocks/scripts/builder.sh bluetooth_battery
|
||||
interval=5
|
||||
|
||||
[battery]
|
||||
command=~/.config/i3blocks/scripts/builder.sh battery
|
||||
interval=30
|
||||
|
||||
[volume]
|
||||
command=~/.config/i3blocks/scripts/builder.sh volume
|
||||
interval=1
|
||||
signal=1
|
||||
|
||||
[pomodoro]
|
||||
command=~/.config/i3blocks/scripts/builder.sh pomodoro
|
||||
interval=1
|
||||
signal=2
|
||||
|
||||
[language]
|
||||
command=~/.config/i3blocks/scripts/builder.sh language
|
||||
signal=1
|
||||
|
||||
[userhost]
|
||||
command=~/.config/i3blocks/scripts/builder.sh userhost
|
||||
signal=1
|
||||
|
||||
[time]
|
||||
command=~/.config/i3blocks/scripts/builder.sh time
|
||||
interval=30
|
||||
125
home/user/.config/i3blocks/scripts/builder.sh
Executable file
125
home/user/.config/i3blocks/scripts/builder.sh
Executable file
@ -0,0 +1,125 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ue
|
||||
|
||||
|
||||
readonly EXIT_SUCCESS=0
|
||||
readonly EXIT_FAILURE=1
|
||||
|
||||
|
||||
cmd_wireless() {
|
||||
wifiname="$(LANG=C nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)"
|
||||
wifi_ip=$(ip -o -4 addr show | grep wlp | awk '{print $4}' | cut -d/ -f1 | head -1)
|
||||
|
||||
if [ -z "${wifiname}" ] || [ -z "${wifi_ip}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
printf ' %s %s\n' "${wifiname}" "${wifi_ip}"
|
||||
}
|
||||
|
||||
cmd_battery() {
|
||||
charging_status="$(cat /sys/class/power_supply/BAT0/status)"
|
||||
percent="$(cat /sys/class/power_supply/BAT0/capacity)"
|
||||
|
||||
if [ "${percent}" -lt 35 ]; then
|
||||
emoji_status="🪫"
|
||||
else
|
||||
emoji_status="🔋"
|
||||
fi
|
||||
|
||||
if [ "${charging_status}" = "Charging" ]; then
|
||||
emoji_status="🔌"
|
||||
fi
|
||||
|
||||
printf "%s %s%%\n" "${emoji_status}" "${percent}"
|
||||
}
|
||||
|
||||
cmd_disk_root() {
|
||||
df -h / | awk '/\// {print "/ "$3"/"$2}'
|
||||
}
|
||||
|
||||
cmd_disk_home() {
|
||||
res="$(df -h /home)"
|
||||
if [ "$(echo "${res}" | awk '/\// {print $6}')" = "/" ]; then
|
||||
return 1
|
||||
fi
|
||||
df -h /home | awk '/\// {print " "$3"/"$2}'
|
||||
}
|
||||
|
||||
cmd_memory() {
|
||||
free -h | awk '/^Mem/ {print "🎟 "$3"/"$2}' | sed 's/i//g'
|
||||
}
|
||||
|
||||
cmd_cpu_usage() {
|
||||
top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print " "100 - $1"%"}'
|
||||
}
|
||||
|
||||
cmd_cpu_temp() {
|
||||
temp_mC="$(cat /sys/class/thermal/thermal_zone0/temp)"
|
||||
temp_C="$((temp_mC / 1000))"
|
||||
|
||||
if [ "${temp_C}" -gt 80 ]; then
|
||||
printf '<span foreground="red"> %s°C</span>\n' "${temp_C}"
|
||||
else
|
||||
printf ' %s°C\n' "${temp_C}"
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_time() {
|
||||
LC_ALL=C date '+ %d.%m.%y %a %H:%M'
|
||||
}
|
||||
|
||||
cmd_volume() {
|
||||
value="$(pactl --format=json get-sink-volume @DEFAULT_SINK@ | jq --raw-output '.volume."front-left".value_percent')"
|
||||
printf ' %s\n' "${value}"
|
||||
}
|
||||
|
||||
cmd_pomodoro() {
|
||||
pomodoro get
|
||||
}
|
||||
|
||||
cmd_bluetooth_battery() {
|
||||
device="$(upower -e | grep headset | head -1)"
|
||||
upower -i "${device}" | grep percentage | awk '{ print "🎧🔋"$2"" }'
|
||||
}
|
||||
|
||||
cmd_language() {
|
||||
layout="$(swaymsg -t get_inputs | jq -r '.[] | select(.type == "keyboard") | .xkb_active_layout_name' | head -1)"
|
||||
|
||||
case "${layout}" in
|
||||
"English (US)")
|
||||
printf '🇬🇧 En\n'
|
||||
;;
|
||||
Russian)
|
||||
printf '🇷🇺 Ru\n'
|
||||
;;
|
||||
*)
|
||||
printf '🌐 %s\n' "${layout}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
cmd_userhost() {
|
||||
printf "%s@%s\n" "${USER}" "${HOST:-${HOSTNAME:-}}"
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
wireless) shift; cmd_wireless "$@" ;;
|
||||
ethernet) shift; cmd_ethernet "$@" ;;
|
||||
battery) shift; cmd_battery "$@" ;;
|
||||
disk_root) shift; cmd_disk_root "$@" ;;
|
||||
disk_home) shift; cmd_disk_home "$@" ;;
|
||||
memory) shift; cmd_memory "$@" ;;
|
||||
cpu_usage) shift; cmd_cpu_usage "$@" ;;
|
||||
cpu_temp) shift; cmd_cpu_temp "$@" ;;
|
||||
time) shift; cmd_time "$@" ;;
|
||||
volume) shift; cmd_volume "$@" ;;
|
||||
pomodoro) shift; cmd_pomodoro "$@" ;;
|
||||
bluetooth_battery) shift; cmd_bluetooth_battery "$@" ;;
|
||||
language) shift; cmd_language "$@" ;;
|
||||
userhost) shift; cmd_userhost "$@" ;;
|
||||
|
||||
*) exit "${EXIT_FAILURE}" ;;
|
||||
esac
|
||||
exit "${EXIT_SUCCESS}"
|
||||
8
home/user/.config/i3blocks/scripts/layout_change_handler.sh
Executable file
8
home/user/.config/i3blocks/scripts/layout_change_handler.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
swaymsg -m -t SUBSCRIBE "['input']" | \
|
||||
jq --unbuffered -r '.change' | while read -r line; do
|
||||
if echo "${line}" | grep -q "xkb_layout"; then
|
||||
pkill -RTMIN+1 i3blocks
|
||||
fi
|
||||
done
|
||||
@ -1,81 +0,0 @@
|
||||
general {
|
||||
colors = true
|
||||
interval = 5
|
||||
output_format = i3bar
|
||||
}
|
||||
|
||||
order += "wireless _first_"
|
||||
order += "ethernet _first_"
|
||||
order += "disk /"
|
||||
order += "disk /home"
|
||||
order += "memory"
|
||||
order += "cpu_usage"
|
||||
order += "cpu_temperature 0"
|
||||
order += "tztime holder__headphones"
|
||||
order += "battery all"
|
||||
order += "volume master"
|
||||
order += "tztime local"
|
||||
|
||||
wireless _first_ {
|
||||
format_up = " (%quality at %essid %frequency) %ip"
|
||||
format_down = " down"
|
||||
}
|
||||
|
||||
ethernet _first_ {
|
||||
format_up = " %ip"
|
||||
format_down = " down"
|
||||
}
|
||||
|
||||
battery all {
|
||||
format = "%status %percentage"
|
||||
last_full_capacity = false
|
||||
format_down = ""
|
||||
status_chr = "⚡"
|
||||
status_bat = "🔋"
|
||||
status_unk = "?"
|
||||
status_full = ""
|
||||
path = "/sys/class/power_supply/BAT%d/uevent"
|
||||
low_threshold = 15
|
||||
}
|
||||
|
||||
disk "/" {
|
||||
format = "/ %used/%total"
|
||||
}
|
||||
|
||||
disk "/home" {
|
||||
format = " %used/%total"
|
||||
}
|
||||
|
||||
memory {
|
||||
format = " %used/%total"
|
||||
threshold_degraded = "1G"
|
||||
threshold_critical = "200M"
|
||||
format_degraded = "MEMORY < %available"
|
||||
}
|
||||
|
||||
cpu_usage {
|
||||
format = " %usage"
|
||||
}
|
||||
|
||||
cpu_temperature 0 {
|
||||
format = " %degrees°"
|
||||
max_threshold = "80"
|
||||
format_above_threshold = " %degrees"
|
||||
}
|
||||
|
||||
tztime local {
|
||||
format = " %d.%m.%y %a %H:%M"
|
||||
}
|
||||
|
||||
volume master {
|
||||
format = " %volume"
|
||||
format_muted = ": muted %volume"
|
||||
device = "default"
|
||||
mixer = "Master"
|
||||
mixer_idx = 0
|
||||
}
|
||||
|
||||
|
||||
tztime holder__headphones {
|
||||
format = "holder__headphones"
|
||||
}
|
||||
1
home/user/.config/mako/config
Normal file
1
home/user/.config/mako/config
Normal file
@ -0,0 +1 @@
|
||||
output=DP-1
|
||||
11
home/user/.config/mimeapps.list
Normal file
11
home/user/.config/mimeapps.list
Normal file
@ -0,0 +1,11 @@
|
||||
[Default Applications]
|
||||
application/pdf=firefox.desktop;
|
||||
text/html=firefox.desktop
|
||||
x-scheme-handler/about=firefox.desktop
|
||||
x-scheme-handler/http=firefox.desktop
|
||||
x-scheme-handler/https=firefox.desktop
|
||||
x-scheme-handler/about=firefox.desktop
|
||||
x-scheme-handler/unknown=firefox.desktop
|
||||
x-scheme-handler/tonsite=org.telegram.desktop.desktop
|
||||
x-scheme-handler/tg=org.telegram.desktop.desktop
|
||||
x-scheme-handler/postman=Postman.desktop
|
||||
5
home/user/.config/nvim/after/ftplugin/go.lua
Normal file
5
home/user/.config/nvim/after/ftplugin/go.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local opt = vim.opt_local
|
||||
|
||||
opt.expandtab = false
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
7
home/user/.config/nvim/after/ftplugin/python.lua
Normal file
7
home/user/.config/nvim/after/ftplugin/python.lua
Normal file
@ -0,0 +1,7 @@
|
||||
vim.g.python_indent = {
|
||||
open_paren = 'shiftwidth()',
|
||||
nested_paren = 'shiftwidth()',
|
||||
continue = 'shiftwidth()',
|
||||
closed_paren_align_last_line = false,
|
||||
searchpair_timeout = 150,
|
||||
}
|
||||
@ -25,9 +25,11 @@ end
|
||||
map('n', '<Leader>hc', create_function_tabdo('set cursorline!'),
|
||||
{desc = "Toggle line highlighting"})
|
||||
|
||||
map('n', '<Leader>h/',
|
||||
function() vim.opt.hlsearch = not vim.opt.hlsearch["_value"] end,
|
||||
{desc = "Toggle search highlighting"})
|
||||
map('n', '<Leader>cs',
|
||||
function() vim.fn.setreg('/', '\\%x') end,
|
||||
{desc = "Clear search"})
|
||||
|
||||
map('n', '<Leader>h/', function() vim.o.hlsearch = not vim.o.hlsearch end, {desc = "Clear search"})
|
||||
|
||||
|
||||
-- enable search highlight in search mode
|
||||
@ -44,6 +46,9 @@ map('n', '<Leader>hl', create_function_tabdo('lua toggle_number_style()'),
|
||||
|
||||
|
||||
map('n', '~', 'vg~', {desc = "Toggle character case"})
|
||||
map('n', 'Ё', 'vg~', {desc = "Toggle character case"})
|
||||
|
||||
map('v', 'Ё', '~', {desc = "Toggle character case"})
|
||||
|
||||
|
||||
map('n',
|
||||
@ -56,6 +61,7 @@ map('n',
|
||||
{remap = false, silent = true}
|
||||
)
|
||||
|
||||
map('n', 'q:', ':')
|
||||
map('n', 'Ж', ':')
|
||||
|
||||
map('n', '<Enter>', 'o<ESC>')
|
||||
@ -76,11 +82,6 @@ map('n', '<C-a>', 'mvggVG')
|
||||
map('v', '<C-a>', '<Esc>`v:delmarks v<CR>', {silent = true})
|
||||
|
||||
|
||||
-- Scroll tabs
|
||||
map("n", '<C-l>', vim.cmd.tabnext)
|
||||
map("n", '<C-h>', vim.cmd.tabprev)
|
||||
|
||||
|
||||
map("n", '<Leader>qq', '<cmd>bd!<CR>',
|
||||
{desc = "Kill current buffer"})
|
||||
|
||||
|
||||
@ -2,12 +2,11 @@
|
||||
|
||||
local function map_filetype(filetype, key, cmd)
|
||||
local function format_string()
|
||||
local run_script_string = [[:e %% | :terminal %s <CR> :set nocursorline number norelativenumber <CR> G]]
|
||||
local run_script_string = [[:terminal %s <CR> :set nocursorline number norelativenumber <CR> G]]
|
||||
local cmd_string = string.format(run_script_string, cmd)
|
||||
|
||||
local map = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
map('n', key, cmd_string, opts)
|
||||
vim.keymap.set('n', key, cmd_string, opts)
|
||||
end
|
||||
|
||||
|
||||
@ -24,13 +23,13 @@ map_filetype('markdown', '<Leader>rr', 'pandoc -t plain %')
|
||||
map_filetype('python', '<Leader>rr', 'python3 %')
|
||||
map_filetype('python', '<Leader>rt', 'pytest %')
|
||||
|
||||
map_filetype('go', '<Leader>rr', 'go run')
|
||||
map_filetype('go', '<Leader>rr', 'go run %')
|
||||
|
||||
map_filetype('rust', '<Leader>rr', 'cargo run')
|
||||
|
||||
map_filetype('c', '<Leader>rr', 'gcc -o /tmp/a.out % && /tmp/a.out')
|
||||
map_filetype('cpp', '<Leader>rr', 'g++ -o /tmp/a.out % && /tmp/a.out')
|
||||
map_filetype('c', '<Leader>rr', 'gcc -o "${TMPDIR}/a.out" % && "${TMPDIR}/a.out"')
|
||||
map_filetype('cpp', '<Leader>rr', 'g++ -o "${TMPDIR}/a.out" % && "${TMPDIR}/a.out"')
|
||||
|
||||
map_filetype('asm', '<Leader>rr', 'as -o /tmp/out.o % && ld -o /tmp/a.out /tmp/out.o && /tmp/a.out')
|
||||
map_filetype('asm', '<Leader>rr', 'as -o "${TMPDIR}/out.o" % && ld -o "${TMPDIR}/a.out" "${TMPDIR}/out.o" && "${TMPDIR}/a.out"')
|
||||
|
||||
map_filetype('make', '<Leader>rr', 'make -C "$(dirname "%")"')
|
||||
@ -144,19 +144,28 @@ vim.cmd.highlight({ "DiagnosticHint", "guifg=Grey" })
|
||||
opt.langmap = 'ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz'
|
||||
|
||||
|
||||
vim.o.viewdir = vim.fn.stdpath('cache')..'/view'
|
||||
vim.fn.mkdir(vim.o.viewdir, 'p')
|
||||
opt.viewoptions = "folds,cursor"
|
||||
|
||||
vim.api.nvim_create_autocmd({"BufWinLeave", "BufLeave"}, {
|
||||
vim.api.nvim_create_autocmd("BufWinLeave", {
|
||||
pattern = {"?*"},
|
||||
callback = function()
|
||||
vim.cmd.mkview(1)
|
||||
callback = function(args)
|
||||
local bufname = vim.api.nvim_buf_get_name(args.buf)
|
||||
if not bufname:match("^term://") then
|
||||
vim.cmd.mkview(1)
|
||||
end
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||
pattern = {"?*"},
|
||||
callback = function()
|
||||
vim.cmd("silent! loadview 1")
|
||||
callback = function(args)
|
||||
local bufname = vim.api.nvim_buf_get_name(args.buf)
|
||||
if not bufname:match("^term://") then
|
||||
vim.cmd([[silent! loadview 1]])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@ -1,45 +1,52 @@
|
||||
local border_opts = {
|
||||
border = "single",
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
||||
max_width = 50,
|
||||
min_width = 50,
|
||||
max_height = math.floor(vim.o.lines * 0.4),
|
||||
min_height = 3,
|
||||
}
|
||||
|
||||
local function has_words_before()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local function setup_cmp()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
preselect = cmp.PreselectMode.None,
|
||||
completion = {
|
||||
autocomplete = {'TextChanged'}
|
||||
completeopt = 'menu,menuone,noinsert,noselect',
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
vim.snippet.expand(args.body)
|
||||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<Tab>'] = cmp.mapping(
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Select,
|
||||
select = true,
|
||||
})
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
{ "i", "s" }
|
||||
),
|
||||
['<C-k>'] = cmp.mapping.select_prev_item({ behaviour = cmp.SelectBehavior.Select }),
|
||||
['<C-j>'] = cmp.mapping.select_next_item({ behaviour = cmp.SelectBehavior.Select }),
|
||||
['<C-p>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-n>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(border_opts),
|
||||
documentation = cmp.config.window.bordered(border_opts),
|
||||
@ -123,5 +130,8 @@ return {
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@ -89,15 +89,6 @@ return {
|
||||
},
|
||||
config = function()
|
||||
require('neodev').setup()
|
||||
require('lspconfig').lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
@ -167,29 +158,32 @@ return {
|
||||
end
|
||||
},
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
'MunifTanjim/nui.nvim'
|
||||
"wsdjeg/vim-fetch",
|
||||
},
|
||||
config = function()
|
||||
require("actions-preview").setup {
|
||||
telescope = {
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
width = 0.8,
|
||||
height = 0.9,
|
||||
prompt_position = "top",
|
||||
preview_cutoff = 20,
|
||||
preview_height = function(_, _, max_lines)
|
||||
return max_lines - 15
|
||||
end,
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
'MunifTanjim/nui.nvim'
|
||||
},
|
||||
config = function()
|
||||
require("actions-preview").setup {
|
||||
telescope = {
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
width = 0.8,
|
||||
height = 0.9,
|
||||
prompt_position = "top",
|
||||
preview_cutoff = 20,
|
||||
preview_height = function(_, _, max_lines)
|
||||
return max_lines - 15
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.keymap.set("n", "<space>c", "", {desc = "Code action"})
|
||||
vim.keymap.set("n", "<space>ca", require("actions-preview").code_actions, {desc = "Code action"})
|
||||
end,
|
||||
}
|
||||
vim.keymap.set("n", "<space>c", "", {desc = "Code action"})
|
||||
vim.keymap.set("n", "<space>ca", require("actions-preview").code_actions, {desc = "Code action"})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@ -23,7 +23,7 @@ local function lsp_buf_rename(client_name)
|
||||
vim.lsp.buf.rename(nil, { name = client_name })
|
||||
end
|
||||
|
||||
function lsp_buf_rename_use_any(fallback)
|
||||
function LSP_BUF_RENAME_USE_ANY(fallback)
|
||||
local client_names = get_lsp_client_names(lsp_have_feature.rename)
|
||||
for _, client_name in ipairs(client_names) do
|
||||
lsp_buf_rename(client_name)
|
||||
@ -35,68 +35,46 @@ function lsp_buf_rename_use_any(fallback)
|
||||
end
|
||||
|
||||
|
||||
local on_attach = function(_, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_set_option_value(...) end
|
||||
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc', {})
|
||||
|
||||
-- Mappings.
|
||||
|
||||
local opts = { noremap=true, silent=true }
|
||||
|
||||
local function desc(description)
|
||||
return vim.tbl_extend("keep", opts, {desc = description})
|
||||
end
|
||||
|
||||
-- Sections
|
||||
buf_set_keymap('n', '<space>w', '', {desc = "Workspace manage"})
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', desc("Go declaration"))
|
||||
buf_set_keymap('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', desc("Go definition"))
|
||||
buf_set_keymap('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', desc("Go implementation"))
|
||||
buf_set_keymap('n', 'gr', '<cmd>Telescope lsp_references<CR>', desc("Go references"))
|
||||
buf_set_keymap('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', desc("Go type references"))
|
||||
buf_set_keymap('n', '<space>k', '<cmd>lua vim.lsp.buf.hover()<CR>', desc("Show help"))
|
||||
buf_set_keymap('n', '<space>K', '<cmd>lua vim.lsp.buf.signature_help()<CR>', desc("Show signature"))
|
||||
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', desc("Add workspace folder"))
|
||||
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', desc("Remove workspace folder"))
|
||||
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', desc("Show workspace folders"))
|
||||
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc("Show type"))
|
||||
buf_set_keymap('n', '<space>rn', "<cmd>lua lsp_buf_rename_use_any()<CR>", desc("Rename object"))
|
||||
buf_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', desc("Show diagnostic"))
|
||||
buf_set_keymap('n', '<space>p', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc("Previous problem"))
|
||||
buf_set_keymap('n', '<space>n', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc("Next problem"))
|
||||
buf_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.format()<CR>', desc("Format file"))
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
'mason-org/mason.nvim',
|
||||
dependencies = {
|
||||
'neovim/nvim-lspconfig',
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Mappings.
|
||||
local opts = { noremap=true, silent=true }
|
||||
|
||||
local function desc(description)
|
||||
return vim.tbl_extend("keep", opts, {desc = description})
|
||||
end
|
||||
|
||||
-- Sections
|
||||
vim.api.nvim_set_keymap('n', '<space>w', '', {desc = "Workspace manage"})
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.api.nvim_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', desc("Go declaration"))
|
||||
vim.api.nvim_set_keymap('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', desc("Go definition"))
|
||||
vim.api.nvim_set_keymap('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', desc("Go implementation"))
|
||||
vim.api.nvim_set_keymap('n', 'gr', '<cmd>Telescope lsp_references<CR>', desc("Go references"))
|
||||
vim.api.nvim_set_keymap('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', desc("Go type references"))
|
||||
vim.api.nvim_set_keymap('n', '<space>k', '<cmd>lua vim.lsp.buf.hover()<CR>', desc("Show help"))
|
||||
vim.api.nvim_set_keymap('n', '<space>K', '<cmd>lua vim.lsp.buf.signature_help()<CR>', desc("Show signature"))
|
||||
vim.api.nvim_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', desc("Add workspace folder"))
|
||||
vim.api.nvim_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', desc("Remove workspace folder"))
|
||||
vim.api.nvim_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', desc("Show workspace folders"))
|
||||
vim.api.nvim_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc("Show type"))
|
||||
vim.api.nvim_set_keymap('n', '<space>rn', "<cmd>lua LSP_BUF_RENAME_USE_ANY()<CR>", desc("Rename object"))
|
||||
vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', desc("Show diagnostic"))
|
||||
vim.api.nvim_set_keymap('n', '<space>p', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc("Previous problem"))
|
||||
vim.api.nvim_set_keymap('n', '<space>n', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc("Next problem"))
|
||||
vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.format()<CR>', desc("Format file"))
|
||||
|
||||
require("mason").setup()
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason_lspconfig.setup()
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
function (server_name)
|
||||
require("lspconfig")[server_name].setup({
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
})
|
||||
end
|
||||
})
|
||||
require("mason-lspconfig").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
@ -83,46 +83,12 @@ return {
|
||||
end)
|
||||
end
|
||||
},
|
||||
{
|
||||
'ggandor/leap.nvim',
|
||||
keys = {
|
||||
{"J", "<Plug>(leap-forward-to)"},
|
||||
{"K", "<Plug>(leap-backward-to)"},
|
||||
},
|
||||
config = function()
|
||||
require('leap').opts.safe_labels = {}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'chentoast/marks.nvim',
|
||||
config = function()
|
||||
require("marks").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
"max397574/better-escape.nvim",
|
||||
config = function()
|
||||
require("better_escape").setup({
|
||||
timeout = vim.o.timeoutlen,
|
||||
default_mappings = false,
|
||||
mappings = {
|
||||
i = {
|
||||
j = {
|
||||
f = "<ESC>`^"
|
||||
},
|
||||
["о"] = {
|
||||
["а"] = "<ESC>`^"
|
||||
},
|
||||
},
|
||||
c = {
|
||||
j = {
|
||||
f = "<Esc>",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'Pocco81/auto-save.nvim',
|
||||
config = function()
|
||||
|
||||
@ -15,6 +15,9 @@ return {
|
||||
cmd = {
|
||||
"Telescope"
|
||||
},
|
||||
previewers = {
|
||||
buffer_previewer_maker = require('telescope.previewers').buffer_previewer_maker
|
||||
},
|
||||
keys = {
|
||||
{ '<Leader>fb', '<cmd>Telescope buffers<CR>' },
|
||||
{ '<Leader>ff', '<cmd>Telescope find_files<CR>' },
|
||||
@ -43,30 +46,32 @@ return {
|
||||
["<C-n>"] = actions.preview_scrolling_down,
|
||||
["<C-p>"] = actions.preview_scrolling_up,
|
||||
["<C-a>"] = actions.toggle_all,
|
||||
["?"] = actions.which_key,
|
||||
["jf"] = { "<esc>", type = "command" },
|
||||
["<C-o>"] = actions.toggle_selection,
|
||||
},
|
||||
n = {
|
||||
["jf"] = actions.close,
|
||||
["?"] = actions.which_key,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-n>"] = actions.preview_scrolling_down,
|
||||
["<C-p>"] = actions.preview_scrolling_up,
|
||||
["<C-a>"] = actions.toggle_all,
|
||||
}
|
||||
},
|
||||
selection_caret = " ",
|
||||
path_display = { "truncate" },
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
".svn/",
|
||||
"%.git/",
|
||||
"%.svn/",
|
||||
"%.o",
|
||||
"%.a",
|
||||
"%.so",
|
||||
"a.out",
|
||||
"a%.out",
|
||||
"venv/",
|
||||
"CMakeFiles/",
|
||||
"cmake_install.cmake",
|
||||
"CMakeCache.txt",
|
||||
"cmake_install%.cmake",
|
||||
"CMakeCache%.txt",
|
||||
"target/",
|
||||
".pytest_cache/",
|
||||
"vendor/*",
|
||||
"%.pytest_cache/",
|
||||
"vendor/",
|
||||
"%.lock",
|
||||
"%.db",
|
||||
"%.sqlite3",
|
||||
@ -84,11 +89,11 @@ return {
|
||||
"%.ttf",
|
||||
"%.webp",
|
||||
"%.bin",
|
||||
".dart_tool/",
|
||||
".gradle/",
|
||||
".idea/",
|
||||
".settings/",
|
||||
".vscode/",
|
||||
"%.dart_tool/",
|
||||
"%.gradle/",
|
||||
"%.idea/",
|
||||
"%.settings/",
|
||||
"%.vscode/",
|
||||
"pycache/",
|
||||
"build/",
|
||||
"env/",
|
||||
@ -105,8 +110,7 @@ return {
|
||||
"%.jar",
|
||||
"%.docx",
|
||||
"%.met",
|
||||
"smalljre_*/*",
|
||||
".vale/",
|
||||
"%.vale/",
|
||||
"%.rar",
|
||||
"%.zip",
|
||||
"%.7z",
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
return {
|
||||
{
|
||||
'kana/vim-textobj-lastpat', -- text-object i/, operate under finding
|
||||
event = "InsertEnter",
|
||||
dependencies = { 'kana/vim-textobj-user' }
|
||||
},
|
||||
{
|
||||
'sgur/vim-textobj-parameter',
|
||||
event = "InsertEnter",
|
||||
dependencies = { 'kana/vim-textobj-user' }
|
||||
},
|
||||
{
|
||||
|
||||
@ -200,4 +200,10 @@ return {
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
"petertriho/nvim-scrollbar",
|
||||
config = function()
|
||||
require("scrollbar").setup()
|
||||
end
|
||||
},
|
||||
}
|
||||
@ -1,434 +0,0 @@
|
||||
|
||||
#################################
|
||||
# Shadows #
|
||||
#################################
|
||||
|
||||
|
||||
# Enabled client-side shadows on windows. Note desktop windows
|
||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
||||
# unless explicitly requested using the wintypes option.
|
||||
#
|
||||
# shadow = false
|
||||
shadow = true;
|
||||
|
||||
# The blur radius for shadows, in pixels. (defaults to 12)
|
||||
# shadow-radius = 12
|
||||
shadow-radius = 7;
|
||||
|
||||
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
||||
# shadow-opacity = .75
|
||||
|
||||
# The left offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-x = -15
|
||||
shadow-offset-x = -7;
|
||||
|
||||
# The top offset for shadows, in pixels. (defaults to -15)
|
||||
# shadow-offset-y = -15
|
||||
shadow-offset-y = -7;
|
||||
|
||||
# Red color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-red = 0
|
||||
|
||||
# Green color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-green = 0
|
||||
|
||||
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
|
||||
# shadow-blue = 0
|
||||
|
||||
# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
|
||||
# shadow-color = "#000000"
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow.
|
||||
#
|
||||
# examples:
|
||||
# shadow-exclude = "n:e:Notification";
|
||||
#
|
||||
# shadow-exclude = []
|
||||
shadow-exclude = [
|
||||
"name = 'Notification'",
|
||||
"class_g = 'Conky'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
|
||||
# clip-shadow-above = []
|
||||
|
||||
# Specify a X geometry that describes the region in which shadow should not
|
||||
# be painted in, such as a dock window region. Use
|
||||
# shadow-exclude-reg = "x10+0+0"
|
||||
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
|
||||
#
|
||||
# shadow-exclude-reg = ""
|
||||
|
||||
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
|
||||
# xinerama-shadow-crop = false
|
||||
|
||||
|
||||
#################################
|
||||
# Fading #
|
||||
#################################
|
||||
|
||||
|
||||
# Fade windows in/out when opening/closing and when opacity changes,
|
||||
# unless no-fading-openclose is used.
|
||||
fading = false
|
||||
# fading = true;
|
||||
|
||||
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
|
||||
# fade-in-step = 0.028
|
||||
fade-in-step = 0.075;
|
||||
|
||||
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
|
||||
# fade-out-step = 0.03
|
||||
fade-out-step = 0.075;
|
||||
|
||||
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
|
||||
# fade-delta = 10
|
||||
|
||||
# Specify a list of conditions of windows that should not be faded.
|
||||
# fade-exclude = []
|
||||
|
||||
# Do not fade on window open/close.
|
||||
# no-fading-openclose = false
|
||||
|
||||
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
|
||||
# no-fading-destroyed-argb = false
|
||||
|
||||
|
||||
#################################
|
||||
# Transparency / Opacity #
|
||||
#################################
|
||||
|
||||
|
||||
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
|
||||
inactive-opacity = 1
|
||||
# inactive-opacity = 0.95;
|
||||
|
||||
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
|
||||
# frame-opacity = 1.0
|
||||
frame-opacity = 0.9;
|
||||
|
||||
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
|
||||
# inactive-opacity-override = true
|
||||
inactive-opacity-override = false;
|
||||
|
||||
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
|
||||
# active-opacity = 1.0
|
||||
|
||||
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
|
||||
inactive-dim = 0.15
|
||||
|
||||
# Specify a list of conditions of windows that should never be considered focused.
|
||||
# focus-exclude = []
|
||||
focus-exclude = [
|
||||
"class_g = 'firefox'",
|
||||
"class_g = 'webview'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"class_g = 'Conky'"
|
||||
];
|
||||
|
||||
# Use fixed inactive dim value, instead of adjusting according to window opacity.
|
||||
# inactive-dim-fixed = 1.0
|
||||
|
||||
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
|
||||
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
|
||||
# Note we don't make any guarantee about possible conflicts with other
|
||||
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
|
||||
# example:
|
||||
# opacity-rule = [ "80:class_g = 'URxvt'" ];
|
||||
#
|
||||
# opacity-rule = []
|
||||
|
||||
|
||||
#################################
|
||||
# Corners #
|
||||
#################################
|
||||
|
||||
# Sets the radius of rounded window corners. When > 0, the compositor will
|
||||
# round the corners of windows. Does not interact well with
|
||||
# `transparent-clipping`.
|
||||
corner-radius = 3
|
||||
|
||||
# Exclude conditions for rounded corners.
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'"
|
||||
];
|
||||
|
||||
|
||||
#################################
|
||||
# Background-Blurring #
|
||||
#################################
|
||||
|
||||
|
||||
# Parameters for background blurring, see the *BLUR* section for more information.
|
||||
# blur-method =
|
||||
# blur-size = 12
|
||||
#
|
||||
# blur-deviation = false
|
||||
#
|
||||
# blur-strength = 5
|
||||
|
||||
# Blur background of semi-transparent / ARGB windows.
|
||||
# Bad in performance, with driver-dependent behavior.
|
||||
# The name of the switch may change without prior notifications.
|
||||
#
|
||||
# blur-background = false
|
||||
|
||||
# Blur background of windows when the window frame is not opaque.
|
||||
# Implies:
|
||||
# blur-background
|
||||
# Bad in performance, with driver-dependent behavior. The name may change.
|
||||
#
|
||||
# blur-background-frame = false
|
||||
|
||||
|
||||
# Use fixed blur strength rather than adjusting according to window opacity.
|
||||
# blur-background-fixed = false
|
||||
|
||||
|
||||
# Specify the blur convolution kernel, with the following format:
|
||||
# example:
|
||||
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
|
||||
#
|
||||
# blur-kern = ""
|
||||
blur-kern = "3x3box";
|
||||
|
||||
|
||||
# Exclude conditions for background blur.
|
||||
# blur-background-exclude = []
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'",
|
||||
"window_type = 'desktop'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
#################################
|
||||
# General Settings #
|
||||
#################################
|
||||
|
||||
# Enable remote control via D-Bus. See the man page for more details.
|
||||
# dbus = true
|
||||
|
||||
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
|
||||
# daemon = false
|
||||
|
||||
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
|
||||
# `xrender` is the default one.
|
||||
#
|
||||
# backend = "glx"
|
||||
backend = "xrender";
|
||||
|
||||
# Enable/disable VSync.
|
||||
# vsync = false
|
||||
vsync = true;
|
||||
|
||||
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
|
||||
# dbus = false
|
||||
|
||||
# Try to detect WM windows (a non-override-redirect window with no
|
||||
# child that has 'WM_STATE') and mark them as active.
|
||||
#
|
||||
# mark-wmwin-focused = false
|
||||
mark-wmwin-focused = true;
|
||||
|
||||
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
|
||||
# mark-ovredir-focused = false
|
||||
mark-ovredir-focused = true;
|
||||
|
||||
# Try to detect windows with rounded corners and don't consider them
|
||||
# shaped windows. The accuracy is not very high, unfortunately.
|
||||
#
|
||||
# detect-rounded-corners = false
|
||||
detect-rounded-corners = true;
|
||||
|
||||
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
|
||||
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
|
||||
#
|
||||
# detect-client-opacity = false
|
||||
detect-client-opacity = true;
|
||||
|
||||
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
|
||||
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
|
||||
# provided that the WM supports it.
|
||||
#
|
||||
# use-ewmh-active-win = false
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected,
|
||||
# to maximize performance for full-screen windows. Known to cause flickering
|
||||
# when redirecting/unredirecting windows.
|
||||
#
|
||||
# unredir-if-possible = false
|
||||
|
||||
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
|
||||
# unredir-if-possible-delay = 0
|
||||
|
||||
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
|
||||
# unredir-if-possible-exclude = []
|
||||
|
||||
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
|
||||
# in the same group focused at the same time.
|
||||
#
|
||||
# detect-transient = false
|
||||
detect-transient = true;
|
||||
|
||||
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
|
||||
# group focused at the same time. This usually means windows from the same application
|
||||
# will be considered focused or unfocused at the same time.
|
||||
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
|
||||
#
|
||||
# detect-client-leader = false
|
||||
|
||||
# Resize damaged region by a specific number of pixels.
|
||||
# A positive value enlarges it while a negative one shrinks it.
|
||||
# If the value is positive, those additional pixels will not be actually painted
|
||||
# to screen, only used in blur calculation, and such. (Due to technical limitations,
|
||||
# with use-damage, those pixels will still be incorrectly painted to screen.)
|
||||
# Primarily used to fix the line corruption issues of blur,
|
||||
# in which case you should use the blur radius value here
|
||||
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
|
||||
# with a 5x5 one you use `--resize-damage 2`, and so on).
|
||||
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
|
||||
#
|
||||
# resize-damage = 1
|
||||
|
||||
# Specify a list of conditions of windows that should be painted with inverted color.
|
||||
# Resource-hogging, and is not well tested.
|
||||
#
|
||||
# invert-color-include = []
|
||||
|
||||
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
|
||||
# Might cause incorrect opacity when rendering transparent content (but never
|
||||
# practically happened) and may not work with blur-background.
|
||||
# My tests show a 15% performance boost. Recommended.
|
||||
#
|
||||
glx-no-stencil = true;
|
||||
|
||||
# GLX backend: Avoid rebinding pixmap on window damage.
|
||||
# Probably could improve performance on rapid window content changes,
|
||||
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
|
||||
# Recommended if it works.
|
||||
#
|
||||
# glx-no-rebind-pixmap = false
|
||||
|
||||
# Disable the use of damage information.
|
||||
# This cause the whole screen to be redrawn every time, instead of the part of the screen
|
||||
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
|
||||
# The opposing option is use-damage
|
||||
#
|
||||
# no-use-damage = false
|
||||
use-damage = true;
|
||||
|
||||
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
||||
# calls are finished before picom starts drawing. Needed on nvidia-drivers
|
||||
# with GLX backend for some users.
|
||||
#
|
||||
# xrender-sync-fence = false
|
||||
|
||||
# GLX backend: Use specified GLSL fragment shader for rendering window
|
||||
# contents. Read the man page for a detailed explanation of the interface.
|
||||
#
|
||||
# window-shader-fg = "default"
|
||||
|
||||
# Use rules to set per-window shaders. Syntax is SHADER_PATH:PATTERN, similar
|
||||
# to opacity-rule. SHADER_PATH can be "default". This overrides window-shader-fg.
|
||||
#
|
||||
# window-shader-fg-rule = [
|
||||
# "my_shader.frag:window_type != 'dock'"
|
||||
# ]
|
||||
|
||||
# Force all windows to be painted with blending. Useful if you
|
||||
# have a glx-fshader-win that could turn opaque pixels transparent.
|
||||
#
|
||||
# force-win-blend = false
|
||||
|
||||
# Do not use EWMH to detect fullscreen windows.
|
||||
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
|
||||
#
|
||||
# no-ewmh-fullscreen = false
|
||||
|
||||
# Dimming bright windows so their brightness doesn't exceed this set value.
|
||||
# Brightness of a window is estimated by averaging all pixels in the window,
|
||||
# so this could comes with a performance hit.
|
||||
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
|
||||
#
|
||||
# max-brightness = 1.0
|
||||
|
||||
# Make transparent windows clip other windows like non-transparent windows do,
|
||||
# instead of blending on top of them.
|
||||
#
|
||||
# transparent-clipping = false
|
||||
|
||||
# Specify a list of conditions of windows that should never have transparent
|
||||
# clipping applied. Useful for screenshot tools, where you need to be able to
|
||||
# see through transparent parts of the window.
|
||||
#
|
||||
# transparent-clipping-exclude = []
|
||||
|
||||
# Set the log level. Possible values are:
|
||||
# "trace", "debug", "info", "warn", "error"
|
||||
# in increasing level of importance. Case doesn't matter.
|
||||
# If using the "TRACE" log level, it's better to log into a file
|
||||
# using *--log-file*, since it can generate a huge stream of logs.
|
||||
#
|
||||
# log-level = "debug"
|
||||
log-level = "warn";
|
||||
|
||||
# Set the log file.
|
||||
# If *--log-file* is never specified, logs will be written to stderr.
|
||||
# Otherwise, logs will to written to the given file, though some of the early
|
||||
# logs might still be written to the stderr.
|
||||
# When setting this option from the config file, it is recommended to use an absolute path.
|
||||
#
|
||||
# log-file = "/path/to/your/log/file"
|
||||
|
||||
# Show all X errors (for debugging)
|
||||
# show-all-xerrors = false
|
||||
|
||||
# Write process ID to a file.
|
||||
# write-pid-path = "/path/to/your/log/file"
|
||||
|
||||
# Window type settings
|
||||
#
|
||||
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
|
||||
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
|
||||
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
|
||||
# "tooltip", "notification", "combo", and "dnd".
|
||||
#
|
||||
# Following per window-type options are available: ::
|
||||
#
|
||||
# fade, shadow:::
|
||||
# Controls window-type-specific shadow and fade settings.
|
||||
#
|
||||
# opacity:::
|
||||
# Controls default opacity of the window type.
|
||||
#
|
||||
# focus:::
|
||||
# Controls whether the window of this type is to be always considered focused.
|
||||
# (By default, all window types except "normal" and "dialog" has this on.)
|
||||
#
|
||||
# full-shadow:::
|
||||
# Controls whether shadow is drawn under the parts of the window that you
|
||||
# normally won't be able to see. Useful when the window has parts of it
|
||||
# transparent, and you want shadows in those areas.
|
||||
#
|
||||
# clip-shadow-above:::
|
||||
# Controls whether shadows that would have been drawn above the window should
|
||||
# be clipped. Useful for dock windows that should have no shadow painted on top.
|
||||
#
|
||||
# redir-ignore:::
|
||||
# Controls whether this type of windows should cause screen to become
|
||||
# redirected again after been unredirected. If you have unredir-if-possible
|
||||
# set, and doesn't want certain window to cause unnecessary screen redirection,
|
||||
# you can set this to `true`.
|
||||
#
|
||||
wintypes:
|
||||
{
|
||||
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
|
||||
dock = { shadow = false; clip-shadow-above = true; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 0.8; }
|
||||
dropdown_menu = { opacity = 0.8; }
|
||||
};
|
||||
@ -2,5 +2,9 @@ configuration {
|
||||
show-icons: true;
|
||||
terminal: "alacritty";
|
||||
font: "xft:FiraCode 12";
|
||||
kb-accept-entry: "Ctrl+m,Return";
|
||||
kb-row-up: "Ctrl+k";
|
||||
kb-row-down: "Ctrl+j";
|
||||
kb-remove-to-eol: "";
|
||||
}
|
||||
@theme "Arc-Dark"
|
||||
|
||||
28
home/user/.config/sway/autostart.conf
Normal file
28
home/user/.config/sway/autostart.conf
Normal file
@ -0,0 +1,28 @@
|
||||
# vim: ft=swayconfig
|
||||
# Sway autostart
|
||||
|
||||
exec swayidle -w \
|
||||
timeout 1800 'swaylock -f' \
|
||||
timeout 1805 'swaymsg "output * power off"' \
|
||||
resume 'swaymsg "output * power on"' \
|
||||
before-sleep 'swaylock -f'
|
||||
|
||||
# Screen layout
|
||||
exec_always ~/.screenlayout/default
|
||||
|
||||
output * bg "$(find ~/.wallpaper -type f | shuf -n 1)" fill
|
||||
|
||||
# Notifications
|
||||
#systemctl --user enable --now dbus.service
|
||||
exec mako --anchor top-right --default-timeout 4000 --icons 1 --actions 1 --output $primary
|
||||
|
||||
exec_always wayvnc -o $primary -S "$(mktemp --dry-run --tmpdir="${XDG_RUNTIME_DIR}" wayvnc.XXXXXXXXXX)" 127.0.0.1 5900
|
||||
exec_always wayvnc -o $secondary -S "$(mktemp --dry-run --tmpdir="${XDG_RUNTIME_DIR}" wayvnc.XXXXXXXXXX)" 127.0.0.1 5901
|
||||
exec --no-startup-id easyeffects --gapplication-service
|
||||
|
||||
exec --no-startup-id pomodoro daemon
|
||||
|
||||
exec $browser
|
||||
exec $terminal
|
||||
exec Telegram
|
||||
exec firefox_media
|
||||
19
home/user/.config/sway/bar.conf
Normal file
19
home/user/.config/sway/bar.conf
Normal file
@ -0,0 +1,19 @@
|
||||
# vim: ft=swayconfig
|
||||
# Sway bar
|
||||
|
||||
bar {
|
||||
mode dock
|
||||
position bottom
|
||||
status_command i3blocks
|
||||
wrap_scroll no
|
||||
bindsym button4 nop
|
||||
bindsym button5 nop
|
||||
hidden_state hide
|
||||
output *
|
||||
tray_output $primary
|
||||
strip_workspace_name no
|
||||
strip_workspace_numbers no
|
||||
modifier $mod
|
||||
}
|
||||
|
||||
exec ~/.config/i3blocks/scripts/layout_change_handler.sh
|
||||
201
home/user/.config/sway/bindings.conf
Normal file
201
home/user/.config/sway/bindings.conf
Normal file
@ -0,0 +1,201 @@
|
||||
# vim: ft=swayconfig
|
||||
# Sway bindings
|
||||
|
||||
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pkill -RTMIN+1 i3blocks
|
||||
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pkill -RTMIN+1 i3blocks
|
||||
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+1 i3blocks
|
||||
|
||||
bindsym --locked XF86AudioPlay exec playerctl play-pause
|
||||
bindsym --locked XF86AudioPause exec playerctl play-pause
|
||||
bindsym --locked XF86AudioNext exec playerctl next
|
||||
bindsym --locked XF86AudioPrev exec playerctl previous
|
||||
bindsym --locked XF86Tools exec pavucontrol
|
||||
|
||||
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
|
||||
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||
|
||||
bindsym --to-code $mod+p exec pomodoro toggle && pkill -RTMIN+2 i3blocks
|
||||
|
||||
bindsym $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
|
||||
bindsym --release $mod+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
|
||||
|
||||
bindsym $mod+Shift+z exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
|
||||
bindsym XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk
|
||||
bindsym --release XF86PickupPhone exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute
|
||||
|
||||
bindsym XF86Go exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 0 ## Hold to talk, x1carb11
|
||||
bindsym --release XF86Go exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ 1 ## Release to mute, x1carb11
|
||||
|
||||
|
||||
bindsym $mod+XF86AudioMicMute exec --no-startup-id pactl list short sources | awk '/input.*RUNNING/ {system("pactl set-source-mute " $1 " toggle")}' ## Find and mute mics
|
||||
|
||||
bindsym --to-code $mod+s exec ~/.config/sway/scripts/swap-workspaces.sh
|
||||
|
||||
bindsym --to-code $mod+Shift+q kill
|
||||
bindsym --to-code $mod+Shift+r reload
|
||||
|
||||
set $menu rofi -show drun -m -1
|
||||
bindsym --to-code $mod+d exec $menu
|
||||
bindsym $mod+o exec --no-startup-id slm_rofi
|
||||
|
||||
# Change focus
|
||||
bindsym --to-code $mod+h focus left
|
||||
bindsym --to-code $mod+j focus down
|
||||
bindsym --to-code $mod+k focus up
|
||||
bindsym --to-code $mod+l focus right
|
||||
bindsym --to-code $mod+Left focus left
|
||||
bindsym --to-code $mod+Down focus down
|
||||
bindsym --to-code $mod+Up focus up
|
||||
bindsym --to-code $mod+Right focus right
|
||||
|
||||
# Move focused window
|
||||
bindsym --to-code $mod+Shift+h move left
|
||||
bindsym --to-code $mod+Shift+j move down
|
||||
bindsym --to-code $mod+Shift+k move up
|
||||
bindsym --to-code $mod+Shift+l move right
|
||||
bindsym --to-code $mod+Shift+Left move left
|
||||
bindsym --to-code $mod+Shift+Down move down
|
||||
bindsym --to-code $mod+Shift+Up move up
|
||||
bindsym --to-code $mod+Shift+Right move right
|
||||
|
||||
|
||||
bindsym --to-code $mod+Ctrl+Shift+l move workspace to output right
|
||||
bindsym --to-code $mod+Ctrl+Shift+h move workspace to output left
|
||||
bindsym --to-code $mod+Ctrl+Shift+k move workspace to output up
|
||||
bindsym --to-code $mod+Ctrl+Shift+j move workspace to output down
|
||||
|
||||
|
||||
bindsym --to-code $mod+f fullscreen toggle
|
||||
|
||||
bindsym --to-code $mod+t layout tabbed
|
||||
bindsym --to-code $mod+v layout toggle split
|
||||
bindsym --to-code $mod+a focus parent
|
||||
|
||||
bindsym --to-code $mod+Shift+slash floating toggle
|
||||
bindsym --to-code $mod+Shift+comma sticky toggle
|
||||
|
||||
# Change focus between tiling / floating windows
|
||||
bindsym --to-code $mod+slash focus mode_toggle
|
||||
|
||||
|
||||
bindsym --to-code Print exec --no-startup-id screenshot select copy
|
||||
bindsym --to-code $mod+Print exec --no-startup-id screenshot window copy
|
||||
bindsym --to-code Ctrl+Print exec --no-startup-id screenshot entire copy
|
||||
|
||||
bindsym --to-code Shift+Print exec --no-startup-id screenshot select save
|
||||
bindsym --to-code Shift+$mod+Print exec --no-startup-id screenshot window save
|
||||
bindsym --to-code Shift+Ctrl+Print exec --no-startup-id screenshot entire save
|
||||
|
||||
|
||||
bindsym --to-code $mod+q workspace hide1; workspace hide2
|
||||
|
||||
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
|
||||
bindsym --to-code $mod+b bar mode toggle
|
||||
|
||||
set $exitmode "Power: [e]xit, [r]eboot, [s]hutdown, s[u]spend, [l]ock, [b]lack, [R]UEFI"
|
||||
mode $exitmode {
|
||||
bindsym --to-code e exit
|
||||
bindsym --to-code r exec --no-startup-id reboot
|
||||
bindsym --to-code s exec --no-startup-id shutdown -h now
|
||||
bindsym --to-code u exec ~/.config/sway/scripts/lock-telegram.sh && systemctl suspend; mode "default"
|
||||
bindsym --to-code l exec ~/.config/sway/scripts/lock-telegram.sh && swaylock -f; mode "default"
|
||||
bindsym --to-code b exec magick canvas:none PNG:- | feh --class black -YFx -; mode "default"
|
||||
bindsym --to-code Shift+r exec --no-startup-id systemctl reboot --firmware-setup
|
||||
|
||||
bindsym Escape mode "default"
|
||||
bindsym Return mode "default"
|
||||
}
|
||||
bindsym --to-code $mod+x mode $exitmode
|
||||
|
||||
# switch to workspace
|
||||
bindsym --to-code $mod+1 workspace number $ws1
|
||||
bindsym --to-code $mod+2 workspace number $ws2
|
||||
bindsym --to-code $mod+3 workspace number $ws3
|
||||
bindsym --to-code $mod+4 workspace number $ws4
|
||||
bindsym --to-code $mod+5 workspace number $ws5
|
||||
bindsym --to-code $mod+6 workspace number $ws6
|
||||
bindsym --to-code $mod+7 workspace number $ws7
|
||||
bindsym --to-code $mod+8 workspace number $ws8
|
||||
bindsym --to-code $mod+9 workspace number $ws9
|
||||
bindsym --to-code $mod+0 workspace number $ws10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym --to-code $mod+Shift+1 move container to workspace number $ws1
|
||||
bindsym --to-code $mod+Shift+2 move container to workspace number $ws2
|
||||
bindsym --to-code $mod+Shift+3 move container to workspace number $ws3
|
||||
bindsym --to-code $mod+Shift+4 move container to workspace number $ws4
|
||||
bindsym --to-code $mod+Shift+5 move container to workspace number $ws5
|
||||
bindsym --to-code $mod+Shift+6 move container to workspace number $ws6
|
||||
bindsym --to-code $mod+Shift+7 move container to workspace number $ws7
|
||||
bindsym --to-code $mod+Shift+8 move container to workspace number $ws8
|
||||
bindsym --to-code $mod+Shift+9 move container to workspace number $ws9
|
||||
bindsym --to-code $mod+Shift+0 move container to workspace number $ws10
|
||||
|
||||
bindsym --to-code $mod+u workspace prev
|
||||
bindsym --to-code $mod+Shift+u workspace next
|
||||
|
||||
# workspace_auto_back_and_forth no
|
||||
bindsym --to-code $mod+Tab workspace back_and_forth
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
set $resizemode "Resize: toggle [p]recize"
|
||||
mode $resizemode {
|
||||
bindsym --to-code h resize shrink width 10 px or 10 ppt
|
||||
bindsym --to-code j resize grow height 10 px or 10 ppt
|
||||
bindsym --to-code k resize shrink height 10 px or 10 ppt
|
||||
bindsym --to-code l resize grow width 10 px or 10 ppt
|
||||
|
||||
bindsym --to-code $mod+r mode "default"
|
||||
bindsym --to-code p mode $presizemode
|
||||
|
||||
bindsym --to-code Return mode "default"
|
||||
bindsym --to-code Escape mode "default"
|
||||
}
|
||||
set $presizemode "Precise resize: toggle [p]resize"
|
||||
mode $presizemode {
|
||||
bindsym --to-code h resize shrink width 1 px or 1 ppt
|
||||
bindsym --to-code j resize grow height 1 px or 1 ppt
|
||||
bindsym --to-code k resize shrink height 1 px or 1 ppt
|
||||
bindsym --to-code l resize grow width 1 px or 1 ppt
|
||||
|
||||
bindsym --to-code $mod+r mode "default"
|
||||
bindsym --to-code p mode $resizemode
|
||||
|
||||
bindsym --to-code Return mode "default"
|
||||
bindsym --to-code Escape mode "default"
|
||||
}
|
||||
bindsym --to-code $mod+r mode $resizemode
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout us,ru
|
||||
xkb_options grp:win_space_toggle,caps:ctrl_modifier
|
||||
xkb_model "pc101"
|
||||
repeat_delay 250
|
||||
repeat_rate 100
|
||||
}
|
||||
|
||||
input type:pointer {
|
||||
natural_scroll disabled
|
||||
}
|
||||
|
||||
input type:touchpad {
|
||||
tap enabled
|
||||
tap_button_map lrm
|
||||
dwt enabled
|
||||
scroll_method two_finger
|
||||
natural_scroll enabled
|
||||
drag enabled
|
||||
drag_lock disabled
|
||||
pointer_accel 0.4
|
||||
}
|
||||
|
||||
bindgesture swipe:3:right workspace next
|
||||
bindgesture swipe:3:left workspace prev
|
||||
bindgesture swipe:3:up exec $menu
|
||||
bindgesture swipe:3:down workspace hide1; workspace hide2
|
||||
34
home/user/.config/sway/config
Normal file
34
home/user/.config/sway/config
Normal file
@ -0,0 +1,34 @@
|
||||
# Sway config sourcer
|
||||
|
||||
exec swaylock -f
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
set $ws1 "1 Browser"
|
||||
set $ws2 "2 Code"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8💬Social"
|
||||
set $ws9 "9🎵Music"
|
||||
set $ws10 "10🍿Media"
|
||||
|
||||
set $terminal ~/.config/sway/scripts/auto-alacritty.sh
|
||||
set $browser firefox
|
||||
|
||||
# Example variables.d:
|
||||
#set $primary DVI-I-1
|
||||
#set $secondary VGA-1
|
||||
#set $terminal alacritty
|
||||
#set $browser firefox
|
||||
include ~/.config/sway/variables.d/*.conf
|
||||
|
||||
include ~/.config/sway/other.conf
|
||||
include ~/.config/sway/bindings.conf
|
||||
include ~/.config/sway/bar.conf
|
||||
include ~/.config/sway/autostart.conf
|
||||
|
||||
include /etc/sway/config.d/*.conf
|
||||
include ~/.config/sway/config.d/*.conf
|
||||
0
home/user/.config/sway/config.d/.gitkeep
Normal file
0
home/user/.config/sway/config.d/.gitkeep
Normal file
55
home/user/.config/sway/other.conf
Normal file
55
home/user/.config/sway/other.conf
Normal file
@ -0,0 +1,55 @@
|
||||
# vim: ft=swayconfig
|
||||
# Other sway config
|
||||
|
||||
# Hide cursor
|
||||
seat seat0 hide_cursor when-typing enable
|
||||
seat seat0 hide_cursor 5000
|
||||
|
||||
|
||||
set $font_size 11
|
||||
font xft:FiraCode $font_size
|
||||
|
||||
floating_modifier $mod
|
||||
|
||||
focus_follows_mouse no
|
||||
mouse_warping none
|
||||
popup_during_fullscreen smart
|
||||
smart_borders on
|
||||
focus_on_window_activation urgent
|
||||
|
||||
default_border pixel 1
|
||||
default_floating_border normal
|
||||
hide_edge_borders smart
|
||||
|
||||
for_window [tiling] border pixel 3
|
||||
for_window [title="Picture-in-Picture"] sticky enable
|
||||
for_window [title="Picture-in-Picture"] border pixel 0
|
||||
for_window [app_id="firefox"] inhibit_idle fullscreen
|
||||
|
||||
for_window [app_id="pavucontrol"] {
|
||||
floating enable
|
||||
resize set width 60 ppt height 80 ppt
|
||||
move position center
|
||||
}
|
||||
|
||||
for_window [class="black"] fullscreen enable
|
||||
|
||||
no_focus [title="^Peek preview$"]
|
||||
no_focus [class="black"]
|
||||
|
||||
assign [app_id="firefox_media"] workspace $ws10
|
||||
assign [app_id="Alacritty"] workspace $ws2
|
||||
assign [app_id="org.telegram.desktop"] workspace $ws8
|
||||
assign [app_id="firefox"] workspace $ws1
|
||||
|
||||
workspace $ws1 output $primary
|
||||
workspace $ws2 output $primary
|
||||
workspace $ws3 output $primary
|
||||
workspace $ws9 output $secondary
|
||||
workspace $ws10 output $secondary
|
||||
|
||||
workspace hide1 output $primary
|
||||
workspace hide2 output $secondary
|
||||
|
||||
|
||||
exec_always test -f ~/.Xresources && xrdb -merge ~/.Xresources
|
||||
6
home/user/.config/sway/scripts/auto-alacritty.sh
Executable file
6
home/user/.config/sway/scripts/auto-alacritty.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
while true; do
|
||||
alacritty
|
||||
sleep 1
|
||||
done
|
||||
25
home/user/.config/sway/scripts/lock-telegram.sh
Executable file
25
home/user/.config/sway/scripts/lock-telegram.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
TELEGRAM_WINDOW="$(
|
||||
swaymsg -t get_tree | \
|
||||
jq -r '.. | select(.app_id? == "org.telegram.desktop") | .id' | \
|
||||
head -n 1
|
||||
)"
|
||||
|
||||
readonly TELEGRAM_WINDOW
|
||||
|
||||
|
||||
if [ -z "${TELEGRAM_WINDOW}" ]; then
|
||||
echo "Error: Telegram not found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
swaymsg "[con_id=${TELEGRAM_WINDOW}] focus"
|
||||
|
||||
sleep 0.2
|
||||
|
||||
wtype -M ctrl l
|
||||
|
||||
swaymsg workspace back_and_forth
|
||||
|
||||
exit 0
|
||||
26
home/user/.config/sway/scripts/swap-workspaces.sh
Executable file
26
home/user/.config/sway/scripts/swap-workspaces.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
current_monitor=$(swaymsg -r -t get_workspaces | jq '.[] | select(.focused).output' | tr -d '"')
|
||||
other_monitor=$(swaymsg -r -t get_outputs | jq -r ".[] | select(.active and .name != \"${current_monitor}\").name" | head -n 1)
|
||||
|
||||
if [ -z "${other_monitor}" ]; then
|
||||
echo "No other active monitor found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current_workspace=$(swaymsg -r -t get_workspaces | jq '.[] | select(.focused).name' | tr -d '"')
|
||||
other_workspace=$(swaymsg -r -t get_workspaces | jq -r ".[] | select(.visible and .output == \"${other_monitor}\").name" | head -n 1)
|
||||
|
||||
if [ -n "${other_workspace}" ]; then
|
||||
# Swap workspaces
|
||||
swaymsg "workspace ${other_workspace}; move workspace to output ${current_monitor}"
|
||||
swaymsg "workspace ${current_workspace}; move workspace to output ${other_monitor}"
|
||||
swaymsg "workspace ${other_workspace}"
|
||||
else
|
||||
# Just move current workspace if target is empty
|
||||
swaymsg "move workspace to output ${other_monitor}"
|
||||
fi
|
||||
0
home/user/.config/sway/variables.d/.gitkeep
Normal file
0
home/user/.config/sway/variables.d/.gitkeep
Normal file
3
home/user/.config/swaylock/config
Normal file
3
home/user/.config/swaylock/config
Normal file
@ -0,0 +1,3 @@
|
||||
color=000000
|
||||
ignore-empty-password
|
||||
show-failed-attempts
|
||||
18
home/user/.config/systemd/user/mpv.service
Normal file
18
home/user/.config/systemd/user/mpv.service
Normal file
@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=MPV Audio Player Service
|
||||
Documentation=man:mpv(1)
|
||||
After=sound.target graphical-session.target
|
||||
Wants=sound.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/.local/bin/mpv-service.sh
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
|
||||
Environment=XDG_RUNTIME_DIR=%t
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
17
home/user/.config/systemd/user/ssh-proxy@.service
Normal file
17
home/user/.config/systemd/user/ssh-proxy@.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=SSH proxy
|
||||
Requires=default.target
|
||||
After=default.target
|
||||
|
||||
# ln -s % ~/.config/systemd/user
|
||||
# systemctl --user enable --now ssh-proxy@server.vpn
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/ssh -o ControlMaster=no -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -vCTN -D 127.0.0.1:1080 %i
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
StartLimitInterval=0
|
||||
StartLimitBurst=0
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@ -8,7 +8,8 @@ Type=simple
|
||||
ExecStart=/usr/bin/tmux -D -L %u
|
||||
ExecStop=/usr/bin/tmux -L %u kill-server
|
||||
ExecReload=/usr/bin/tmux -L %u source-file %h/.config/tmux/tmux.conf
|
||||
Restart=always
|
||||
Restart=on-failure
|
||||
ExecStartPost=/usr/bin/tmux -L %u new-session -d -s landing 'sh -c "tmux rename-window -t 1 landing; tmux set-option remain-on-exit on; figlet -w 200 -c -f big Landing; trap : INT; while true; do sleep 3600; done"'
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@ -7,7 +7,7 @@ After=default.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=/bin/sleep 10
|
||||
ExecStart=/usr/bin/x11vnc -noxdamage -rfbauth %h/.vnc/passwd -display :0 -forever
|
||||
ExecStart=/usr/bin/x11vnc -noxdamage -rfbauth %h/.vnc/passwd -display :0 -forever -reopen -shared
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
|
||||
@ -36,3 +36,7 @@ set -g command-alias[110] default-layout="
|
||||
resize-pane -x $_tmux_main_pane_size
|
||||
select-layout '6c98,213x55,0,0{72x55,0,0,72,140x55,73,0,73}'
|
||||
"
|
||||
|
||||
set -g command-alias[111] enable-zoom='
|
||||
if -F "#{window_zoomed_flag}" "" "resize-pane -Z"
|
||||
'
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
set -g prefix C-b
|
||||
bind C-b send-prefix
|
||||
bind C-и send-prefix
|
||||
|
||||
|
||||
# Toggle local tmux mappings to allow control remote tmux
|
||||
@ -18,11 +19,42 @@ bind -T off F12 {
|
||||
set status on
|
||||
}
|
||||
|
||||
bind WheelUpPane send-keys -N 2 scroll-up
|
||||
bind WheelDownPane send-keys -N 2 scroll-Down
|
||||
|
||||
bind F12 send-keys F12
|
||||
|
||||
|
||||
bind s choose-tree-index
|
||||
# View current pane in editor
|
||||
bind y {
|
||||
capture-pane -J
|
||||
save-buffer /tmp/tmux-buffer
|
||||
delete-buffer
|
||||
display-popup -E -w 90% -h 80% "nvim /tmp/tmux-buffer"
|
||||
}
|
||||
|
||||
# View current buffer in editor
|
||||
bind Y {
|
||||
capture-pane -J -S - -E -
|
||||
save-buffer /tmp/tmux-buffer
|
||||
delete-buffer
|
||||
display-popup -E -w 90% -h 80% "nvim /tmp/tmux-buffer"
|
||||
}
|
||||
|
||||
bind t display-popup -E -h 70% -w 60% -d "${HOME}"
|
||||
|
||||
|
||||
|
||||
bind c display-menu \
|
||||
calendar c {
|
||||
display-popup -w 33% -h 70% "cal -my"
|
||||
} \
|
||||
time t {
|
||||
display-popup -w 50% -h 17% "watch -t -n 1 'figlet -ct -f big \"$(date \"+%H : %M : %S\")\"'"
|
||||
} \
|
||||
weather w {
|
||||
display-popup -h 80% -w 60% "zsh -ic 'weather \$CITY'"
|
||||
}
|
||||
|
||||
|
||||
# Switch new session
|
||||
@ -30,14 +62,21 @@ bind n new-session -c ~
|
||||
# Switch new named session
|
||||
bind N command-prompt -p "New session:" "new-session -A -s '%1' -c ~"
|
||||
|
||||
bind x if -F "#{?#{==:#{client_session},landing},0,1}" \
|
||||
"confirm-before -p \"kill current session? (y/n)\" kill-session" \
|
||||
"display-message 'Cannot kill session: landing'"
|
||||
|
||||
bind x confirm-before -p "kill current session? (y/n)" "kill-session"
|
||||
bind X confirm-before -p "kill last session [#{client_last_session}]? (y/n)" "kill-session -t #{client_last_session} \; display-message \"Killed last session\""
|
||||
bind C-x confirm-before -p "kill other sessions? (y/n)" "kill-session -a"
|
||||
bind X if -F "#{?#{==:#{client_last_session},landing},0,1}" \
|
||||
"confirm-before -p \"kill last session [#{client_last_session}]? (y/n)\" \"kill-session -t #{client_last_session} \\; display-message 'Killed last session'\"" \
|
||||
"display-message 'Cannot kill session: landing'"
|
||||
|
||||
bind q confirm-before -p "kill current pane? (y/n)" "kill-pane"
|
||||
bind Q kill-window
|
||||
bind C-q confirm-before -p "kill other windows? (y/n)" "kill-window -a"
|
||||
bind q if -F "#{?#{==:#{client_session},landing},0,1}" \
|
||||
"confirm-before -p \"kill current pane? (y/n)\" kill-pane" \
|
||||
"display-message 'Cannot kill session: landing'"
|
||||
|
||||
bind Q if -F "#{?#{==:#{window_name},landing},0,1}" \
|
||||
"confirm-before -p \"kill current window? (y/n)\" kill-window" \
|
||||
"display-message 'Cannot kill session: landing'"
|
||||
|
||||
bind d detach
|
||||
bind D choose-client -Z
|
||||
@ -95,16 +134,16 @@ bind i detect-panes
|
||||
|
||||
|
||||
# Windows navigation
|
||||
bind -n M-1 if-shell 'tmux select-window -t 1' '' 'new-window -t 1 -n 1 -c "#{pane_current_path}"'
|
||||
bind -n M-2 if-shell 'tmux select-window -t 2' '' 'new-window -t 2 -n 2 -c "#{pane_current_path}"'
|
||||
bind -n M-3 if-shell 'tmux select-window -t 3' '' 'new-window -t 3 -n 3 -c "#{pane_current_path}"'
|
||||
bind -n M-4 if-shell 'tmux select-window -t 4' '' 'new-window -t 4 -n 4 -c "#{pane_current_path}"'
|
||||
bind -n M-5 if-shell 'tmux select-window -t 5' '' 'new-window -t 5 -n 5 -c "#{pane_current_path}"'
|
||||
bind -n M-6 if-shell 'tmux select-window -t 6' '' 'new-window -t 6 -n 6 -c "#{pane_current_path}"'
|
||||
bind -n M-7 if-shell 'tmux select-window -t 7' '' 'new-window -t 7 -n 7 -c "#{pane_current_path}"'
|
||||
bind -n M-8 if-shell 'tmux select-window -t 8' '' 'new-window -t 8 -n 8 -c "#{pane_current_path}"'
|
||||
bind -n M-9 if-shell 'tmux select-window -t 9' '' 'new-window -t 9 -n 9 -c "#{pane_current_path}"'
|
||||
bind -n M-0 if-shell 'tmux select-window -t 10' '' 'new-window -t 10 -n 10 -c "#{pane_current_path}"'
|
||||
bind -n M-1 if-shell 'tmux new-window -t 1 -n 1 -c "#{pane_current_path}"' '' 'select-window -t 1'
|
||||
bind -n M-2 if-shell 'tmux new-window -t 2 -n 2 -c "#{pane_current_path}"' '' 'select-window -t 2'
|
||||
bind -n M-3 if-shell 'tmux new-window -t 3 -n 3 -c "#{pane_current_path}"' '' 'select-window -t 3'
|
||||
bind -n M-4 if-shell 'tmux new-window -t 4 -n 4 -c "#{pane_current_path}"' '' 'select-window -t 4'
|
||||
bind -n M-5 if-shell 'tmux new-window -t 5 -n 5 -c "#{pane_current_path}"' '' 'select-window -t 5'
|
||||
bind -n M-6 if-shell 'tmux new-window -t 6 -n 6 -c "#{pane_current_path}"' '' 'select-window -t 6'
|
||||
bind -n M-7 if-shell 'tmux new-window -t 7 -n 7 -c "#{pane_current_path}"' '' 'select-window -t 7'
|
||||
bind -n M-8 if-shell 'tmux new-window -t 8 -n 8 -c "#{pane_current_path}"' '' 'select-window -t 8'
|
||||
bind -n M-9 if-shell 'tmux new-window -t 9 -n 9 -c "#{pane_current_path}"' '' 'select-window -t 9'
|
||||
bind -n M-0 if-shell 'tmux new-window -t 10 -n 10 -c "#{pane_current_path}"' '' 'select-window -t 10'
|
||||
|
||||
|
||||
# Moving pane to window by Alt+Shift+Number
|
||||
@ -147,17 +186,27 @@ bind -n M-Tab swap-pane -t '{left-of}'
|
||||
# Copy mode
|
||||
setw -g mode-keys vi
|
||||
bind v copy-mode
|
||||
bind -n M-V copy-mode
|
||||
bind -r p paste-buffer
|
||||
bind C-p choose-buffer
|
||||
bind -T copy-mode-vi C-v {
|
||||
send-keys -X rectangle-toggle
|
||||
if -F '#{selection_active}' '' 'send-keys -X begin-selection'
|
||||
}
|
||||
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "copy"
|
||||
|
||||
bind MouseDrag1Pane copy-mode
|
||||
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "copy"
|
||||
|
||||
bind -r p run-shell "pasta | tmux load-buffer - && tmux paste-buffer -p"
|
||||
bind -r з run-shell "pasta | tmux load-buffer - && tmux paste-buffer -p"
|
||||
bind -r P paste-buffer -p
|
||||
|
||||
|
||||
## Toggle selection
|
||||
bind -T copy-mode-vi v if -F '#{selection_active}' 'send-keys -X clear-selection' 'send-keys -X begin-selection'
|
||||
|
||||
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||
bind -T copy-mode-vi Escape if -F '#{selection_active}' 'send-keys -X clear-selection' 'send-keys -X cancel'
|
||||
|
||||
bind -T copy-mode-vi Escape send-keys -X cancel
|
||||
bind -T copy-mode-vi C-c send-keys -X cancel
|
||||
bind -T copy-mode-vi q send-keys -X cancel
|
||||
|
||||
@ -165,15 +214,12 @@ bind -T copy-mode-vi q send-keys -X cancel
|
||||
bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 2 scroll-up
|
||||
bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down
|
||||
|
||||
## Search all files in buffer
|
||||
bind-key f copy-mode \; send-keys -X search-backward \
|
||||
'(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))'
|
||||
|
||||
|
||||
# Session managment
|
||||
bind 1 run-shell ~/.tmux/01.sh
|
||||
bind 2 run-shell ~/.tmux/02.sh
|
||||
bind 3 run-shell ~/.tmux/03.sh
|
||||
bind 4 run-shell ~/.tmux/04.sh
|
||||
bind 5 run-shell ~/.tmux/05.sh
|
||||
bind 6 run-shell ~/.tmux/06.sh
|
||||
bind 7 run-shell ~/.tmux/07.sh
|
||||
bind 8 run-shell ~/.tmux/08.sh
|
||||
bind 9 run-shell ~/.tmux/09.sh
|
||||
bind 0 run-shell ~/.tmux/10.sh
|
||||
bind a display-popup -EE -w 80% -h 80% -B '~/.config/tmux/scripts/attach_session.sh'
|
||||
bind s display-popup -EE -w 80% -h 80% -B '~/.config/tmux/scripts/start_session.sh'
|
||||
bind S display-popup -EE -w 40% -h 80% -B '~/.config/tmux/scripts/start_projects.sh'
|
||||
|
||||
@ -18,7 +18,7 @@ set -g repeat-time 400
|
||||
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
set -g renumber-windows off
|
||||
set -g renumber-windows on
|
||||
|
||||
set -g history-limit 10000
|
||||
|
||||
@ -36,12 +36,4 @@ set -g terminal-overrides[101] "xterm-256color:Tc"
|
||||
|
||||
set-hook -g after-new-session[101] 'rename-window -t 1 1'
|
||||
|
||||
set -g update-environment[101] 'DISPLAY'
|
||||
set -g update-environment[102] 'WINDOWID'
|
||||
set -g update-environment[103] 'XAUTHORITY'
|
||||
set -g update-environment[104] 'SSH_CLIENT'
|
||||
set -g update-environment[105] 'SSH_ASKPASS'
|
||||
set -g update-environment[106] 'SSH_AUTH_SOCK'
|
||||
set -g update-environment[107] 'SSH_AGENT_PID'
|
||||
set -g update-environment[108] 'SSH_CONNECTION'
|
||||
set -g update-environment[109] 'SSH_TTY'
|
||||
set -g update-environment "PATH DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM LANG LC_ALL COLORTERM EDITOR VISUAL SWAYSOCK WAYLAND_DISPLAY"
|
||||
|
||||
@ -9,3 +9,6 @@ set -g @plugin 'laktak/extrakto'
|
||||
set -g @extrakto_popup_size '40%'
|
||||
set -g @extrakto_key 'e'
|
||||
set -g @extrakto_fzf_unset_default_opts "false"
|
||||
set -g @extrakto_insert_key 'enter'
|
||||
set -g @extrakto_copy_key 'tab'
|
||||
set -g @extrakto_help_key 'ctrl-/'
|
||||
|
||||
@ -1,3 +1 @@
|
||||
# vim: ft=tmux
|
||||
|
||||
set detach-on-destroy on
|
||||
27
home/user/.config/tmux/scripts/attach_session.sh
Executable file
27
home/user/.config/tmux/scripts/attach_session.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
readonly tmux_list_sessions_script="${HOME}/.config/tmux/scripts/list_sessions.sh"
|
||||
readonly tmux_kill_session_script="${HOME}/.config/tmux/scripts/kill_session.sh"
|
||||
|
||||
export FZF_DEFAULT_OPTS="\
|
||||
${FZF_DEFAULT_OPTS}
|
||||
--no-multi
|
||||
--marker=''
|
||||
--border=rounded
|
||||
--border-label-pos=bottom
|
||||
--border-label=' Attach session '
|
||||
--color='border:blue,label:blue'
|
||||
--preview-window=follow
|
||||
--preview='tmux capture-pane -p -e -t {1}'
|
||||
--bind
|
||||
ctrl-x:execute\(${tmux_kill_session_script}\ {1}\)+reload\(${tmux_list_sessions_script}\),\
|
||||
load:reload\(${tmux_list_sessions_script}\;sleep\ 1\)\
|
||||
"
|
||||
|
||||
session_to_attach="$("${tmux_list_sessions_script}" | fzf | awk '{printf $1}')"
|
||||
readonly session_to_attach
|
||||
|
||||
if [ -n "${session_to_attach}" ]; then
|
||||
tmux switch-client -t "${session_to_attach}"
|
||||
fi
|
||||
7
home/user/.config/tmux/scripts/kill_session.sh
Executable file
7
home/user/.config/tmux/scripts/kill_session.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "${1}" = "landing" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux kill-session -t "${1}"
|
||||
15
home/user/.config/tmux/scripts/list_sessions.sh
Executable file
15
home/user/.config/tmux/scripts/list_sessions.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
current_session="$(tmux display-message -p '#S')"
|
||||
readonly current_session
|
||||
|
||||
last_session="$(tmux display-message -p '#{client_last_session}')"
|
||||
readonly last_session
|
||||
|
||||
sessions="$(tmux list-session -F '#S#{?session_attached, (attached) , }')"
|
||||
sessions="$(echo "${sessions}" | sed "s/^${current_session} /${current_session} (current) /")"
|
||||
sessions="$(echo "${sessions}" | sed "s/^${last_session} /${last_session} (last) /")"
|
||||
readonly sessions
|
||||
|
||||
echo "${sessions}"
|
||||
35
home/user/.config/tmux/scripts/start_projects.sh
Executable file
35
home/user/.config/tmux/scripts/start_projects.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
export FZF_DEFAULT_OPTS="\
|
||||
${FZF_DEFAULT_OPTS}
|
||||
--no-multi
|
||||
--marker=''
|
||||
--border=rounded
|
||||
--border-label-pos=bottom
|
||||
--border-label=' Start session '
|
||||
--color='border:grey,label:grey'
|
||||
"
|
||||
|
||||
|
||||
project_dir="$(find "${HOME}" -xdev -maxdepth 3 -type d -not -path '*/.*' | sed "s%^${HOME}%~%" | fzf | sed "s%^~%${HOME}%")"
|
||||
readonly project_dir
|
||||
|
||||
|
||||
if [ -z "${project_dir}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d "${project_dir}" ]; then
|
||||
printf 'Directory "%s" not found' "${project_dir}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
session="$(basename "${project_dir}" | sed 's/\./_/g')"
|
||||
|
||||
if ! tmux has-session -t="${session}" 2>/dev/null; then
|
||||
tmux new-session -d -n 1 -c "${project_dir}" -s "$(basename "${project_dir}")"
|
||||
fi
|
||||
|
||||
tmux switch-client -t "${session}"
|
||||
41
home/user/.config/tmux/scripts/start_session.sh
Executable file
41
home/user/.config/tmux/scripts/start_session.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
readonly TMUX_SESSIONS="${HOME}/.tmux"
|
||||
readonly EDITOR="nvim"
|
||||
|
||||
export FZF_DEFAULT_OPTS="\
|
||||
${FZF_DEFAULT_OPTS}
|
||||
--no-multi
|
||||
--marker=''
|
||||
--border=rounded
|
||||
--border-label-pos=bottom
|
||||
--border-label=' Start session '
|
||||
--color='border:green,label:green'
|
||||
--preview='highlight -O ansi '${TMUX_SESSIONS}/{1}''
|
||||
--bind
|
||||
ctrl-e:execute\(${EDITOR}\ \"${TMUX_SESSIONS}/{1}\"\)\
|
||||
"
|
||||
|
||||
|
||||
current_session="$(tmux display-message -p '#S')"
|
||||
readonly current_session
|
||||
|
||||
existing_sessions="$(tmux list-session -F '#S')"
|
||||
readonly existing_sessions
|
||||
|
||||
sessions="$(find "${TMUX_SESSIONS}/" -type f -executable -exec basename {} \;)"
|
||||
sessions="$(echo "${sessions}" | sed "s/^${current_session}/${current_session} (current)/")"
|
||||
|
||||
for _s in $existing_sessions
|
||||
do
|
||||
sessions="$(echo "${sessions}" | sed "s/^${_s}/${_s} (created)/")"
|
||||
done
|
||||
readonly sessions
|
||||
|
||||
session_file="$(echo "${sessions}" | fzf | awk '{printf $1}')"
|
||||
readonly session_file
|
||||
|
||||
if [ -n "${session_file}" ]; then
|
||||
"${TMUX_SESSIONS}/${session_file}"
|
||||
fi
|
||||
@ -1,10 +1,10 @@
|
||||
# vim: ft=tmux
|
||||
|
||||
|
||||
_tmux_color_inactive_background="colour236"
|
||||
_tmux_color_inactive_background="terminal" # "colour236"
|
||||
_tmux_color_inactive_foreground="colour247"
|
||||
_tmux_color_main_background="terminal"
|
||||
_tmux_color_border="colour24"
|
||||
_tmux_color_border="colour12"
|
||||
_tmux_color_menu="colour24"
|
||||
_tmux_color_activity_style="colour239"
|
||||
|
||||
|
||||
42
home/user/.config/waybar/config
Normal file
42
home/user/.config/waybar/config
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"layer": "bottom",
|
||||
"position": "bottom",
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"sway/mode",
|
||||
],
|
||||
"modules-center": [],
|
||||
"modules-right": [
|
||||
"sway/language",
|
||||
"clock",
|
||||
"tray"
|
||||
],
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true
|
||||
},
|
||||
"clock": {
|
||||
"format": " {:%F %a %H:%M}",
|
||||
"format-alt": " {:%A, %B %d, %Y (%R)}",
|
||||
"tooltip-format": "<tt><small>{calendar}</small></tt>",
|
||||
"calendar": {
|
||||
"mode" : "year",
|
||||
"mode-mon-col" : 3,
|
||||
"weeks-pos" : "right",
|
||||
"on-scroll" : 1,
|
||||
"format": {
|
||||
"months": "<span color='#ffead3'><b>{}</b></span>",
|
||||
"days": "<span color='#ecc6d9'><b>{}</b></span>",
|
||||
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
|
||||
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-scroll-up": "tz_up",
|
||||
"on-scroll-down": "tz_down",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
}
|
||||
@ -1,8 +1,11 @@
|
||||
if [[ "$TTY" =~ /dev/tty* ]]; then
|
||||
|
||||
if [[ "${TTY}" =~ /dev/tty* ]]; then
|
||||
setterm -blength=0
|
||||
setfont cyr-sun16
|
||||
fi
|
||||
|
||||
if [[ "$TTY" = "/dev/tty1" ]] && [[ $XDG_VTNR -eq 1 ]] && [[ -z $DISPLAY ]] && systemctl -q is-active graphical.target; then
|
||||
exec startx >> ~/.xlogs 2>&1
|
||||
if [ "${TTY}" = "/dev/tty1" ] && [ -z "${WAYLAND_DISPLAY}" ] && [ -z "${DISPLAY}" ]; then
|
||||
wayland_dir="${XDG_STATE_HOME:-${HOME}/.local/state}/wayland"
|
||||
mkdir -p "${wayland_dir}"
|
||||
exec sway >> "${wayland_dir}/sway.log" 2>&1
|
||||
fi
|
||||
@ -4,20 +4,23 @@
|
||||
if \
|
||||
[ "$(tty)" != "/dev/tty3" ] && \
|
||||
command -v tmux &>/dev/null && \
|
||||
[ -z "$TMUX" ] && \
|
||||
tmux -N -L "$USER" list-sessions &>/dev/null
|
||||
[ -z "${TMUX}" ] && \
|
||||
tmux -N -L "${USER}" list-sessions &>/dev/null
|
||||
then
|
||||
exec tmux -N -L "$USER" new-session
|
||||
if [ -n "${SSH_CLIENT}" ]; then
|
||||
exec tmux -N -L "${USER}" new-session
|
||||
fi
|
||||
exec tmux -N -L "${USER}" new-session -A
|
||||
fi
|
||||
|
||||
if [ -f "$ZDOTDIR/sourcer" ]; then
|
||||
source "$ZDOTDIR/sourcer"
|
||||
if [ -f "${ZDOTDIR}/sourcer" ]; then
|
||||
source "${ZDOTDIR}/sourcer"
|
||||
fi
|
||||
|
||||
if \
|
||||
command -v tmux &>/dev/null && \
|
||||
[ -n "$TMUX" ] && \
|
||||
[ -n "$SSH_CLIENT" ]
|
||||
[ -n "${TMUX}" ] && \
|
||||
[ -n "${SSH_CLIENT}" ]
|
||||
then
|
||||
tmux source-file "$XDG_CONFIG_HOME/tmux/remote.conf"
|
||||
tmux source-file "${XDG_CONFIG_HOME}/tmux/remote.conf"
|
||||
fi
|
||||
43
home/user/.config/zsh/accept_line
Normal file
43
home/user/.config/zsh/accept_line
Normal file
@ -0,0 +1,43 @@
|
||||
export ZCALC_HISTFILE="${HOME}/.zcalc_history"
|
||||
|
||||
autoload -U zcalc
|
||||
|
||||
function __format_number() {
|
||||
local num="${1}"
|
||||
local res
|
||||
|
||||
num="$(echo "${num}" | sed 's/\.$//')"
|
||||
res="${num}"
|
||||
|
||||
if [[ "${num}" =~ ^[-]?[0-9]+$ ]]; then
|
||||
res="$(LC_NUMERIC='en_US.UTF-8' printf "%'.20f\n" "${num}" | sed "s/,/_/g")"
|
||||
fi
|
||||
|
||||
echo "${res}" | sed 's/\.\([0-9]*[1-9]\)0*$/.\1/; s/\.0*$//'
|
||||
}
|
||||
|
||||
function __calc {
|
||||
local result
|
||||
result="$(ZDOTDIR="${HOME}" zcalc -f -e "$*" 2>/dev/null)"
|
||||
|
||||
__format_number "${result}"
|
||||
}
|
||||
|
||||
aliases[calc]='noglob __calc'
|
||||
aliases[=]='noglob __calc'
|
||||
|
||||
|
||||
function accept-line() {
|
||||
if [[ ${BUFFER} =~ '^[ ]?\(?[-+]?[0-9]+[^a-zA-Z]+' ]]; then
|
||||
echo
|
||||
test "${BUFFER[1]}" != " " && print -S -- "${BUFFER}" # saving the command to history
|
||||
__calc "${BUFFER}"
|
||||
BUFFER=
|
||||
fi
|
||||
|
||||
zle .${WIDGET}
|
||||
}
|
||||
|
||||
zle -N accept-line
|
||||
|
||||
# vim: ft=zsh
|
||||
@ -1,20 +1,205 @@
|
||||
# vim: ft=zsh
|
||||
|
||||
alias -g L='| $PAGER'
|
||||
|
||||
_d() { true ; }
|
||||
_f() { true ; }
|
||||
_a() { true ; }
|
||||
|
||||
|
||||
alias ls='ls --classify=auto --human-readable'
|
||||
alias ll='ls -l'
|
||||
alias la='ls --almost-all'
|
||||
alias lla='ls -l --almost-all'
|
||||
alias l.='ls --almost-all --ignore="*"'
|
||||
alias ll.='ls -l --almost-all --ignore="*"'
|
||||
|
||||
if command -v eza &>/dev/null; then
|
||||
alias eza='eza --classify=auto'
|
||||
alias ls='eza'
|
||||
alias ll='eza --long'
|
||||
alias la='eza --all'
|
||||
alias lla='eza --long --all'
|
||||
alias l.='_d() ( cd "${1:-.}" && eza --list-dirs .* ; ); _d'
|
||||
alias ll.='_d() ( cd "${1:-.}" && eza --long --all --list-dirs .* ; ); _d'
|
||||
|
||||
alias tree='eza --tree'
|
||||
fi
|
||||
|
||||
GREP_OPTIONS=(
|
||||
--color=auto
|
||||
--binary-files=without-match
|
||||
--exclude-dir=.git
|
||||
--exclude-dir=.svn
|
||||
)
|
||||
|
||||
alias grep='grep $GREP_OPTIONS'
|
||||
alias g='noglob grep $GREP_OPTIONS --dereference-recursive --line-number'
|
||||
|
||||
alias f='_f() { find . -name "*${1}*" }; noglob _f'
|
||||
|
||||
alias _='sudo'
|
||||
alias root='sudo --login TMOUT=450'
|
||||
|
||||
alias rm='rm --interactive=once --verbose --recursive --one-file-system'
|
||||
alias mkdir='mkdir --parents --verbose'
|
||||
alias md='mkdir --parents --verbose'
|
||||
|
||||
alias q='exit 0'
|
||||
|
||||
alias path='echo -e ${PATH//:/\\n}'
|
||||
|
||||
alias dh='dirs -v'
|
||||
alias pd='popd'
|
||||
|
||||
# shorts
|
||||
alias c='clear'
|
||||
alias h='history -d -D 0'
|
||||
alias j='jobs -l'
|
||||
|
||||
alias zshrc='source "${ZDOTDIR}/.zshrc" >/dev/null'
|
||||
|
||||
if command -v colordiff &>/dev/null; then
|
||||
alias diff='colordiff'
|
||||
fi
|
||||
|
||||
alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .'
|
||||
alias man='MANWIDTH=$((COLUMNS > 80 ? 80 : COLUMNS)) man'
|
||||
|
||||
# time
|
||||
alias now='date +"%T"'
|
||||
alias nowdate='date +"%d-%m-%Y"'
|
||||
alias cal='cal --monday'
|
||||
alias beeptime='beep -D 400 -l 400 -r "$(date +%I)" -f 440 -n -D 1000 -l 0 -n -D 800 -l 200 -f 880 -r "$(($(date +%M)/15+1))"'
|
||||
|
||||
# vim
|
||||
alias vi='nvim'
|
||||
alias svi="sudo --preserve-env nvim"
|
||||
|
||||
# git
|
||||
for al in s d di co col cob ds u ps pst pl pr hs last lastd df amend br fuck sw swl swc swb
|
||||
do
|
||||
alias "g${al}"="git ${al}"
|
||||
done
|
||||
|
||||
|
||||
# net
|
||||
alias ports='ss -tlnp'
|
||||
alias wget='wget -c'
|
||||
alias ip='ip -c'
|
||||
alias fastping='ping -c 100 -i 0.1'
|
||||
|
||||
alias www='serveit'
|
||||
|
||||
# hardware
|
||||
alias reboot='sudo /sbin/reboot'
|
||||
alias poweroff='sudo /sbin/poweroff'
|
||||
alias suspend='sudo systemctl suspend'
|
||||
alias halt='sudo /sbin/halt'
|
||||
alias shutdown='sudo /sbin/shutdown now'
|
||||
|
||||
alias meminfo='free -mlth'
|
||||
|
||||
# python
|
||||
alias pipir='pip install -r requirements.txt'
|
||||
alias pipar='pip list --not-required --format freeze | tee requirements.txt'
|
||||
alias vd='deactivate'
|
||||
|
||||
|
||||
# docker
|
||||
alias dc='docker compose'
|
||||
alias dcl='docker compose logs -f'
|
||||
alias drmc='docker container prune'
|
||||
alias drmi='docker image prune'
|
||||
alias dpsa='docker ps -a'
|
||||
|
||||
alias gb='gobuild'
|
||||
|
||||
|
||||
# tmux
|
||||
alias dt='tmux detach'
|
||||
|
||||
# x11
|
||||
alias caps='xdotool key Caps_Lock'
|
||||
alias CAPS='xdotool key Caps_Lock'
|
||||
|
||||
alias colors='for i in {0..255}; do printf "\x1b[38;5;${i}mcolor${i} - ██████████\n"; done'
|
||||
|
||||
|
||||
alias paste.thek4n.ru='curl --data-binary @- "https://paste.thek4n.ru/" 2>/dev/null'
|
||||
alias pastewww='paste.thek4n.ru'
|
||||
|
||||
alias copy='tee /dev/stderr | \copy'
|
||||
|
||||
alias ssh='TERM=xterm-256color ssh'
|
||||
alias sshn='ssh -S none'
|
||||
|
||||
alias black='magick canvas:none PNG:- | feh --class black -YFx -'
|
||||
alias ex='extract'
|
||||
|
||||
# Notes
|
||||
alias notes='note'
|
||||
alias n='note'
|
||||
alias ns='note sync'
|
||||
alias ne='note edit'
|
||||
alias nfe='note fe'
|
||||
alias nfg='note fg'
|
||||
alias ng='note git'
|
||||
alias sn='mdpreview --browser --host localhost --port 0 "$(note --prefix)"'
|
||||
|
||||
|
||||
# Cargo
|
||||
alias cr='cargo run'
|
||||
alias crr='cargo run --release'
|
||||
alias cb='cargo build'
|
||||
alias cbr='cargo build --release'
|
||||
alias ct='cargo test'
|
||||
alias cf='cargo fmt'
|
||||
alias cl='cargo clippy --release'
|
||||
|
||||
|
||||
alias p='player'
|
||||
|
||||
# :)
|
||||
alias PINK='beep -f 233 -l 440 -n -f 349 -l 440 -n -f 196 -l 440 -n -f 330 -l 650'
|
||||
|
||||
alias -g L='2>&1 | $PAGER'
|
||||
alias -g H='| head'
|
||||
alias -g T='| tail'
|
||||
alias -g HL='| highlight -O ansi -S '
|
||||
alias -g JSON='| json HL json'
|
||||
alias -g DI='| diff'
|
||||
alias -g ?='| grep'
|
||||
alias -g ?='| grep -i'
|
||||
alias -g G='| grep -i'
|
||||
alias -g C='| wc -l'
|
||||
|
||||
alias -g O="1>/dev/null"
|
||||
alias -g R="2>/dev/null"
|
||||
alias -g Q="&>/dev/null"
|
||||
alias -g BG="Q &"
|
||||
alias -g CO='--color=always'
|
||||
|
||||
alias -g ...='../..'
|
||||
alias -g ....='../../..'
|
||||
alias -g .3='../../..'
|
||||
alias -g .....='../../../..'
|
||||
alias -g .4='../../../..'
|
||||
alias -g ......='../../../../..'
|
||||
alias -g .5='../../../../..'
|
||||
|
||||
alias -g D="DISPLAY=:0.0"
|
||||
alias -g XT="TERM=xterm"
|
||||
alias -g GP="GOPROXY=direct"
|
||||
|
||||
alias -g DN=">/dev/null"
|
||||
alias -g 2DN="2>/dev/null"
|
||||
alias -g ADN="&>/dev/null"
|
||||
alias -g BG="&>/dev/null &" # background
|
||||
|
||||
alias -g RED='2> >(while read line; do printf "\033[0;31m${line}\033[0m\n"; done)'
|
||||
|
||||
alias -g BEEP='&& beep -f 800 -l 250 -n -f 1000 -l 500 || beep -f 800 -l 250 -n -f 500 -l 500'
|
||||
|
||||
alias -s mp4='vlc'
|
||||
alias -s mp3='audacious'
|
||||
alias -s flac='audacious'
|
||||
if [[ "${OSTYPE}" == "linux-android"* ]]; then
|
||||
alias -g BEEP='&& termux-notification --sound --vibrate 500,1000,200'
|
||||
fi
|
||||
|
||||
alias -g WAKE='BEEP; notify-send --urgency normal Wake'
|
||||
|
||||
|
||||
alias -g PROXY='http_proxy="socks5://${SOCKS5_SERVER:-localhost}"'
|
||||
|
||||
81
home/user/.config/zsh/autoenv
Normal file
81
home/user/.config/zsh/autoenv
Normal file
@ -0,0 +1,81 @@
|
||||
: ${AUTOENV_AUTH_FILE:=~/.autoenv_auth}
|
||||
: ${AUTOENV_FILE_ENTER:=.autoenv.zsh}
|
||||
: ${AUTOENV_FILE_LEAVE:=.autoenv_leave.zsh}
|
||||
: ${AUTOENV_DISABLED:=0}
|
||||
: ${AUTOENV_HANDLE_LEAVE:=1}
|
||||
|
||||
|
||||
_autoenv_hash_pair() {
|
||||
local env_file="${1:A}"
|
||||
|
||||
if [ ! -s "${env_file}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local env_cksum=${${:-$(cksum "${env_file}")}[1]}
|
||||
printf "%s:%s" "${env_file}" "${env_cksum}"
|
||||
}
|
||||
|
||||
_autoenv_envfile_authorize() {
|
||||
local env_cksum="$(_autoenv_hash_pair "${1}")"
|
||||
|
||||
local line
|
||||
for line in $(<"${AUTOENV_AUTH_FILE}")
|
||||
do
|
||||
if [ "${line}" == "${env_cksum}" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
_autoenv_source_if_authorized() {
|
||||
local file_to_source="${1}"
|
||||
|
||||
if [ ! -s "${file_to_source}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! _autoenv_envfile_authorize "${file_to_source}"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
source "${file_to_source}"
|
||||
}
|
||||
|
||||
_autoenv() {
|
||||
_autoenv_source_if_authorized "${PWD}/${AUTOENV_FILE_ENTER}"
|
||||
}
|
||||
|
||||
_autoenv_leave() {
|
||||
_autoenv_source_if_authorized "${OLDPWD}/${AUTOENV_FILE_LEAVE}"
|
||||
}
|
||||
|
||||
if [[ "${AUTOENV_DISABLED}" != 1 ]]; then
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd _autoenv
|
||||
|
||||
if [[ "${AUTOENV_HANDLE_LEAVE}" == 1 ]]; then
|
||||
add-zsh-hook chpwd _autoenv_leave
|
||||
fi
|
||||
|
||||
_autoenv_source_if_authorized "${PWD}/${AUTOENV_FILE_ENTER}"
|
||||
fi
|
||||
|
||||
|
||||
autoenv-auth() {
|
||||
echo >> "${AUTOENV_AUTH_FILE}"
|
||||
if [ -s "${PWD}/${AUTOENV_FILE_ENTER}" ]; then
|
||||
_autoenv_hash_pair "${PWD}/${AUTOENV_FILE_ENTER}" >> "${AUTOENV_AUTH_FILE}"
|
||||
echo >> "${AUTOENV_AUTH_FILE}"
|
||||
fi
|
||||
|
||||
if [ -s "${PWD}/${AUTOENV_FILE_LEAVE}" ]; then
|
||||
_autoenv_hash_pair "${PWD}/${AUTOENV_FILE_LEAVE}" >> "${AUTOENV_AUTH_FILE}"
|
||||
echo >> "${AUTOENV_AUTH_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# vim: ft=zsh
|
||||
@ -1,23 +0,0 @@
|
||||
# calculator
|
||||
autoload -U zcalc
|
||||
|
||||
function __calc {
|
||||
zcalc -f -e "$*"
|
||||
}
|
||||
aliases[calc]='noglob __calc'
|
||||
aliases[=]='noglob __calc'
|
||||
|
||||
|
||||
function accept-line() {
|
||||
if [[ $BUFFER =~ '^[ ]?\(?[-+]?[0-9]+[^a-zA-Z]+' ]]; then
|
||||
echo
|
||||
test "$BUFFER[1]" != " " && print -S -- "$BUFFER" # saving the command to history
|
||||
__calc "$BUFFER" | sed 's/\.$//'
|
||||
BUFFER=
|
||||
fi
|
||||
zle .$WIDGET
|
||||
}
|
||||
|
||||
zle -N accept-line
|
||||
|
||||
# vim: ft=zsh
|
||||
@ -1,15 +1,19 @@
|
||||
|
||||
# enable completion features
|
||||
# vim: ft=zsh
|
||||
fpath=(~/.zfunc $fpath)
|
||||
zmodload zsh/complist
|
||||
setopt menucomplete
|
||||
autoload -Uz compinit
|
||||
compinit -d ~/.cache/zcompdump
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
compinit -d ~/.cache/zsh/.zcompdump
|
||||
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path "${HOME}/.cache/zsh/.zcompcache"
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' auto-description 'specify: %d'
|
||||
zstyle ':completion:*' completer _expand _complete _correct _approximate
|
||||
zstyle ':completion:*' format 'Completing %d'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
|
||||
zstyle ':completion:*' rehash true
|
||||
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
||||
@ -17,10 +21,72 @@ zstyle ':completion:*' use-compctl false
|
||||
zstyle ':completion:*' verbose true
|
||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||
zstyle ':completion:*:*:extract:*' file-patterns '*.tar* *.lzma *.bz2 *.zip *.7z'
|
||||
zstyle ':completion:*' complete-options true
|
||||
zstyle ':completion:*' squeeze-slashes true
|
||||
|
||||
zstyle ':completion:*:match:*' original only
|
||||
zstyle ':completion:*:*:(eza|ls):*' file-sort modification
|
||||
|
||||
zstyle ':completion:*' completer _expand _complete _ignored _prefix _list
|
||||
|
||||
zstyle ':completion:*:correct:*' completer _correct
|
||||
zstyle ':completion:*:approximate:*' completer _approximate
|
||||
zstyle ':completion:*:correct:*' max-errors 1
|
||||
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
||||
|
||||
|
||||
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
|
||||
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
|
||||
|
||||
zstyle ':completion:*' squeeze-slashes true
|
||||
|
||||
zstyle ':completion:*:cd:*' ignore-parents parent pwd
|
||||
|
||||
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
|
||||
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
|
||||
|
||||
|
||||
|
||||
bindkey -M menuselect '^h' vi-backward-char
|
||||
bindkey -M menuselect '^k' vi-up-line-or-history
|
||||
bindkey -M menuselect '^j' vi-down-line-or-history
|
||||
bindkey -M menuselect '^l' vi-forward-char
|
||||
bindkey -M menuselect '^e' undo
|
||||
bindkey -M menuselect '^[' accept
|
||||
bindkey -M menuselect '^M' check-command
|
||||
bindkey -M menuselect '^I' accept-and-infer-next-history
|
||||
bindkey '^l' menu-select
|
||||
|
||||
setopt AUTO_PARAM_SLASH
|
||||
setopt COMPLETE_IN_WORD
|
||||
unsetopt menucomplete
|
||||
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
|
||||
compdef _directories _d
|
||||
compdef _files _f
|
||||
compdef _directories mcd
|
||||
|
||||
|
||||
_gcim_completion() {
|
||||
local -a commit_types
|
||||
|
||||
commit_types=(
|
||||
'fix:Fix errors'
|
||||
'feat:New features'
|
||||
'chore:Routine chore'
|
||||
'docs:Documentation changes'
|
||||
'style:Code style'
|
||||
'refactor:Refactoring'
|
||||
'perf:Performance improvements'
|
||||
'test:Add tests'
|
||||
'revert:Revert changes'
|
||||
'ci:CI/CD changes'
|
||||
'build:Build system changes'
|
||||
)
|
||||
_describe 'commit message type in format CT1: "type(optional-scope): description"' commit_types -S ''
|
||||
}
|
||||
|
||||
function _gcim() {
|
||||
noglob git cim "${*}"
|
||||
}
|
||||
compdef _gcim_completion _gcim
|
||||
|
||||
alias gcim='noglob _gcim'
|
||||
|
||||
72
home/user/.config/zsh/functions
Normal file
72
home/user/.config/zsh/functions
Normal file
@ -0,0 +1,72 @@
|
||||
# vim: ft=zsh
|
||||
|
||||
mcd() {
|
||||
local dir
|
||||
if [ -z "${1}" ]; then
|
||||
dir="$(mktemp -ut "${USER:-user}.XXXX")"
|
||||
else
|
||||
dir="${1}"
|
||||
fi
|
||||
readonly dir
|
||||
|
||||
mkdir -p "${dir}" && cd "${dir}"
|
||||
}
|
||||
|
||||
ve() {
|
||||
local -r venv_name="${1:-venv}"
|
||||
python3 -m venv "${venv_name}" && . "${venv_name}/bin/activate"
|
||||
}
|
||||
|
||||
va() {
|
||||
if [[ -v 1 ]]; then
|
||||
if [[ -f "${1}/bin/activate" ]]; then
|
||||
source "${1}/bin/activate"
|
||||
return 0
|
||||
fi
|
||||
echo "va: error: virtual environment ${1} not found, use 'python3 -m venv ${1}'" >&2
|
||||
return 1$
|
||||
fi
|
||||
|
||||
if [[ -f "./venv/bin/activate" ]]; then
|
||||
source "./venv/bin/activate"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local activate_venv
|
||||
activate_venv="$(find -P . -maxdepth 3 -type f -wholename '*/bin/activate' | sort | head -n 1)"
|
||||
readonly activate_venv
|
||||
|
||||
if [[ -f "${activate_venv}" ]]; then
|
||||
source "${activate_venv}"
|
||||
return 0
|
||||
else
|
||||
echo "va: error: virtual environment not found, use python3 -m venv venv" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
top-commands() {
|
||||
local -r num_args="${1:-1}"
|
||||
|
||||
if ! [[ "${num_args}" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo "error: usage: top-commands [N]" >&2
|
||||
echo "error: N must be a positive non-zero integer." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
fc -l -n 1 | awk 'NF' | awk -v n="$num_args" '{
|
||||
end = (NF < n) ? NF : n
|
||||
for (i = 1; i <= end; i++) {
|
||||
printf "%s%s", $i, (i == end ? "\n" : OFS)
|
||||
}
|
||||
}' | sort | uniq -c | sort -nr | sed 's/^[[:space:]]*//'
|
||||
}
|
||||
|
||||
cargo-init() {
|
||||
if [[ ! -v 1 ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
cargo init "${1}" && cd "${1}" && \
|
||||
return "${?}"
|
||||
}
|
||||
@ -11,7 +11,15 @@ setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a dupl
|
||||
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
|
||||
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
||||
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
|
||||
setopt HIST_REDUCE_BLANKS # Убирать лишние пробелы из командных строк, добавляемых в историю.
|
||||
setopt HIST_NO_STORE # Не хранить записи о командах history.
|
||||
|
||||
|
||||
export HISTSIZE=100000
|
||||
export HISTFILESIZE="${HISTSIZE}"
|
||||
export HISTCONTROL=ignoreboth:erasedups
|
||||
export HISTTIMEFORMAT="%F %T "
|
||||
export HISTIGNORE="&:l[lsa\.]:[bf]g:exit:q:clear:c:history:h"
|
||||
export HISTORY_IGNORE='(cd|c|q|exit|l[sal.]|[bf]g#( *)#|..|lsl|ll[a.]|cd ..)'
|
||||
|
||||
# configure `time` format
|
||||
|
||||
0
home/user/.config/zsh/hosts/.gitkeep
Normal file
0
home/user/.config/zsh/hosts/.gitkeep
Normal file
125
home/user/.config/zsh/mappings
Normal file
125
home/user/.config/zsh/mappings
Normal file
@ -0,0 +1,125 @@
|
||||
# vim: ft=zsh
|
||||
|
||||
KEYTIMEOUT=1
|
||||
# Activate vim mode.
|
||||
bindkey -v
|
||||
|
||||
bindkey -M visual 'i' vi-insert
|
||||
bindkey -M visual 'a' vi-add-next
|
||||
|
||||
|
||||
# Yank to the system clipboard
|
||||
function vi-yank-xclip {
|
||||
zle vi-yank
|
||||
echo -n "$CUTBUFFER" | \copy
|
||||
}
|
||||
|
||||
zle -N vi-yank-xclip
|
||||
bindkey -M visual 'y' vi-yank-xclip
|
||||
|
||||
|
||||
bindkey ' ' magic-space
|
||||
|
||||
bindkey '^K' up-line-or-history # C-k
|
||||
bindkey -M vicmd '^K' up-line-or-history # C-k
|
||||
|
||||
bindkey '^J' down-line-or-history # C-j
|
||||
bindkey -M vicmd '^J' down-line-or-history # C-j
|
||||
|
||||
bindkey '^U' kill-whole-line # C-u
|
||||
bindkey -M vicmd '^U' kill-whole-line # C-u
|
||||
|
||||
bindkey -M viins '\e.' insert-last-word # M-.
|
||||
|
||||
bindkey '^[[Z' reverse-menu-complete # S-Tab
|
||||
|
||||
|
||||
bindkey -M viins '`' autosuggest-accept
|
||||
bindkey -M vicmd '`' autosuggest-accept
|
||||
|
||||
bindkey -M viins '^?' backward-delete-char
|
||||
bindkey -M vicmd '^?' backward-delete-char
|
||||
|
||||
bindkey -M viins '^W' backward-delete-word
|
||||
bindkey -M vicmd '^W' backward-delete-word
|
||||
|
||||
bindkey -M viins '^H' backward-delete-char
|
||||
bindkey -M vicmd '^H' backward-delete-char
|
||||
|
||||
|
||||
insert-sudo() {
|
||||
local sudo_template="${SUDO:=sudo} "
|
||||
local template_len="${#sudo_template}"
|
||||
|
||||
if [ -z "${LBUFFER}${RBUFFER}" ]; then
|
||||
zle up-history
|
||||
if [ ! "${LBUFFER::$template_len}" = "$sudo_template" ]; then
|
||||
LBUFFER="${sudo_template}${LBUFFER}"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "${LBUFFER::$template_len}" = "$sudo_template" ]; then
|
||||
LBUFFER="${LBUFFER:$template_len}"
|
||||
else
|
||||
LBUFFER="${sudo_template}${LBUFFER}"
|
||||
fi
|
||||
}
|
||||
|
||||
zle -N insert-sudo
|
||||
|
||||
bindkey -M vicmd '^S' insert-sudo # C-s
|
||||
bindkey -M viins '^S' insert-sudo # C-s
|
||||
|
||||
|
||||
popdquiet() {
|
||||
popd &>/dev/null
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N popdquiet
|
||||
bindkey "^P" popdquiet
|
||||
bindkey -M vicmd "^P" popdquiet
|
||||
|
||||
|
||||
cddotdot() {
|
||||
cd ..
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N cddotdot
|
||||
bindkey "^O" cddotdot
|
||||
bindkey -M vicmd "^O" cddotdot
|
||||
|
||||
fzfhistory() {
|
||||
local cmd
|
||||
cmd=$(fc -il 1 | \
|
||||
awk '{
|
||||
original = $0;
|
||||
clean = $0;
|
||||
sub(/^[ ]*[0-9]+[ ]+[0-9]{4}-[0-9]{2}-[0-9]{2}[ ]+[0-9]{2}:[0-9]{2}[ ]*/, "", clean);
|
||||
print clean "\t" original
|
||||
}' | \
|
||||
fzf \
|
||||
--ignore-case \
|
||||
--scheme=history \
|
||||
--no-multi \
|
||||
--tac \
|
||||
--tiebreak=begin,index \
|
||||
--height="$((${LINES}/4))" \
|
||||
--query="${BUFFER}" \
|
||||
--delimiter=$'\t' \
|
||||
--with-nth=1 \
|
||||
--preview="echo {2} | sed 's/\\\n/\\n/g' | highlight -O ansi -S zsh" \
|
||||
--preview-window=wrap:30%:50% | \
|
||||
cut -f1 | sed 's/\\n/\n/g')
|
||||
|
||||
if [[ -n "${cmd}" ]]; then
|
||||
BUFFER="${cmd}"
|
||||
CURSOR=$#BUFFER
|
||||
fi
|
||||
|
||||
zle reset-prompt
|
||||
}
|
||||
|
||||
zle -N fzfhistory
|
||||
bindkey "^R" fzfhistory
|
||||
bindkey -M vicmd "^R" fzfhistory
|
||||
@ -6,6 +6,11 @@ setopt notify # report the status of background jobs immediately
|
||||
setopt numericglobsort # sort filenames numerically when it makes sense
|
||||
setopt promptsubst # enable command substitution in prompt
|
||||
setopt noflowcontrol # disable C-s mapping
|
||||
setopt autocd
|
||||
|
||||
DIRSTACKSIZE=8
|
||||
setopt autopushd
|
||||
setopt pushdignoredups
|
||||
|
||||
WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word
|
||||
|
||||
@ -44,44 +49,4 @@ precmd_functions+=(_fix_cursor)
|
||||
# 6 -> steady bar, xterm.
|
||||
|
||||
|
||||
# Activate vim mode.
|
||||
bindkey -v
|
||||
|
||||
bindkey -M viins 'jf' vi-cmd-mode
|
||||
|
||||
bindkey ' ' magic-space # history expansion on space
|
||||
|
||||
bindkey '^K' up-line-or-history # C-k
|
||||
bindkey -M vicmd '^K' up-line-or-history # C-k
|
||||
|
||||
bindkey '^J' down-line-or-history # C-j
|
||||
bindkey -M vicmd '^J' down-line-or-history # C-j
|
||||
|
||||
bindkey -M vicmd '^U' kill-whole-line # C-u
|
||||
bindkey -M viins '^U' kill-whole-line # C-u
|
||||
|
||||
bindkey -M viins '\e.' insert-last-word # M-.
|
||||
bindkey '^[[Z' reverse-menu-complete # S-Tab
|
||||
|
||||
|
||||
zle_highlight=('paste:bg=24,fg=15', 'region:bg=24,fg=15') # colors of visual select
|
||||
|
||||
|
||||
insert-sudo() {
|
||||
local sudo_template="${SUDO:=sudo} "
|
||||
local template_len="${#sudo_template}"
|
||||
|
||||
if [ -z "${LBUFFER}${RBUFFER}" ]; then
|
||||
zle up-history
|
||||
fi
|
||||
if [ "${LBUFFER::$template_len}" = "$sudo_template" ]; then
|
||||
LBUFFER="${LBUFFER:$template_len}"
|
||||
else
|
||||
LBUFFER="${sudo_template}${LBUFFER}"
|
||||
fi
|
||||
}
|
||||
|
||||
zle -N insert-sudo
|
||||
|
||||
bindkey -M vicmd '^S' insert-sudo # C-s
|
||||
bindkey -M viins '^S' insert-sudo # C-s
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
# vim: ft=zsh
|
||||
|
||||
# enable color support of ls, less and man, and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
@ -15,18 +17,3 @@ if [ -x /usr/bin/dircolors ]; then
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
fi
|
||||
|
||||
|
||||
# enable auto-suggestions based on the history
|
||||
if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
|
||||
. /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
# change suggestion color
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999'
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$(command -v pyenv >/dev/null)" ]; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
||||
@ -1,20 +1,18 @@
|
||||
so () {
|
||||
[ -f "$1" ] && source "$1"
|
||||
}
|
||||
|
||||
# vim ft=zsh
|
||||
|
||||
|
||||
install_if_not_exists() {
|
||||
local path="$HOME/.config/zsh/plugins/$1"
|
||||
if [ ! -d "$path" ]; then
|
||||
git clone "https://github.com/$1" "$path"
|
||||
local path="${HOME}/.config/zsh/plugins/${1}"
|
||||
if [ ! -d "${path}" ]; then
|
||||
/usr/bin/git clone "https://github.com/${1}" "${path}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_if_not_exists zsh-users/zsh-autosuggestions
|
||||
install_if_not_exists zsh-users/zsh-syntax-highlighting
|
||||
install_if_not_exists hlissner/zsh-autopair
|
||||
install_if_not_exists unixorn/fzf-zsh-plugin
|
||||
|
||||
so ~/.config/zsh/plugins/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
so ~/.config/zsh/plugins/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
so ~/.config/zsh/plugins/hlissner/zsh-autopair/autopair.zsh
|
||||
so ~/.config/zsh/plugins/unixorn/fzf-zsh-plugin/fzf-zsh-plugin.plugin.zsh
|
||||
_so "${HOME}/.config/zsh/plugins/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
_so "${HOME}/.config/zsh/plugins/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
_so "${HOME}/.config/zsh/plugins/hlissner/zsh-autopair/autopair.zsh"
|
||||
|
||||
@ -1,28 +1,39 @@
|
||||
# vim: ft=zsh
|
||||
|
||||
_so() {
|
||||
[ -r "$1" ] && [ -f "$1" ] && source "$1"
|
||||
[ -r "${1}" ] && [ -f "${1}" ] && source "${1}"
|
||||
}
|
||||
|
||||
_sod() {
|
||||
local -r dir_to_source="${1}"
|
||||
|
||||
if [ -d "${dir_to_source}" ] && [ -n "$(ls "${dir_to_source}")" ]; then
|
||||
local filename
|
||||
for filename in $(ls "${dir_to_source}" | sort -n)
|
||||
do
|
||||
# shellcheck disable=SC1090
|
||||
source "${dir_to_source}/${filename}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
_so "$XDG_CONFIG_HOME/bash/export"
|
||||
_so "$XDG_CONFIG_HOME/bash/aliases"
|
||||
_so "$XDG_CONFIG_HOME/bash/functions"
|
||||
_so "$XDG_CONFIG_HOME/bash/hosts/$HOST"
|
||||
source "${ZDOTDIR}/options"
|
||||
source "${ZDOTDIR}/completion"
|
||||
source "${ZDOTDIR}/history"
|
||||
source "${ZDOTDIR}/prompt"
|
||||
source "${ZDOTDIR}/other"
|
||||
source "${ZDOTDIR}/aliases"
|
||||
source "${ZDOTDIR}/functions"
|
||||
|
||||
_so "${ZDOTDIR}/hosts/${HOST}"
|
||||
|
||||
_so /etc/zsh_command_not_found
|
||||
_so "$ZDOTDIR/options"
|
||||
_so "$ZDOTDIR/completion"
|
||||
_so "$ZDOTDIR/history"
|
||||
_so "$ZDOTDIR/prompt"
|
||||
_so "$ZDOTDIR/other"
|
||||
_so "$ZDOTDIR/aliases"
|
||||
source "${ZDOTDIR}/plugin"
|
||||
|
||||
_so "$ZDOTDIR/plugin"
|
||||
source "${ZDOTDIR}/autoenv"
|
||||
|
||||
_so "$ZDOTDIR/calculator"
|
||||
source "${ZDOTDIR}/mappings"
|
||||
|
||||
bindkey '`' autosuggest-accept
|
||||
source "${ZDOTDIR}/accept_line"
|
||||
|
||||
_sod "$ZDOTDIR/zshrc.d"
|
||||
_sod "${ZDOTDIR}/zshrc.d"
|
||||
|
||||
3
home/user/.config/zsh/zshrc.d/00_zhashd.sh
Normal file
3
home/user/.config/zsh/zshrc.d/00_zhashd.sh
Normal file
@ -0,0 +1,3 @@
|
||||
# Example:
|
||||
# hash -d pa=~/code/ProcessAgent2
|
||||
# cd ~pa
|
||||
44
home/user/.docker/cli-plugins/docker-health
Executable file
44
home/user/.docker/cli-plugins/docker-health
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "docker-cli-plugin-metadata" ]; then
|
||||
cat << HERE
|
||||
{
|
||||
"SchemaVersion": "0.1.0",
|
||||
"Vendor": "Thek4n",
|
||||
"Version": "0.1.0",
|
||||
"ShortDescription": "Check health of docker container"
|
||||
}
|
||||
HERE
|
||||
exit
|
||||
fi
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: docker health CONTAINER
|
||||
|
||||
Check health of docker container
|
||||
EOF
|
||||
}
|
||||
|
||||
shift
|
||||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
readonly CONTAINER="$1"
|
||||
|
||||
if [ -z "$CONTAINER" ]; then
|
||||
echo "Error: Container name was not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
status="$(docker container inspect --format='{{index .State.Health.Status}}' "$CONTAINER")"
|
||||
readonly status
|
||||
|
||||
echo "$status"
|
||||
test "$status" = 'healthy'
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user