Robert 3 months ago
parent 00718d7558
commit b8e889875e
  1. 23
      .aliases.d/0-define-editors.sh
  2. 8
      scripts/helper/scan_aliases.sh

@ -1,2 +1,21 @@
# clear out the screen
clear
# to change default editor change order here:
editors=("nano" "pico" "neovim" "vim" "vi" "emacs")
geditors=("geany" "brackets" "notepadqq" "code" "medit" "gnome-text-editor" "mousepad" "leafpad" "kwrite" "kate" "pluma" "xed" "sublime" "atom" "gvim")
for editor in "${editors[@]}"; do
full_path=$(command -v "$editor" 2> /dev/null)
if [ -n "$full_path" ]; then
export EDITOR="$full_path"
break
fi
done
for geditor in "${geditors[@]}"; do
full_path=$(command -v "$geditor" 2> /dev/null)
if [ -n "$full_path" ]; then
export VISUAL="$full_path"
break
fi
done
alias ,='$EDITOR'
vis() { $VISUAL $@ & }
alias @='vis'

@ -95,7 +95,7 @@ prompter_for_fix() {
good=1
if [ ! -f "$SANE_CHECKER" ]; then
echo -e "\033[0;34m 1st run added to sane sum file! \033[0m"
$SHA_SUM_APP {~/scripts/*.sh,~/.aliases.d/*.sh,~/.bash_aliases,~/.bashrc,~/.bash_logout,~/scripts/helper/.git_bash_prompt,~/.profile,~/scripts/helper/.kube-ps1,~/scripts/helper/theme} > "$tmpsum" 2>/dev/null
$SHA_SUM_APP {~/scripts/*.sh,~/scripts/helper/*.sh,~/.aliases.d/*.sh,~/.bash_aliases,~/.bashrc,~/.bash_logout,~/scripts/helper/.git_bash_prompt,~/.profile,~/scripts/helper/.kube-ps1,~/scripts/helper/theme} > "$tmpsum" 2>/dev/null
require_root "$SANE_CHECKER" "$tmpsum"
good=0
else
@ -123,6 +123,12 @@ check_certificates() {
SANE_TEST_FAILED=1
fi
done
for FILE in ~/scripts/helper/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"
SANE_TEST_FAILED=1
fi
done
for FILE in ~/.aliases.d/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"

Loading…
Cancel
Save