Browse Source

fix: echo messages

bookworm
pvincent 3 years ago
parent
commit
31d35564d5
  1. 72
      src/main

72
src/main

@ -48,7 +48,8 @@ REQUIRED_PACKAGES=( \
[ `id -u` -eq 0 ] && echo 'normal user required' && exit -1
# required packages
echo "# required packages"
echo "==================="
for package in ${REQUIRED_PACKAGES[@]}; do
runVoid dpkg-query --status $package
if [ $? -ne 0 ] ; then
@ -58,14 +59,16 @@ for package in ${REQUIRED_PACKAGES[@]}; do
fi
done
## debian-bash
echo "## debian-bash"
echo "=============="
if [[ ! -d /opt/debian-bash ]]; then
curl https://git.artcode.re/pvincent/debian-bash/raw/master/install.sh | sudo bash -s -- --host
else
echo "debian-bash already installed!"
fi
## openssh-server
echo "## openssh-server"
echo "================="
PGKNAME='openssh-server'
runVoid dpkg-query --status $PGKNAME
if [ $? -ne 0 ] ; then
@ -80,7 +83,8 @@ else
echo "${PGKNAME} already installed!"
fi
## allow hotplug eth0
echo "## allow hotplug eth0"
echo "====================="
if [[ $(grep 'auto eth0' /etc/network/interfaces.d/setup ) ]];then
sudo /opt/debian-bash/tools/append_or_replace "^auto eth0.*$" "allow-hotplug eth0" /etc/network/interfaces.d/setup
else
@ -88,7 +92,8 @@ else
fi
## firefox latest
echo "## firefox latest"
echo "================="
if [[ ! /usr/local/bin/firefox -ef /opt/firefox/firefox ]];then
set -e
cd /tmp
@ -117,30 +122,12 @@ else
echo "firefox latest already installed!"
fi
# firefox profile with ublock origin
# if [[ -d $HOME/.mozilla/firefox ]];then
# echo "Profile Firefox already created!"
# echo -n "Need acknowledgment before resetting firefox profile from SCRATCH! Do you accept "
# askConfirmation N
# fi
# if [ $? -eq 0 ];then
# echo "resume processing new firefox profile"
# echo -n "please wait for a while..."
# wget -q $GIT_REPOSITORY_RAW/files/firefox.tgz -O /tmp/firefox.tgz
# rm -rf $HOME/.mozilla/firefox
# tar -xzvf /tmp/firefox.tgz -C $HOME/.mozilla/
# echo "DONE"
# else
# echo "Omit firefox profile"
# fi
## firefox by default
echo "## firefox by default"
echo "====================="
xdg-settings set default-web-browser firefox-stable.desktop
## disable apparmor evince
echo "## disable apparmor evince"
echo "=========================="
if [[ ! -L /etc/apparmor.d/disable/usr.bin.evince ]]; then
sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/disable/usr.bin.evince
@ -148,7 +135,8 @@ else
echo "evince apparmor already disabled!"
fi
## gnome default settings
echo "## gnome default settings"
echo "============="
gsettings set org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state true
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.nautilus.preferences click-policy 'single'
@ -158,13 +146,15 @@ gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
# favorite apps
echo "## favorite apps"
echo "================"
favorite_apps=$(gsettings get org.gnome.shell favorite-apps)
if [[ "$favorite_apps" == "['firefox-esr.desktop', 'org.gnome.Evolution.desktop', 'rhythmbox.desktop', 'libreoffice-writer.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop', 'yelp.desktop']" ]]; then
gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop','firefox-stable.desktop','org.gnome.Software.desktop']"
fi
## gnome-extensions-cli
echo "## gnome-extensions-cli"
echo "======================="
command gnome-extensions-cli 2> /dev/null
if [[ $? -ne 0 ]]; then
sudo pip3 install gnome-extensions-cli
@ -172,13 +162,13 @@ else
echo "gnome-extensions-cli already installed!"
fi
## gnome extension system-monitor
echo "## gnome extension system-monitor"
echo "================================="
EXTENSIONS=(
"appindicatorsupport@rgcjonas.gmail.com"
"system-monitor@paradoxxx.zero.gmail.com"
"dash-to-dock@micxgx.gmail.com"
"netspeed@hedayaty.gmail.com"
)
for extension in "${EXTENSIONS[@]}"; do
@ -191,7 +181,8 @@ for extension in "${EXTENSIONS[@]}"; do
fi
done
# gnome extra settings
echo "# gnome extra settings"
echo "======================"
gsettings set org.gnome.shell.extensions.system-monitor show-tooltip true
gsettings set org.gnome.shell.extensions.system-monitor cpu-show-text false
gsettings set org.gnome.shell.extensions.system-monitor cpu-graph-width 60
@ -206,25 +197,14 @@ gsettings set org.gnome.shell.extensions.dash-to-dock apply-custom-theme true
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true
gsettings set org.gnome.shell.extensions.dash-to-dock multi-monitor true
# firefox addons
echo "# firefox addons"
echo "================"
declare -A FIREFOX_ADDONS
FIREFOX_ADDONS['uBlock0@raymondhill.net']="3740966/ublock_origin-1.34.0-an+fx.xpi"
FIREFOX_ADDONS['fr-dicollecte@dictionaries.addons.mozilla.org']='3581786/dictionnaire_francais-7.0b.xpi'
FIREFOX_ADDONS['chrome-gnome-shell@gnome.org']='898030/gnome_shell_integration-10.1-an+fx-linux.xpi'
FIREFOX_ADDONS['jid1-ZAdIEUB7XOzOJw@jetpack']='3741831/duckduckgo_privacy_essentials-2021.3.8-an+fx.xpi'
## TO REMOVE IF USELESS!!!
## can detect actual firefox profile
##
# PROFILE_INI=$HOME/.mozilla/firefox/profiles.ini
# if [[ $(grep '\[Profile[^0]\]' $PROFILE_INI ) ]];then
# PROFPATH=$(grep -E '^\[Profile|^Path|^Default' $PROFILE_INI | grep -1 '^Default=1' | grep '^Path' | cut -c6-)
# else
# PROFPATH=$(grep 'Path=' $PROFILE_INI | sed 's/^Path=//')
# fi
# echo $PROFPATH
mkdir -p /opt/firefox/distribution/extensions
for addon_id in "${!FIREFOX_ADDONS[@]}"; do
addon_part_url="${FIREFOX_ADDONS[$addon_id]}"

Loading…
Cancel
Save