scripts
This commit is contained in:
parent
dd52f1afe6
commit
719baaf847
@ -6,7 +6,7 @@ PACKAGES=(
|
|||||||
|
|
||||||
linux base linux-firmware lvm2 sudo polkit # base
|
linux base linux-firmware lvm2 sudo polkit # base
|
||||||
pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # device management
|
pulseaudio pulseaudio-bluetooth bluez bluez-utils networkmanager udisks2 # device management
|
||||||
openssh man-db htop # admin utils
|
openssh sysstat screen man-db # system
|
||||||
|
|
||||||
nodejs dash jq # runtime
|
nodejs dash jq # runtime
|
||||||
qemu-system-x86 # virt
|
qemu-system-x86 # virt
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ]; then
|
|
||||||
echo "bad args" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEST=$(realpath "$2")
|
|
||||||
cd "$1"
|
|
||||||
|
|
||||||
#shellcheck disable=SC2016
|
|
||||||
find . \
|
|
||||||
-type f \
|
|
||||||
-not -path '*/.*' \
|
|
||||||
-path "$3" | \
|
|
||||||
xargs -0 -d \\n -n 1 sh -c "mkdir -p $DEST/\$(dirname \"\$1\")" sh
|
|
||||||
|
|
||||||
#shellcheck disable=SC2016
|
|
||||||
find . \
|
|
||||||
-type f \
|
|
||||||
-not -path '*/.*' \
|
|
||||||
-path "$3" \
|
|
||||||
-printf "$(pwd)/%P\n$DEST/%P\n" | \
|
|
||||||
xargs -0 -d \\n -n 2 sh -c "$4" sh
|
|
||||||
|
|
||||||
|
|
||||||
#for rel in $(find . -type f -name *.gpg); do
|
|
||||||
# DESTFILE=$(echo $DEST/$rel | sed 's/\.[^.]*$//')
|
|
||||||
# [ -f "$DESTFILE" ] && continue
|
|
||||||
# mkdir -p "$(dirname "$DESTFILE")"
|
|
||||||
# gpg --output "$DESTFILE" --decrypt "$rel"
|
|
||||||
#done
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -z "$PASSPHRASE" ]; then
|
|
||||||
read -srp "Password: " PASSPHRASE
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
export PASSPHRASE
|
|
||||||
|
|
||||||
bash ~/.local/bin/alg/file-tree-apply.sh "$1" "$2" '*.gpg' \
|
|
||||||
'if [ ! -f "$2" ]; then gpg --decrypt "$1" | gpg --symmetric --output "$2" --passphrase "$PASSPHRASE" --batch --yes; fi'
|
|
||||||
|
|
||||||
echo ok
|
|
26
arch-user/bin/qemu/arch.sh
Executable file
26
arch-user/bin/qemu/arch.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo Error: no name >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! screen -ls | grep -q qemu-arch; then
|
||||||
|
screen-detach "qemu-arch-$1" \
|
||||||
|
qemu-system-x86_64 "$HOME/lfs/vm/$1" \
|
||||||
|
-display none \
|
||||||
|
-m 2G \
|
||||||
|
-accel kvm -cpu host \
|
||||||
|
-net nic -net user,hostfwd=tcp:127.0.0.1:2222-:22
|
||||||
|
fi
|
||||||
|
|
||||||
|
screen -ls | grep qemu-arch
|
||||||
|
if ! screen -ls | grep -q "qemu-arch-$1"; then
|
||||||
|
echo Error: another kind is running >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
ssh arch@127.0.0.1 -p 2222 && break
|
||||||
|
sleep 5
|
||||||
|
done
|
9
arch-user/bin/screen/detach.sh
Executable file
9
arch-user/bin/screen/detach.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
session_name="$1"
|
||||||
|
shift
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
cmd="$(printf "%q " "$@")"
|
||||||
|
qcmd="$(printf "%q " "$cmd")"
|
||||||
|
echo -e ". ~/.bashrc\nhistory -s "$qcmd"\necho "$qcmd"\n$cmd && exit" > "$tmpfile"
|
||||||
|
screen -S "$session_name" -dm bash --init-file "$tmpfile"
|
@ -9,3 +9,5 @@ alias grep='grep --color=auto'
|
|||||||
|
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
PS1='\[\033[38;2;153;136;255m\]\u@\h:\W\$\[\033[0m\]\[\e[0;91m\]${?#0}\[\e[0m\] '
|
PS1='\[\033[38;2;153;136;255m\]\u@\h:\W\$\[\033[0m\]\[\e[0;91m\]${?#0}\[\e[0m\] '
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export PASSWORD_STORE_DIR="$HOME/know/id"
|
export PASSWORD_STORE_DIR="$HOME/know/id"
|
||||||
export PASSWORD_STORE_GENERATED_LENGTH=16
|
export PASSWORD_STORE_GENERATED_LENGTH=16
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export INPUTRC="$HOME/.config/readline/inputrc"
|
export INPUTRC="$HOME/.config/readline/inputrc"
|
||||||
|
2
arch-user/config/screen/env.sh
Executable file
2
arch-user/config/screen/env.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
export SCREENRC="$HOME/.config/screen/screenrc"
|
1
arch-user/config/screen/screenrc
Normal file
1
arch-user/config/screen/screenrc
Normal file
@ -0,0 +1 @@
|
|||||||
|
termcapinfo * ti@:te@
|
@ -135,7 +135,7 @@ bindsym --to-code {
|
|||||||
# basic scripts
|
# basic scripts
|
||||||
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
|
$mod+Colon exec ~/.local/bin/sway/command-mode.sh
|
||||||
$mod+Return exec footclient
|
$mod+Return exec footclient
|
||||||
$mod+Space exec run.sh
|
$mod+Space exec ~/.local/bin/bemenu/run.sh
|
||||||
}
|
}
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ mkdir -p "${USER_DIRS[@]}"
|
|||||||
########## scripts #############
|
########## scripts #############
|
||||||
cp -rf bin/* ~/.local/bin
|
cp -rf bin/* ~/.local/bin
|
||||||
|
|
||||||
LN_EXCLUDE_DIRS=(i3blocks bemenu)
|
LN_EXCLUDE_DIRS=(i3blocks bemenu sway)
|
||||||
|
|
||||||
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
|
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
|
||||||
for sdir in bin/*; do
|
for sdir in bin/*; do
|
||||||
@ -59,7 +59,7 @@ for sdir in bin/*; do
|
|||||||
-exec rm {} \;
|
-exec rm {} \;
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
find ~/.local/bin/"$sdir" -maxdepth 1 -type f -perm -u+rwx | \
|
find ~/.local/bin/"$sdir" -maxdepth 1 -type f -perm -u+rwx | \
|
||||||
xargs -0 -d \\n -n 1 sh -c 'ln -s "$1" "/$HOME/.local/bin/$(basename "$(dirname "$1")")-${1##*/}"' sh
|
xargs -0 -d \\n -n 1 sh -c 'ln -s "$1" "/$HOME/.local/bin/$(basename "$(dirname "$1")")-$(basename "$1" .sh)"' sh
|
||||||
done
|
done
|
||||||
################################
|
################################
|
||||||
|
|
||||||
|
3
linux-compat/home/env.sh
Executable file
3
linux-compat/home/env.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export BASIC_PACMAN="vim less"
|
Loading…
Reference in New Issue
Block a user