https://github.com/dutu/tails-autostart
Automatically start scripts/applications on Tails bootup
https://github.com/dutu/tails-autostart
Last synced: about 1 year ago
JSON representation
Automatically start scripts/applications on Tails bootup
- Host: GitHub
- URL: https://github.com/dutu/tails-autostart
- Owner: dutu
- Created: 2023-01-24T19:31:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T08:00:22.000Z (about 3 years ago)
- Last Synced: 2025-03-06T02:32:31.581Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tails Autostart
## What is it?
Automatically start scripts/applications on tails bootup
## Why make this?
There could be a need for several scripts to run each time Tails boots up, so this is a mechanism for doing so.
## How do I install it on Tails?
1. Make sure you have dotfiles feature turned on in your persistence configuration.
2. Download and unpack asset files:
```shell
cd ~/Downloads
wget https://raw.githubusercontent.com/dutu/tails-autostart/master/assets/tails-autostart.tar.gz
tar -xzvf tails-autostart.tar.gz
```
3. Run the installation script:
```shell
cd tails-autostart
chmod +x install_tails_autostart.sh
sudo ./install_tails_autostart.sh
```
Done.
## How do I use it?
* add any scripts to `/live/persistence/TailsData_unlocked/dotfiles/.config/autostart/amnesia.d` to execute them on startup as amnesia
* add any scripts to `/live/persistence/TailsData_unlocked/dotfiles/.config/autostart/root.d` to execute them on startup as root
## How does it work?
`run_dir_scripts.sh` runs all the scripts ending in `.sh` in a particular directory. This way, we use the same script to run `amnesia.d` scripts and `root.d` scripts.
`startup_mods.sh` runs `run_dir_scripts.sh` for each user (root and amnesia). running as root is done using `pkexec` (gui for sudo prompt).
Finally, using Gnome's autostart feature, `Tails-autostart.desktop` is run each time Gnome starts up. This `Tails-autostart.desktop` runs `/live/persistence/TailsData_unlocked/tails-autostart/startup_mods.sh`
So on startup, gnome runs:
```mermaid
graph LR;
A(Tails-autostart.desktop)-->B(startup_mods.sh);
B(startup_mods.sh)-->C(pkexec run_dir_scripts.sh);
B(startup_mods.sh)-->D(run_dir_scripts.sh);
C(pkexec run_dir_scripts.sh)-->E(root.d/*.sh);
D(run_dir_scripts.sh)-->F(amnesia/*.sh);
```
> Note: `startup_mods.sh` now checks for `.sh` script files in `.config/autostart/root.d`. If no files are found, `pkexec` is not executed. This is to avoid unnecessary prompt to enter admin password after Gnome starts up.
## How do I remove it from Tails?
1. Remove Tails-autostart files:
```shell
rm /live/persistence/TailsData_unlocked/dotfiles/.config/autostart/Tails-autostart.desktop
rm -fr /live/persistence/TailsData_unlocked/dotfiles/.config/autostart/Tails-autostart
```
> Note: Scripts in `autostart/amnesia.d` and `autostart/root.d` intended to run on startup will remain in place. However, with the removal of Tails autostart, they will no longer be triggered at Tails startup.