diff --git a/bashrc.d/bat b/bashrc.d/bat new file mode 100644 index 0000000..b936e2a --- /dev/null +++ b/bashrc.d/bat @@ -0,0 +1,3 @@ +# .bashrc + +alias bat="batcat" diff --git a/init.sh b/init.sh index dcee3d8..b62c430 100755 --- a/init.sh +++ b/init.sh @@ -1,10 +1,8 @@ #!/bin/bash set -o errexit -selection="$(find scripts/ -type f -printf "%f\n" | awk -F '.' '{ print $1 }' | sort | bin/sk --multi --bind 'right:select-all,left:deselect-all,space:toggle+up' --preview="bin/bat --color=always scripts/{}.sh --color=always")" - if test $# -eq 0; then - _prompt + selection="$(find scripts/ -type f -printf "%f\n" | awk -F '.' '{ print $1 }' | sort | sk --multi --bind 'right:select-all,left:deselect-all,space:toggle+up' --preview="bat --color=always scripts/{}.sh --color=always")" else selection="$(echo "$@" | tr ' ' '\n' | sort -u | tr '\n' ' ' | xargs echo | sort)" echo "$selection" diff --git a/scripts/skim.sh b/scripts/skim.sh new file mode 100644 index 0000000..02341f8 --- /dev/null +++ b/scripts/skim.sh @@ -0,0 +1,13 @@ +#!/bin/sh +if [ -f /etc/fedora-release ]; then + sudo dnf install -y skim +elif [ -f /etc/lsb-release ] || [ -f /etc/os-release ] ; then + mkdir -p /tmp/skim/ + cd /tmp/skim + wget -qO- https://raw.githubusercontent.com/lotabout/skim/master/install | bash + sudo install bin/sk /usr/local/bin +else + echo "Unsupported distribution. This script only supports Fedora and Ubuntu." + exit 1 +fi +echo "Skim has been successfully installed."