Browse Source

launch

bookworm
pvincent 4 years ago
parent
commit
1f11833123
  1. 2
      README.md
  2. 130
      src/main.bash

2
README.md

@ -5,4 +5,4 @@ utilisé lors des Instalalis dispensés par Libre.re
## install
`curl -s https://git.artcode.re/pvincent/debian-gnome/raw/master/src/main.bash | bash -s --`
`curl -s https://git.artcode.re/pvincent/debian-gnome/raw/master/src/launch | bash -s --`

130
src/main.bash

@ -1,130 +0,0 @@
#!/bin/bash
## FUNCTIONS
function runVoid(){
local COMMAND="$@"
bash -c "${COMMAND}" >/dev/null 2>&1
return $?
}
function askConfirmation (){
case "$1" in
y|Y|yes|YES )
QUESTION="(Y/n)?"
DEFAULT=0
;;
* )
QUESTION="(y/N)?"
DEFAULT=1
;;
esac
read -p "$QUESTION : " choice
case "$choice" in
y|Y|yes|YES ) return 0;; #true
n|no|N|NO ) return 1;; #false
* ) return $DEFAULT;;
esac
}
## MAIN
[ `id -u` -eq 0 ] && echo 'normal user required' && exit -1
ALLOWED_USERS=$(id -un) #CUSTOMIZE if needed!
GIT_REPOSITORY_RAW="https://git.artcode.re/pvincent/debian-gnome/raw/master"
## openssh-server
PGKNAME='openssh-server'
runVoid dpkg-query --status $PGKNAME
if [ $? -ne 0 ] ; then
set -e
sudo apt install $PGKNAME
sudo /opt/debian-bash/tools/append_or_replace "^#\?PermitRootLogin.*$" "PermitRootLogin no" /etc/ssh/sshd_config
sudo /opt/debian-bash/tools/append_or_replace "^#\?PasswordAuthentication.*$" "PasswordAuthentication no" /etc/ssh/sshd_config
sudo /opt/debian-bash/tools/append_or_replace "^#\?AllowUsers.*$" "AllowUsers $ALLOWED_USERS" /etc/ssh/sshd_config
sudo systemctl restart sshd
set +e
else
echo "${PGKNAME} already installed!"
fi
## firefox latest
if [[ ! /usr/local/bin/firefox -ef /opt/firefox/firefox ]];then
set -e
cd /tmp
wget `curl 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US' | cut -d '"' -f2` -O firefox-latest.tar.bz2
sudo mkdir /opt/firefox -p
sudo chown $USER /opt/firefox
tar -xjf firefox-latest.tar.bz2 -C /opt
cat <<EOF | sudo tee -a /usr/share/applications/firefox-stable.desktop
[Desktop Entry]
Name=Firefox Stable
Comment=Web Browser
Exec=/opt/firefox/firefox %u
Terminal=false
Type=Application
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
StartupWMClass=Firefox
EOF
sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200 && sudo update-alternatives --set x-www-browser /opt/firefox/firefox
sudo apt remove firefox-esr
set +e
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 acknoledgment before resetting firefox profile from SCRATCH! Do you accept "
askConfirmation y
fi
if [ $? -eq 0 ];then
echo "resume processing new firefox profile"
wget $GIT_REPOSITORY_RAW/files/firefox.tgz -O /tmp/firefox.tgz
rm $HOME/.mozilla/firefox
tar -xzvf /tmp/firefox.tgz -C $HOME/.mozilla/
else
echo "omit firefox profile"
fi
## gnome settings
echo "default settings"
gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop','firefox-stable.desktop','org.gnome.Software.desktop']"
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'
gsettings set org.gnome.shell.overrides dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 1
## gnome extension system-monitor
runVoid dpkg-query --status gnome-shell-extension-system-monitor
if [ $? -ne 0 ] ; then
set -e
sudo apt install gnome-shell-extension-system-monitor
sudo cp /usr/share/gnome-shell/extensions/system-monitor@paradoxxx.zero.gmail.com/schemas/*.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
gnome-shell-extension-tool -e system-monitor@paradoxxx.zero.gmail.com
gnome-shell-extension-tool -r system-monitor@paradoxxx.zero.gmail.com
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
gsettings set org.gnome.shell.extensions.system-monitor memory-display false
gsettings set org.gnome.shell.extensions.system-monitor net-display true
gsettings set org.gnome.shell.extensions.system-monitor net-style digit
gsettings set org.gnome.shell.extensions.system-monitor icon-display false
gsettings set org.gnome.shell.extensions.system-monitor disk-display false
set +e
else
echo "gnome-shell-extension-system-monitor installed!"
fi
Loading…
Cancel
Save