#!/usr/bin/python import os # check if whe are into ltsp environment looking LTSP_FATCLIENT=false or empty is_fatclient = os.environ.get('LTSP_FATCLIENT') is_ltsp = os.environ.get('LTSP_CLIENT') # call xfce4-logout-session with (logout action) or without parameter (menu) if (is_ltsp != None and is_fatclient == "false"): args = "-l" else: args = "" os.system("/usr/bin/xfce4-session-logout "+args)