sudo pacman -S xautolock slock dunst
xautolock runs slock - a simple screen locker - after no input has been detected for 5 minutes.
20 seconds before slock will be run, a message is sent to dunst using notify-send.
The secure flag means xautolock will ignore enable, disable, toggle, locknow, unlocknow, and restart messages meaning it is harder to unlock by other means, for example an ssh session.