You are not logged in.
I think everyone of this forum is aware of the opera's and ff's option "cotinue from last time", I'm looking for the exact same functionalaty but for the X server.
Last edited by hack.augusto (2009-01-12 23:30:40)
Offline
You'll likely need a session manager, such as gnome-session. I forget what the equivalent in KDE is.
I remember reading about a D-Bus command to save the session, though I'm not sure if this would allow you to function without a session manager.
M*cr*s*ft: Who needs quality when you have marketing?
Offline
gnome-session is quite confusing, and it was a extra 40M, then I made this script:
#!/bin/zsh
#--- Configuration ---
# Blacklist - programs that are not saved between sessions
blacklist=(screen dbus-launch dbus-daemon gconfd-2 dzen session)
# Blacklist
nochild=(opera emesene)
# session file
file='/home/augusto/.session_programs'
#+++ Configuration +++
# Ratpoison's pid
wm_pid=`ps -wwao pid,comm | grep ratpoison | sed 's/ *\([0-9]*\).*/\1/'`
# Clearing list from last session
echo "" > $file
# Making sure it's executable
chmod +x $file
# The argument must be a pid number
process() {
# All process child from the given argument and owned by the user
for proc in "${(f)$(ps --no-headers --ppid $1 -o comm,pid,user | grep $USER)}"; do
# Getting program name
program=`echo $proc | sed 's/\([a-zA-Z0-9_-]*\).*/\1/'`
# Checking if program is NOT blacklisted or empty
if [[ ! -z "${blacklist/*$program*/}" && $proc != "" && ! -z "${proc/*<defunct>*/}" ]] then
# Getting the program's pid number
pid=`echo $proc | sed 's/[a-zA-Z0-9_-]* *\([0-9]*\).*/\1/'`
# Adding program to session file
echo $(ps --no-headers --pid $pid -o cmd)"&" >> $file
# Getting any wanted child from actual process
if [[ ! -z "${nochild/*$program*/}" ]]; then
process $pid
fi
fi
done
}
# Looking for "unparented" processes
process 1
# Looking for WM's child processes
process $wm_pid
if anyone want give it a try just need to add "addhook quit exec /bin/zsh -c <path_to_script>" and "exec ~/.session_programs" in the ~/.ratpoisonrc, and edit the file variable in the script
Last edited by hack.augusto (2009-01-14 05:56:03)
Offline