title: Getting user uptime in bash script
body: <p>I'm trying to write a bash script and need to learn how many seconds past since user logged in(xsession). I'm searching for hours and i couldn't find a solution for that. I found only uptime command but i think it's only get computers running time.</p>
  
  <p>To be more clear...
  I'm writing gui with gtkdialog and i have "hide gui on startup" option. I can start program when user login and if user check that option i can hide gui. But if user wants to configure options and open the gui again??? 
  My only solution for that. I can write the condition if user logged in 30 sec ago or if not checked "hide gui on startup" option than show gui. So if user click program in xsession can see gui again. </p>