Below is a step‑by‑step guide to have your KDE Wallet (KWallet) automatically unlock when you log in via ly and then start Hyprland. In short, you’ll:
- Install the PAM module (
kwallet-pam
) and ensure your wallet password matches your user password - Hook PAM in ly’s login routine so it hands off your login password to KWallet
- Autostart the helper (
pam_kwallet_init
) in your Hyprland config so that the wallet actually opens
With these in place, applications like Dolphin or Brave should stop nagging you for the wallet password after you’ve already logged in.
Make sure you have the core KWallet components and the PAM integration module:
sudo pacman -S kwallet kwallet-pam kwalletmanager
kwallet-pam
provides the PAM module that lets your login password decrypt the wallet.kwallet
is the Wallet daemon itself, andkwalletmanager
is a GUI for managing your vaults.
The ly display manager uses its own PAM stack (/etc/pam.d/ly
). You need to insert two lines so that ly’s authentication and session phases include the KWallet PAM module.
- Open
/etc/pam.d/ly
as root (e.g.sudo nano /etc/pam.d/ly
). - Under the auth section, add:
auth optional pam_kwallet5.so
- Under the session section, add:
session optional pam_kwallet5.so auto_start force_run
- The
auto_start
flag tells it to launch the wallet daemon. - The
force_run
flag is needed when you log in on a plain TTY (which ly essentially is).
- The
- Save and exit.
💡 Why these lines?
auth optional pam_kwallet5.so
lets PAM hand off your login password to the wallet module.session optional pam_kwallet5.so auto_start force_run
launches and unlocks the wallet once your session starts, even from a TTY.
If you don’t see a /etc/pam.d/ly
, make sure ly is properly installed (it should drop that file). You can compare with /etc/pam.d/sddm
or /etc/pam.d/lightdm
to verify the correct placement.
PAM will hand off the password, but your Wayland session still needs to actually run the helper binary. Add the following to your Hyprland config (e.g. ~/.config/hypr/hyprland.conf
):
# run once when the Wayland session starts
exec-once = /usr/lib/pam_kwallet_init
or, if you prefer the systemd‐style wrapper:
exec-once = env XDG_AUTOSTART_DIR="$XDG_CONFIG_DIRS/autostart" /usr/bin/gtk-launch pam_kwallet_init
This matches the ArchWiki recommendation for “Unlocking KWallet automatically in a window manager.”
⚠️ Note: Some guides suggestexec --no-startup-id /usr/lib/pam_kwallet_init
; Hyprland’s syntax isexec-once
, but the idea is the same.
- Wallet name & encryption
- Your wallet must be named
kdewallet
(the default) and use Blowfish encryption.
- Your wallet must be named
- Password match
- The KWallet password must exactly match your user login password for PAM to work.
- Autologin & fingerprints
- Automatic unlock won’t work if you use fingerprint login or an autologin method that doesn’t save the password.
- Reload or reboot your system:
sudo systemctl restart ly.service reboot
- At the ly prompt, log in as usual.
- Once Hyprland starts, open Dolphin or your browser—KWallet should now already be unlocked.
If you still get prompted, check the journal for PAM errors:
journalctl -b | grep pam_kwallet
and verify that /usr/lib/pam_kwallet5.so
is being invoked.
With these steps, your KWallet will play nicely with ly + Hyprland: one login, no extra wallet‐unlocking dance!
Changing
exec-once
toexec
exec-once only once per Hyprland launch, and never again until you fully exit and restart Hyprland.
So if you:
exec-once
runsexec-once
does not run againThat's why your KWallet daemons might not get re-launched or re-initialized when switching sessions. Even though the desktop restarts, exec-once thinks it already did its job.
Find a problem
If either command prints nothing after you switch back to Hyprland, that daemon died and is why your wallet vanished.
You should see lines confirming pam_kwallet5.so auto_start ran at login. If you don’t, your wallet never unlocked in this session.