Editing Actman

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
Desktop Activity Manager, or D-A-M, or DAM, or actman, is a command line tool and a status menu widget that allows saving and restoring of the desktop. There can be multiple saved desktops so it is possible to have different activities (desktop profiles) and switch between them by saving the current one and loading another.
+
== Desktop Activity Manager ==
-
For discussion about actman visit [http://talk.maemo.org/showthread.php?t=47373 this thread].
+
=== Introduction ===
 +
Desktop Activity Manager, or D-A-M, or DAM, or actman, is a command line tool and a status menu widget that allows saving and restoring of the destkop. There can be multiple saved desktops so it is possible to have different activities (desktop profiles) and switch between them by saving the current one and loading another.
-
== Status menu widget ==
+
=== Status menu widget ===
The status menu widget is a front-end to the command line tool. While it doesn't have all its features it is easier to use and handles all common user actions.
The status menu widget is a front-end to the command line tool. While it doesn't have all its features it is easier to use and handles all common user actions.
-
[[Image:actman-screenshot1.png|thumb|300px|alt=Screenshot of Actman main page|Main page]]
+
[[Image:actman-screenshot1.png|300px]]
The main page includes the following actions:
The main page includes the following actions:
Line 14: Line 15:
* Delete: Deletes the selected activity. It is not possible to delete the current activity
* Delete: Deletes the selected activity. It is not possible to delete the current activity
* More: Shows more actions
* More: Shows more actions
-
 
-
[[Image:actman-ss-more.png|thumb|300px|alt=Screenshot of Actman more actions|More actions]]
 
When clicking "more", some more actions are shown:
When clicking "more", some more actions are shown:
 +
 +
[[Image:actman-ss-more.png|300px]]
 +
 +
Where:
* Store current: Saves the current activity without switching to a new one
* Store current: Saves the current activity without switching to a new one
* Reload current: Reloads the current activity
* Reload current: Reloads the current activity
-
{{clear}}
 
-
== Command line tool ==
+
=== Command line tool ===
-
The command line tool is named "activity" and is installed in <code>/usr/bin</code>. It should be run as user (and not as root!) and it includes a help screen:
+
The command line tool is named "activity" and is installed in /usr/bin. It should be ran as user (and not as root!) and it includes a help screen:
-
 
+
~ $ /usr/bin/activity help   
-
<pre>
+
Activity manager 1.1
-
~ $ /usr/bin/activity help   
+
-
Activity manager 1.1
+
Available commands:
-
 
+
-
Available commands:
+
  change DEST Store current activity and load DEST.
-
 
+
  clone ACT1 ACT2 Create activity ACT2 as a clone of ACT1. Current
-
  change DEST Store current activity and load DEST.
+
  activity will not be changed.
-
  clone ACT1 ACT2 Create activity ACT2 as a clone of ACT1. Current
+
  create ACTIVITY Create a new (empty) activity.
-
  activity will not be changed.
+
  current Print the current activity name.
-
  create ACTIVITY Create a new (empty) activity.
+
  delete [-f] ACTIVITY Same as remove.
-
  current Print the current activity name.
+
  help This help.
-
  delete [-f] ACTIVITY Same as remove.
+
  list List available activities.
-
  help This help.
+
  load [-f] SRC Load activity SRC. If -f is used then it will be
-
  list List available activities.
+
  allowed to re-load the current activity.
-
  load [-f] SRC Load activity SRC. If -f is used then it will be
+
  new ACTIVITY Same as create.
-
  allowed to re-load the current activity.
+
  reload Reload current activity without storing first.
-
  new ACTIVITY Same as create.
+
  remove [-f] ACTIVITY Remove activity ACTIVITY. If -f is used then there
-
  reload Reload current activity without storing first.
+
  will be no questions asked.
-
  remove [-f] ACTIVITY Remove activity ACTIVITY. If -f is used then there
+
  rename ACT1 ACT2 Rename activity ACT1 to ACT2.
-
  will be no questions asked.
+
  runstart [ACTIVITY] Run scripts of entering an activity
-
  rename ACT1 ACT2 Rename activity ACT1 to ACT2.
+
  runend [ACTIVITY] Run scripts of ending an activity
-
  runstart [ACTIVITY] Run scripts of entering an activity
+
  store DEST Store current activity as DEST.
-
  runend [ACTIVITY] Run scripts of ending an activity
+
  version Print the version.
-
  store DEST Store current activity as DEST.
+
-
  version Print the version
+
Activities are stored under /home/user/.activities
-
</pre>
+
-
 
+
-
Activities are stored under <code>/home/user/.activities</code>
+
To get a list of available activities use "list":
To get a list of available activities use "list":
-
 
+
~ $ /usr/bin/activity list  
-
<pre>
+
car
-
~ $ /usr/bin/activity list  
+
clean
-
car
+
empty
-
clean
+
main
-
empty
+
main2
-
main
+
main3
-
main2
+
Tei
-
main3
+
Test
-
Tei
+
test2
-
Test
+
-
test2
+
-
</pre>
+
To save the current activity and switch to a new one use "change", etc.
To save the current activity and switch to a new one use "change", etc.
-
== How it works ==
+
=== How it works ===
-
Actman (Activity Manager) works by:
+
TBD
-
- dumping (on store) and restoring gconf entries for each activity.
+
=== Running user scripts ===
-
 
+
-
- copying (on store) and pasting (on switching/restore)the contents of $HOME/.config/hildon-desktop/home.plugins.
+
-
 
+
-
- copying (on store) and pasting (on switching/restore) the contents of $HOME/.bookmarks/home-thumbnails.
+
-
 
+
-
- killing hildon-home whenever the user decides to change their activities.
+
-
 
+
-
Such gconf that are dumped and restored are:
+
-
- appletbase (widgets and shortcuts for each home screen and their positions)
+
-
 
+
-
- viewsbase (the amount of home screens the user has and the background images
+
-
for each home screens)
+
-
 
+
-
- hildon-home (bookmarks and shortcuts the user has for this particular activity)
+
-
 
+
-
- contacts (contacts that the user has placed on the home screens)
+
-
 
+
-
Individual files and directories are copied and pasted such as:
+
-
 
+
-
- homeplugins (widgets used)
+
-
 
+
-
- thumbnails (bookmarks to web pages the user has for this particular activity)
+
-
 
+
-
In addition to what it does above, actman allows users to place scripts to be executed before and/or after the switch across to this activity, it also allows cloning of activities, restoring without saving changes, renaming as well as listing of the activities already stored.
+
-
 
+
-
These activies are usually stored in ~/.activities/activities/<name_of_activity_the_user_chooses_to_name>/. The only exception is the root user and in almost all cases ~ would be /home/user (unless one decides to login through another username for instance).
+
-
 
+
-
== Running user scripts ==
+
Since versions 1.1, actman has the ability to run user scripts.
Since versions 1.1, actman has the ability to run user scripts.
-
The scripts are stored under <code>/home/user/.activities/scripts</code> (which does not exist by default).
+
The scripts are stored under /home/user/.activities/scripts (which does not exist by default).
There are two kind of scripts:
There are two kind of scripts:
Line 116: Line 84:
* end: is used when leaving the corresponding activity
* end: is used when leaving the corresponding activity
-
The rationale behind this is to have initscript-like scripts that may start or stop services (kindA) or save/restore a widget's configuration (kindB).
+
The rationale behind this is to have initscript-like scripts that may start or stop services (kindA) or save/restore a widgets configuration (kindB).
-
=== Scripts associated with an activity ===
+
==== Scripts associated with an activity ====
-
Those scripts are installed in a directory named as the activity. For example, for the activity 'main' one can place scripts in <code>/home/user/.activities/scripts/main</code>. They will be ran when switching to or from that activity.
+
Those scripts are installed in a directory named as the activity. For example, for the activity 'main' on can place scripts in /home/user/.activities/scripts/main. They will be ran when switching to or from that activity.
-
=== Scripts not associated with an activity ===
+
==== Scripts not associated with an activity ====
-
They are installed in <code>/home/user/.activities/scripts/always</code> and are ran whenever an activity is switched.
+
They are installed in /home/user/.activities/scripts/always and are ran whenever an activity is switched.
-
=== Invocation ===
+
==== Invocation ====
Scripts are ran with the parameter "start" or "stop" depending on the invocation type. For example it is possible to create a script that connects/disconnects from the Internet when entering/leaving an activity:
Scripts are ran with the parameter "start" or "stop" depending on the invocation type. For example it is possible to create a script that connects/disconnects from the Internet when entering/leaving an activity:
-
<source lang="bash">
+
#!/bin/sh
-
#!/bin/sh
+
-
 
+
if [ "$1" = "start" ] ; then
-
if [ "$1" = "start" ] ; then
+
  # Commands to connect to the internet
-
  # Commands to connect to the internet
+
elif [ "$1" = "stop" ] ; then
-
elif [ "$1" = "stop" ] ; then
+
  # Commands to disconnect from the internet
-
  # Commands to disconnect from the internet
+
fi
-
fi
+
-
</source>
+
-
 
+
-
Putting the above in <code>/home/user/.activities/scripts/internet</code> and having an activity named "internet" (watch for the case) will result in auto connecting/disconnecting to/from the Internet when entering/leaving that activity.
+
-
 
+
-
For desktop widgets that want to implement per-activity settings and are not already handled by actman it is possible to put a script in <code>/home/user/.activities/scripts/always</code> like this:
+
-
 
+
-
<source lang="bash">
+
-
#!/bin/sh
+
-
# This is where actman stores the settings of the activities
+
Putting the above in /home/user/.activities/scripts/internet and having an activity named "internet" (watch for the case) will result in auto connecting/disconnecting to/from the Internet when entering/leaving that activity.
-
# ACTMAN_ACTIVITY contains the name of the corresponding activity and it is
+
-
# set by actman
+
-
DEST=/home/user/.activities/$ACTMAN_ACTIVITY
+
-
if [ "$1" = "start" ] ; then
+
For desktop widgets that want to implement per-activity settings and are not already handled by actman it is possible to put a script in /home/user/.activities/scripts/always like this:
-
  OLDSETTINGS="$DEST/myapp.tar"
+
-
  if [ -e "$OLDSETTINGS" ] ; then
+
-
    ( cd /home/user
+
-
      rm -rf .mywidget
+
-
      mkdir .mywidget
+
-
      tar -xf $OLDSETTINGS )
+
-
  fi
+
-
elif [ "$1" = "stop" ] ; then
+
-
  ( cd /home/user;
+
-
    tar -cf $DEST/myapp.tar .mywidget
+
-
    rm -rf .mywidget
+
-
  )
+
-
fi
+
-
</source>
+
-
The idea is to store the configuration files in the same location where actman stores each activity's settings (<code>/home/user/.activities/<activity name>/</code>) as a tar (or even better as a tgz). <code>$ACTMAN_ACTIVITY</code> will always have the name of the current activity and can be used as such.
+
#!/bin/sh
 +
 +
# This is where actman stores the settings of the activities
 +
# ACTMAN_ACTIVITY contains the name of the corresponding activity and it is
 +
# set by actman
 +
DEST=/home/user/.activities/$ACTMAN_ACTIVITY
 +
 +
if [ "$1" = "start" ] ; then
 +
  OLDSETTINGS="$DEST/myapp.tar
 +
  if [ -e "$OLDSETTINGS" ] ; then
 +
    ( cd /home/user
 +
      rm -rf .mywidget
 +
      mkdir .mywidget
 +
      tar -xf $OLDSETTINGS )
 +
  fi
 +
elif [ "$1" = "stop" ] ; then
 +
  ( cd /home/user;
 +
    tar -cf $DEST/myapp.tar .mywidget
 +
    rm -rf .mywidget
 +
  )
 +
fi
-
[[Category:Software]]
+
The idea is to store the configuration files in the same location where actman stores each activity's settings (/home/user/.activities/<activity name/) as a tar (or even better as a tgz). $ACTMAN_ACTIVITY will always have the name of the current activity and can be used as such.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: