maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Hacking Matchbox (https://talk.maemo.org/showthread.php?t=18920)

qwerty12 2008-04-09 09:08

Hacking Matchbox
 
How to have some fun with matchbox.

As root run:
vi /etc/osso-af-init/matchbox.defs.

You will be presented with (this is also the default if you mess up):
Code:

#!/bin/sh
# matchbox.defs - Matchbox defines

TITLEBAR=yes
DESKTOPMODE=plain
LOWLIGHT=no
SHOWCURSOR=yes
DIALOGMODE=static
MBTHEME=$DEFAULTMBTHEME
SUPERMODAL=yes

if [ -f $HOME/.osso/mbtheme ]; then
    MBTHEME=`cat $HOME/.osso/mbtheme`
fi

What do these options do?

I will only go through the options that worked and the ones I have tried.

TITLEBAR:
  • Default is yes
  • Controls the bit with the title at the top

The only mod you can do is change it to no. What does that do?:
http://i30.tinypic.com/24vuxbt.png

Change TITLEBAR=yes to TITLEBAR=no.


DIALOGMODE:
  • Default is static
  • Controls the movement of dialog boxes
  • Accepted options are: free | static | const-horiz

This mod lets you move around the dialog boxes! You see when you press on a window bar, it goes transparent? Now you can drag them. This can be fun for rotation :)

Free Mode:
http://i30.tinypic.com/15s0vn5.png

Yes, it has a little bug where some dialog boxes are placed in wrong position but it can be fixed by dragging like so:

http://i30.tinypic.com/29fbl15.png

Constant/Consistent Horizontal:

http://i30.tinypic.com/33di7lu.png

This works perfectly, dragging works, movement is free but it makes things longer. (yes, I try not to laugh)

Being dragged:
http://i28.tinypic.com/5wat0m.png

Change DIALOGMODE=static to DIALOGMODE=free or DIALOGMODE=const-horiz.

SUPERMODAL:
  • Default is yes
  • Controls whether supermodal dialog boxes (ones that make you give an answer to them before letting you do anything else) can take priority.
  • Accepted options are: yes | no

Setting this to no will let you do other things while receiving a file over bluetooth for example

http://img228.imageshack.us/img228/4...nshot00ui8.png

Change SUPERMODAL=yes to SUPERMODAL=no

I also have a thread on changing your device name too.

Some notes:

Changing DESKTOPMODE=plain to decorated is pointless but does something.
Changing LOWLIGHT=no to yes makes dialog boxes have a black 3d square thing. Not as cool as it sounds.
No idea about this one SHOWCURSOR=yes. (Yabbas says it may be for blinking text cursor.He was right about supermodal)
Leave MBTHEME=$DEFAULTMBTHEME as is. $DEFAULTMBTHEME is a variable pointing to your current theme set.

pixelseventy2 2008-04-09 11:30

Re: Hacking Matchbox
 
Thanks, I've only enabled the dialog moving feature, but it works well

yabbas 2008-04-09 12:54

Re: Hacking Matchbox
 
Presumably showcursor enables/disables the blinking text cursor?

And supermodal enables/disables supermodal dialog boxes? [You know those dialogs that pop up, stay on top and don't let you click anywhere else until they disappear.]

qwerty12 2008-04-09 13:01

Re: Hacking Matchbox
 
Quote:

Originally Posted by yabbas (Post 167371)
And supermodal enables/disables supermodal dialog boxes? [You know those dialogs that pop up, stay on top and don't let you click anywhere else until they disappear.]

Hehe, thanks, i'll disable it and see what happens (why cant I do anything when sending a file over bluetooth :p)

qwerty12 2008-04-09 13:10

Re: Hacking Matchbox
 
Yabbas, you are brilliant!

I can use my n800 while recieving a file over bluetooth. Time to update 1st post.

Benson 2008-04-09 13:25

Re: Hacking Matchbox
 
Quote:

Originally Posted by yabbas (Post 167371)
Presumably showcursor enables/disables the blinking text cursor?

No, showcursor is related to the general conspiracy to stop mice from working.
See here for more info.

Natehunderd 2008-07-29 16:17

Re: Hacking Matchbox
 
OK - I made it there... Now how to edit the file?

Benson 2008-07-29 16:57

Re: Hacking Matchbox
 
Be root. Use any of joe, sed, nano, vi, emacs... it's just a flat file.

caperren 2008-08-12 03:01

Isn't working
 
Hey I'm new to this so tell me if i'm doing something wrong because i can't get thsi to work. I used nano to edit the file. Here is what it now looks like.
Code:

#!/bin/sh
# matchbox.defs - Matchbox defines

TITLEBAR=yes
DESKTOPMODE=plain
LOWLIGHT=no
SHOWCURSOR=yes
DIALOGMODE=const-horiz
MBTHEME=$DEFAULTMBTHEME
SUPERMODAL=no

if [ -f $HOME/.osso/mbtheme ]; then
    MBTHEME=`cat $HOME/.osso/mbtheme`
fi

I saved the file over the original one but my windows are still fixed in one spot and bluetooth windows still keep me from doing anything else. Do you have to download a certain theme to use this hack? If anyone has any ideas let me know please. I am running diablo with the latest update.

qole 2008-08-12 03:42

Re: Hacking Matchbox
 
You need to reboot to see the changes... perhaps that's what's wrong?

caperren 2008-08-12 05:41

Re: Hacking Matchbox
 
No that didn't work either. It was the first thing I tried after it didn't work immediately. I'll reboot again just to make sure.

caperren 2008-08-12 05:45

Re: Hacking Matchbox
 
Nvm, I never knew that shutting down while charging didn't shut it down completely. I unplugged it from the charger and then rebooted and now it works fine. Thanks.

doppers 2008-08-17 23:16

Re: Hacking Matchbox
 
Quote:

Originally Posted by qwerty12 (Post 167325)

In this screenshot what's the name of the USB OTG menu selection module that you're using here? Can you provide a link?

qwerty12 2008-08-18 11:13

Re: Hacking Matchbox
 
Quote:

Originally Posted by doppers (Post 214727)
In this screenshot what's the name of the USB OTG menu selection module that you're using here? Can you provide a link?

https://garage.maemo.org/projects/usb-otg-plugin/

Matan 2008-10-13 11:36

Re: Hacking Matchbox
 
Using the matchbox executable at

http://my.arava.co.il/~matan/770/mat...window-manager

with DIALOGMODE=free, dialog windows start in the centre of screen, like in static mode, while still being movable. To use, simply download the file, copy it to /usr/bin, and reboot.

qole 2008-10-15 17:37

Re: Hacking Matchbox
 
Matan: I'm obviously not doing something right. I renamed your matchbox-window-manager to "matchbox-window-manager-matan" and copied the /etc/osso-af-init/matchbox.sh script to matchbox-matan.sh, and then I changed the new script to point to your mb-w-m instead of the standard one. I tried to shut down the mb-w-m (using the old matchbox.sh script) and then start the new one (using the new matchbox-matan.sh script) and it did really weird things; the stylus keyboard was up in the top left corner, I couldn't switch windows properly, the decorations disappeared... wow... it's almost as if the new window manager didn't start at all, even though the script acted like it did... no errors, just not working.

Perhaps I have to name it "matchbox-window-manager"? I won't be able to include this version in my package if I can't keep the old wm; completely replacing the wm is too invasive a procedure to inflict on the general public...

EDIT: Here's my script.

Code:

# Shut down Matchbox Window Manager.

. /etc/osso-af-init/af-defines.sh
. /etc/osso-af-init/matchbox.defs
echo dialogmode=$DIALOGMODE
echo stopping matchbox...
. /etc/osso-af-init/matchbox.sh stop

# Start up Matchbox Window Manager again, with the new settings.

. /etc/osso-af-init/af-defines.sh

# Always run matan mbwm in free mode
. /etc/osso-af-init/matchbox.defs.window-hack

echo dialogmode=$DIALOGMODE
echo starting matan matchbox...
. /etc/osso-af-init/matchbox-matan.sh start


debernardis 2008-10-15 17:50

Re: Hacking Matchbox
 
@Qole: the script isn't finding the executable - I know because when I downloaded Matan's script I didn't realize it had for some strange reason an .html extension so couldn't be invoked - and the symptoms I saw where the same.
Double check file names and executable permissions, maybe there's a typo and you get running *without* m-w-m.

Matan 2008-10-15 18:03

Re: Hacking Matchbox
 
I don't see this problem, and I did not hear any such reports. What version of OS2008 do you use?

I don't see how renaming might cause this, but I expect renaming to cause problems since there might be issues with lifeguard and the rest.

What is the problem with renaming matchbox-window-manager to matchbox-window-manager.orig in postinst script and renaming it back at prerm script?

Benson 2008-10-15 18:10

Re: Hacking Matchbox
 
Quote:

Originally Posted by qole (Post 233810)
Matan: I'm obviously not doing something right. I renamed your matchbox-window-manager to "matchbox-window-manager-matan" and copied the /etc/osso-af-init/matchbox.sh script to matchbox-matan.sh, and then I changed the new script to point to your mb-w-m instead of the standard one. I tried to shut down the mb-w-m (using the old matchbox.sh script) and then start the new one (using the new matchbox-matan.sh script) and it did really weird things; the stylus keyboard was up in the top left corner, I couldn't switch windows properly, the decorations disappeared... wow... it's almost as if the new window manager didn't start at all, even though the script acted like it did... no errors, just not working.

It sounds very like the wm didn't start. Assuming you have a ssh link up, see if it's in ps output?
Quote:

Perhaps I have to name it "matchbox-window-manager"? I won't be able to include this version in my package if I can't keep the old wm; completely replacing the wm is too invasive a procedure to inflict on the general public...
Well, I don't think it would need to be that invasive... You could divert the original matchbox-window-manager. In fact, I think this would be the least invasive option to get it to start with the new wm at bootup, which seems preferable. There's no downside to the new one. I suppose, though, until you tweak the config (and then restart anyway), there's no benefit... so maybe that's not a worthy goal.

qole 2008-10-15 19:01

Re: Hacking Matchbox
 
It was a permissions problem. No execute permission. Thanks debernardis.

qwerty12 2009-04-17 21:58

Re: Hacking Matchbox
 
Whoo: Here's a nice bump...

If you don't specify a dialogmode, matchbox will let you move dialogs around without making them oversized. Also, you don't need to replace your matchbox binary.

(Thanks to Meizerkki for figuring it out for Mer a long while back)

Just edit /etc/osso-af-init/matchbox.defs and remove the 'DIALOGMODE' line and edit /etc/osso-af-init/matchbox.sh and remove the $DIALOGMODE mode references entirely. Make sure it is done properly or your tablet won't boot!

debernardis 2009-12-13 18:33

Re: Hacking Matchbox
 
BUMP! Now something equivalent could be nice for the N900 window manager (for easy debian apps).


All times are GMT. The time now is 16:48.

vBulletin® Version 3.8.8