Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dev:session-management [2009/07/19 14:17] – add more stuff 67.188.6.70dev:session-management [2009/07/19 14:26] – more typos, localization note kelnos
Line 34: Line 34:
   * This is somewhat abusing the XDG autostart spec.  We'd end up either setting ''Hidden=true''/''NoDisplay=true'' to keep anyone else from seeing it, or (more likely) using ''OnlyShowIn=XFCE;'' to achieve the same result.  But still, it's a little nasty.   * This is somewhat abusing the XDG autostart spec.  We'd end up either setting ''Hidden=true''/''NoDisplay=true'' to keep anyone else from seeing it, or (more likely) using ''OnlyShowIn=XFCE;'' to achieve the same result.  But still, it's a little nasty.
   * Third-party tools might wipe out our session-management-specific keys upon editing them, if they're not written in a sane way.  This is a minor consideration, I think.   * Third-party tools might wipe out our session-management-specific keys upon editing them, if they're not written in a sane way.  This is a minor consideration, I think.
-  * It's more difficult to clear the session, both manually and programmatically.  Instead of just deleting out a file or directory, you have to check each file to see if it's a plain-vanilla XDG autostart file, or if it's part of a saved session.  This also raises the question of what a "session removal" really is: is it just removing apps restored by the session manager, or does it also mean clearing out all XDG autostart files, even those created by the user or auto-created by some random app? +  * It's more difficult to clear the session, both manually and programmatically.  Instead of just deleting a file or directory, you have to check each file to see if it's a plain-vanilla XDG autostart file, or if it's part of a saved session.  This also raises the question of what a "session removal" really is: is it just removing apps restored by the session manager, or does it also mean clearing out all XDG autostart files, even those created by the user or auto-created by some random app? 
-  * Using the XDG autostart dir makes having more than one saved session difficult (well, not too difficult: you just have an extra key in the file with the session name; but of course this makes the previous point more complicated, and makes the point about third-party tools fail completely, since they'll likely show app apps from all sessions).  However, I've often thought having multiple sessions is a rarely-used feature that just bloats xfce4-session, complicates the code, and is confusing to end-users so I'd consider removing it.+  * Using the XDG autostart dir makes having more than one saved session difficult (well, not too difficult: you just have an extra key in the file with the session name; but of course this makes the previous point more complicated, and makes the point about third-party tools fail completely, since they'll likely show all apps from all sessions).  However, I've often thought having multiple sessions is a rarely-used feature that just bloats xfce4-session, complicates the code, and is confusing to end-users so I'd consider removing it.
  
 I'm currently leaning toward storing these in the XDG autostart directory. I'm currently leaning toward storing these in the XDG autostart directory.
Line 59: Line 59:
 ClientId=abcdefg-0123456789\\  ClientId=abcdefg-0123456789\\ 
 Priority=40\\  Priority=40\\ 
-RestartCommand=xfdesktop --sm-client-id abcdefg-0123456789+RestartCommand=xfdesktop --sm-client-id abcdefg-0123456789\\ 
 CurrentDirectory=/home/brian\\  CurrentDirectory=/home/brian\\ 
 RestartStyle=RestartImmediately'' RestartStyle=RestartImmediately''
Line 78: Line 78:
 ==== Other Issues ==== ==== Other Issues ====
  
-=== Value of the ''Name'' Key ===+=== Value of the Name Key ===
  
-The ''Name'' key in the desktop file would provide a user-readable name for the application.  This is useful in a session editor (which ends up being the autostart editor).  For autostart/session files installed by the application, this is already taken care of us, and the names are even probably localized for us.+The ''Name'' key in the desktop file would provide a user-readable name for the application.  This is useful in a session editor (which ends up being the autostart editor).  For autostart/session files installed by the application, this is already taken care of for us, and the names are even probably localized for us.
  
 But for apps started by the user that get saved in the session, how do we figure out a useful value to put in the ''Name'' key? But for apps started by the user that get saved in the session, how do we figure out a useful value to put in the ''Name'' key?
Line 86: Line 86:
 Options: Options:
   - Use the value of the SmProgram XSMP property if present.   - Use the value of the SmProgram XSMP property if present.
-  - Dig around in the system and user .desktop file directories (''$XDG_DATA_DIRS/applications'') and try to find an application with a matching ''Exec'' key (or at least one with the same argv[0]), and use the ''Name'' key from there.+  - Dig around in the system and user .desktop file directories (''$XDG_DATA_DIRS/applications'') and try to find an application with a matching ''Exec'' key (or at least one with the same argv[0]), and use the (probably localized) ''Name'' key from there.
   - When the session is saved, find the WM_CLIENT_LEADER window and take its _NET_WM_NAME property.  This is also beneficial to allow the user to uniquely identify each entry if several copies of the same app are saved to the session.  Usually this value will be localized as well.   - When the session is saved, find the WM_CLIENT_LEADER window and take its _NET_WM_NAME property.  This is also beneficial to allow the user to uniquely identify each entry if several copies of the same app are saved to the session.  Usually this value will be localized as well.