probaly the best docking procedure for your stuff
Allmighty code by Tinic Uro, done in december 1997
Feedback should go to: 5uro@informatik.uni-hamburg.de
This piece of 0s and 1s is copyrighted under the laws of an unknown universe. But anyway no one will care about this so do what you want with it. But preferably leave me a mail if you want to it sell it or put it on a CD or I cannot garantee that you will not beamed to a world where BeOS does not exist.
So what the hell are you going to do with ToolDock? Good question. First a little test if ToolDock is really the thing you need:
If you can answer any of these questions with yes, leave now and forget ToolDock... Otherwise, fun begins now:
ToolDock does in fact nothing more than launching files with specified arguments. This sounds simple but in fact you can get quite impressive results to omptimize your work with the BeOS.
The main window of ToolDock shows a list of buttons. Each of this button can be configured with a desired operation and a shortcut, additionally you can drop files on these buttons. Its a nice replacement for linking icons on the desktop. But you can do even more. You can f.ex. lauch terminal only applications with a single click.
If you fiddle a bit around, ToolDock can be a replacement for the beloved DR8 Dock. ToolDock allows you to configure the position and some parts of the look.
The configuration is done through a preferences file which can be edited with any text editor. The file is called "Config.cfg" and should reside in the same directory like ToolDock.
When you press 'LeftControl 1' a Terminal will be launched. This is a global shortcut and should work in any case even when ToolDock is not the active window. You wont be lucky if your app has a similar shortcut ;-) Pressing 'LeftControl 4' will open the home directory in a Tracker window.
When you click Show processes a terminal will be opened and will run the command ps using the more tool. Since I am also developing audio software, I found Kill AudioServer and Launch AudioServer useful, since the Server is still not the most stable stuff of the BeOS. Same for the Network stuff.
There is more, I consider to look at the preferences file for this.
The configuration file is called "Config.cfg" and can be edited with any text editor (turn off wrapping of lines!!!). When ToolDock is running and you are saving the file ToolDock will automatically display the new settings (this does not work everytime though, the Node watcher seems to be quite unreliable.). Each line in the configuration should contain one of these commands:
does nothing, used to add comments.
Sets the numer of rows to display, where [x] should be replaced with the desired number. This command should be placed before any mime, path or empty comand.
Default is 2.
Sets the numer of colums to display, where [x] should be replaced with the desired number. This command should be placed before any mime, path or empty comand.
Default is 6.
Sets the position of the dock. The following magic words are recognized: TOP, BOTTOM, LEFTTOP, RIGHTTOP, LEFTBOTTOM, RIGHTBOTTOM. If you use another value than TOP or BOTTOM its useful to the the colums to 1 and rows to a higher value.
Default is BOTTOM.
Sets the width of the dock in pixels. This has no effect when the position is TOP or BOTTOM.
Default is 128.
Adds an empty button.
Adds a usable button to the dock. [label] is the label the button should show, [mimetype] the application to launch,
[arg1 arg2 ...] should be the arguments which are added when launching the application. Note that like in the bash shell something like "Captn Kirk" or 'Captn Kirk' is recognized as a single argument. To replace a | use the sequence !!, f.ex. " dir !! more".
[env1 env2 ...] are environment settings which are added to the global settings when launching the file. Here the same rules like at the arguments are valid. An evironment setting looks f.ex. like this: FOLDER_PATH=/home.
[shortcut] can be replaced with a key sequence. Look in the Sortcuts section for more info.
[icon] is either a mimetype or path. It will try to retrieve a Mini icon either from the mimetype, from the attributes or resources.
Its legal to leave [shortcut], [arg1 ...], [env1 ...] or [icon] empty but [label] and [mimetype] must be valid.
You can get the mimetype of an application by selecting the application with the tracker and using the 'FileType' add-on which is in the File menu. Simply copy and paste the 'signature:' entry.
In fact the same like mime, but instead of a mimetype you replace [path] with the direct path to the application.
Shortcuts should look like this:
Function Key 1
Left Shift + Left Control + 1
Right Control + F1
Left Control + A
Additionally you can use the normal keys. To get the numpad keys prefix a N f.ex. NENTER or N0.
path | ShutDown | /bin/shutdown
When you click this button the machine does a shutdown. The same function like in the Deskbar.
path | NetPositive | /boot/apps/NetPositive | LCTRL-1 | | | /boot/apps/NetPositive
A button with the label 'NetPositive' is added to the ToolDock. When you click the button or press LeftControl-1 NetPositive will be launched. The NetPositive icon will be showed on the button.
mime | BeIDE | application/x-mw-BeIDE | | | | application/x-mw-BeIDE
When you click it, BeIDE will be launched. If you drag files on the button BeIDE will try to open these files. The BeIDE icon will be showed on the button.
mime | Home sweet home | application/x-vnd.Be-TRAK | | /boot/home
A button with the label 'Home sweet home' is added to the ToolDock. When you click on this button a tracker window will be opened which shows the contents of /boot/home. Short-cut is empty here.
mime | ToolDock config | application/x-mw-BeIDE | | Config.cfg
Will open a BeIDE texteditor window with the configuration file of ToolDock.
mime | Term in source | application/x-vnd.Be-SHEL | LSHIFT-F1 | | FOLDER_PATH=/boot/home/config/etc
This one will open a Terminal in the directory /boot/home/config/etc. In fact this works like the TermHire add-on. Arguments are not used here.
mime | PS | application/x-vnd.Be-SHEL | | /bin/sh -login -c "ps !! more -e"
A terminal will be opened and will show the running processes.
mime | Cool!| application/x-vnd.Be-SHEL|| /bin/sh -login -c "dir !! more -e"| FOLDER_PATH=/bin
When you click it, a new terminal will be opened, the shell goes to the /bin folder and executes the command 'dir | more', which will show the contents of /bin.
;--------------------------------------------------------------------------------------------------------------------------------------- ; Example config file for ToolDock ; Read docs for more information about how to edit this file ;--------------------------------------------------------------------------------------------------------------------------------------- ; colums = 6 rows = 3 ; ;type | Button label | Path or mimetype | ShortCut | Arguments | Environment | Icon ; mime | ToolDock Config | application/x-mw-BeIDE | LCTRL-1 | Config.cfg | | application/x-Tinic.ToolDock mime | Terminal | application/x-vnd.Be-SHEL | LCTRL-2 | | | application/x-vnd.Be-SHEL path | NetPositive | /boot/apps/NetPositive | | | | /boot/apps/NetPositive mime | BeIDE | application/x-mw-BeIDE | LCTRL-3 | | | application/x-mw-BeIDE empty mime | Term in settings | application/x-vnd.Be-SHEL | | | FOLDER_PATH=/boot/home/config/settings ; mime | Home directory | application/x-vnd.Be-TRAK | LCTRL-4 | /boot/home | | application/x-vnd.Be-directory mime | AddOn directory | application/x-vnd.Be-TRAK | | /boot/home/config/add-ons | | application/x-vnd.Be-directory mime | Apps directory | application/x-vnd.Be-TRAK | | /boot/apps | | application/x-vnd.Be-directory empty mime | Edit BootScript | application/x-mw-BeIDE | | /boot/home/config/boot/UserBootscript mime | Edit SetupEnv. | application/x-mw-BeIDE | | /boot/home/config/boot/UserSetupEnvironment ; path | Network prefs | /boot/preferences/Network | LCTRL-5 | | | /boot/preferences/Network path | Drive Setup | /boot/preferences/DriveSetup | LCTRL-6 | | | /boot/preferences/DriveSetup empty mime | Show processes | application/x-vnd.Be-SHEL | | /bin/sh -login -c "ps !! more -e" mime | Kill AudioServer | application/x-vnd.Be-SHEL | | /bin/sh -login -c "kill -9 audio_server" path | Launch AudioServer| /boot/beos/system/servers/audio_server ; ; ; ; end of file
Daffy Duck lives! Yep, you reached the end...
Now go and write some feedback to 5uro@informatik.uni-hamburg.de. Please...