remove bash
This commit is contained in:
parent
7f66492f2a
commit
e978486393
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,8 +3,6 @@ home/user/.config/zsh/plugins/*
|
|||||||
home/user/.config/nvim/plugin
|
home/user/.config/nvim/plugin
|
||||||
home/user/.config/nvim/spell
|
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/*
|
||||||
!home/user/.config/zsh/zshrc.d/00_zhashd.sh
|
!home/user/.config/zsh/zshrc.d/00_zhashd.sh
|
||||||
home/user/.config/zsh/.zcalc_history
|
home/user/.config/zsh/.zcalc_history
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
## Project description
|
## Project description
|
||||||
|
|
||||||
Config files for:
|
Config files for:
|
||||||
* bash
|
|
||||||
* zsh
|
* zsh
|
||||||
* alacritty
|
* alacritty
|
||||||
* tmux
|
* tmux
|
||||||
@ -37,17 +36,17 @@ Config files for:
|
|||||||
<img src=".assets/prompt.png" alt="Prompt">
|
<img src=".assets/prompt.png" alt="Prompt">
|
||||||
</p>
|
</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:\
|
Example:\
|
||||||
`~/.config/bash/bashrc.d/01_hello.sh`
|
`~/.config/zsh/zshrc.d/01_hello.sh`
|
||||||
```bash
|
```sh
|
||||||
echo "Hello $USER!"
|
echo "Hello $USER!"
|
||||||
```
|
```
|
||||||
|
|
||||||
<a id="chapter-1"></a>
|
<a id="chapter-1"></a>
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
git clone https://github.com/TheK4n/dotfiles
|
git clone https://github.com/TheK4n/dotfiles
|
||||||
cd dotfiles
|
cd dotfiles
|
||||||
./install zsh nvim ...
|
./install zsh nvim ...
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
echo
|
echo
|
||||||
figlet -ct -f banner "welcome mr.kan"
|
figlet -ct -f banner "welcome mr.kan"
|
||||||
echo
|
echo
|
||||||
@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo wg0 status: $(systemctl is-active wg-quick@wg0.service)
|
echo "wg0 status: $(systemctl is-active wg-quick@wg0.service)"
|
||||||
|
|
||||||
if ! systemctl is-active wg-quick@wg0.service &>/dev/null; then
|
if ! systemctl is-active wg-quick@wg0.service 1>/dev/null; then
|
||||||
echo 'Executing this command may fix wireguard: "sudo apt update && sudo apt install linux-headers-$(uname -r) && sudo reboot"'
|
echo 'Executing this command may fix wireguard: "sudo apt update && sudo apt install linux-headers-$(uname -r) && sudo reboot"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -29,9 +29,6 @@ zstyle ':completion:*' squeeze-slashes true
|
|||||||
|
|
||||||
zstyle ':completion:*:cd:*' ignore-parents parent pwd
|
zstyle ':completion:*:cd:*' ignore-parents parent pwd
|
||||||
|
|
||||||
autoload bashcompinit
|
|
||||||
bashcompinit
|
|
||||||
|
|
||||||
compdef _directories _d
|
compdef _directories _d
|
||||||
compdef _files _f
|
compdef _files _f
|
||||||
compdef _directories mcd
|
compdef _directories mcd
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
|
if [ "$1" = "docker-cli-plugin-metadata" ]; then
|
||||||
cat << HERE
|
cat << HERE
|
||||||
{
|
{
|
||||||
"SchemaVersion": "0.1.0",
|
"SchemaVersion": "0.1.0",
|
||||||
@ -22,7 +22,7 @@ EOF
|
|||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
|
if [ "$1" = "docker-cli-plugin-metadata" ]; then
|
||||||
cat << HERE
|
cat << HERE
|
||||||
{
|
{
|
||||||
"SchemaVersion": "0.1.0",
|
"SchemaVersion": "0.1.0",
|
||||||
@ -22,23 +22,24 @@ EOF
|
|||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
result="CONTAINER NAME;IMAGE;IP\n"
|
|
||||||
|
|
||||||
for container in $(docker ps -q | tr '\n' ' ')
|
(
|
||||||
do
|
printf "CONTAINER NAME;IMAGE;IP\n"
|
||||||
ip="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container" 2>/dev/null)"
|
for container in $(docker ps -q | tr '\n' ' ')
|
||||||
container_name="$(docker inspect --format='{{.Name}}' "$container" 2>/dev/null)"
|
do
|
||||||
image_name="$(docker inspect --format='{{.Config.Image}}' "$container" 2>/dev/null)"
|
ip="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container" 2>/dev/null)"
|
||||||
|
container_name="$(docker inspect --format='{{.Name}}' "$container" 2>/dev/null)"
|
||||||
|
image_name="$(docker inspect --format='{{.Config.Image}}' "$container" 2>/dev/null)"
|
||||||
|
|
||||||
result+="${container_name#"/"};${image_name};${ip}\n"
|
printf "%s;%s;%s\n" "${container_name#/}" "${image_name}" "${ip}"
|
||||||
done
|
done
|
||||||
|
) | column -t -s ";"
|
||||||
|
|
||||||
echo -e "$result" 2>/dev/null | column -t -s ";"
|
|
||||||
exit 0
|
exit 0
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
|
if [ "$1" = "docker-cli-plugin-metadata" ]; then
|
||||||
cat << HERE
|
cat << HERE
|
||||||
{
|
{
|
||||||
"SchemaVersion": "0.1.0",
|
"SchemaVersion": "0.1.0",
|
||||||
@ -22,7 +22,7 @@ EOF
|
|||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
|
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
set -m # enable background jobs
|
set -m # enable background jobs
|
||||||
@ -7,7 +7,7 @@ readonly SESSION=example-background-job
|
|||||||
readonly MAINW=1
|
readonly MAINW=1
|
||||||
|
|
||||||
|
|
||||||
if tmux has-session -t "${SESSION}" &>/dev/null; then
|
if tmux has-session -t "${SESSION}" 2>/dev/null; then
|
||||||
tmux kill-session -t "${SESSION}"
|
tmux kill-session -t "${SESSION}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -18,13 +18,13 @@ tmux switch-client -t "${SESSION}"
|
|||||||
temp_script="$(mktemp)"
|
temp_script="$(mktemp)"
|
||||||
readonly temp_script
|
readonly temp_script
|
||||||
cat > "${temp_script}" << EOF
|
cat > "${temp_script}" << EOF
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm \$0 # remove self after exit
|
rm \$0 # remove self after exit
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup EXIT ERR
|
trap cleanup EXIT
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
tmux send-keys -t "${SESSION}:${MAINW}.1" 'echo hello' Enter
|
tmux send-keys -t "${SESSION}:${MAINW}.1" 'echo hello' Enter
|
||||||
|
|||||||
@ -1,15 +1,21 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
declare -r SESSION_PREFIX="sandbox"
|
|
||||||
|
|
||||||
declare RND="${RANDOM}"
|
random() {
|
||||||
declare SESSION="${SESSION_PREFIX}${RND}"
|
seq 0 65535 | shuf | head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly SESSION_PREFIX="sandbox"
|
||||||
|
|
||||||
|
|
||||||
|
RND="$(random)"
|
||||||
|
SESSION="${SESSION_PREFIX}${RND}"
|
||||||
|
|
||||||
while tmux has-session -t "${SESSION}" 2>/dev/null
|
while tmux has-session -t "${SESSION}" 2>/dev/null
|
||||||
do
|
do
|
||||||
RND="${RANDOM}"
|
RND="$(random)"
|
||||||
SESSION="${SESSION_PREFIX}${RND}"
|
SESSION="${SESSION_PREFIX}${RND}"
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -17,7 +23,6 @@ readonly RND
|
|||||||
readonly SESSION
|
readonly SESSION
|
||||||
|
|
||||||
|
|
||||||
declare WORKING_PROJECT
|
|
||||||
WORKING_PROJECT="$(mktemp -td "${SESSION_PREFIX}${RND}.XXXX")"
|
WORKING_PROJECT="$(mktemp -td "${SESSION_PREFIX}${RND}.XXXX")"
|
||||||
readonly WORKING_PROJECT
|
readonly WORKING_PROJECT
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
@ -6,20 +6,18 @@ SSH_SERVERS="$(grep 'Host ' "${HOME}/.ssh/config" | sed 's/^Host //')"
|
|||||||
HOSTS="$(grep -v '^#' /etc/hosts)"
|
HOSTS="$(grep -v '^#' /etc/hosts)"
|
||||||
HISTORY_HOSTS="$(grep ssh "${HOME}/.zsh_history" | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
HISTORY_HOSTS="$(grep ssh "${HOME}/.zsh_history" | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
|
||||||
|
|
||||||
ALL_HOSTS="$(echo "$SSH_SERVERS" "$HOSTS" "$HISTORY_HOSTS" | grep -v '\*'| sed 's/ /\n/g' | sed '/^$/d' | sort | uniq | tac)"
|
ALL_HOSTS="$(echo "$SSH_SERVERS" "$HOSTS" "$HISTORY_HOSTS" | grep -v '\*'| sed 's/ /\n/g ; /^$/d' | sort | uniq | tac)"
|
||||||
|
|
||||||
SSH_SERVER="$(echo -n "$ALL_HOSTS" | fzf +m --print-query --bind 'tab:replace-query' | tail -n 1)"
|
SSH_SERVER="$(echo "$ALL_HOSTS" | fzf +m --print-query --bind 'tab:replace-query' | tail -n 1)"
|
||||||
|
|
||||||
|
|
||||||
if [[ -z "${SSH_SERVER}" ]]; then
|
if [ -z "${SSH_SERVER}" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
SSH_SERVER_SESSION_NAME="${SSH_SERVER//\./-}"
|
SSH_SERVER_SESSION_NAME="$(echo "${SSH_SERVER%% *}" | sed 's/\./\-/g ; s/\:/\-/g')"
|
||||||
SSH_SERVER_SESSION_NAME="${SSH_SERVER_SESSION_NAME//:/-}"
|
readonly SESSION="ssh_${SSH_SERVER_SESSION_NAME}"
|
||||||
SSH_SERVER_SESSION_NAME="${SSH_SERVER_SESSION_NAME%% *}"
|
|
||||||
declare -r SESSION="ssh_${SSH_SERVER_SESSION_NAME}"
|
|
||||||
|
|
||||||
|
|
||||||
if ! tmux has-session -t "${SESSION}" 2>/dev/null; then
|
if ! tmux has-session -t "${SESSION}" 2>/dev/null; then
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo 'pacman -S man-pages man-db lesspipe'
|
echo 'pacman -S man-pages man-db lesspipe'
|
||||||
echo 'echo "ParallelDownloads = 5\nVerbosePkgLists" >> /etc/pacman.conf'
|
echo 'echo "ParallelDownloads = 5\nVerbosePkgLists" >> /etc/pacman.conf'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
sub="$HOME/.local/share/fonts"
|
sub="$HOME/.local/share/fonts"
|
||||||
|
|
||||||
@ -8,4 +8,4 @@ wget 'https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.
|
|||||||
unzip FiraCode.zip -d "$sub"
|
unzip FiraCode.zip -d "$sub"
|
||||||
git clone 'https://github.com/powerline/fonts.git' --depth=1
|
git clone 'https://github.com/powerline/fonts.git' --depth=1
|
||||||
cd fonts
|
cd fonts
|
||||||
./install.sh
|
./install.sh
|
||||||
6
install-hooks/git/post-install
Normal file → Executable file
6
install-hooks/git/post-install
Normal file → Executable file
@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
git config --global user.name "$USER"
|
git config --global user.name "$USER"
|
||||||
git config --global user.email "${USER}@${HOST:-$HOSTNAME}"
|
git config --global user.email "${USER}@${HOST}"
|
||||||
git config --global user.signingkey "$USER"
|
git config --global user.signingkey "$USER"
|
||||||
|
|
||||||
git config --global github.user "$USER"
|
git config --global github.user "$USER"
|
||||||
git config --global github.email "${USER}@${HOST:-$HOSTNAME}"
|
git config --global github.email "${USER}@${HOST}"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
cat "$SUB/.gnupg/gpg.conf" >> "$HOME/.gnupg/gpg.conf"
|
cat "$SUB/.gnupg/gpg.conf" >> "$HOME/.gnupg/gpg.conf"
|
||||||
echo -e "default-cache-ttl 1\nmax-cache-ttl 1" > "$HOME/.gnupg/gpg-agent.conf"; echo RELOADAGENT | gpg-connect-agent
|
echo -e "default-cache-ttl 1\nmax-cache-ttl 1" > "$HOME/.gnupg/gpg-agent.conf"; echo RELOADAGENT | gpg-connect-agent
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo "sudo pacman -S nitrogen picom compton ttf-font-awesome xdotool xclip maim playerctl rofi"
|
echo "sudo pacman -S nitrogen picom compton ttf-font-awesome xdotool xclip maim playerctl rofi"
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo "sudo pacman -S npm ctags fzf glow; mkdir ~/.npm-global; npm config set prefix '~/.npm-global'"
|
echo "sudo pacman -S npm ctags fzf glow; mkdir ~/.npm-global; npm config set prefix '~/.npm-global'"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
mkdir -p "$SANDBOX_PATH/.config/ranger/plugins"
|
mkdir -p "$SANDBOX_PATH/.config/ranger/plugins"
|
||||||
git clone https://github.com/alexanderjeurissen/ranger_devicons "$SANDBOX_PATH/.config/ranger/plugins/ranger_devicons"
|
git clone https://github.com/alexanderjeurissen/ranger_devicons "$SANDBOX_PATH/.config/ranger/plugins/ranger_devicons"
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo "sudo pacman -S highlight ttf-joypixels noto-fonts-emoji ueberzug poppler"
|
echo "sudo pacman -S highlight ttf-joypixels noto-fonts-emoji ueberzug poppler"
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
cat "$SUB/.ssh/config" >> "$HOME/.ssh/config"
|
cat "$SUB/.ssh/config" >> "$HOME/.ssh/config"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
if [[ -d "$HOME/.shortcuts" ]]; then
|
if [ -d "$HOME/.shortcuts" ]; then
|
||||||
cp "$SUB/.shortcuts/*" "$HOME/.shortcuts"
|
cp "$SUB/.shortcuts/*" "$HOME/.shortcuts"
|
||||||
else
|
else
|
||||||
cp -r "$SUB/.shortcuts" "$HOME"
|
cp -r "$SUB/.shortcuts" "$HOME"
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo "apt install termux-api tsu"
|
echo "apt install termux-api tsu"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
command -v systemctl >/dev/null && systemctl --user enable --now tmux
|
command -v systemctl >/dev/null && systemctl --user enable --now tmux
|
||||||
git clone https://github.com/tmux-plugins/tpm "$HOME/.config/tmux/plugins/tpm" | true
|
git clone https://github.com/tmux-plugins/tpm "$HOME/.config/tmux/plugins/tpm" | true
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
# useradd -md /home/sandbox -s $0 sandbox
|
# useradd -md /home/sandbox -s $0 sandbox
|
||||||
# usermod -aG docker sandbox
|
# usermod -aG docker sandbox
|
||||||
# echo "$0" | sudo tee -a /etc/shells # for pam
|
# echo "$0" | sudo tee -a /etc/shells # for pam
|
||||||
exec docker run --rm -it --name sandbox -v sandbox:/root -w /root --network none alpine
|
exec docker run --rm -it --name sandbox -v sandbox:/root -w /root --network none alpine
|
||||||
Loading…
x
Reference in New Issue
Block a user