User:Pike/Shell tools

From Openmoko

< User:Pike(Difference between revisions)
Jump to: navigation, search
(change paroli bg)
(Shell Tools)
 
Line 1: Line 1:
 
=Shell Tools=
 
=Shell Tools=
  
So many GUIs to do so many things - and they all crash or do the wrong thing - and what i need is always so simple.
+
So many GUIs to do so many things - and they all crash or do the wrong thing - and what i need is always sooooo simple. So lately I keep a bunch of shell scripts to do the job - and link those from /usr/share/applications, using
 
+
So lately I keep a bunch of shell scripts to do the job - and link those from /usr/share/applications, as in
+
 
<pre>
 
<pre>
 
Exec=vala-terminal -e "/root/bin/somescript.sh; exit"
 
Exec=vala-terminal -e "/root/bin/somescript.sh; exit"
 
</pre>
 
</pre>
  
No big magic here. YMMV.  
+
No big magic here. YMMV. Tweek as needed.
  
 
==keeping the phone from falling asleep==
 
==keeping the phone from falling asleep==

Latest revision as of 15:06, 27 August 2009

Contents

[edit] Shell Tools

So many GUIs to do so many things - and they all crash or do the wrong thing - and what i need is always sooooo simple. So lately I keep a bunch of shell scripts to do the job - and link those from /usr/share/applications, using

Exec=vala-terminal -e "/root/bin/somescript.sh; exit"

No big magic here. YMMV. Tweek as needed.

[edit] keeping the phone from falling asleep

Very usefull when using wifi or a navigator, or a alarm :-D

[edit] sleep-off.sh

#!/bin/sh
echo "never sleeping again"
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        Display enabled 
sleep 5

[edit] sleep-on.sh

#!/bin/sh
echo "Sleeping when I want"
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        Display auto 
sleep 5

[edit] wifi management

[edit] wifi-home.sh

This ofcourse requires you have configure your network/interfaces ..

#!/bin/sh

# power up wifi
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        WiFi enabled

# bounce eth0
iwconfig eth0 essid your_essid_here
ifdown eth0; ifup eth0

sleep 30

[edit] wifi-off.sh

#!/bin/sh

# power down wifi
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        WiFi disabled

sleep 5

[edit] gprs management

[edit] gprs-on.sh

#!/bin/sh
echo enabling gprs ..
APN="internet"
USERNAME=" "
PASSWORD=" "
BUSNAME="org.freesmartphone.ogsmd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"
sleep 5

[edit] gprs-off.sh

#!/bin/sh
echo "Disabling gprs"
BUSNAME="org.freesmartphone.ogsmd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME
sleep 5

[edit] change paroli bg

Actually, I've only done this once. Saving it here for reference.

#!/bin/sh

BLAH=/usr/share/paroli/applications/paroli-launcher2/edje/default/images/bg.png
echo "put your bg in $BLAH"

cd /usr/share/paroli/applications/paroli-launcher2
edje_cc -id edje/default/images -id ../common-for-edje/images -fd ../common-for-edje/fonts \
	edje/default/paroli-launcher.edc -o paroli-launcher.edj
chmod +r paroli-launcher.edj
pkill paroli
DISPLAY=:0 paroli &
Personal tools

Shell Tools

So many GUIs to do so many things - and they all crash or do the wrong thing - and what i need is always sooooo simple. So lately I keep a bunch of shell scripts to do the job - and link those from /usr/share/applications, using

Exec=vala-terminal -e "/root/bin/somescript.sh; exit"

No big magic here. YMMV. Tweek as needed.

keeping the phone from falling asleep

Very usefull when using wifi or a navigator, or a alarm :-D

sleep-off.sh

#!/bin/sh
echo "never sleeping again"
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        Display enabled 
sleep 5

sleep-on.sh

#!/bin/sh
echo "Sleeping when I want"
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        Display auto 
sleep 5

wifi management

wifi-home.sh

This ofcourse requires you have configure your network/interfaces ..

#!/bin/sh

# power up wifi
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        WiFi enabled

# bounce eth0
iwconfig eth0 essid your_essid_here
ifdown eth0; ifup eth0

sleep 30

wifi-off.sh

#!/bin/sh

# power down wifi
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
        org.freesmartphone.Usage.SetResourcePolicy \
        WiFi disabled

sleep 5

gprs management

gprs-on.sh

#!/bin/sh
echo enabling gprs ..
APN="internet"
USERNAME=" "
PASSWORD=" "
BUSNAME="org.freesmartphone.ogsmd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"
sleep 5

gprs-off.sh

#!/bin/sh
echo "Disabling gprs"
BUSNAME="org.freesmartphone.ogsmd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME
sleep 5

change paroli bg

Actually, I've only done this once. Saving it here for reference.

#!/bin/sh

BLAH=/usr/share/paroli/applications/paroli-launcher2/edje/default/images/bg.png
echo "put your bg in $BLAH"

cd /usr/share/paroli/applications/paroli-launcher2
edje_cc -id edje/default/images -id ../common-for-edje/images -fd ../common-for-edje/fonts \
	edje/default/paroli-launcher.edc -o paroli-launcher.edj
chmod +r paroli-launcher.edj
pkill paroli
DISPLAY=:0 paroli &