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 Activity Manager == |
+ | |||
+ | === 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. | ||
For discussion about actman visit [http://talk.maemo.org/showthread.php?t=47373 this thread]. | For discussion about actman visit [http://talk.maemo.org/showthread.php?t=47373 this thread]. | ||
- | == 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 | + | [[Image:actman-screenshot1.png|300px]] |
The main page includes the following actions: | The main page includes the following actions: | ||
Line 14: | Line 17: | ||
* 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 | ||
- | |||
- | |||
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 | ||
- | |||
- | == Command line tool == | + | === Command line tool === |
- | The command line tool is named "activity" and is installed in | + | 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 | |
- | + | 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 | |
- | + | activity will not be changed. | |
- | + | create ACTIVITY Create a new (empty) activity. | |
- | + | current Print the current activity name. | |
- | + | delete [-f] ACTIVITY Same as remove. | |
- | + | help This help. | |
- | + | list List available activities. | |
- | + | load [-f] SRC Load activity SRC. If -f is used then it will be | |
- | + | allowed to re-load the current activity. | |
- | + | new ACTIVITY Same as create. | |
- | + | reload Reload current activity without storing first. | |
- | + | remove [-f] ACTIVITY Remove activity ACTIVITY. If -f is used then there | |
- | + | will be no questions asked. | |
- | + | rename ACT1 ACT2 Rename activity ACT1 to ACT2. | |
- | + | runstart [ACTIVITY] Run scripts of entering an activity | |
- | + | runend [ACTIVITY] Run scripts of ending an activity | |
- | + | store DEST Store current activity as DEST. | |
- | + | version Print the version. | |
- | + | ||
- | + | Activities are stored under /home/user/.activities | |
- | + | ||
- | + | ||
- | Activities are stored under | + | |
To get a list of available activities use "list": | To get a list of available activities use "list": | ||
- | + | ~ $ /usr/bin/activity list | |
- | + | car | |
- | ~ $ /usr/bin/activity list | + | clean |
- | car | + | empty |
- | clean | + | main |
- | empty | + | main2 |
- | main | + | main3 |
- | main2 | + | Tei |
- | main3 | + | Test |
- | Tei | + | test2 |
- | Test | + | |
- | test2 | + | |
- | + | ||
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 === |
- | + | TBD | |
- | + | === Running user scripts === | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | == 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 | + | 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 86: | ||
* 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 | + | 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' | + | 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 | + | 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: | ||
- | + | #!/bin/sh | |
- | #!/bin/sh | + | |
- | + | if [ "$1" = "start" ] ; then | |
- | if [ "$1" = "start" ] ; then | + | # Commands to connect to the internet |
- | + | elif [ "$1" = "stop" ] ; then | |
- | elif [ "$1" = "stop" ] ; then | + | # Commands to disconnect from the internet |
- | + | fi | |
- | fi | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | 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. | |
- | + | ||
- | + | ||
- | + | ||
- | + | 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: | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | #!/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 | ||
- | + | 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.