From ffc0db5a046775e35a11ff4e5e52f63b13799bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20L=C3=BCbbemeier?= <luebbemeier@metaventis.com> Date: Sat, 5 Feb 2022 12:59:29 +0100 Subject: [PATCH] Add documentation for autostart --- README.md | 2 +- doc/how-to-gnome-autostart.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 doc/how-to-gnome-autostart.md diff --git a/README.md b/README.md index 6623a4f..3eeb938 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ gnome-keyring-yubikey-unlock/create_secret_file.sh /path/to/your_secret [Your Gn As an example, I need to input `login:My_Very_Long_Login_Password`. (You may use `seahorse` or `tools/list_keyrings.sh` to determine the name of your keyring) -Then, add the following command to gnome-autostart. You should know how to auto-run a command after starting gnome. +Then, add the following command to gnome-autostart. If you don't know how to do it, [read me](doc/how-to-gnome-autostart.md)! ``` /path/to/this/project/unlock_keyrings.sh /path/to/your_secret diff --git a/doc/how-to-gnome-autostart.md b/doc/how-to-gnome-autostart.md new file mode 100644 index 0000000..511348d --- /dev/null +++ b/doc/how-to-gnome-autostart.md @@ -0,0 +1,34 @@ +# How To Autostart On Gnome + +To automatically unlock keyrings right after logging into Gnome, you need to autostart +`unlock_keyrings.sh`. There are different ways to to this. + +## Start Via Systemd + +Create a new file at `~/.config/systemd/user/unlock-keyring.service` with the following content +(adapt the command after `ExecStart` to your setup): + +```ini +[Unit] +Description=Unlock keyring using YubiKey +BindsTo=gnome-session.target + +[Service] +Type=oneshot +ExecStart=/path/to/this/project/unlock_keyrings.sh /path/to/your_secret 123456 + +[Install] +WantedBy=gnome-session.target +``` + +Run the following command (not root): + +```sh +systemctl --user enable unlock-keyring.service +``` + +When doing changes to the service file, run + +```sh +systemctl --user daemon-reload +``` -- GitLab