Chrome kwallet and xmonad

During the last month, after the umpteenth Plasma crash, I’m gradually switching to xmonad

The hardest part of the switch has been changing my behaviour from floating to a tiling window system. But also missing my configurations and tools is becoming a problem.

In KDE, I had kwallet to store my password, and with a couple of clicks I had chrome configured to use it to keep the passwords; how do I do the same on xmonad?

I’ve discovered that chrome supports kwallet out of the box; you need to use the --password-store=kwallet command line flag, but how do I tell chrome to always run with that flag?

Solution

On Archlinux the google-chrome package’s script contains the following lines:

> $ cat $(which google-chrome)
#!/bin/bash

# Allow users to override command-line options
if [[ -f ~/.config/chrome-flags.conf ]]; then
   CHROME_USER_FLAGS="$(cat ~/.config/chrome-flags.conf)"
fi

# Launch
exec /opt/google/chrome/google-chrome $CHROME_USER_FLAGS "$@"%

as you can see, the script loads the CHROME_USER_FLAG from the ~/.config/chrome-flags.conf file, so all we need to do is edit that file and add the following option to it:

--password-store=kwallet

At the next startup, you will have chrome asking for kwallet config/password.