I have program which is starting on boot when raspberry powered up. What I want to do is prevent someone to plug a hdmi cable and see desktop of raspberry. Is it possible to set screensaver? Of course it should ask a password to unlock the screensaver?
Open the terminal on Raspberry Pi itself or you can do this in SSH also:
sudo pkill -f lxsession
GUI session will logout and display the Login screen. SSH session will remain logged in.
If you want to blank the display, type following in the terminal:
xset -display :0 dpms force off
- this will work only if the desktop session is logged in
- The screen will turn on if the mouse or keyboard is used.
This command will disable HDMI port
To disable port
vcgencmd display_power 0
To enable port
vcgencmd display_power 1