Author Topic: Mb-applet-powerctrl  (Read 35050 times)

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #90 on: July 23, 2007, 10:23:32 pm »
Quote
Quote
I have test in icewm. The bad news is mb-applet-powerctrl can not support icewm.

So I should conside to rewrite it, and make it run. Maybe based on egg tray icon is better choice?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165278\"][{POST_SNAPBACK}][/a][/div]
I use mb-applet-powerctrl on icewm. It works - it does crash occasionally with a segment fault, and sometimes the icons are very strange (sometimes they just work fine).

I always get "Failed to open /proc/driver/battery/sharpsl_main_battery_voltage".

I have tried meanies compiled version and am currently running my own compiled version.

What is it that doesn't work in icewm?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165279\"][{POST_SNAPBACK}][/a][/div]

The segment fault is due to the program's bug, icewm resize icon three times, and openbox just once, so I can not found the bug in openbox.

It is my mistake, sorry!

When zaurus in charging, program can not get battery percent from normal apm_read function, so we read /proc/driver/battery/sharpsl_main_battery_voltage to get battery voltage, and estimate the battery percent. It is not accuracy in fact, but better than nothing.

Is the file exist? If exist, you may try:
cat /proc/driver/battery/sharpsl_main_battery_voltage

If not exist, you may try to find it and tell me the location.
« Last Edit: July 23, 2007, 10:28:49 pm by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #91 on: July 24, 2007, 12:50:10 am »
Quote
Can you attach the full source for the latest? ready to build. Thanks
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165282\"][{POST_SNAPBACK}][/a][/div]

The source compile env is not changed. You can download a older src.tar.gz, and replace mb-applet-powerctrl.c with new one.

PS:
"sudo" options is coming back in new attach.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #92 on: July 24, 2007, 02:03:17 am »
All is OK. works great so far

But it's not showing my swap partition anymore while not activated. Few versions ago, it was shown. I only see it now if the swap is activated, and I can turn it off.

[img]http://up.drun.net/v/s/2/f/powerctrl1.png\" border=\"0\" class=\"linked-image\" /]
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

climber

  • Full Member
  • ***
  • Posts: 189
    • View Profile
Mb-applet-powerctrl
« Reply #93 on: July 24, 2007, 04:35:17 am »
ecc_hy,

I tried to do your installation setting but I think you prescribed a little bit.

How to use mb-applet-powerctrl in icewm?
1. Autorun when icewm startup
check & add line to ~/.xinitrc:
Code: [Select]
icewm 2>deve/null >/dev/null & wmpid=$!
icewmtray & >/dev/null
mb-applet-powerctrl & >dev/null

My version:  I hope this is correct?
Code: [Select]
icewm 2>/dev/null >/dev/null & wmpid=$!
icewmtray & >/dev/null
mb-applet-powerctrl & >/dev/null


I don't have a folder programs inside ~.icewm???
Should I reinstall icewm?

So far the Power Applet don't start after icewm is loading  

Regards
climber

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #94 on: July 24, 2007, 05:35:58 am »
Quote
ecc_hy,

I tried to do your installation setting but I think you prescribed a little bit.

How to use mb-applet-powerctrl in icewm?
1. Autorun when icewm startup
check & add line to ~/.xinitrc:
Code: [Select]
icewm 2>deve/null >/dev/null & wmpid=$!
icewmtray & >/dev/null
mb-applet-powerctrl & >dev/null

My version:  I hope this is correct?
Code: [Select]
icewm 2>/dev/null >/dev/null & wmpid=$!
icewmtray & >/dev/null
mb-applet-powerctrl & >/dev/null

I don't have a folder programs inside ~.icewm???
Should I reinstall icewm?

So far the Power Applet don't start after icewm is loading   

Regards
climber
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165313\"][{POST_SNAPBACK}][/a][/div]

You may test mb-applet-powerctrl in x terminal before.
Open x terminal like xterm, rxvt etc, and exec mb-applet-powerctrl.
If you found problem, reply the screen capture or debug message here.

Try autoload after every thing is ok.

"programs" is not folder, whole file path is "~/.icewm/programs". In my expericense, icewm always disable panel in start menu, so you can not run mb-applet-* from menu.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #95 on: July 24, 2007, 05:48:47 am »
Quote
All is OK. works great so far

But it's not showing my swap partition anymore while not activated. Few versions ago, it was shown. I only see it now if the swap is activated, and I can turn it off.

[div align=\"right\"][a href=\"index.php?act=findpost&pid=165307\"][{POST_SNAPBACK}][/a][/div]

To get mounted card information and swaped infor, powerctrl scan "/proc/mounts" ast first, and try "/etc/mtab" if failed.

The new program read them to memory since scan 3 times when active menu once.

You may check the function:

Bool mtab_read(MTAB arMTab[])

and try to find problem.

PS:
Very cool background even not clear.
« Last Edit: July 24, 2007, 05:51:21 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #96 on: July 24, 2007, 07:14:23 am »
Quote
Quote
All is OK. works great so far

But it's not showing my swap partition anymore while not activated. Few versions ago, it was shown. I only see it now if the swap is activated, and I can turn it off.

[div align=\"right\"][a href=\"index.php?act=findpost&pid=165307\"][{POST_SNAPBACK}][/a][/div]

To get mounted card information and swaped infor, powerctrl scan "/proc/mounts" ast first, and try "/etc/mtab" if failed.

The new program read them to memory since scan 3 times when active menu once.

You may check the function:

Bool mtab_read(MTAB arMTab[])

and try to find problem.

PS:
Very cool background even not clear.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165318\"][{POST_SNAPBACK}][/a][/div]

/proc/mounts and /etc/mtab shows what can is available for unmounting, however, /etc/fstab contains info about what can be mounted such as swap files and swap partitions
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #97 on: July 24, 2007, 08:48:45 am »
Quote
Quote
Quote
All is OK. works great so far

But it's not showing my swap partition anymore while not activated. Few versions ago, it was shown. I only see it now if the swap is activated, and I can turn it off.

[div align=\"right\"][a href=\"index.php?act=findpost&pid=165307\"][{POST_SNAPBACK}][/a][/div]

To get mounted card information and swaped infor, powerctrl scan "/proc/mounts" ast first, and try "/etc/mtab" if failed.

The new program read them to memory since scan 3 times when active menu once.

You may check the function:

Bool mtab_read(MTAB arMTab[])

and try to find problem.

PS:
Very cool background even not clear.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165318\"][{POST_SNAPBACK}][/a][/div]

/proc/mounts and /etc/mtab shows what can is available for unmounting, however, /etc/fstab contains info about what can be mounted such as swap files and swap partitions
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165320\"][{POST_SNAPBACK}][/a][/div]


I have this in /etc/fstab:

Code: [Select]
/dev/mtdblock2  /               jffs2   rw              1  1
/dev/mtdblock3  /home           jffs2   rw              0  0
/dev/hda1       /mnt/cf         auto    noauto,owner    0  0
/dev/mmcda1     /mnt/card       auto    noauto,owner    0  0
/dev/sda1       /mnt/usbstorage auto    noauto,owner    0  0
/dev/hda3       /storage        auto    auto,owner      1  1
/dev/hda2       swap            swap    defaults        1  1
none            /dev/pts        devpts  gid=5,mode=620  0  0
proc            /proc           proc    defaults        0  0

but swap is not auto-detected ...
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #98 on: July 24, 2007, 11:28:13 am »
To kk:
I know you idea now. You want powerctrl swap on/off partition, I have thought about it, there are some problem may cause system crash:
1. When swap off the last partition, the system can not move swap data out and crash.
2. Swap partition is not suitable for C3XXX, since they have fixed storage.
3. Sytem mount swap partition automatically.
4. Swap file is more flexible and simple in C1000 and C8XX

To Meanie:
I have install icewm + idesk + rotate for powerctrl testing.
But when screen rotate, my mb-applet-powerctrl always be killed, and other applets which I do not want, like volume, battery, blanker.

Finally, I found the problem. rotate use the file "~/.icewm/icedock" or "/etc/icewm/icedock", we should clear the content and add the wanted applet.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #99 on: July 24, 2007, 02:21:01 pm »
Quote
To kk:
I know you idea now. You want powerctrl swap on/off partition, I have thought about it, there are some problem may cause system crash:
1. When swap off the last partition, the system can not move swap data out and crash.
2. Swap partition is not suitable for C3XXX, since they have fixed storage.
3. Sytem mount swap partition automatically.
4. Swap file is more flexible and simple in C1000 and C8XX

To Meanie:
I have install icewm + idesk + rotate for powerctrl testing.
But when screen rotate, my mb-applet-powerctrl always be killed, and other applets which I do not want, like volume, battery, blanker.

Finally, I found the problem. rotate use the file "~/.icewm/icedock" or "/etc/icewm/icedock", we should clear the content and add the wanted applet.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165325\"][{POST_SNAPBACK}][/a][/div]

Well, I can definatelty swap off with powerctrl. What i cannot is swap on. Why is swap partition not suitable for C3XXX ? I use it all the time, and have no complaints on this. What's the problem, don't get it.

about 3 - well, my system does not turn on swap partition automatically, despites what's written in /etc/fstab
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #100 on: July 24, 2007, 07:35:33 pm »
Quote
Quote
To kk:
I know you idea now. You want powerctrl swap on/off partition, I have thought about it, there are some problem may cause system crash:
1. When swap off the last partition, the system can not move swap data out and crash.
2. Swap partition is not suitable for C3XXX, since they have fixed storage.
3. Sytem mount swap partition automatically.
4. Swap file is more flexible and simple in C1000 and C8XX

To Meanie:
I have install icewm + idesk + rotate for powerctrl testing.
But when screen rotate, my mb-applet-powerctrl always be killed, and other applets which I do not want, like volume, battery, blanker.

Finally, I found the problem. rotate use the file "~/.icewm/icedock" or "/etc/icewm/icedock", we should clear the content and add the wanted applet.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165325\"][{POST_SNAPBACK}][/a][/div]

Well, I can definatelty swap off with powerctrl. What i cannot is swap on. Why is swap partition not suitable for C3XXX ? I use it all the time, and have no complaints on this. What's the problem, don't get it.

about 3 - well, my system does not turn on swap partition automatically, despites what's written in /etc/fstab
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165329\"][{POST_SNAPBACK}][/a][/div]

the problem with swap not working automatically is because /etc/fstab is evaluated before the pcmcia devices (which the microdrive is part of) are initialized. i added some stuff to rc.sysconfig to mount the swap partition if it exists and map it correctly to the device name, ie /dev/hda2 or /dev/hdc2
i think powerctrl is just not looking at /etc/fstab yet to get the swap partition info which can be tricky because the device name is dynamic and thus not usually added to /etc/fstab

i use icedock in pdaXii13 to load matchbox applets so you dont need to edit .xinitrc and i kill all the applets and reload them during rotation because of some problems with the icewm panel...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #101 on: July 25, 2007, 12:54:38 am »
How to add new swap item to powerctrl?

All options is in ~/Choice/powerctrl.cfg

# If SwapCount = 0, swap menu is disabled
SwapCount=2

[Swap0]
# menu item for better understand
name=SD Card
# swap can be enable or not? if the mount point is in mtab, swap can be enable. following is mount point of device
mount=/mnt/card
# mount point of swap partition or file path
path=/mnt/card/.swapfile
# file or partition
type=file
# only useful when type is swap file
size=16,32,64,128,256
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #102 on: July 25, 2007, 01:15:18 am »
Quote
How to add new swap item to powerctrl?

All options is in ~/Choice/powerctrl.cfg

# If SwapCount = 0, swap menu is disabled
SwapCount=2

[Swap0]
# menu item for better understand
name=SD Card
# swap can be enable or not? if the mount point is in mtab, swap can be enable. following is mount point of device
mount=/mnt/card
# mount point of swap partition or file path
path=/mnt/card/.swapfile
# file or partition
type=file
# only useful when type is swap file
size=16,32,64,128,256
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165340\"][{POST_SNAPBACK}][/a][/div]


does this mean, everytime you enable a swap file on SD or CF, it creates a new swapfile and then enables it. what if you already have a swapfile and just want to enable it without recreating it?
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #103 on: July 25, 2007, 05:04:48 am »
Quote
does this mean, everytime you enable a swap file on SD or CF, it creates a new swapfile and then enables it. what if you already have a swapfile and just want to enable it without recreating it?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165342\"][{POST_SNAPBACK}][/a][/div]

Yes, powerctrl's swap file function is based on cacko's memoryapplet-1.0.1.tar.gz.
Recreate swap file maybe a better choice since we are not sure the swap file is correct or not.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #104 on: July 25, 2007, 08:24:12 pm »
Quote
Quote
does this mean, everytime you enable a swap file on SD or CF, it creates a new swapfile and then enables it. what if you already have a swapfile and just want to enable it without recreating it?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165342\"][{POST_SNAPBACK}][/a][/div]

Yes, powerctrl's swap file function is based on cacko's memoryapplet-1.0.1.tar.gz.
Recreate swap file maybe a better choice since we are not sure the swap file is correct or not.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165349\"][{POST_SNAPBACK}][/a][/div]

This is true and should be the default behaviour, however, it may be a good idea to have a flag which if set changes the default behaviour such as not recreating the swap file.


btw, I think /proc/driver/battery/chg_status is the file you need for the battery charging status
« Last Edit: July 25, 2007, 09:18:40 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K