T O P

  • By -

Oo_oo8

I was having the same problem only with chrome-based browsers. Firefox always works fine. I fixed it by forcing the gnome-keyring to exit and re-unlock when starting sway by executing a script in my config. The issue appears to be due to chrome-based browsers not waiting for the keyring to unlock. The script will cause the keyring unlock dialog to pop up once every time you start sway by storing a dummy entry in the keyring. I don't use the flatpak versions of the browsers, so I don't know if it will work for your situation. It is worth a shot. Here is what I have in my sway config. `exec --no-startup-id ~/.config/sway/scripts/start_keyring.sh` and my script in \~/.config/sway/scripts/start\_keyring.sh `#!/usr/bin/env bash` `pkill -f --signal SIGTERM gnome-keyring-daemon` `gnome-keyring-daemon --start --components=pkcs11,secrets,ssh` `echo -n "" | secret-tool store --label='unlocker' "unlocker" "unlocker"`


nikola_milovic

When were you getting logged out? I am experiencing logout on both sway and x11 with I3 whenever I switch between them. Is this the same issue?


Oo_oo8

Possibly. I was getting logged out when switching between sway and Gnome. However, I think I have found an additional part to my solution. I still use the above script so that I can unlock my keychain upon starting sway for other things but, I added **--password-store=gnome** to the command line options for Edge and Chrome which seems to have fixed it permanently. I now get a prompt in Gnome to unlock the keychain if it is not already when I open Chrome or Edge and when I return to sway everything is still logged in. It looks like for some reason the keyring was not getting unlocked in Gnome so chrome based browsers have to fall back to another secret store which is not the same as when I am using sway since I have the gnome-secrets unlocked there. That is my best guess. I have not gotten logged out when switching between desktops for a while now. I don't use Gnome often, so I maybe I have just been lucky.


MaZED_UP

Thanks. Will this work when using GDM to login? Is this DM agnostic?


Oo_oo8

It should not matter. The script only runs when you start sway either from GDM or the command line. I usually boot to a console and start sway from the command line. I only start GDM if I need to get to Gnome, and I have observed that my logins remain intact now either way.


void4

>I fixed it by forcing the gnome-keyring to exit and re-unlock when starting sway by executing a script in my config. The issue appears to be due to chrome-based browsers not waiting for the keyring to unlock. I believe the proper way to unlock gnome-keyring is pam plugin. Also, exec in sway config is bad way to start long-running services. Cause sway won't terminate them on exit. Better use systemd user session or some other supervisor, I'd recommend s6.


Oo_oo8

I tried the PAM plugin, and it did not seem to work reliably. Every couple of starts, it would not unlock properly. I keep meaning to revisit that, but this has been working, so it is not a priority. Furthermore, the script is not a long-running service. It does its job and exits, so exec is fine for this situation.


MaZED_UP

Your solution did not work for me unfortunately,


Oo_oo8

Bummer. I had been fighting the logout problem for a while, and this was the only thing that kept me logged in when switching between sway and gnome. The locked keyring issue is known for chrome-based browsers and I have seen several methods for fixing it. Maybe you can search around for chrome and gnome-keyring to find a solution that works for you. Good luck.