| Fink & Apple's X11 |
|
/ Tips & Hints /
I hope this page will grow into a collection of 'hints and tips' about applications and utilities installed with Fink in X11.
Contents Vim colors Psync Backups Deborphan Starting Mysql at boot time Blackbox Tips Xmms no sound Xmms Skin Installation Select multiple mp3 files in xmms Pico Editor basic commands Fluxbox Tips ImageMagick Tips To turn off Eterm random backgrounds Emacs commands To view man pages in html Debug tools To list the files installed by a package To find out what package a particular file is part of To check which packages are out of date To delete the "old deb files" via Fink fix-fink Bluefish and Safari To add apps to the gnome2 menu KDE Tips To send the compile output to a text file Adding options to a package .info file Sharing the Fink Reinstalling Fink Tips Sleeping during compile Uninstalling Gnome Running ethereal Vim colors Problem: "I'm having trouble getting vim's syntax highlighting to use ANSI colors in Terminal.app. Is there a setting that I'm missing in my .vimrc?" Answer: Please check that you have in your .vimrc file: :syntax enable or write in your .vimrc file: let &t_Co = 8 If the above doesn't work, try these suggestions from the manual: There can be a number of reasons why you don't see colors: Your terminal does not support colors. Vim will use bold, italic and underlined text, but this doesn't look very nice. You probably will want to try to get a terminal with colors. Your terminal does support colors, but Vim doesn't know this. Make sure your $TERM setting is correct. For example, when using an xterm that supports colors: setenv TERM xterm-color or (depending on your shell): TERM=xterm-color; export TERM The terminal name must match the terminal you are using. or Most color xterms have only eight colors. They should work with these lines in your .vimrc:
[<Esc> is a real escape, type CTRL-V <Esc>] You might want to put these lines in an ":if" that checks the name of your terminal, for example:
Note: Do these settings BEFORE doing ":syntax on". Otherwise the colors may be wrong. Psync Backups Psync does an update copy. It compares source directory and target directory at first, then erases items that are nonexistent on source directory if specified and finally copies everything on source directory. Items with the same modification date and (data fork) size remain untouched, saving time on operation. I love this script, thanks to psync I saved myself a lot of headaches in many occasions, I use it regularly like this: sudo psync -d /Users/pm /Volumes/backupdisk/backup to produce a copy of my home directory (and all subdirectories) inside the backup directory on "backupdisk". And, the next time you use it with the same command, it will sync the backup with the active copy, deleting files on the backup that have been deleted on the main copy (if you don't want this to happen just take out the -d flag), and only copying files that have changed. According to the man pages, it is also possible to backup everything in the startup volume, all you have to say is: sudo psync -d / /Volumes/Ibackup And the resulting backup volume is fully-bootable copy thereof. Note `sudo' or root privilege is necessary to restore file ownership. Deborphan -d, --show-deps Shows a list of dependencies for packages that have them.
Starting Mysql at boot time Question: "I successfully installed mysql from fink ('fink install mysql'). I can start the server manually once the computer is up by issuing: /sw/bin/safe_mysqld --user=mysql --log & However, I am having trouble starting the server at boot time". Answer: Run 'sudo daemonic enable mysql' From 'fink info mysql': Usage Notes: The package creates the administrative tables on installation. Be sure to set a MySQL root password using mysqladmin:
You can start the MySQL server manually 1) using 'safe_mysqld --user=mysql &' - version 3.x 2) using 'mysqld_safe --user=mysql &' - version 4.x or you can run 'daemonic enable mysql' to create a StartupItem for it. All of these must be done as root. Blackbox Tips You can configure the applications to appear in the app-launcher in your ~/.blackbox/menu file. Download some nice themes and cp them to: /sw/share/Blackbox/styles If you use blackbox, you can also install the packages: bbkeys Key binding handler for Blackbox. bbmail Email-watcher designed for use with Blackbox. bbpager Pager tool for the Blackbox window manager. Xmms no sound Since xmms forks an esd process the first time you run it then you'll might have one running as root already, to confirm try: ps -auxw | grep esd If the first column is root hunt that process down and kill it, and restart esd from the command line. Be sure to select the "eSound Output Plugin" in the xmms preferences. Run in an xterm: esd & if you hear a sound, then it should be working. Then run in an xterm: xmms & Xmms Skin Installation Download Xmms Skins Download Xmms Skins XMMS creates a directory called: ~/.xmms/Skins/ in which you can unarchive the skins you downloaded. If you installed XMMS with Fink, it will look for skins in these directories: /sw/share/xmms/Skins and ~/.xmms/Skins Use ALT+S when using XMMS to bring up the skin selector. XMMS will remember which skin you had loaded when you start XMMS the next time (saved in ~/.xmms/config). In the skin selector you have an option to use random skin on play, this will pick a random skin on song change. XMMS supports archived skins. Both .zip and .tgz (.tar.gz) archived skins are supported. Just "check" if it works for you and copy the archive to one of the skin path's and XMMS will take care of the rest. In order to support zipped skins you will need to have unzip installed. If this doesn't work for you, then just unarchive the skin and copy the folder to one of the Skins directories. Select multiple mp3 files in xmms When you select multiple mp3 files for xmms to play, sometimes the player just freezes after the end of the first track. In contrast - when selecting only single mp3s for playback everything is fine. However, there is a workaround: Open XMMS preferences -> Options -> Click on: "Pause between songs for 2 seconds" (maybe 1 sec is also sufficient). This seems to avoid the buffer overrun. Pico Editor basic commands Pico is a simple text editor based upon the Pine Message/mail System. Editing commands are entered using control-key combinations. The most important commands are displayed at the bottom of the screen, facilitating ease of use. To start pico, simply use the command "pico" followed by the name of the file you wish to edit. If the file exists, pico will start with that file. If it does not exist, then pico will assume that it is a new file. The basic commands provided by pico include:
Note that cursor positioning can also be accomplished by using the up, down, right and left arrow keys. Fluxbox Tips To use your own configuration: Create a directorory, in your homedir, called .fluxbox and copy: init, keys and menu from /sw/share/fluxbox/. Dont forget to change session.menuFile and session.titlebarFile in the file init. You can use your old blackbox configuration file too. Just copy: .blackboxrc to ~/.fluxbox/init The same goes for menu file. You can also use the Blackbox themes in Fluxbox. If there isn't any format for the tab in the theme then the tab will have the same theme as the titlebar. The keys config file can be selected in the file init: session.keyFile: [filename here] The keys file is no longer compatible with bbkeys. There's a convertkeys script at: Convert Keys script that will convert the bbkeys format to the fluxbox format. To change the default startup 'style': The init file has several parameters--it starts with a style called 'Clean'. You can change this to a different style if you wish. Find the line that reads: session.styleFile: /sw/share/fluxbox/styles/Clean Say you wish to start with the 'Rancor style'. You would change the above session.styleFile to: session.styleFile: /sw/share/fluxbox/styles/Rancor A quick example of menus: Open your home directory's .fluxbox/menu file. You'll see that the pattern of a menu item is: [exec] (xterm) {xterm} The exec means you can execute the command, the second item is how it will appear in the menu and the third, in curly braces is the actual command. Say you wanted to add 'aterm' to the menu file and you want it to appear directly under the listing for xterm. So, under the listing for xterm add: [exec] (aterm) {aterm} The second listing is how it will appear when you see the available menu options. So, you could write Aterm or ATERM in there--it makes no difference. You can add whatever programs you wish, under the pre-existing menus and submenus. A few extra notes: To disable tabs and/or iconbar just change it in configure menu. To work with tabs, use the third mouse button to drag a tab to another tab. This will group the two windows together. With 'Sloppy Window Grouping' turned on (in your configure menu), you can drop the tabs anywhere on the target window to group windows together. The 'Maximize over Slit' option means that maximized windows will not stop at the outside border of the slit, and will instead cover it. In the init file, the session.screen0.rootCommand: option will override the rootCommand option in a theme- keeping your background the same, no matter what the theme says it should be. ImageMagick Tips You can use display, part of the ImageMagick suite of tools, to view an image in X11. If you run display and the file name of the image to be viewed, it displays the image in a new window. Run: display name_of_file.jpeg If you left-click on the image window it will open the display 'command menu' in a new window. Menu items let you change the image size and otherwise change or transform the image display. For an explanation of the various available display commands, choose Overview from the Help menu. If you middle-click on the image it will open a new window with a magnified view of the image centered where you click or if you right-click on the image window a pop-up menu containing a few of the most frequently-used commands will come up. The commands included are: Quit, which exits display, and the Image Info, which displays information about the image file, including number of colors, image depth, and resolution. display can also be used to view images on the World Wide Web. To put an image in the root window, run: display -window root name_of_file.jpeg To turn off Eterm random backgrounds The default themes all choose background pictures at random from the collection supplied with Eterm. The lines in the config file that activate this behavior are shown here:
The first two lines are merely comments. The third line does the actual work. The backquotes are evaluated first to cat the pixmaps.list file and include its contents as the parameters to the %random() function. The function then picks one parameter at random and returns it. Thus, the name of the randomly-selected pixmap becomes the parameter to the file attribute. In order to deactivate this behavior, simply change this line to refer to a specific image file, or alter the mode line (just below the file line) to specify a mode other than image for the background. Emacs commands
Emacs has an excellent on-line help tutorial. To use it, start up emacs. When you are "in emacs", type C-h, then type the letter "t". Follow directions. When you wish to leave the tutorial, type C-x C-c. To view man pages in html (Thanks to Paul McCann (pmccann) for the tip) Install with Fink the rman package. It takes man pages from most of the popular flavors of UNIX and transforms them into any of a number of text source formats. For more info about rman check: Polyglotman web site Then, use rman via a script to generate an html file and open the file in your default browser.
You'll have to change the path to the outfile (which is overwritten every time you call the script) Save the script in ~/bin/bman (for example) then "chmod u+x ~/bin/bman", then "rehash" and finally you can run for example: % bman tcsh Debug tools If you installed Apple's developer tools, check: man gdb (The GNU Debugger) man otool (-tool to display specified parts of object files or libraries) man ktrace (-enables kernel trace logging for the specified processes) man 1 dyld (-the dynamic link editor (useful env vars)) man install_name_tool (-change dynamic shared library install names) otool examples: otool -Lv YourBinaryHere otool -LV /sw/bin/gimp-real otool -L /sw/bin/dpkg otool -L /sw/lib/libgdal.1.1.dylib otool -L /sw/lib/libk* | less otool -L /sw/lib/*.dylib To list the files installed by a package To get a list of all of the files installed by a package, run: dpkg -L packagename To find out what package a particular file is part of To find out what package a particular file is part of, run: dpkg -S filename Fast alternative to dpkg -L and dpkg -S With Fink you can install: dlocate-0.5-2 "Uses GNU locate to greatly speed up finding out which package a file belongs to (i.e. a very fast dpkg -S). many other uses, including options to view all files in a package, calculate disk space used, view and check md5sums, list man pages, etc". To check which packages are out of date fink list -o To delete the "old deb files" via Fink Run from terminal.app the command: sudo apt-get autoclean And, if you use source, to clean up the old .deb files, run the command: (or from the FinkCommander menu, Source -> Utilities -> "Cleanup") fink cleanup fix-fink version-2.1-1 David R. Morrison updated the fix-fink program to help people update their libpng libraries to libpng3 and hopefully cure the libpng/libpng3 woes. "Here's what it does: it examines all of your libraries and executables to see if they link to libpng.2.dylib, and if they do, it tells you to rebuild the corresponding fink packages. This only makes sense, by the way, if you have run "fink selfupdate-cvs" on March 10-2003 or later (to make sure that the "libpng -> libpng3" updates are present on your system)". He also updated the older part of fix-fink so that it should no longer report "false positives" on the test that it runs. Warning: if you have KDE installed, then fix-fink is going to want to rebuild your KDE packages, updating them to the new KDE 3.1 packages. This could take a day or more of compiling, so you might want to time your execution of fix-fink appropriately. There is one situation in which fix-fink is slightly tricky to use. If you have at some point in the past installed some packages from the unstable tree, but are currently using the stable tree, fink might get confused by the instruction to rebuild the packages. In this case, you can temporarily turn on the unstable tree, run fix-fink, and then revert to the stable tree after everything has been rebuilt. Bluefish and Safari To get Safari to preview the page that is being written up in Bluefish: I use 'fink installed bluefish-0.11-1' in 'Apple's X11 rootless' with Safari, so I wrote the following in: Bluefish -->Options -->Preferences -->External programs --> browser= Safari Command= open /Applications/Safari.app %s & To add apps to the gnome2 menus To customize your menus, you can use the Nautilus file manager (check the info with "Help") or Launcher Popup menu. Launcher Popup menu: When you right-click on a launcher in a menu, the popup menu for the launcher opens. Check the submenu-->Entire menu -->Add new item to this menu. Another window will open where you fill the name, the command of your apps, and choose an icon. Press ok. Your apps will now appear in your panel menu. I'm using Apple's X11 with gnome2, but I deselect "Use Nautilus to draw the desktop" in the Preferences of the Nautilus File Manager as I like to run Apple's X11 in rootless mode. (together with MacOS X desktop) and then I access most of my apps through the Apple's X11 'Applications' menu which I can access also from the dock. KDE Tips -Once KDE launches my mouse clicks become unresponsive once the tips screen appears: You need to turn off 'Enable icons on desktop' in: Control Panel -> Desktop -> Behavior The transparent root window desktop is over the Aqua desktop. You may need to select Minimize from the X11 Window menu intially to access the Control Panel. --------- KDE Multiple Desktops on Panther The desktops are a function of the window manager. If you use KDE with quartz-wm you only will get 'one' virtual desktop. In order to use Multiple Desktops in KDE with Apple's X11, create a .xinitrc file in your home directory, with the following lines:
--------- Fonts -navigate to KDE's control panel for system fonts, use the drop down to pick something that works. --------- -Take a look through the /sw/bin/startkde script. There are several instructions early in the script's execution that focus on font location and what fonts will be made available to X11. There are 5 different checks and possible font activations- X fonts, user fonts, system fonts, user override fonts, and system override fonts. --------- -In applications that support the Xft font rendering, Apple's X11 can shortcut directly to Apple's font renderer, and you have access to all of the fonts in OSX, as well as X11 fonts. -You can install fink applesystemfonts package to make your fonts visible to x11 non-xft apps. --------- -anti-aliasing is implemented in X11. It works just fine in KDE, with a default configuration. Go into the font settings and pick an Xft-supported font. To send the compile output to a text file
Adding options to a package .info file Example: Adding "--with-python" option to vim Create a directory /sw/fink/dists/local/main/finkinfo/editors and copy the vim .info file (and .patch file if it exists) in there. Add: --with-python or whatever you want to the ConfigureParams line and increment the revision number. Then, Add: "local/main" to the 'Trees' line in /sw/etc/fink.conf. Finally, fink update vim Question: Would any updates to vim require me to fiddle with the configure script before each installation? If the vim package is updated to a revision number higher than the one in your local directory, a "fink update-all" will replace your version. To get around this, call your vim package "vim-python" and add: Conflicts: vim Replaces: vim Provides: vim to the .info file (this is what is done for the vim-nox package - you might just use that one as a starting point). Sharing the Fink (How to share software between more than one fink installation) Thanks to Benjamin Reed (Fink Project Lead). Tales of the Racoon Fink October 29, 2003 --------------------- Sharing the Fink "I was recently asked how to share software between more than one fink installation. This is usually because the person has 2 (or more) machines, only one of which is fast. =) It's pretty easy to share binaries you've built on one system with another. Here's how (keep in mind these instructions will generally only work if each system is running the same major version of Mac OS X): 1. Install Fink on the "master" (build) system. 2. (If the clients already have fink installed, you can skip this step.) Copy /sw to the "client" systems. First you must enable "Remote Login" on the "master" box. Then, run the following on each of the "client" machines:
Just replace user@otherhost above with the username and hostname of the system to copy from. This will make a clone of the fink installation on your "master" box on each of the clients. 3. On the "master" box, build something, and then run: fink scanpackages This will make fink generate apt indexes for all of your enabled trees. 4. On the "master" box, enable: "Personal Web Sharing" in the Sharing section of System Preferences, and then set up httpd to expose your /sw/fink directory externally. I do so by making an: /etc/httpd/users/fink.conf file that contains:
..and then run: sudo /usr/sbin/apachectl graceful to (re)start. 5. On the "client" box(es), edit: /sw/etc/apt/sources.list and add the lines representing your fink trees. For example, if my IP address of my build box at home is 192.168.42.7, the client would add:
6. On the "client" box(es), run: sudo apt-get update If all goes well, you should see something like:
7. You should then be able to do: sudo apt-get install <package> for anything that's been built on the "master" box. Any time you build more stuff there, you will need to re-run: fink scanpackages on the master, and sudo apt-get update on the client(s)". Reinstalling Fink Tips To reinstall fink you need to remove all of /sw by sudo rm -rf /sw but you can save /sw/src and /sw/etc. /sw/src is sources you'll need to have to download again. /sw/etc is where configs are kept, if you changed any of them. For example to save /sw/src do the following: sudo mv /sw/src ~ then when you reinstall fink, it will ask you for a place where additional sources are, and you can then enter: /Users/username/src Sleeping during compile If you have a compile going on and close the lid of your ibook, the compilation will be temporarily suspended and your computer will go to sleep. When you open the lid the compilation will resume when the computer wakes up. It's pretty safe. Note: It happened in some cases, that the iBook accidentally couldn't sleep, like for example, if after RAM or an AirPort Card installation, the keyboard was not properly installed back causing some key(s) being pressed by the lid, which prevented the iBook from going to sleep. Uninstalling Gnome There is no package that does the corresponding *uninstalling*. Running ethereal Ethereal needs to be run as root. If you are not root, you will not see any devices. In 10.2, you could run 'sudo open-x11 ethereal'. In 10.3 you can start from an xterm with: sudo ethereal
/ Make Contact /drop me a line at: sao1@mac.com |
| MacOS X, Fink, X11, Unix ...and other related things |