diff --git a/.gitignore b/.gitignore
index 9b800d5..4bf3f70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,6 @@ 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/00_zhashd.sh
home/user/.config/zsh/.zcalc_history
diff --git a/README.md b/README.md
index 166e70a..681ec9a 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,6 @@
## Project description
Config files for:
-* bash
* zsh
* alacritty
* tmux
@@ -37,17 +36,17 @@ Config files for:
-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!"
```
## Installation
-```bash
+```sh
git clone https://github.com/TheK4n/dotfiles
cd dotfiles
./install zsh nvim ...
diff --git a/etc/update-motd.d/10-figlet b/etc/update-motd.d/10-figlet
index f29a95b..a3cbfbc 100755
--- a/etc/update-motd.d/10-figlet
+++ b/etc/update-motd.d/10-figlet
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
echo
figlet -ct -f banner "welcome mr.kan"
echo
\ No newline at end of file
diff --git a/etc/update-motd.d/20-service-status.example b/etc/update-motd.d/20-service-status.example
index 971155c..7359546 100755
--- a/etc/update-motd.d/20-service-status.example
+++ b/etc/update-motd.d/20-service-status.example
@@ -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"'
fi
diff --git a/home/user/.config/zsh/completion b/home/user/.config/zsh/completion
index e31de36..11c69f1 100644
--- a/home/user/.config/zsh/completion
+++ b/home/user/.config/zsh/completion
@@ -29,9 +29,6 @@ zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*:cd:*' ignore-parents parent pwd
-autoload bashcompinit
-bashcompinit
-
compdef _directories _d
compdef _files _f
compdef _directories mcd
\ No newline at end of file
diff --git a/home/user/.docker/cli-plugins/docker-health b/home/user/.docker/cli-plugins/docker-health
index 81ca98b..2347832 100755
--- a/home/user/.docker/cli-plugins/docker-health
+++ b/home/user/.docker/cli-plugins/docker-health
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
+if [ "$1" = "docker-cli-plugin-metadata" ]; then
cat << HERE
{
"SchemaVersion": "0.1.0",
@@ -22,7 +22,7 @@ EOF
shift
-if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
exit 0
fi
diff --git a/home/user/.docker/cli-plugins/docker-ips b/home/user/.docker/cli-plugins/docker-ips
index 80ae9ed..1e8053f 100755
--- a/home/user/.docker/cli-plugins/docker-ips
+++ b/home/user/.docker/cli-plugins/docker-ips
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
+if [ "$1" = "docker-cli-plugin-metadata" ]; then
cat << HERE
{
"SchemaVersion": "0.1.0",
@@ -22,23 +22,24 @@ EOF
shift
-if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
exit 0
fi
set -e
-result="CONTAINER NAME;IMAGE;IP\n"
-for container in $(docker ps -q | tr '\n' ' ')
-do
- 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)"
+(
+ printf "CONTAINER NAME;IMAGE;IP\n"
+ for container in $(docker ps -q | tr '\n' ' ')
+ do
+ 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"
-done
+ printf "%s;%s;%s\n" "${container_name#/}" "${image_name}" "${ip}"
+ done
+) | column -t -s ";"
-echo -e "$result" 2>/dev/null | column -t -s ";"
exit 0
\ No newline at end of file
diff --git a/home/user/.docker/cli-plugins/docker-shell b/home/user/.docker/cli-plugins/docker-shell
index a1649fb..4796d0c 100755
--- a/home/user/.docker/cli-plugins/docker-shell
+++ b/home/user/.docker/cli-plugins/docker-shell
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
+if [ "$1" = "docker-cli-plugin-metadata" ]; then
cat << HERE
{
"SchemaVersion": "0.1.0",
@@ -22,7 +22,7 @@ EOF
shift
-if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
exit 0
fi
diff --git a/home/user/.tmux/dotfiles b/home/user/.tmux/dotfiles
index 6fd7067..7eb21dc 100755
--- a/home/user/.tmux/dotfiles
+++ b/home/user/.tmux/dotfiles
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
set -eux
diff --git a/home/user/.tmux/example-background-job b/home/user/.tmux/example-background-job
index 65372cd..dd82a3d 100644
--- a/home/user/.tmux/example-background-job
+++ b/home/user/.tmux/example-background-job
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
set -eu
set -m # enable background jobs
@@ -7,7 +7,7 @@ readonly SESSION=example-background-job
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}"
fi
@@ -18,13 +18,13 @@ tmux switch-client -t "${SESSION}"
temp_script="$(mktemp)"
readonly temp_script
cat > "${temp_script}" << EOF
-#!/bin/bash
+#!/bin/sh
cleanup() {
rm \$0 # remove self after exit
}
-trap cleanup EXIT ERR
+trap cleanup EXIT
sleep 3
tmux send-keys -t "${SESSION}:${MAINW}.1" 'echo hello' Enter
diff --git a/home/user/.tmux/sandbox b/home/user/.tmux/sandbox
index 4eb8e7d..e37a582 100755
--- a/home/user/.tmux/sandbox
+++ b/home/user/.tmux/sandbox
@@ -1,15 +1,21 @@
-#!/usr/bin/env bash
+#!/bin/sh
set -eux
-declare -r SESSION_PREFIX="sandbox"
-declare RND="${RANDOM}"
-declare SESSION="${SESSION_PREFIX}${RND}"
+random() {
+ 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
do
- RND="${RANDOM}"
+ RND="$(random)"
SESSION="${SESSION_PREFIX}${RND}"
done
@@ -17,7 +23,6 @@ readonly RND
readonly SESSION
-declare WORKING_PROJECT
WORKING_PROJECT="$(mktemp -td "${SESSION_PREFIX}${RND}.XXXX")"
readonly WORKING_PROJECT
diff --git a/home/user/.tmux/ssh b/home/user/.tmux/ssh
index 91e8c84..e21cde4 100755
--- a/home/user/.tmux/ssh
+++ b/home/user/.tmux/ssh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
set -eu
@@ -6,20 +6,18 @@ SSH_SERVERS="$(grep 'Host ' "${HOME}/.ssh/config" | sed 's/^Host //')"
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}')"
-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
fi
-SSH_SERVER_SESSION_NAME="${SSH_SERVER//\./-}"
-SSH_SERVER_SESSION_NAME="${SSH_SERVER_SESSION_NAME//:/-}"
-SSH_SERVER_SESSION_NAME="${SSH_SERVER_SESSION_NAME%% *}"
-declare -r SESSION="ssh_${SSH_SERVER_SESSION_NAME}"
+SSH_SERVER_SESSION_NAME="$(echo "${SSH_SERVER%% *}" | sed 's/\./\-/g ; s/\:/\-/g')"
+readonly SESSION="ssh_${SSH_SERVER_SESSION_NAME}"
if ! tmux has-session -t "${SESSION}" 2>/dev/null; then
diff --git a/install-hooks/arch/pre-install b/install-hooks/arch/pre-install
index 0a82c69..d871be5 100755
--- a/install-hooks/arch/pre-install
+++ b/install-hooks/arch/pre-install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
echo 'pacman -S man-pages man-db lesspipe'
echo 'echo "ParallelDownloads = 5\nVerbosePkgLists" >> /etc/pacman.conf'
diff --git a/install-hooks/font/pre-install b/install-hooks/font/pre-install
index 86331ee..79b6c3a 100755
--- a/install-hooks/font/pre-install
+++ b/install-hooks/font/pre-install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
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"
git clone 'https://github.com/powerline/fonts.git' --depth=1
cd fonts
-./install.sh
+./install.sh
\ No newline at end of file
diff --git a/install-hooks/git/post-install b/install-hooks/git/post-install
old mode 100644
new mode 100755
index 5e943d3..7e36cf1
--- a/install-hooks/git/post-install
+++ b/install-hooks/git/post-install
@@ -1,8 +1,8 @@
-#!/usr/bin/env bash
+#!/bin/sh
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 github.user "$USER"
-git config --global github.email "${USER}@${HOST:-$HOSTNAME}"
+git config --global github.email "${USER}@${HOST}"
\ No newline at end of file
diff --git a/install-hooks/gpg/post-install b/install-hooks/gpg/post-install
index 43c11a3..826aa41 100755
--- a/install-hooks/gpg/post-install
+++ b/install-hooks/gpg/post-install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
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
\ No newline at end of file
diff --git a/install-hooks/i3/pre-install b/install-hooks/i3/pre-install
index b441701..b7dce52 100755
--- a/install-hooks/i3/pre-install
+++ b/install-hooks/i3/pre-install
@@ -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"
\ No newline at end of file
diff --git a/install-hooks/nvim/pre-install b/install-hooks/nvim/pre-install
index 0155204..6d07987 100755
--- a/install-hooks/nvim/pre-install
+++ b/install-hooks/nvim/pre-install
@@ -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'"
\ No newline at end of file
diff --git a/install-hooks/ranger/post-install b/install-hooks/ranger/post-install
index 976870b..0048cfd 100755
--- a/install-hooks/ranger/post-install
+++ b/install-hooks/ranger/post-install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
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"
\ No newline at end of file
diff --git a/install-hooks/ranger/pre-install b/install-hooks/ranger/pre-install
index 6e0b939..ee22c97 100755
--- a/install-hooks/ranger/pre-install
+++ b/install-hooks/ranger/pre-install
@@ -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"
\ No newline at end of file
diff --git a/install-hooks/ssh/post-install b/install-hooks/ssh/post-install
index b07711b..f12fa6a 100755
--- a/install-hooks/ssh/post-install
+++ b/install-hooks/ssh/post-install
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/bin/sh
-cat "$SUB/.ssh/config" >> "$HOME/.ssh/config"
+cat "$SUB/.ssh/config" >> "$HOME/.ssh/config"
\ No newline at end of file
diff --git a/install-hooks/termux/post-install b/install-hooks/termux/post-install
index fcd395d..dea5c5c 100755
--- a/install-hooks/termux/post-install
+++ b/install-hooks/termux/post-install
@@ -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"
else
cp -r "$SUB/.shortcuts" "$HOME"
diff --git a/install-hooks/termux/pre-install b/install-hooks/termux/pre-install
index c86bb12..0bd24f7 100755
--- a/install-hooks/termux/pre-install
+++ b/install-hooks/termux/pre-install
@@ -1,3 +1,3 @@
-#!/usr/bin/env bash
+#!/bin/sh
-echo "apt install termux-api tsu"
+echo "apt install termux-api tsu"
\ No newline at end of file
diff --git a/install-hooks/tmux/post-install b/install-hooks/tmux/post-install
index 3fdca5f..e3fb9f2 100755
--- a/install-hooks/tmux/post-install
+++ b/install-hooks/tmux/post-install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
command -v systemctl >/dev/null && systemctl --user enable --now tmux
git clone https://github.com/tmux-plugins/tpm "$HOME/.config/tmux/plugins/tpm" | true
\ No newline at end of file
diff --git a/opt/bin/sandbox b/opt/bin/sandbox
index 112dad6..2cc112f 100755
--- a/opt/bin/sandbox
+++ b/opt/bin/sandbox
@@ -1,5 +1,5 @@
-#!/usr/bin/env bash
+#!/bin/sh
# useradd -md /home/sandbox -s $0 sandbox
# usermod -aG docker sandbox
# 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
\ No newline at end of file