# add this to /etc/systemd/system and enable service [Unit] Description=i3lock on suspend After=sleep.target [Service] User=akshay Type=forking Environment=DISPLAY=:0 ExecStart=/home/akshay/.config/i3/lock/lock.sh [Install] WantedBy=sleep.target