OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Post Install Tweeks, That would make life easyer
craigtyson
post Jun 4 2009, 09:43 AM
Post #1





Group: Members
Posts: 464
Joined: 15-June 04
Member No.: 3,698



Having installed ZUBUNTU for the first time, here are some bits that people might find of use

after loging in the first time run

ts_calibrate

to calibrate your touch screen

run killall tskeys

to get some free memory

ensure dhcp is running properly by changing the 102 and 103 entries for dhcp in /etc/passwd to 0

get your wifi / network running by looking on the forums

once you have internet connectivity, install synaptic so you can find packages with

apt-get install synaptic

now you're ready to rock

Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
ptoki
post May 1 2010, 01:14 AM
Post #2





Group: Members
Posts: 90
Joined: 1-April 08
From: Silesia
Member No.: 21,583



Here is my script:
CODE
#!/bin/sh
ONE=$(grep Spitzkbd /proc/interrupts|md5sum)
while true
do
sleep 240
PLAYING=$(mpc|grep "play"|wc -l)
if [ "$PLAYING" = 0 ]; then
TWO=$(grep "Spitzkbd\|ts" /proc/interrupts|md5sum)
#echo $ONE $TWO
if [ "$ONE" = "$TWO" ]; then
apm -s
fi
fi
ONE=$TWO
done


File with interrupts (/proc/interrupts) looks like this:
CODE
CPU0
3: 1240 SC ohci_hcd:usb1
6: 12 SC pxa_i2c-i2c.1
11: 0 SC pxa27x_udc
16: 0 SC SSP
17: 34 SC LCD
18: 2214 SC pxa_i2c-i2c.0
23: 158689 SC pxa2xx-mci
25: 17071 SC DMA
26: 295976 SC ost0
73: 0 GPIO MMC card detect
75: 40 GPIO ts
76: 87 GPIO Spitzkbd Sense
77: 0 GPIO Spitzkbd HP Type, sharpsl_rc
80: 0 GPIO Spitzkbd Sync
81: 77 GPIO Spitzkbd Sense
85: 0 GPIO Fatal Battery
98: 56 GPIO Spitzkbd Sense
100: 79 GPIO Spitzkbd Sense
102: 158 GPIO Spitzkbd Sense
103: 763 GPIO Spitzkbd Sense
154: 0 GPIO Battery Cover
155: 82 GPIO Spitzkbd Sense
158: 0 GPIO PCMCIA0 CD
159: 30 GPIO Spitzkbd PwrOn
160: 23 GPIO Spitzkbd SWB
161: 4 GPIO Spitzkbd SWA
165: 0 GPIO CO
169: 10693 GPIO ide0
179: 0 GPIO AC Input Detect
180: 0 GPIO Spitzkbd HP
Err: 0

I think ide0 contains number of interrupts for cf card and pxa2xx-mci contains number of interrupts for sd card.

If you want to check activity of network card just check output of ifconfig and look for eth0, ppp0 wifi activity represented by number of bytes,sent/received.

In my case it was not important how much keys was pressed i just needed to know if anything happened so i used md5sum to check that.

There is a lot of ways to achieve result which You need, just peek in /proc or /sys and with simple script monitor what is happening in those files while You are doodling with zaurus and then write script to use that information and react.
You can use beeping instead led flash. Or you can try aosd_cat as a OSD visualizer.


I have written a small utility to show vital signs of my zaurus. I connected it to a keypress using .xbindkeysrc:
Look at "#show" battery section. When you press FN and 0 (zero) then /bin/batt script is executed.
Also Fn+9 is mpd toggle and fn+8 and Fn+7 is next and prev song

CODE
###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier (on my keyboard):
# Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# Another way to specifie a key is to use 'xev' and set the
# keycode with c:nnn or the modifier with m:nnn where nnn is
# the keycode or the state returned by xev
#
# This file is created by xbindkey_config
# The structure is :
# # Remark
# "command"
# m:xxx + c:xxx
# Shift+...




#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable



#Brigtness Down
"display-brightness.sh down"
m:0x40 + c:12
Mod4 + 3

#Brightness Up
"display-brightness.sh up"
m:0x40 + c:13
Mod4 + 4

#Volume Down
"pcm down"
m:0x40 + c:10
Mod4 + 1
"pcm down"
F19

#Volume Up
"pcm up"
m:0x40 + c:11
Mod4 + 2
"pcm up"
F20

#show battery
"/bin/batt osd"
m:0x40 + c:19
Mod4 + 0

#toggle mpd
"mpc toggle"
m:0x40 + c:18
Mod4 + 9
"mpc toggle"
F18

#prev mpd
"mpc prev"
m:0x40 + c:16
Mod4 + 7

#next mpd
"mpc next"
m:0x40 + c:17
Mod4 + 8


#Right Mouse Click
"xte 'mouseclick 3'"
Control + b:1 (mouse)

#middle mouse click
"xte 'mouseclick 2'"
Shift + b:1

#rotate
"/bin/rot"
F10

"xte 'key Delete'"
Mod4 + c:22
#

#f1
#"xte 'key f1'"
# Mod4 + 1

#rotate screen
"/bin/rot"
m:0x40 + c:15

#fake alt-tab
"xte 'keydown Alt_L' 'key Tab' 'keyup Alt_L'"
c:67
"xte 'keydown Alt_L' 'key Tab' 'keyup Alt_L'"
F17

#fake alt-f4
"xte 'keydown Alt_L' 'key F4' 'keyup Alt_L'"
c:96

#show desktop
"xte 'keydown Alt_L' 'key l' 'keyup Alt_L'"
c:107

#
# End of xbindkeys configuration


It is helpful to use xev to check which codes are generated by X while pressing keyboard keys.

Here is a batt script:
It shows some nice information about Z

CODE
#!/bin/sh

a=$(cat /sys/devices/platform/sharpsl-pm/battery_percentage)
f=$( free|grep Mem|awk '{ print $1 int($4/1024) }'|tail -n 3|tr "\n" " ")
l=$(top -b -n 1|grep "load average"|cut -d "," -f 3-6|cut -d ":" -f 2)
d=$(date)
s=$(amixer sget PCM|grep "\["|cut -d " " -f 4,6)


TEKST=$(echo -e "PCM\n$s\n$d\nbatt:$a \n$f \nload:$l")

echo -e "batt:$a $f load:$l"
if [ "$1" = "osd" ]; then
aosd_cat -d 5000 -e 0 -F "Trebuchet 30" -s 3 -S 100 -r 1 -g 1 -b 0 -x 30 -y 30 -t "$TEKST"
fi

And one more:
CODE
pcm script (used to change volume)

#!/bin/sh


STEP=3

if [ ! -n "$1" ]; then
echo "max / current"
amixer sget PCM
elif [ "$1" = "up" ]; then
amixer sset PCM $STEP"%+"
elif [ "$1" = "down" ]; then
amixer sset PCM $STEP"%-"
else
echo -e "\nUsage:\n\t `basename $0` [up | down]\n"
fi


And if I remember correctly I have changed slightly standard zubuntu script to change display brightness.

CODE
#!/bin/sh

# display-brightness.sh
# simple script to set display-brightness for zaurus clamshell
# author: patrick steiner <[EMAIL PROTECTED]>
# modified by: Ian Munsie <[EMAIL PROTECTED]>
# modified by: Paul M "speculatrix" - for Spitz/Zubuntu
# version: 1.02 | 15/12/2008 21:48 GMT

STEP=5
MAX_BRIGHTNESS=47
MIN_BRIGHTNESS=0

DRIVER="`ls /sys/class/backlight/|head -n 1`"
BRIGHTNESS_FILE="/sys/class/backlight/$DRIVER/brightness"
BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/actual_brightness`
# this gives bad number - 15 is max, 16 is off!
#MAX_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/max_brightness`

POWER_FILE="/sys/class/backlight/$DRIVER/bl_power"
POWER_ON=0
#POWER_OFF=1


if [ ! -n "$1" ]; then
echo "max / current"
echo "$MAX_BRIGHTNESS / $BRIGHTNESS"
elif [ "$1" = "up" ]; then
test -x /usr/bin/bl && bl on
echo $POWER_ON >> $POWER_FILE
if [ $BRIGHTNESS -lt $MAX_BRIGHTNESS ]; then
let BRIGHTNESS=$BRIGHTNESS+$STEP
if [ $BRIGHTNESS -ge $MAX_BRIGHTNESS ]; then
let BRIGHTNESS=$MAX_BRIGHTNESS
fi
echo $BRIGHTNESS >> $BRIGHTNESS_FILE
fi
elif [ "$1" = "down" ]; then
test -x /usr/bin/bl && bl on
echo $POWER_ON >> $POWER_FILE
if [ $BRIGHTNESS -gt $MIN_BRIGHTNESS ]; then
let BRIGHTNESS=$BRIGHTNESS-$STEP
if [ $BRIGHTNESS -le $MIN_BRIGHTNESS ]; then
let BRIGHTNESS=$MIN_BRIGHTNESS
fi
echo $BRIGHTNESS >> $BRIGHTNESS_FILE
fi
elif [ "$1" = "off" ]; then
if [ $BRIGHTNESS -ne 0 ];then
echo "$BRIGHTNESS" >/tmp/backlight
echo 0 > $BRIGHTNESS_FILE
fi
elif [ "$1" = "on" ]; then
cat /tmp/backlight > $BRIGHTNESS_FILE
rm /tmp/backlight
else
echo -e "\nUsage:\n\t `basename $0` [up | down]\n"
fi


Combined together with .xbindkeyrc, those give quite nice result in usability of the zaurus. Dont forget ro run xbindkeys in your ./homedir/.xinitrc. the saver script is also executed there with background option (& ampersand at the end of a command)
BTW I use matchbox WM so there is not much to put in panel to monitor OS condition thats why i have those scripts.
Aosd_cat is quite slow to start but I use it rarely so it is not a problem.
Go to the top of the page
 
+Quote Post

Posts in this topic
craigtyson   Post Install Tweeks   Jun 4 2009, 09:43 AM
RX Shorty   Nice Thanks, I am going to try Zubuntu tonight.   Jun 19 2009, 05:45 PM
ptoki   at my c1000 its not nessesary to kill tskeys its s...   Jul 9 2009, 09:58 AM
RGRICH   QUOTE(ptoki @ Jul 9 2009, 02:58 PM) at my...   Dec 5 2009, 11:35 AM
ptoki   QUOTE(RGRICH @ Dec 5 2009, 09:35 PM) QUOT...   Dec 22 2009, 02:08 AM
danboid   QUOTE(ptoki @ Jul 9 2009, 06:58 PM) tweak...   Apr 22 2010, 02:28 PM
ptoki   QUOTE(danboid @ Apr 23 2010, 12:28 AM) QU...   Apr 25 2010, 11:15 AM
danboid   QUOTE(ptoki @ Apr 25 2010, 08:15 PM) QUOT...   Apr 26 2010, 12:22 AM
ptoki   QUOTE(danboid @ Apr 26 2010, 10:22 AM) QU...   Apr 26 2010, 02:30 AM
brontoZaurus   QUOTE(craigtyson @ Jun 4 2009, 07:43 PM) ...   Jul 23 2009, 03:35 AM
craigtyson   QUOTE(brontoZaurus @ Jul 23 2009, 11:35 A...   Jul 24 2009, 06:44 AM
brontoZaurus   oh! yes from shell it works, but from the menu...   Jul 26 2009, 11:49 PM
craigtyson   QUOTE(brontoZaurus @ Jul 27 2009, 07:49 A...   Jul 27 2009, 02:47 AM
brontoZaurus   ok but where is located that fileż? thanks in adva...   Jul 27 2009, 04:02 AM
ptoki   Another chunk of post install tweaks. Put CODE#m...   Jul 30 2009, 08:00 AM
ptoki   To make irda work: Ensure that modules irda, ircom...   Aug 5 2009, 09:30 PM
ptoki   Another batch of tweaks: Do not use LXDE, it has ...   Sep 11 2009, 12:18 AM
craigtyson   QUOTE(ptoki @ Sep 11 2009, 08:18 AM) Anot...   Sep 11 2009, 01:56 AM
ptoki   Next thing to do is to make dual boot with cacko. ...   Feb 15 2010, 02:43 AM
danboid   Hi ptoki! I'm not quite sure what you mea...   Apr 29 2010, 07:58 AM
ptoki   Here is my script: CODE#!/bin/sh ONE=$(gr...   May 1 2010, 01:14 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2014 - 12:56 AM