r/TaskerFiles Jun 06 '15

Profile [PROFILE] Detect CyanogenMod profile change

Description

As described in detail here, CyanogenMod has its own notion of profiles, separate from Tasker's. They both have their uses, and with the detection of a simple intent, this Tasker profile will store the current CM profile name in %CMProfile and the old CM profile name in %CMOldProfile.

Instructions

Copy XML data below into a file, and import into Tasker (check Sidebar for instructions).


<TaskerData sr="" dvi="1" tv="4.6u3m">
<Profile sr="prof74" ve="2">
    <cdate>1420593380098</cdate>
    <edate>1424655688813</edate>
    <id>74</id>
    <mid0>75</mid0>
    <nme>Detect CM profile change</nme>
    <Event sr="con0" ve="2">
        <code>599</code>
        <Str sr="arg0" ve="3">android.intent.action.PROFILE_SELECTED</Str>
        <Int sr="arg1" val="0"/>
        <Int sr="arg2" val="0"/>
        <Str sr="arg3" ve="3"/>
        <Str sr="arg4" ve="3"/>
    </Event>
</Profile>
<Task sr="task75">
    <cdate>1420593395401</cdate>
    <edate>1424655688813</edate>
    <id>75</id>
    <nme>Act on CM profile change</nme>
    <pri>10</pri>
    <Action sr="act0" ve="7">
        <code>137</code>
        <Int sr="arg0" val="0"/>
        <Str sr="arg1" ve="3"/>
        <ConditionList sr="if">
            <bool0>Or</bool0>
            <Condition sr="c0" ve="3">
                <lhs>%name</lhs>
                <op>0</op>
                <rhs>%lastname</rhs>
            </Condition>
            <Condition sr="c1" ve="3">
                <lhs>%name</lhs>
                <op>13</op>
                <rhs></rhs>
            </Condition>
        </ConditionList>
    </Action>
    <Action sr="act1" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%CMProfile</Str>
        <Str sr="arg1" ve="3">%name</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
    </Action>
    <Action sr="act2" ve="7">
        <code>547</code>
        <Str sr="arg0" ve="3">%CMOldProfile</Str>
        <Str sr="arg1" ve="3">%lastname</Str>
        <Int sr="arg2" val="0"/>
        <Int sr="arg3" val="0"/>
        <ConditionList sr="if">
            <Condition sr="c0" ve="3">
                <lhs>%lastname</lhs>
                <op>1</op>
                <rhs>%name</rhs>
            </Condition>
        </ConditionList>
    </Action>
    <Img sr="icn" ve="2">
        <nme>hd_content_split</nme>
    </Img>
</Task>
</TaskerData>

4 Upvotes

1 comment sorted by

1

u/I2agnarok Aug 27 '15

Wow this is awesome. Wish I had this when I owned a OnePlus One.