From 3eb09d349c4e73594c957b910675f7a70ff9e729 Mon Sep 17 00:00:00 2001
From: alexis <alexis.calin9@etu.univ-lorraine.fr>
Date: Wed, 26 Apr 2023 15:25:14 +0200
Subject: [PATCH] arkenfox setup added

---
 setup.sh | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 13 deletions(-)

diff --git a/setup.sh b/setup.sh
index 8a6ddc2..9fe878b 100755
--- a/setup.sh
+++ b/setup.sh
@@ -42,19 +42,48 @@ if [ "$distro" == "Debian" ]; then
         sudo apt purge gnome-games
         sudo systemctl enable --now NetworkManager && echo 'Enabled Network Manager'
 
-        echo 'Install VScode ? (y or n)'
-        read yn
-        if [ "$yn" == 'y' ]; then
-            # vscode
-            curl https://go.microsoft.com/fwlink/?LinkID=760868 && sudo apt install ./code*.deb
-        fi
-
-        echo 'Install Mullvad vpn ? (y or n)'
-        read yn
-        if [ "$yn" == 'y' ]; then
-            # vscode
-            curl https://mullvad.net/download/app/deb/latest/ && sudo apt install ./Mullvad*.deb && sudo systemctl enable --now mullvad-daemon
-        fi
+	echo 'Install VS Code? (y or n)'
+	read yn
+	if [ "$yn" == 'y' ]; then
+	    # Download and install VS Code
+	    curl https://go.microsoft.com/fwlink/?LinkID=760868 -o ~/Downloads/code.deb && sudo apt install ~/Downloads/code.deb
+	    
+	    # Clean up the downloaded deb file
+	    rm ~/Downloads/code.deb
+	fi
+
+	echo 'Install Mullvad VPN? (y or n)'
+	read yn
+	if [ "$yn" == 'y' ]; then
+	    # Download and install Mullvad VPN
+	    curl https://mullvad.net/download/app/deb/latest/ -o ~/Downloads/mullvad.deb && sudo apt install ~/Downloads/mullvad.deb
+	    
+	    # Enable and start Mullvad daemon
+	    sudo systemctl enable --now mullvad-daemon
+	    
+	    # Clean up the downloaded deb file
+	    rm ~/Downloads/mullvad.deb
+	fi
+
+	echo 'Setup Arkenfox user.js ? (y or n)'
+	read yn
+	if [ "$yn" == 'y' ]; then
+	    sudo apt install firefox-esr
+	    curl -o user.js https://raw.githubusercontent.com/arkenfox/user.js/master/user.js
+
+	    # Disable letterboxing
+	    sed -i 's/user_pref("privacy.resistFingerprinting.letterboxing", true);/user_pref("privacy.resistFingerprinting.letterboxing", false);/' user.js
+
+            # Enable keyword.enabled preference
+            sed -i 's/user_pref("keyword.enabled", false);/user_pref("keyword.enabled", true);/' user.js
+
+            # Move user.js to Firefox profile directory with most files in it
+            most_files_dir=$(find ~/.mozilla/firefox/ -maxdepth 1 -type d -name '*.default*' -exec sh -c 'echo "{} $(ls -1 "{}" | wc -l)"' \; | sort -k 2 -n -r | head -n1 | cut -d" " -f1)
+            mv user.js "${most_files_dir}/user.js"
+
+            echo "Arkenfox user.js file applied with letterboxing disabled and keyword.enabled preference set to true."
+
+       fi
     fi
 
     
-- 
GitLab