Skip to content

Instantly share code, notes, and snippets.

@averymd
Created May 23, 2022 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save averymd/4eb636029ac302a68bb4b013f1f0ec29 to your computer and use it in GitHub Desktop.
Save averymd/4eb636029ac302a68bb4b013f1f0ec29 to your computer and use it in GitHub Desktop.
A Tasker project that switches between wireguard connections based on wifi status
<TaskerData sr="" dvi="1" tv="5.15.14">
<Profile sr="prof11" ve="2">
<cdate>1625582573422</cdate>
<edate>1648008026635</edate>
<flags>8</flags>
<id>11</id>
<mid0>12</mid0>
<nme>At Home</nme>
<State sr="con0" ve="2">
<cname>At Home</cname>
<code>165</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%CURRENTWIFI</lhs>
<op>4</op>
<rhs>HomeSsidName*</rhs>
</Condition>
</ConditionList>
</State>
</Profile>
<Profile sr="prof3" ve="2">
<cdate>1625579572978</cdate>
<clp>true</clp>
<edate>1648008036438</edate>
<flags>8</flags>
<id>3</id>
<mid0>4</mid0>
<nme>Not At Home</nme>
<pri>7</pri>
<State sr="con0" ve="2">
<cname>Not At Home</cname>
<code>165</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%CURRENTWIFI</lhs>
<op>5</op>
<rhs>HomeSsidName*</rhs>
</Condition>
</ConditionList>
</State>
</Profile>
<Profile sr="prof7" ve="2">
<cdate>1634673691379</cdate>
<clp>true</clp>
<edate>1648095617900</edate>
<flags>8</flags>
<id>7</id>
<mid0>6</mid0>
<nme>Wifi Connected</nme>
<State sr="con0" ve="2">
<code>160</code>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="2"/>
</State>
</Profile>
<Profile sr="prof9" ve="2">
<cdate>1634673764893</cdate>
<clp>true</clp>
<edate>1647991418639</edate>
<flags>8</flags>
<id>9</id>
<mid0>2</mid0>
<nme>Wifi Disconnected</nme>
<State sr="con0" ve="2">
<code>160</code>
<pin>true</pin>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="2"/>
</State>
</Profile>
<Project sr="proj0" ve="2">
<cdate>1630802812790</cdate>
<name>MullvadConnectivity</name>
<pids>9,11,3,7</pids>
<tids>12,2,6,4,5</tids>
<Img sr="icon" ve="2">
<nme>cust_animal_panda</nme>
</Img>
</Project>
<Task sr="task12">
<cdate>1625582588223</cdate>
<edate>1648095565640</edate>
<id>12</id>
<nme>Switch To Mullvad</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>365</code>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(false,home)</Str>
</Action>
<Action sr="act1" ve="7">
<code>365</code>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(true,mullvad-home) </Str>
</Action>
</Task>
<Task sr="task2">
<cdate>1634672433088</cdate>
<edate>1648007995825</edate>
<id>2</id>
<nme>Fake SSID</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%CURRENTWIFI</Str>
<Str sr="arg1" ve="3">None</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
<Int sr="arg6" val="1"/>
</Action>
</Task>
<Task sr="task4">
<cdate>1625579587280</cdate>
<edate>1648095584287</edate>
<id>4</id>
<nme>Switch To Home VPN</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>365</code>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(false,mullvad-home)</Str>
</Action>
<Action sr="act1" ve="7">
<code>365</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""/&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(true,home)</Str>
</Action>
</Task>
<Task sr="task5">
<cdate>1634673266146</cdate>
<edate>1634673438187</edate>
<id>5</id>
<nme>Show Ssid</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">%CURRENTWIFI</Str>
<Int sr="arg1" val="0"/>
<Str sr="arg10" ve="3"/>
<Int sr="arg11" val="1"/>
<Int sr="arg12" val="0"/>
<Str sr="arg13" ve="3"/>
<Int sr="arg14" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Int sr="arg9" val="1"/>
</Action>
</Task>
<Task sr="task6">
<cdate>1648007962954</cdate>
<edate>1648095617900</edate>
<id>6</id>
<nme>Get SSID</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>341</code>
<Int sr="arg0" val="5"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3">%CURRENTWIFI</Str>
</Action>
</Task>
</TaskerData>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment