Skip to content

Commit

Permalink
feat(skim): install
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed Nov 4, 2024
1 parent 65ccd9c commit eb7c08d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bashrc.d/bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .bashrc

alias bat="batcat"
4 changes: 1 addition & 3 deletions init.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
13 changes: 13 additions & 0 deletions scripts/skim.sh
Original file line number Diff line number Diff line change
@@ -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."

0 comments on commit eb7c08d

Please sign in to comment.