From ed56733a683e836cef6b78415ef604b1febbed54 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sat, 27 Mar 2021 23:34:39 +0400 Subject: [PATCH] duckduckgo --- src/main | 77 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/src/main b/src/main index 0e00531..84392a8 100755 --- a/src/main +++ b/src/main @@ -37,7 +37,7 @@ function askConfirmation (){ BASEDIR=/opt/debian-gnome GIT_REPOSITORY_RAW="https://git.artcode.re/pvincent/debian-gnome/raw/master" ALLOWED_USERS=$(id -un) #CUSTOMIZE if needed! -REQUIRED_PACKAGES=( git wget curl htop tilix jq unzip python3-pip ) +REQUIRED_PACKAGES=( vim git wget curl htop tilix jq unzip python3-pip ) # required packages for package in ${REQUIRED_PACKAGES[@]}; do @@ -65,7 +65,11 @@ else fi ## debian-bash - +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 ## firefox latest if [[ ! /usr/local/bin/firefox -ef /opt/firefox/firefox ]];then @@ -97,24 +101,25 @@ else 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 -## gnome settings +# 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 + +## gnome default settings 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' @@ -137,11 +142,11 @@ else echo "gnome-extensions-cli already installed!" fi - ## gnome extension system-monitor EXTENSIONS=( "appindicatorsupport@rgcjonas.gmail.com" "system-monitor@paradoxxx.zero.gmail.com" + "dash-to-dock@micxgx.gmail.com" "netspeed@hedayaty.gmail.com" ) @@ -153,7 +158,7 @@ for extension in "${EXTENSIONS[@]}"; do fi done -# gsettings +# gnome extra settings 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 @@ -164,3 +169,33 @@ gsettings set org.gnome.shell.extensions.system-monitor net-show-text false gsettings set org.gnome.shell.extensions.system-monitor icon-display false gsettings set org.gnome.shell.extensions.system-monitor disk-display false + + +# firefox addons +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' + +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]}" + addon_xpi="/opt/firefox/distribution/extensions/${addon_id}.xpi" + if [[ ! -f "$addon_xpi" ]]; then + echo -n "Firefox addon <$addon_id> installing ..." + wget -q "https://addons.mozilla.org/firefox/downloads/file/${addon_part_url}" -O $addon_xpi + echo DONE + else + echo "Firefox addon <$addon_id> already installed!" + fi +done +