Guides

TAILS PERSISTENT SETTINGS GUIDE INCLUDING DARK THEME JAVASCRIPT TOR BROWSER SETTINGS

Started by floydude · Apr 18, 2023

#12654
Hey guys, so I've been working on this all night. I am by no means a coder of any kind. I have been trying to make this happen for days on end and I finally got it to work. How? Goddamn chatGPT. What an incredible tool. I encountered a shit ton of errors and bugs but with the help of our lovely AI bot i managed to figure out how to make tails a little more convenient to use. Of course, you should do this at your own risk as i do not know if this somehow compromises OpSec . I also don't know if this will break other tails versions or work on them, I am using 5.11.

What is the ultimate goal of this guide? To make tails startup the way you want it. You can do it in many ways, but i found this way the simplest and fastest for me. The end result for me was two .sh scripts to choose from, all i do is double click it and all my desired settings will be applied automatically. One of them for bright theme, one of them for dark theme. They also share non visual settings like tor security settings, wifi, and other general settings i will mention below.

YOU MUST ENABLE PERSISTENT STORAGE AND DOTFILES BEFOREHAND FOR THIS TO WORK

So what can we customize?

- General settings like wifi, microphone, default audio output device, background, theme.

- Tor settings (all of them, including javascript, safety level, theme, always prioritize onions)

- We can also have the script open apps automatically (I do this for kleopatra and keepassxc since i always need them).

First, let's get those tor browser settings we want.

1- Go to persitent, enter the Tor Browser folder. Here, Create two folders: One called Light, one called Dark

2- Launch tor browser as usual, and set itto be exactly how you want as you would in preferences and about:config. I recommend setting the privacy level to safest, disable javascript (go to about:config in the browser, search for javascript and set javascript.enabled to false. I also like to select "always prioritize onions" in privacy. Also set the theme you want. We will do this twice, once for dark theme, once for light theme.

3- Set your desired settings and theme, and close tor browser. Now, in tails go to /home/amnesia/.tor-browser/profile.default/ (I do this by going to home, enabling show hidden files, and directly you will see the .tor-browser folder than you need). Once you're in profile.default, copy the prefs.js file. This has all the settings you used last for tor. Paste this in the folders we created in persistence. If you did dark theme for tor before, paste the prefs.js in dark.

4- Open tor again, this time change the theme (All the other settings should remain since we didnt reboot tails yet, but its good to double check anyway). Close it again, and repeat the same process except this time you copy yhe prefs.js to the other appropriate folder we created (Light, since we did the light theme this time).

5- Rename both the copied prefs.js files to user.js

Remember, each one has to be in its different folder (Light or dark). Idk if it makes a difference, but I cleaned up those .sh files a bit by opening them in text editor, and removing the introduction (Mozilla user preferences etc.). I only kept the lines that start with user_pref. These are our settings that we want.

So now, we have our preferences for tor nice and seperated by dark and light, with our desired security/privacy settings common to both.

Next we need to write up a pair of scripts that will apply these settings for us.

Open text editor, and copy/paste the following:

#!/bin/bash

# TOR SETTINGS
# Set the path to your custom user.js file
custom_userjs='/live/persistence/TailsData_unlocked/Persistent/Tor Browser/Dark/user.js'

# Set the path to the Tor Browser profile.default directory
profile_dir="/home/amnesia/.tor-browser/profile.default"

# Copy the custom user.js file to the Tor Browser profile.default directory
cp "$custom_userjs" "$profile_dir"


Save this file as Dark.sh in persistence.

Next, we need the one for the light theme.

Again, open text editor and copy paste the following:

#!/bin/bash

# TOR SETTINGS
# Set the path to your custom user.js file
custom_userjs='/live/persistence/TailsData_unlocked/Persistent/Tor Browser/Light/user.js'

# Set the path to the Tor Browser profile.default directory
profile_dir="/home/amnesia/.tor-browser/profile.default"

# Copy the custom user.js file to the Tor Browser profile.default directory
cp "$custom_userjs" "$profile_dir"


Save this one in persistence as well, as Light.sh

Great, now we have two scripts, one for each theme for tor. Make them both executable by right clicking, properties, permissions, allow to executing file as program.

You can stop here, but i like to be more comprehensive. To the same scripts, we can add some commands that we like.

For the dark mode script, I also make the Tails OS go into dark mode so everything is nice and dark. Optionally, you can also download a basic pure black image from the web and store it in persistence as black.jpg so we can change it to a black blackground in dark theme instead of that blinding bright blue.

Open the dark theme script we made in text editor, and add the following to the end by copy/paste:

# Switch to Dark Mode
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'

# Switch to Dark Gedit
/usr/bin/gsettings set org.gnome.gedit.preferences.editor scheme 'oblivion'

# Set Background to Black
/usr/bin/gsettings set org.gnome.desktop.background picture-uri (start with file:)"///home/amnesia/Persistent/black.jpg"


Now, this script will do both the tor settings and the tails settings in one go!

For the light theme script, open it in text editor, and add the following:

# Switch to Light Mode
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'

# Switch to Light Gedit
/usr/bin/gsettings set org.gnome.gedit.preferences.editor scheme 'Classic'


Now, the Light.sh script will switch you back to light theme in both tor and tails if you desire.

Additonally, we can add some common commands to both the scripts that arent related to theme. I like to mute the mic, turn off wifi since i use ethernet, and switch the audio output to my speakers connected via USB. To find the exact audio output name you need to enter, run terminal and type "pacmd list-sinks" and enter. It will give you a list of available devices, look for the name of your preferred one and copy it to use below. I tried to include turning off the camera but i could't get it to work, but i have a physical switch for that on my laptop so no biggie, but if anyone knows how please let us know for the sake of those who have no physical shutter on their computers.

Also here i will add the commands to open the desired apps, this is also completely up to you and which apps you use. I will include commands for kleopatra and keepassxc.

Anyway, back to those commands you can add to both scripts, choose any of these that are useful to you and add them:

# Turn off Wifi
nmcli radio wifi off

# Turn off microphone
/usr/bin/amixer set Capture nocap

# Switch Audio Output Device to Digital Output (S/PDIF)- Schiit Modi Uber
output_device="SPEAKER DEVICE NAME HERE"
pactl set-default-sink "${output_device}"

# OPEN FOLLOWING APPS
# Open KeePassXC
/usr/bin/keepassxc &

# Open Kleopatra
/usr/bin/kleopatra &


I would add these commands to both scripts, since they are not theme related. Again, choose the ones that suit you.

We're getting pretty close now!

We've got two beautiful scripts that we have customized to our liking. One for dark, one for light, both with common settings for tor and tails.

Now to run them! In the file browser, go to preferences>behavior>executable text files>run them. Otherwise, the scripts will just open in text editor and do nothing. Also important reminder here to make them both executable by right clicking, properties, permissions, allow to executing file as program.

All you need to do now is double click the script you want et voila!! all settings applied.

But you may be thinking, its a little inconvenient to go to file explorer settings each time to enable that stupid setting of running executable text files, because this setitng itself indeed resets each time you reboot tails.

So if you wanna go the extra mile and make it so all you need to do is literally open persistence and double click on the desired script to run it upon booting tails, this is what you need to do:

Open text editor, copy paste the following:

#!/bin/bash

# Enable running executabletext files when they are open
dconf write /org/gnome/nautilus/preferences/executable-text-activation "'launch'"


Save this in persistence as "autorun.sh" and allow it to be executable as i explained above.

Next, open file explorer and go to dotfiles. Enable view hidden items if you haven't already. If there is no .config folder, create one. Inside .config, create another folder and name it autostart. In this folder, we will need to create a text file. Open text editor and copy/paste the following:

[Desktop Entry]
Type=Application
Exec=sh /home/amnesia/Persistent/autorun.sh
Hidden=false
X-GNOME-Autostart-enabled=true
Name=autorun
Comment=Enable running executable text files when they are opened


Save this file in the autostart folder we created as autorun.desktop.

Now, every time you boot tails, the setting should be already applied. All you need to do now is double click your chosen script and BAM!

You can even switch between them in the same session. Note though that you will have to restart tor browser as tyhe script will not change the settings until you restart tor browser.

I hope this helps and works for you as it did for me.

I will try to answer any questions you have, but my knowledge is very limited so dont expect much more than what is already in this post.

I hope this helps and works for you as it did for me.

I will try to answer any questions you have, but my knowledge is very limited so dont expect much more than what is already in this post.

Also very interested to hear if and how this may affect OpSec.
#12655
↳ Replying to @floydude
Your post has been up for a week and no one has said it's wrong.

Are you OK with me doing a spell/grammar check, adding your sig and the Guides copyright, and adding it to the wiki?

𝓯𝓵𝓸𝔂𝓭𝓾𝓭𝓮© /d/Guides All the best Guides live here.
#12657
↳ Replying to @floydude
Thanks. I'd love to hear more about"How? Goddamn chatGPT. What an incredible tool."

That would make an interesting Guide.
#12658
↳ Replying to @floydude
I'll get back to you on the OpSec. I have NFI but I know who to ask.
#12659
↳ Replying to @floydude
[removed]
#12660
↳ Replying to @deleted-dd5f43ed
[color=aqua]𝓯𝓵𝓸𝔂𝓭𝓾𝓭𝓮© /d/Guides All the best Guides live here.[/color]
#12662
↳ Replying to @floydude
Thank you, this is gold!

I would disable auto downloads too, in your browser settings.