logout from remote desktop

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
alessandro.psrt
Posts: 16
Joined: Tue Dec 06, 2016 2:34 pm

logout from remote desktop

Post by alessandro.psrt »

If we connect to dietpi via Remote Desktop, in lxde (I think the most used because of lightness) logout button have too many options; suspend, hibernate and lockscreen I think are useless, also if you logon via root there is the risk of shutdown the server that is located km / miles away.

In lxde when you press close session in lxde-menu from lxde-panel it launch /usr/bin/lxde-logout:

Code: Select all

#!/bin/sh

lxsession-logout --banner "/usr/share/lxde/images/logout-banner.png" --side=top
I can't code, so I used zenity

Code: Select all

apt-get install zenity
edited /usr/bin/lxde-logout

Code: Select all

#!/bin/sh

#lxsession-logout --banner "/usr/share/lxde/images/logout-banner.png" --side=top

zenity --icon-name="system-log-out" --question --title="Logout" --text="Are you sure?"
if [ $? = 0 ]; then
    pkill -SIGTERM -f lxsession
else
    exit
fi
And simply logout.

https://github.com/lxde/lxsession/tree/ ... ion-logout can be edited removing suspend, hibernate, lockscreen and why not, with dietpi banner. In next days I'll do some experiments with it.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: logout from remote desktop

Post by Fourdee »

To stop/exit vnc desktop session I recommend:

Code: Select all

systemctl stop vncserver
Terminates desktop, session, vnc server and everything related.

Then to restart:

Code: Select all

systemctl start vncserver
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply