diff --git a/README.md b/README.md index 57eff966..8865b6a7 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,8 @@ The Asciiville project includes many curated Ascii Art galleries. These include hundreds of high resolution Ascii Art files created by Asciiville author and artist, Dr. Ronald Joe Record. The Asciiville package, when installed, provides the following Ascii Art galleries -located in the default Ascii Art Gallery folder `/usr/share/asciiville/art/`: +located in the default Ascii Art Gallery folder `/usr/share/asciiville/art/` +(`/usr/local/share/asciiville/art/` on `macOS`): ``` Art - A collection of fine art transformed into Ascii Art diff --git a/bin/any2ascii b/bin/any2ascii index fdc4bd6b..5daa3cd3 100755 --- a/bin/any2ascii +++ b/bin/any2ascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ## @file any2ascii ## @brief Convert from any audio/video or image format to Ascii diff --git a/bin/asciibrow b/bin/asciibrow index 3a460072..3355e26a 100755 --- a/bin/asciibrow +++ b/bin/asciibrow @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # asciibrow - frontend using mpv/socli/w3m for opening urls # diff --git a/bin/asciisplash b/bin/asciisplash index 56b76c99..be364358 100755 --- a/bin/asciisplash +++ b/bin/asciisplash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # asciisplash - display Asciiville splash screens using ASCIImatics # diff --git a/bin/asciiville b/bin/asciiville index d295cb9e..687a13af 100755 --- a/bin/asciiville +++ b/bin/asciiville @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # _ _ _ _ __ __ # / \ (_) (_) (_) [ | [ | # / _ \ .--. .---. __ __ _ __ __ | | | | .---. @@ -93,11 +93,11 @@ CONFIG="${HOME}/.config/asciiville/config" # Backwards compatibility with older Asciiville config [ -d "${ARTDIR}" ] || { - LOC_ARTDIR=$(echo "${ARTDIR}" | sed -e "s%/usr/%/usr/local/%") + LOC_ARTDIR=$(echo "${ARTDIR}" | ${SED} -e "s%/usr/%/usr/local/%") [ -d "${LOC_ARTDIR}" ] && ARTDIR="${LOC_ARTDIR}" } [ -d "${MUSEDIR}" ] || { - LOC_MUSEDIR=$(echo "${MUSEDIR}" | sed -e "s%/usr/%/usr/local/%") + LOC_MUSEDIR=$(echo "${MUSEDIR}" | ${SED} -e "s%/usr/%/usr/local/%") [ -d "${LOC_MUSEDIR}" ] && MUSEDIR="${LOC_MUSEDIR}" } saved_art_size=${art_font_size} @@ -702,7 +702,7 @@ add_fullscreen() { [ "${have_wmctrl}" ] && { [ "${have_xprop}" ] && { # The things a man must do - win_id=$(wmctrl -lp | grep $(xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | awk '{print $5}' | sed 's/,//' | sed 's/^0x/0x0/') | awk ' { print $1 } ') + win_id=$(wmctrl -lp | grep $(xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | awk '{print $5}' | ${SED} 's/,//' | ${SED} 's/^0x/0x0/') | awk ' { print $1 } ') [ "${win_id}" ] && xprop -id ${win_id} | grep _NET_WM_STATE | grep FULLSCREEN >/dev/null && isfull=1 } [ "${isfull}" ] || { @@ -777,10 +777,10 @@ show_art_file() { num_exp='^[0-9]+$' termname=unknown myppid=$(ps -e | grep ${PPID} | awk ' { print $1 } ') - myppid=$(echo ${myppid} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + myppid=$(echo ${myppid} | ${SED} -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') if [[ ${myppid} =~ ${num_exp} ]]; then parent=$(ps -o ppid= -p ${myppid}) - parent=$(echo ${parent} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + parent=$(echo ${parent} | ${SED} -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') if [[ ${parent} =~ ${num_exp} ]]; then termname=$(ps -e | grep ${parent} | awk ' { print $4 } ') fi @@ -883,10 +883,10 @@ play_show() { num_exp='^[0-9]+$' termname=unknown myppid=$(ps -e | grep ${PPID} | awk ' { print $1 } ') - myppid=$(echo ${myppid} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + myppid=$(echo ${myppid} | ${SED} -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') if [[ ${myppid} =~ ${num_exp} ]]; then parent=$(ps -o ppid= -p ${myppid}) - parent=$(echo ${parent} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + parent=$(echo ${parent} | ${SED} -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') if [[ ${parent} =~ ${num_exp} ]]; then termname=$(ps -e | grep ${parent} | awk ' { print $4 } ') fi @@ -2414,7 +2414,7 @@ show_art_menu() { break ;; *"Art Slideshow",* | *,*"Art Slideshow") - gallery_name=$(echo ${opt} | sed -e "s/ Art Slideshow//") + gallery_name=$(echo ${opt} | ${SED} -e "s/ Art Slideshow//") play_slide_show "${gallery_name}" break ;; @@ -2488,8 +2488,8 @@ show_art_menu() { fi audarg="-P -S ${SONG}" else - ASCSPLASH=$(echo ${ASCSPLASH} | sed -e "s# -a##" -e "s# -s ${SONG}##") - ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | sed -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH=$(echo ${ASCSPLASH} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") audarg= fi break @@ -2540,7 +2540,7 @@ show_art_menu() { if [ "${RECORD}" ]; then ASCSPLASH_TMUX="${ASCSPLASH_TMUX} -R" else - ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | sed -e "s/ -R//") + ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | ${SED} -e "s/ -R//") fi break ;; @@ -2784,20 +2784,20 @@ show_animation_menu() { export DISPLAY="" if [ "${AUDIO}" ]; then if [ "${custom_song}" ]; then - bash ${TOOLSBIN}/bb-tmux -a -s "${SONG}" + ${BASH} ${TOOLSBIN}/bb-tmux -a -s "${SONG}" else - bash ${TOOLSBIN}/bb-tmux -a + ${BASH} ${TOOLSBIN}/bb-tmux -a fi else - bash ${TOOLSBIN}/bb-tmux + ${BASH} ${TOOLSBIN}/bb-tmux fi skip_it_so=1 export DISPLAY="${SAVED_DISPLAY}" break ;; "Fluid"*,* | *,"Fluid"*) - COMMAND="bash -m ${TOP}/bin/show_endo" - COMMAND_TMUX="bash -m ${TOP}/bin/show_endo" + COMMAND="${BASH} -m ${TOP}/bin/show_endo" + COMMAND_TMUX="${BASH} -m ${TOP}/bin/show_endo" ASCSPLASH="${COMMAND}" ASCSPLASH_TMUX="${COMMAND_TMUX}" # trap -- '' SIGINT @@ -2925,8 +2925,8 @@ show_animation_menu() { fi audarg="-P -S ${SONG}" else - ASCSPLASH=$(echo ${ASCSPLASH} | sed -e "s# -a##" -e "s# -s ${SONG}##") - ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | sed -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH=$(echo ${ASCSPLASH} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") audarg= fi skip_it_so=1 @@ -2942,7 +2942,7 @@ show_animation_menu() { if [ "${RECORD}" ]; then ASCSPLASH_TMUX="${ASCSPLASH_TMUX} -R" else - ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | sed -e "s/ -R//") + ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | ${SED} -e "s/ -R//") fi skip_it_so=1 break @@ -3092,7 +3092,7 @@ show_journal_menu() { uses_tilda= [ "${first}" == "~" ] && { uses_tilda=1 - jloc=$(echo ${jloc} | sed -e "s/~//") + jloc=$(echo ${jloc} | ${SED} -e "s/~//") } if [ "${uses_tilda}" ]; then file ${HOME}${jloc} | grep -i terminator >/dev/null && encrypted=1 @@ -3354,9 +3354,13 @@ show_main_menu() { [ "${have_bb}" ] && options+=("AAlib Demo (Curses) [c]") [ "${have_mapscii}" ] && options+=("Mapscii World Map [w]") [ "${have_curl}" ] && options+=("Phase of the Moon [p]") - options+=("Run ${show_comm} in ${show_term} [C]") + if [ "${show_term}" == "Current" ]; then + options+=("Run ${show_comm} in ${show_term} [C]") + else + options+=("Run ${show_comm} in ${show_term} [C]") + fi [ "${have_ddgr}" ] && options+=("Search the Web [s]") - [ "${have_curl}" ] && [ -x ${TOOLSBIN}/pokefetch ] && { + [ "${have_curl}" ] && [ -f ${TOOLSBIN}/pokefetch ] && { check_display [ $? -eq 0 ] && options+=("Show a Pokemon [P]") } @@ -3498,9 +3502,9 @@ show_main_menu() { SAVED_DISPLAY="${DISPLAY}" export DISPLAY="" if [ "${AUDIO}" ]; then - bash ${TOOLSBIN}/bb-tmux -a + ${BASH} ${TOOLSBIN}/bb-tmux -a else - bash ${TOOLSBIN}/bb-tmux + ${BASH} ${TOOLSBIN}/bb-tmux fi skip_it_so=1 export DISPLAY="${SAVED_DISPLAY}" @@ -3508,9 +3512,9 @@ show_main_menu() { ;; "AAlib Demo (X11)",* | *,"AAlib Demo (X11)" | "x",* | *,"x") if [ "${AUDIO}" ]; then - bash ${TOOLSBIN}/bb-tmux -a + ${BASH} ${TOOLSBIN}/bb-tmux -a else - bash ${TOOLSBIN}/bb-tmux + ${BASH} ${TOOLSBIN}/bb-tmux fi skip_it_so=1 break @@ -3522,7 +3526,7 @@ show_main_menu() { break ;; "Show a Pok"*,* | *,"Show a Pok"* | "P",* | *,"P") - ${TOOLSBIN}/pokefetch + ${BASH} -c ${TOOLSBIN}/pokefetch read -p "Press Enter to continue" answer skip_it_so=1 break @@ -3551,7 +3555,7 @@ show_main_menu() { break ;; "Mapscii"*,* | *,"Mapscii"* | "w",* | *,"w") - mapscii + mapscii 2>/dev/null skip_it_so=1 break ;; @@ -3646,7 +3650,7 @@ show_main_menu() { if [ "${RECORD}" ]; then COMMAND_TMUX="${COMMAND_TMUX} -r" else - COMMAND_TMUX=$(echo ${COMMAND_TMUX} | sed -e "s/ -r//") + COMMAND_TMUX=$(echo ${COMMAND_TMUX} | ${SED} -e "s/ -r//") fi skip_it_so=1 break @@ -3667,8 +3671,8 @@ show_main_menu() { fi audarg="-P -S ${SONG}" else - ASCSPLASH=$(echo ${ASCSPLASH} | sed -e "s# -a##" -e "s# -s ${SONG}##") - ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | sed -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH=$(echo ${ASCSPLASH} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") + ASCSPLASH_TMUX=$(echo ${ASCSPLASH_TMUX} | ${SED} -e "s# -a##" -e "s# -s ${SONG}##") audarg= fi skip_it_so=1 @@ -3974,9 +3978,9 @@ set_show_term() { init_vars() { MTITLE="Asciiville" - COMMAND_TMUX="bash ${TOOLSBIN}/btop-tmux" + COMMAND_TMUX="${BASH} ${TOOLSBIN}/btop-tmux" ASCSPLASH="asciisplash" - ASCSPLASH_TMUX="bash ${TOOLSBIN}/asciisplash-tmux" + ASCSPLASH_TMUX="${BASH} ${TOOLSBIN}/asciisplash-tmux" [ "${AUDIO}" ] && [ "${have_mplayer}" ] && { ASCSPLASH="${ASCSPLASH} -a" ASCSPLASH_TMUX="${ASCSPLASH_TMUX} -a" @@ -4035,6 +4039,14 @@ have_tilix=$(type -p tilix) VENV_DIR="${HOME}/.venv" [ -f ${VENV_DIR}/bin/activate ] && source ${VENV_DIR}/bin/activate +BASH=bash +SED=sed +[ "${darwin}" ] && { + have_gsed=$(type -p gsed) + [ "${have_gsed}" ] && SED=gsed + [ -x /opt/homebrew/bin/bash ] && BASH=/opt/homebrew/bin/bash +} + FULLSCREEN= init_vars # Without any arguments, bring up interactive dialog menu @@ -4233,11 +4245,11 @@ while getopts "Aabc:CdD:E:fFgGiIjJkKlL:mMn:NpP:rRSs:tTUvV:wWxXyYzZu" flag; do COMMAND="${OPTARG}" case "${COMMAND}" in endo | Endo) - [ "${have_endo}" ] && bash -m ${TOP}/bin/show_endo + [ "${have_endo}" ] && ${BASH} -m ${TOP}/bin/show_endo exit 0 ;; maps | Maps) - [ "${have_mapscii}" ] && mapscii + [ "${have_mapscii}" ] && mapscii 2>/dev/null exit 0 ;; moon | Moon) @@ -4271,8 +4283,8 @@ while getopts "Aabc:CdD:E:fFgGiIjJkKlL:mMn:NpP:rRSs:tTUvV:wWxXyYzZu" flag; do check_display [ $? -eq 0 ] && { [ "${have_curl}" ] && { - [ -x ${TOOLSBIN}/pokefetch ] && { - ${TOOLSBIN}/pokefetch + [ -f ${TOOLSBIN}/pokefetch ] && { + ${BASH} -c ${TOOLSBIN}/pokefetch exit 0 } } diff --git a/bin/ascinit b/bin/ascinit index ce1bf93c..b43b5fee 100755 --- a/bin/ascinit +++ b/bin/ascinit @@ -1,10 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash # # ascinit - initialize Asciiville configuration files, install needed utilities # # shellcheck disable=SC2001,SC2002,SC2016,SC2006,SC2059,SC2086,SC2089,SC2181,SC2129 darwin= +SED=sed +MKTEMP=mktemp platform=$(uname -s) if [ "${platform}" == "Darwin" ]; then TOP="/usr/local" @@ -211,7 +213,7 @@ install_external_package() { } if [ "${debian}" ]; then [ "${have_wget}" ] && { - TEMP_DEB="$(mktemp --suffix=.deb)" + TEMP_DEB="$(${MKTEMP} --suffix=.deb)" wget --quiet -O "${TEMP_DEB}" "${DL_URL}" >/dev/null 2>&1 chmod 644 "${TEMP_DEB}" [ "${APT}" ] && sudo ${APT} install "${TEMP_DEB}" >/dev/null 2>&1 @@ -224,7 +226,7 @@ install_external_package() { # Until we sign Arch packages we need to download and install locally if [ "${arch}" ]; then [ "${have_wget}" ] && { - TEMP_ARCH="$(mktemp --suffix=.zst)" + TEMP_ARCH="$(${MKTEMP} --suffix=.zst)" wget --quiet -O "${TEMP_ARCH}" "${DL_URL}" >/dev/null 2>&1 chmod 644 "${TEMP_ARCH}" sudo pacman -U --noconfirm "${TEMP_ARCH}" >/dev/null 2>&1 @@ -233,10 +235,10 @@ install_external_package() { else [ "${darwin}" ] && { [ "${have_wget}" ] && { - TEMP_ARCH="$(mktemp --suffix=.tgz)" + TEMP_ARCH="$(${MKTEMP} --suffix=.tgz)" wget --quiet -O "${TEMP_ARCH}" "${DL_URL}" >/dev/null 2>&1 chmod 644 "${TEMP_ARCH}" - tar xzf "${TEMP_ARCH}" -C / + sudo tar xzf "${TEMP_ARCH}" -C / rm -f "${TEMP_ARCH}" } } @@ -317,7 +319,7 @@ install_kitty() { rm -f /tmp/kitty-$$.sh curl --insecure --silent --location \ https://sw.kovidgoyal.net/kitty/installer.sh >/tmp/kitty-$$.sh - cat /tmp/kitty-$$.sh | sed -e "s/curl -/curl -k/" >/tmp/k$$ + cat /tmp/kitty-$$.sh | ${SED} -e "s/curl -/curl -k/" >/tmp/k$$ cp /tmp/k$$ /tmp/kitty-$$.sh rm -f /tmp/k$$ } @@ -396,10 +398,10 @@ install_kitty() { for desktop in "${HOME}"/.local/share/applications/kitty*.desktop; do [ "${desktop}" == "${HOME}/.local/share/applications/kitty*.desktop" ] && continue [ -f /home/${MPP_USER}/${LOCAL}/share/icons/hicolor/256x256/apps/kitty.png ] && { - sed -i "s|Icon=kitty|Icon=/home/${MPP_USER}/${LOCAL}/share/icons/hicolor/256x256/apps/kitty.png|g" "${desktop}" + ${SED} -i "s|Icon=kitty|Icon=/home/${MPP_USER}/${LOCAL}/share/icons/hicolor/256x256/apps/kitty.png|g" "${desktop}" } [ -x /home/${MPP_USER}/${LOCAL}/bin/kitty ] && { - sed -i "s|Exec=kitty|Exec=/home/${MPP_USER}/${LOCAL}/bin/kitty|g" "${desktop}" + ${SED} -i "s|Exec=kitty|Exec=/home/${MPP_USER}/${LOCAL}/bin/kitty|g" "${desktop}" } done [ "${quiet}" ] || printf " done!\n" @@ -468,7 +470,10 @@ remove_durdraw() { } install_durdraw() { - [ -x ${CONFDIR}/tools/bin/install_durdraw ] && ${CONFDIR}/tools/bin/install_durdraw + [ -x ${CONFDIR}/tools/bin/install_durdraw ] && { + printf "\nInstalling Durdraw Ascii Editor\n" + ${CONFDIR}/tools/bin/install_durdraw --quiet + } } remove_neovim() { @@ -631,7 +636,8 @@ fi [ -f ${VENV_DIR}/bin/activate ] && source ${VENV_DIR}/bin/activate # Upgrade pip, setuptools -${PYTHON} -m pip install --upgrade setuptools pip >/dev/null 2>&1 +${PYTHON} -m pip install --upgrade pip >/dev/null 2>&1 +${PYTHON} -m pip install --upgrade setuptools wheel >/dev/null 2>&1 ask_anim= console= @@ -689,7 +695,6 @@ have_jq=$(type -p jq) have_wget=$(type -p wget) have_awk=$(type -p awk) have_fc=$(type -p fc-cache) -have_mktemp=$(type -p mktemp) have_unlink=$(type -p unlink) have_unzip=$(type -p unzip) @@ -944,13 +949,18 @@ durdraw_install= } [ "${have_awk}" ] || install_package awk [ "${have_fc}" ] || install_package fontconfig -# [ "${have_mktemp}" ] && { -# [ "${have_unlink}" ] || install_package coreutils -# } # Always attempt to install coreutils package install_package coreutils [ "${have_unzip}" ] || install_package unzip +# On macOS use GNU sed and mktemp from coreutils +[ "${darwin}" ] && { + have_gsed=$(type -p gsed) + [ "${have_gsed}" ] && SED=gsed + have_gmkt=$(type -p gmktemp) + [ "${have_gmkt}" ] && MKTEMP=gmktemp +} + # Mutt configuration user setup [ "${minimal}" ] || { [ -f ${CONFDIR}/mutt/muttrc ] && { @@ -1165,7 +1175,7 @@ fi BROWSER=default have_browser=1 fi - cat "${KITTYCONF}" | sed -e "s%__SET__BROWSER__%${BROWSER}%" >/tmp/browser$$ + cat "${KITTYCONF}" | ${SED} -e "s%__SET__BROWSER__%${BROWSER}%" >/tmp/browser$$ cp /tmp/browser$$ "${KITTYCONF}" rm -f /tmp/browser$$ } @@ -1392,26 +1402,26 @@ export PATH' if [ -f "${BASHINIT}" ]; then grep "export GOROOT" "${BASHINIT}" >/dev/null || { - echo "${GOTEXT}" | sed -e "s%__YYY__%${HOMEBREW_HOME}%" >>"${BASHINIT}" + echo "${GOTEXT}" | ${SED} -e "s%__YYY__%${HOMEBREW_HOME}%" >>"${BASHINIT}" } [ "${usebrew}" ] && { grep "^eval \"\$(${BREW_EXE} shellenv)\"" "${BASHINIT}" >/dev/null || { - echo 'eval "$(XXX shellenv)"' | sed -e "s%XXX%${BREW_EXE}%" >>"${BASHINIT}" + echo 'eval "$(XXX shellenv)"' | ${SED} -e "s%XXX%${BREW_EXE}%" >>"${BASHINIT}" } } else - echo "${GOTEXT}" | sed -e "s%__YYY__%${HOMEBREW_HOME}%" >"${BASHINIT}" + echo "${GOTEXT}" | ${SED} -e "s%__YYY__%${HOMEBREW_HOME}%" >"${BASHINIT}" [ "${usebrew}" ] && { - echo 'eval "$(XXX shellenv)"' | sed -e "s%XXX%${BREW_EXE}%" >"${BASHINIT}" + echo 'eval "$(XXX shellenv)"' | ${SED} -e "s%XXX%${BREW_EXE}%" >"${BASHINIT}" } fi [ -f "${HOME}/.zshrc" ] && { grep "export GOROOT" "${HOME}/.zshrc" >/dev/null || { - echo "${GOTEXT}" | sed -e "s%__YYY__%${HOMEBREW_HOME}%" >>"${HOME}/.zshrc" + echo "${GOTEXT}" | ${SED} -e "s%__YYY__%${HOMEBREW_HOME}%" >>"${HOME}/.zshrc" } [ "${usebrew}" ] && { grep "^eval \"\$(${BREW_EXE} shellenv)\"" "${HOME}/.zshrc" >/dev/null || { - echo 'eval "$(XXX shellenv)"' | sed -e "s%XXX%${BREW_EXE}%" >>"${HOME}/.zshrc" + echo 'eval "$(XXX shellenv)"' | ${SED} -e "s%XXX%${BREW_EXE}%" >>"${HOME}/.zshrc" } } } @@ -1481,7 +1491,7 @@ have_pip=$(type -p pip3) } } -for pkg in setuptools asciimatics ddgr socli future \ +for pkg in setuptools asciimatics ddgr socli future wheel \ xtermcolor ffmpeg-python pyaudio term-image urlscan openai; do if ${PYTHON} -m pip list 2>/dev/null | grep ${pkg} >/dev/null; then ${PYTHON} -m pip install --upgrade ${pkg} >/dev/null 2>&1 @@ -1613,6 +1623,7 @@ have_jp2a=$(type -p jp2a) install_external_package } } + printf "\n" # Install Neovim [ "${neovim_install}" ] && install_neovim @@ -1625,9 +1636,11 @@ have_jp2a=$(type -p jp2a) } have_mapscii=$(type -p mapscii) -[ "${have_mapscii}" ] || { +if [ "${have_mapscii}" ]; then + [ "${have_npm}" ] && npm update -g mapscii >/dev/null 2>&1 +else [ "${have_npm}" ] && npm install -g mapscii >/dev/null 2>&1 -} +fi have_mapscii=$(type -p mapscii) [ "${have_mapscii}" ] || { [ "${have_npm}" ] && npm install mapscii >/dev/null 2>&1 @@ -1640,7 +1653,7 @@ have_tuir=$(type -p tuir) git clone https://gitlab.com/ajak/tuir.git >/dev/null 2>&1 [ -d tuir ] && { cd tuir || echo "Could not enter tuir" - cat requirements.txt | sed -e "s/requests=.*/requests>=2.20.0/" >/tmp/tuireq$$ + cat requirements.txt | ${SED} -e "s/requests=.*/requests>=2.20.0/" >/tmp/tuireq$$ cp /tmp/tuireq$$ requirements.txt rm -f /tmp/tuireq$$ TUIR_DIR=$(pwd) @@ -1753,11 +1766,11 @@ create_new_profile() { } if [ "${proterm}" == "gnome" ]; then local profile_ids=($(dconf list $dconfdir/ | grep ^: \ - | sed 's/\///g' | sed 's/://g')) + | ${SED} 's/\///g' | ${SED} 's/://g')) fi if [ "${proterm}" == "tilix" ]; then local profile_ids=($(dconf list $dconfdir/ | grep -v ^list \ - | sed 's/\///g' | sed 's/://g')) + | ${SED} 's/\///g' | ${SED} 's/://g')) fi local profile_ids_old="$(dconf read "$dconfdir"/list | tr -d "]")" local profile_id="$(uuidgen)" @@ -1960,7 +1973,7 @@ local profile_ids_old="$(dconf read "$dconfdir"/list | tr -d "]")" [ "${LANG}" ] && { lang=$(echo ${LANG} | awk -F '.' '{print $1}' | awk -F '_' '{print $1}') [ "${lang}" == "en" ] || { - cat ${USERCONF}/got/config.yml | sed -e "s/source: en/source: ${lang}/" -e "s/target: es/target: en/" >/tmp/gotconf$$ + cat ${USERCONF}/got/config.yml | ${SED} -e "s/source: en/source: ${lang}/" -e "s/target: es/target: en/" >/tmp/gotconf$$ cp /tmp/gotconf$$ ${USERCONF}/got/config.yml rm -f /tmp/gotconf$$ } diff --git a/bin/make_ascii_art b/bin/make_ascii_art index 38cac261..93062920 100755 --- a/bin/make_ascii_art +++ b/bin/make_ascii_art @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # make_ascii_art - create ascii art from a folder of images diff --git a/bin/set_xfce_font b/bin/set_xfce_font index 6ed4c36f..fbaccd7e 100755 --- a/bin/set_xfce_font +++ b/bin/set_xfce_font @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # set_term_font - set the XFCE4 terminal window font and font size # diff --git a/bin/set_xfce_trans b/bin/set_xfce_trans index aaba63ab..b9117449 100755 --- a/bin/set_xfce_trans +++ b/bin/set_xfce_trans @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # set_term_trans - set the XFCE4 terminal window transparency # diff --git a/bin/show_ascii_art b/bin/show_ascii_art index 8e85e737..29d38906 100755 --- a/bin/show_ascii_art +++ b/bin/show_ascii_art @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # platform=`uname -s` if [ "${platform}" == "Darwin" ] diff --git a/bin/show_moon b/bin/show_moon index 24058e35..194141ee 100755 --- a/bin/show_moon +++ b/bin/show_moon @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # show_moon - display the phase of the Moon in ANSI characters diff --git a/bin/show_pokemon b/bin/show_pokemon index d187b22d..1102179f 100755 --- a/bin/show_pokemon +++ b/bin/show_pokemon @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # show_pokemon - display a random Pokemon diff --git a/bin/show_weather b/bin/show_weather index 52d5f149..45d0729b 100755 --- a/bin/show_weather +++ b/bin/show_weather @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # show_weather - display a weather report in ANSI characters diff --git a/bin/termprofset b/bin/termprofset index ed619f44..dfd81090 100755 --- a/bin/termprofset +++ b/bin/termprofset @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # termprofset - manipulate the profile settings of Gnome and Tilix terminals # or XFCE4 terminal font settings diff --git a/tools/bin/asciifetch b/tools/bin/asciifetch index 82a78208..92a062ad 100755 --- a/tools/bin/asciifetch +++ b/tools/bin/asciifetch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # asciifetch - display, animate, zoom Asciiville splash screen using Kitty # diff --git a/tools/bin/asciisplash-tmux b/tools/bin/asciisplash-tmux index 5ada226c..6901a10e 100755 --- a/tools/bin/asciisplash-tmux +++ b/tools/bin/asciisplash-tmux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # asciisplash-tmux - display ASCIImatics splash screens in a tmux session platform=`uname -s` diff --git a/tools/bin/bb-tmux b/tools/bin/bb-tmux index b7fcfcec..31b5f454 100755 --- a/tools/bin/bb-tmux +++ b/tools/bin/bb-tmux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # bb-tmux - display bb in a tmux session diff --git a/tools/bin/brewdups b/tools/bin/brewdups index e2cd11ad..844b4a99 100755 --- a/tools/bin/brewdups +++ b/tools/bin/brewdups @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # brewdups - list and/or remove duplicate packages resulting from installs # with the native package management system and Homebrew diff --git a/tools/bin/browse_art b/tools/bin/browse_art index d9fa8625..ea94dc1f 100755 --- a/tools/bin/browse_art +++ b/tools/bin/browse_art @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # browse_art - zoom ascii art from a folder in a Gnome Terminal window diff --git a/tools/bin/browseascii b/tools/bin/browseascii index 325e2cdd..4a619250 100755 --- a/tools/bin/browseascii +++ b/tools/bin/browseascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # defsize=4 diff --git a/tools/bin/btop-tmux b/tools/bin/btop-tmux index 36dfe2b2..378fb4e8 100755 --- a/tools/bin/btop-tmux +++ b/tools/bin/btop-tmux @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # btop-tmux - display btop in a tmux session diff --git a/tools/bin/chktermcolor b/tools/bin/chktermcolor index 07b480f0..b000761f 100755 --- a/tools/bin/chktermcolor +++ b/tools/bin/chktermcolor @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # chktermcolor - checks a terminal's color support # diff --git a/tools/bin/choose_dir b/tools/bin/choose_dir index 58782a12..808eb343 100755 --- a/tools/bin/choose_dir +++ b/tools/bin/choose_dir @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash TMP="$(mktemp)" ranger --show-only-dir --choosedir="$TMP" 1>&2 diff --git a/tools/bin/choose_song b/tools/bin/choose_song index afeb195e..00cbf3dd 100755 --- a/tools/bin/choose_song +++ b/tools/bin/choose_song @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash platform=`uname -s` if [ "${platform}" == "Darwin" ] diff --git a/tools/bin/colorman b/tools/bin/colorman index 53b74fa0..dbc16317 100755 --- a/tools/bin/colorman +++ b/tools/bin/colorman @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # colorman - colorize man pages diff --git a/tools/bin/csv2md b/tools/bin/csv2md index fcf6042d..e0156bf4 100755 --- a/tools/bin/csv2md +++ b/tools/bin/csv2md @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # csv2md - convert CSV format file to Markdown # diff --git a/tools/bin/del_ascii_art b/tools/bin/del_ascii_art index 0e42048d..3e85497c 100755 --- a/tools/bin/del_ascii_art +++ b/tools/bin/del_ascii_art @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # del_ascii_art - selectively delete ascii art from a folder diff --git a/tools/bin/delascii b/tools/bin/delascii index 9650b900..edc24e67 100755 --- a/tools/bin/delascii +++ b/tools/bin/delascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash for i in *.asc do diff --git a/tools/bin/durdraw b/tools/bin/durdraw index 5cbb8fa5..f85fad95 100755 --- a/tools/bin/durdraw +++ b/tools/bin/durdraw @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # PYthon virtual environment front-end for Durdraw # diff --git a/tools/bin/expkeys b/tools/bin/expkeys index 06966c8b..e948f49a 100755 --- a/tools/bin/expkeys +++ b/tools/bin/expkeys @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Migrate GPG Keys from One Workstation to Another # diff --git a/tools/bin/exportkey b/tools/bin/exportkey index 98d29931..e4f15106 100755 --- a/tools/bin/exportkey +++ b/tools/bin/exportkey @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash gpg --list-secret-keys ronaldrecord@gmail.com diff --git a/tools/bin/getheight b/tools/bin/getheight index fdc03afb..76091617 100755 --- a/tools/bin/getheight +++ b/tools/bin/getheight @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash xrandr | grep current | awk -F ',' ' { print $2 } ' | awk ' { print $4 } ' diff --git a/tools/bin/getwidth b/tools/bin/getwidth index 40ea1b60..3106ebb7 100755 --- a/tools/bin/getwidth +++ b/tools/bin/getwidth @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash xrandr | grep current | awk -F ',' ' { print $2 } ' | awk ' { print $2 } ' diff --git a/tools/bin/gtview b/tools/bin/gtview index 11acd000..22daf984 100755 --- a/tools/bin/gtview +++ b/tools/bin/gtview @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash gnome-terminal --window --geometry=160x50 & diff --git a/tools/bin/html2md b/tools/bin/html2md index 0363473c..02c58ec8 100755 --- a/tools/bin/html2md +++ b/tools/bin/html2md @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash have_pandoc=`type -p pandoc` [ "${have_pandoc}" ] || { diff --git a/tools/bin/inst-ascii-image-converter b/tools/bin/inst-ascii-image-converter index c7bada9a..ba7df8b7 100755 --- a/tools/bin/inst-ascii-image-converter +++ b/tools/bin/inst-ascii-image-converter @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash go install github.com/TheZoraiz/ascii-image-converter@latest diff --git a/tools/bin/inst-speedtest b/tools/bin/inst-speedtest index 15ab2c7a..2853c1d1 100755 --- a/tools/bin/inst-speedtest +++ b/tools/bin/inst-speedtest @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash sudo apt install speedtest-cli diff --git a/tools/bin/inst_joplin b/tools/bin/inst_joplin index 71f8d569..a03c1584 100755 --- a/tools/bin/inst_joplin +++ b/tools/bin/inst_joplin @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash diff --git a/tools/bin/install_durdraw b/tools/bin/install_durdraw index b652e1a3..2dc000cc 100755 --- a/tools/bin/install_durdraw +++ b/tools/bin/install_durdraw @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Durdraw is an ASCII, Unicode, and ANSI art editor with many interesting features @@ -7,19 +7,41 @@ SHARE_DIR="${HOME}/.local/share" DURD_DIR="${SHARE_DIR}/durdraw" TOOLS_DIR=/usr/share/asciiville/tools/bin +install_bin() { + [ -x ${BIN_DIR}/durdraw ] && { + diff ${TOOLS_DIR}/durdraw ${BIN_DIR}/durdraw >/dev/null || { + printf "\nINFO: found existing ${BIN_DIR}/durdraw" + printf "\n\tMoving previous ${BIN_DIR}/durdraw to ${BIN_DIR}/durdraw.bak" + printf "\n\tand updating ${BIN_DIR}/durdraw\n" + mv ${BIN_DIR}/durdraw ${BIN_DIR}/durdraw.bak + } + } + cp ${TOOLS_DIR}/durdraw ${BIN_DIR}/durdraw + chmod 755 ${BIN_DIR}/durdraw + [ "${quiet}" ] || { + printf "\nAdd ${BIN_DIR} to your PATH if not already included." + printf "\n\tView durdraw usage help with 'durdraw --help'" + printf "\n\tView durdraw examples with 'durdraw examples'" + printf "\n\tStep through durdraw examples with \n" + } +} + +quiet= +[ "$1" == "--quiet" ] && quiet=1 + [ -d ${SHARE_DIR} ] || mkdir -p ${SHARE_DIR} cd ${SHARE_DIR} if [ -d durdraw ]; then cd durdraw if [ -d .git ]; then - git pull + git pull >/dev/null 2>&1 else printf "\nERROR: found an existing ${SHARE_DIR}/durdraw folder. Exiting without installing.\n" exit 1 fi else - git clone https://github.com/cmang/durdraw.git + git clone https://github.com/cmang/durdraw.git >/dev/null 2>&1 cd durdraw fi @@ -41,34 +63,32 @@ fi source ${HOME}/.venv/bin/activate # Upgrade pip, setuptools -${PYTHON} -m pip install --upgrade setuptools pip +${PYTHON} -m pip install --upgrade setuptools pip >/dev/null 2>&1 -printf "\nInstalling durdraw in Python virtual environment in ${HOME}/.venv\n" -${PYTHON} -m pip install --upgrade . +[ "${quiet}" ] || { + printf "\nInstalling durdraw in Python virtual environment in ${HOME}/.venv\n" +} +${PYTHON} -m pip install --upgrade . >/dev/null 2>&1 -printf "\nInstalling durdraw front-end in ${HOME}/.local/bin/\n" +[ "${quiet}" ] || { + printf "\nInstalling durdraw front-end in ${HOME}/.local/bin/\n" +} [ -d ${BIN_DIR} ] || mkdir -p ${BIN_DIR} if [ -f ${TOOLS_DIR}/durdraw ]; then - [ -x ${BIN_DIR}/durdraw ] && { - diff ${TOOLS_DIR}/durdraw ${BIN_DIR}/durdraw >/dev/null || { - printf "\nINFO: found existing ${BIN_DIR}/durdraw" - printf "\n\tMoving previous ${BIN_DIR}/durdraw to ${BIN_DIR}/durdraw.bak" - printf "\n\tand updating ${BIN_DIR}/durdraw\n" - mv ${BIN_DIR}/durdraw ${BIN_DIR}/durdraw.bak - } - } - cp ${TOOLS_DIR}/durdraw ${BIN_DIR}/durdraw - chmod 755 ${BIN_DIR}/durdraw - printf "\nAdd ${BIN_DIR} to your PATH if not already included." - printf "\n\tView durdraw usage help with 'durdraw --help'" - printf "\n\tView durdraw examples with 'durdraw examples'" - printf "\n\tStep through durdraw examples with \n" + install_bin else - printf "\nWARNING: cannot locate Asciiville front-end for durdraw." - printf "\n\tUpdate Asciiville and rerun this installation script\n" + TOOLS_DIR=/usr/local/share/asciiville/tools/bin + if [ -f ${TOOLS_DIR}/durdraw ]; then + install_bin + else + printf "\nWARNING: cannot locate Asciiville front-end for durdraw." + printf "\n\tUpdate Asciiville and rerun this installation script\n" + fi fi -printf "\nInstalling durdraw themes and sample configuration in ${HOME}/.durdraw/\n" +[ "${quiet}" ] || { + printf "\nInstalling durdraw themes and sample configuration in ${HOME}/.durdraw/\n" +} [ -d ${HOME}/.durdraw/themes ] || mkdir -p ${HOME}/.durdraw/themes [ -f ${HOME}/.durdraw/durdraw.ini ] || { [ -f durdraw.ini ] && cp durdraw.ini ${HOME}/.durdraw/ @@ -76,8 +96,10 @@ printf "\nInstalling durdraw themes and sample configuration in ${HOME}/.durdraw cp themes/*.dtheme.ini ${HOME}/.durdraw/themes/ [ -f ${DURD_DIR}/durdraw.1 ] && { - printf "\nInstalling durdraw man page in ${HOME}/.local/share/man/man1/" - printf "\n\tView durdraw man page with 'man durdraw'\n" + [ "${quiet}" ] || { + printf "\nInstalling durdraw man page in ${HOME}/.local/share/man/man1/" + printf "\n\tView durdraw man page with 'man durdraw'\n" + } [ -d ${HOME}/.local/share/man/man1 ] || mkdir -p ${HOME}/.local/share/man/man1 cp ${DURD_DIR}/durdraw.1 ${HOME}/.local/share/man/man1/ } diff --git a/tools/bin/install_ffmpeg b/tools/bin/install_ffmpeg index f7a2c2cf..def13f1d 100755 --- a/tools/bin/install_ffmpeg +++ b/tools/bin/install_ffmpeg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash have_brew=$(command -v brew) [ "${have_brew}" ] || { diff --git a/tools/bin/install_kodi b/tools/bin/install_kodi index e579d38d..cd1eb579 100755 --- a/tools/bin/install_kodi +++ b/tools/bin/install_kodi @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash sudo apt-get install software-properties-common sudo add-apt-repository ppa:team-xbmc/ppa diff --git a/tools/bin/instgdu b/tools/bin/instgdu index d045e9a7..333220bb 100755 --- a/tools/bin/instgdu +++ b/tools/bin/instgdu @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash sudo add-apt-repository ppa:daniel-milde/gdu sudo apt-get update diff --git a/tools/bin/listkeys b/tools/bin/listkeys index bd9e126d..0bc7b977 100755 --- a/tools/bin/listkeys +++ b/tools/bin/listkeys @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Migrate GPG Keys from One Workstation to Another # diff --git a/tools/bin/lolcards b/tools/bin/lolcards index 132bc9e5..429c23ca 100755 --- a/tools/bin/lolcards +++ b/tools/bin/lolcards @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash have_lolcat=`type -p lolcat` if [ "${have_lolcat}" ] diff --git a/tools/bin/mkascii b/tools/bin/mkascii index 90fb42d5..c8ecc75f 100755 --- a/tools/bin/mkascii +++ b/tools/bin/mkascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash [ -d ascii ] || mkdir ascii for i in *.jpg *.jpeg *.JPG *.png *.PNG diff --git a/tools/bin/nvimcommand b/tools/bin/nvimcommand index ca040e57..5be0cdf0 100755 --- a/tools/bin/nvimcommand +++ b/tools/bin/nvimcommand @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # nvimcommand - command line tool to perform Neovim commands # diff --git a/tools/bin/pokefetch b/tools/bin/pokefetch index 3dae5d0d..c7e04b4b 100755 --- a/tools/bin/pokefetch +++ b/tools/bin/pokefetch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Prepare ---------------------------------------------------------------------- diff --git a/tools/bin/remake b/tools/bin/remake index 4e904b8f..80ff5160 100755 --- a/tools/bin/remake +++ b/tools/bin/remake @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ART_DIR=$HOME/src/Asciiville/art [ -d ascii ] || mkdir ascii diff --git a/tools/bin/rps b/tools/bin/rps index 358f6c10..ac1320d4 100755 --- a/tools/bin/rps +++ b/tools/bin/rps @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # rps - format ps output with rich # diff --git a/tools/bin/saveascii b/tools/bin/saveascii index a687bc33..94a9b9da 100755 --- a/tools/bin/saveascii +++ b/tools/bin/saveascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash [ -d ascii ] || mkdir ascii for i in * diff --git a/tools/bin/show b/tools/bin/show index c8e8216c..2752463d 100755 --- a/tools/bin/show +++ b/tools/bin/show @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash gnome-terminal --window --full-screen \ --profile=Asciiville \ diff --git a/tools/bin/show_art b/tools/bin/show_art index 87a10922..ef8f758a 100755 --- a/tools/bin/show_art +++ b/tools/bin/show_art @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # show_art - view ascii art from a folder in a Gnome Terminal window diff --git a/tools/bin/show_figlet_fonts b/tools/bin/show_figlet_fonts index 8646f968..5b7addcb 100755 --- a/tools/bin/show_figlet_fonts +++ b/tools/bin/show_figlet_fonts @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # show_figlet_fonts # Display an example of each of the installed pyfiglet Figlet fonts diff --git a/tools/bin/showascii b/tools/bin/showascii index 74c7b8c9..56e58d16 100755 --- a/tools/bin/showascii +++ b/tools/bin/showascii @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash termprofset -s 4 diff --git a/tools/bin/showascii2 b/tools/bin/showascii2 index 43279899..1d62c6dc 100755 --- a/tools/bin/showascii2 +++ b/tools/bin/showascii2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # This will read a keypress without the need to press Enter # while true diff --git a/tools/bin/showcolors b/tools/bin/showcolors index 0eb6dc19..c4a4b439 100755 --- a/tools/bin/showcolors +++ b/tools/bin/showcolors @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # showcolors - display the color palette available in a terminal window diff --git a/tools/bin/showcolors24 b/tools/bin/showcolors24 index 02044347..0aab619f 100755 --- a/tools/bin/showcolors24 +++ b/tools/bin/showcolors24 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # showcolors24 - display a bar of colors supported by a 24 bit terminal display diff --git a/tools/bin/start_gnome b/tools/bin/start_gnome index 4fd7d4b3..6c182914 100755 --- a/tools/bin/start_gnome +++ b/tools/bin/start_gnome @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash fullscreen= [ "$1" == "-f" ] && fullscreen="--full-screen" diff --git a/tools/bin/start_gnome2 b/tools/bin/start_gnome2 index ff04fdff..dd309414 100755 --- a/tools/bin/start_gnome2 +++ b/tools/bin/start_gnome2 @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash gnome-terminal --window --profile=Dark & diff --git a/tools/bin/start_tilix b/tools/bin/start_tilix index bb49bb90..1a0c277d 100755 --- a/tools/bin/start_tilix +++ b/tools/bin/start_tilix @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash fullscreen= [ "$1" == "-f" ] && fullscreen="--full-screen" diff --git a/tools/bin/stop_music b/tools/bin/stop_music index 96a00c84..50046cde 100755 --- a/tools/bin/stop_music +++ b/tools/bin/stop_music @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash for i in /tmp/mplayer?* /tmp/bbdemo?* do diff --git a/tools/bin/tlview b/tools/bin/tlview index 839b60b2..9378865d 100755 --- a/tools/bin/tlview +++ b/tools/bin/tlview @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash tilix --geometry=160x50 & diff --git a/tools/bin/uninstallbrew b/tools/bin/uninstallbrew index 95c67d22..37e6c344 100755 --- a/tools/bin/uninstallbrew +++ b/tools/bin/uninstallbrew @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "This will uninstall Homebrew and all of the packages installed with brew." while true diff --git a/tools/bin/wait_for_pid b/tools/bin/wait_for_pid index 842aa91e..7417e421 100755 --- a/tools/bin/wait_for_pid +++ b/tools/bin/wait_for_pid @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # wait_for_pid - wait for pid provided by first argument to exit # then send signal to parent pid diff --git a/tools/bin/weatherfetch b/tools/bin/weatherfetch index 22976dee..ea388f30 100755 --- a/tools/bin/weatherfetch +++ b/tools/bin/weatherfetch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Prepare ---------------------------------------------------------------------- diff --git a/tools/bin/xfce-color-switch b/tools/bin/xfce-color-switch index 170ff140..2f7f56a5 100755 --- a/tools/bin/xfce-color-switch +++ b/tools/bin/xfce-color-switch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if ! [[ -f /usr/share/xfce4/terminal/colorschemes/$1.theme ]] then diff --git a/tools/bin/xfview b/tools/bin/xfview index 430865a3..0a9592a6 100755 --- a/tools/bin/xfview +++ b/tools/bin/xfview @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash xfce4-terminal --font="Monospace Regular 12" --geometry=160x50 &