The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Debian and Mac OS X (http://hintsforums.macworld.com/showthread.php?t=8702)

tjj 01-31-2003 02:37 AM

Re: HA ha hahaha hehehehe
 
Quote:

Originally posted by Glanz
This is for you Thomas

http://glanz.johncfish.com/images/WM.jpg
Ouch, I take it back. You were able to do worse!

thatch, I am having the exact same troubles (and frustrations!). I wanted to remove some applets that haf turned up in my panel, couldn't and then removed the entire panel. Can't get it back. I tried rerunning the dpkg-configure xserver-xfree86. Seems to be no effect of dis- or enabling the Emulate 3-button mouse option. Haven't yet tried stopping and restarting the gdm. Got work to to, I'm afraid.
Have you set color depth to 24? I set it to 16 because of the specs from apple.

Glanz, once again you're efforts are appreciated. Must somehow get you a beer, someday.

thatch 01-31-2003 03:12 AM

tjj, I have set 16 bit color back when we got up and running without the blank screen and all. And that's the best we can get, I think. But I haven't even tried it the 24 bit way. I suppose it's good testing though I like to proceed on to solving the next problem.

The key bindings are most important so you can use the modifier keys which would let us get the applet icons out of the taskbar and menubar at the top. I was able to get rid of one by renaming it and then naming it back with a couple of reboots in between. Not exactly what I want to have to do to put an applet and it's icon away. I still have the gnome panel in both locations and would like to get it out of the taskbar location. All in good time, I suppose.

Check your private messages, okay? I'm sending you one so you can buy me that beer. :p ...

tjj 01-31-2003 04:20 AM

Thatch,
thanks for the message.
Those keyboard issues are annoying. If I get the time, I will mess around with it this week-end. I have problems with special char. as well (the ones that use the alt modifier key, like @, | (pipe), © etc., while the danish æ,ø and å all work as expected).
Hope that Glanzzz has the time to deliver:).

tjj 01-31-2003 07:39 AM

thatch,
I stumbled on this in section 11.3 of the manual:
Quote:

For PowerPC, in /etc/X11/XF86Config or /etc/X11/XF86Config-4, set the mouse device to "/dev/input/mice".

Modern kernels give you the capability to emulate a three-button mouse when your mouse only has one button. Just add the following lines to /etc/sysctl.conf file.

# 3-button mouse emulation
# turn on emulation
/dev/mac_hid/mouse_button_emulation = 1
# Send middle mouse button signal with the F11 key
/dev/mac_hid/mouse_button2_keycode = 87
# Send right mouse button signal with the F12 key
/dev/mac_hid/mouse_button3_keycode = 88
# For different keys, use showkey to tell you what the code is.
I don't have the box with me, so I haven't tried it yet

Glanz 01-31-2003 09:12 AM

Re: Re: HA ha hahaha hehehehe
 
Quote:

Originally posted by tjj


Glanz, once again you're efforts are appreciated. Must somehow get you a beer, someday.
Tea will do..... Don't like beer! Maybe a bagel too.:) with lots of Danish whipped butter.

My color was set automatically @ 24 I believe. I had to choose 1024 x 768 resolution several times before it would take. I had all the material specs with me, printed out on several sheets of paper when I installed from official Debian CDs..... I have seven of them. So far I have only four installed. BTW those instructions you found in the manual are exactly the same ones I wanted to post.

Now, I personally went back to configure much stuff with the "xf86config" Script. Be careful with this because while installing FreeBSD on several machines long ago, I actually blew up a monitor. There is no place for errors here.

"xf86config" will overwrite your existing Xf86Config file...... So if you want to experiment, back up your existing file first by renaming it so it wont be in conflict with the newly created one. You need to be root to do this.... really root. While running xf86config it would be handy to have a print out of the original file at hand.

Really guys.... This is no place for a one-button mouse.... A one-button mouse simply does not exist in the Unix world. For the mouse choosing "/dev/mouse" is /dev/tty00....
You need to know the exact device to which it is connected. For monitors, check if your monitor is listed in /usr/X11R6/lib/X11/doc/Monitors.....

Remember, do not even think of running xf86config if you do not have the exact specs for everything. You will have to choose exact specifications... You can't "just guess"..

And go out and buy yourself a real mouse and throw that one-button atrocity away.....

The keyboard configutation is also in there...

tjj 01-31-2003 09:30 AM

Quote:

And go out and buy yourself a real mouse and throw that one-button atrocity away.....
Sorry, that's not an option as it's built into the casing:) . There is an ADB ( I think) port for ext. mice. Will think about that. I just thought that Debian could be configured so that one could do entirely without mouse. I use a 3-button usb mouse for my pismo, and know some people have 5 or even more buttons (is that what they call a Keyboard?), programmed to this and that. Iwould just like to be able to configure the friggin gnome panel - if I ever get it back- with my built in trackpad/mouse.

The instructions from the manual...do they correspond to choosing Emulate 3-button.....etc in the set-up? If so it didn't work out. Will check the file this week-end.
One of the problems is that the PB manual/specs really aren't very informative...at least not to the degree required by a Debian install...

Glanz 01-31-2003 12:32 PM

OK Tjj, DUH... I understand... I am using a touchpad and a one-button clicker. I set up my meta to reas "alt/option+ click as a right-click...... and I une "tab" to bring up a menu in Wmaker.... First, you have to get your keyboard configured correctly.

Here's what I have on the FreeBSD box....

http://glanz.johncfish.com/images/daemon.jpg

thatch 01-31-2003 03:34 PM

tjj, yes I have read that in the manual about the 3 button emulation. But I assumed that it was for a desktop where an external mouse would be used, not for a laptop where an external mouse would not likely be used.

Anyway, I grabbed the adb mouse from the 7500 and plugged it into the 3400. I've done it before and so I know it works, at least under OS 8.6. Well, it works fine with Debian too. In fact, the regular trackpad clicker works with those settings too. So, now I've removed the unwanted junk from my taskbar and menubar. Hooray!

Glanz, almost all Mac users only have a single button mouse. That's what the latest G4 will ship with. We use modifier keys to emulate three button mouse behavior, like in WindowMaker it's the control+option or control+command for the second and third buttons respectively.

Now I know that a three button mouse will indeed work for the old 3400 and Debian, provided it's an adb one and doesn't require any driver software for it. I never really liked the accessory mice Mac users can buy, like a Logitech 3 button and scrollwheel. It requires driver software and configuration.

To all, I found that after a reboot, my trackpad settings were put back to tap clicking which is apparently the default setup. I don't know why my changed settings won't stick. There must be an rc file or some such where I can enter those preferences somewhere. I just haven't figured out where yet. Navigating around the file system isn't quite the same as OS X.

I can't seem to make some simple aliases stick either. I had put them in my ~/.bashrc where there are already ones to be used. And they worked fine all day yesterday through several logouts and reboots. But today, I have to enter them manually in the terminal to get them to work. Isn't that very odd? Where can I put these things so they will stick globally?

Glanz 01-31-2003 04:22 PM

First of all, here's a good page for you....... nothing to do with aliases, but all you need to know is there, plus all you never dreamed you wanted to know too.

http://www.debian.org/doc/manuals/re....html#contents

I don't use a mouse on my portable. I have a three wheeler on my FreeBSD PC though...

Aliases in bash are different than in tcsh.
Aliases and substitution text are separated by = signs rather than spaces or tabs. There is no method for doing argument substitution in bash..., unlike tcsh. That's why I don't use bash.... too many gymnastics.

Bash doesn't implement variables the same way as tcsh. All it does is set primary and secondary prompts as variables [PS1 & PS2], from which the shell will read strings....

Here's a prompt that reflects the present working directory

# PS1="{pwd`\:!} "
{/root:18}

Setting the command path in bash means setting the PATH environment variable. Here, it's a colon separated string of pathnames with an export statement to "publish" the variable into the environment. PATH=/sbin:/bin:/usr/sbin:/usr/bin:/user/games/:/usr/local/bin:/usr/X11R6/bin:$HOME/bin; export PATH

Notice the only semi-colon in there.

Glanz 01-31-2003 04:51 PM

Here's an email prompt in bash. Note that the "!" does not have the same meaning as in tcsh. I prefer tcsh because it is the FreeBSD shell and I have been using FreeBSD since it was invented. Waaaaay back when Thiomas was just a little whippersnappin, curtain climbin', rug rat.

# PS1="{`whoami`@`hostname | sed 's/\..*//'`:\!} "
{root@www:17}
Now in tcsh, that would be more civilized. My GNU community spirit ends at the shell :D

thatch 02-01-2003 02:03 AM

Glanz, thanks for that excellent link. Judging by the titles and subtitles alone, I can see it's perfect for us at this stage for the whole gamut of what's under the hood in Debian. I know I'll get things straightened out eventually. It's just very new and different right now.

My favorite shell of late is zsh which kind of combines ksh, csh, sh, tcsh and probably a lot of bash as well. So, I'm also familiar with tcsh since I primarily used that prior to zsh. The syntax with aliases in bash is very similar to that in zsh. Other than the special characters, it's really mostly the same.

Anyway, I had said how I added some aliases to my ~/.bashrc and they worked fine, for a day, and then now they aren't working. Maybe it has to do with the shell not be a login shell? They seem to all be called interactive in Debian.

Also, when I had things in the shell the way I wanted them, I chose to save the session which seemed to work fine, again for a day, and then now not so good again.

And the trackpad settings aren't sticking after a reboot, so something's changed but I haven't had the time to figure it out yet.

Where would I make zsh my default and global shell in Debian? In OS X, we would put it in an initrc file in /etc.

Meanwhile, I'll be looking at that link for the round about way of finding those answers, but good reading will pay off in the long run, I know.

Glanz 02-01-2003 09:15 AM

[QUOTE]Originally posted by thatch

Anyway, I had said how I added some aliases to my ~/.bashrc and they worked fine, for a day, and then now they aren't working. Maybe it has to do with the shell not be a login shell? They seem to all be called interactive in Debian.

Where would I make zsh my default and global shell in Debian? In OS X, we would put it in an initrc file in /etc.
/QUOTE]

I too use tcsh for everyday stuff, but my main system shell is either zsh or ksh, depending on my machine.

Here's a trip on shells that I learned using FreeBSD.

One uses "chsh" to change shells system wide. This also works in OS X and/or Fink. You'll see why I say "and/or" momentarily. One uses the semi-app, and one uses the interactive shell session. One is more like FreeBSD, and the other is more like Linux. All this generally applies to all Unix-type systems, BSD, Darwin, or Linux, but in different subtle ways.

Changing your default shell via "~/.login" , be this in OS X or otherwise, is not very efficient because you will be effectively using a "shell within a shell"..... In other words, the system default shell will "call up" your chosen shell. The symptom is a double logout..., one for the shell you are using, and one for the system default shell.

You may change your shell to any shell listes in /etc/shells..... by using the "chsh" command.

In the BSD's this opens a vi interface and acts more like an app than a CLI session. In most Linuxes, an interactive terminal session opens. The way to use chsh is to type in a root terminal ( I am using "thatch" for user, for changing an individual user's shell.) Here's what appears....

# chsh thatch
# Changing user database for thatch
Shell: /bin/bash
Full name xxxxx
Office Location:
etc
etc
##########################
This usually uses the vi editor, so if you make a mistake or are not sure about something, enter a colon (:) followed by a q!

To change the "thatch" shell permanently
from /bin/bash to /usr/local/bin/zsh (or wherever it is)

Once in the vi screen, obtained by typing
chsh thatch
use the arrow keys to move to the beginning of the word tcsh, right after the slash. Press c for "change" and then w for "word". A $ sign will appear at the end of the word you are changing

Shell: /bin/bas$

Type zsh in place of the word bash then press escape to exit the change-word mode. Now the shell is /bin/zsh.
The next step:::
Place the cursor on top of the first slash, just before "bin" and press i for "insert" to get a cursor. Enter /usr/local and press escape.
Now, enter a colon to go into the in-program command line and then follow it with a w for "write". Press enter to save. Finally enter :q and press enter to quit.

The file you have written is a temporary file in /etc. If your changes are valid, they will be read then automatically rebuilt into /etc/master.passwd and /etc/passwd. From now on, every time thatch (or root and thatch if you do it that way) it will be under zsh.

Now, another editor may be used also, depending on which is set as system default. Also the locations I gave were arbitrary because the relate to my system, but they may apply to yours also.

If the changes you make are not valid, you will be given a choice to redo your shell profile or to cancel the operation.

On your Debian, you may enter an interactive terminal session at the "chsh thatch" command.... Each system is different.

Glanz 02-01-2003 10:08 AM

A Note on Editors
 
This "bad advice" applies to users of Linux, OS X, FreeBSD, etc :)

I hate convoluted editors. Editors that were made by out-of-work labyrinth builders, etiologists, ontologists, and others with serious existential problems. I use the "Nirvanna" NEdit editor..... It has it's drawbacks, but it sure beats loading emacs whis is bigger and more CPU intensive than most operating systems. Using emacs is like being Richard Stallman's psychiatrist.... One has the impression of voyaging in the inner workings of a geek mind, rather than using a practical tool. Vi is simply arcane and esoteric. Vim is more arcane. Pico is cute. Nano is Free Soft cute. Joe is good and can emulate all other editors, but NEdit is simply great.

There is also a port for OS X. Fink also has it on the cvs.

It is also available from the Deb archives.
NEdit is a multi-purpose text editor for the X Window System, which combines a standard, easy to use, graphical user interface with the thorough functionality and stability required by users who edit text eight hours a day.

It provides intensive support for development in a wide variety of languages, text processors, and other tools, but at the same time can be used productively by just about anyone who needs to edit text.

As of version 5.1, NEdit may be freely distributed under the terms of the GNU General Public License .

NEdit GUI is based on Motif and is available on all major Unix and Linux systems. If you don't have Motif installed on your workstation, you can use Lesstif or OpenMotif.
If you could only use a Windows32 or a MacOS platform, don't worry !!! NEdit is available too on Windows32 and MAC OSX.

NEdit, which is entirely a volunteer effort, benefits from a strong developer and user community.
<<<People already exposed to modern GUIs when introduced to UNIX used to be (and still are) told to use vi or EMACS. If you complained that any product that requires you to invest hours of training just to edit text is a stinking abomination from the bottommost pits of hell and you can't even figure out how to save your document without a manual, you were told that you were wrong, you just had to hit ctrl+alt+meta+escape + the phase of the moon and write a small lisp routine without visual feedback, and that this is in fact a much more powerful and more efficient way to do things, and that GUI editors are baby's toys (since most of the ones on UNIX were).

NEdit was for those who never capitulated to this attitude, and insisted on a proper gui-based editor that works the way they were used to on other systems, with a focus on ease of use and familiarity for new users, so you could be productive right away, without sacrificing power.
>>>

http://www.nedit.org/about/features.shtml

To use Nedit as root, simply type "sudo nedit" in a terminal. As a regular user, simply launch the app.

thatch 02-01-2003 06:52 PM

Glanz,

The change shell command worked very well. But first I had to make certain to have all the appropriate files in place. And that was a big job because I had to type them by hand since I cannot file share between Debian and OS X on the LAN. Even though I had set up an exchange partition, HFS, which the manual said would help in that regard, I couldn't figure out how to mount it so I could copy files from it to Debian.

Now I have zsh as my shell, but it's got some problems I haven't been able to solve as of yet. First off, the shell complained that it couldn't find certain variables under the setopt for history options. I found that I had to write out 'setopt' for each one whereas in OS X I didn't have to do that. The first one in a list would require it but the others that followed would not. Problem solved there.

The next problem was the shell complaining about, "compinit: function definition file not found", which is part of zsh completions. I didn't know what else to do for that but comment out that particular line. And in doing so, I have no doubt disabled part of the completions function. So, that one isn't really solved I don't think.

I had the same problem with 'compdef' and did the same thing, commented out that line. That is for man completions and I figure something will be broken there as well, so that's not really solved.

And last, is that I have an "unmatched '", but I have gone through the very long ~.zshrc file with a fine tooth comb and can't find any unmatched ('). There is one line that reads, "zstyle ':completion:*' group-name ''", but the two single quotes are supposed to be there right next to one another. And commenting it out didn't solve the problem which means it must be somewhere else. But I can't find out where. How frustrating!

I find it odd that zsh has different syntax between OS's. I never would have thought that about shells in general. Any ideas why?

Oh, forgot to mention one other thing. I lost my delete key since I moved to zsh. Isn't that weird? What bindkey would have done that? I don't show any for the delete key in my .zshrc, .zprofile or .zshenv files.

Glanz 02-01-2003 07:15 PM

For non-root partitions, you'll have to remember to manually modify your new fstab file so that when you reboot the partition will be mounted. Wait for that file (/target/etc/fstab) to be written by dbootstrap, of course, before editing it.

I'll get back on the zsh questions.....:)

Glanz 02-01-2003 07:50 PM

try adding

append="keyboard_sends_linux_keycodes=1"

to your bootx.conf file

to adjust the keyboard

If that does not work
delete it

needless to say..... it's taking a chance.. I know that works with a yaboot.conf file, but I have no experience with bootx files....

Glanz 02-01-2003 07:53 PM

another keyboard trick
 
You can find Mac keyboard layout definitions in /usr/X11R6/lib/X11/xkb/symbols/macintosh

If your distribution does not use Mac keylayouts but standard Linux layouts, they can be found in the symbols directory mentionned above.

thatch 02-01-2003 08:16 PM

Glanz,

Hold in mind that my delete/backspace key did work fine in bash.

I don't have a bootx.conf file.

I viewed the Mac keyboard layout defs file you mentioned. It's there and shows an extended keyboard. Powerbooks don't have an extended keyboard but I guess the same stuff applies other than the extra keys. So, what do I do with that file?

I tried adding a delete key to my .zshrc but it didn't work.
Code:

bindkey "^[[3~" delete-char
How very odd that switching shells could be so problematic. And I thought I would be gaining a lot by switching to my favorite with all it's super functions.

I've apparently lost tab completion too, as I had mentioned with having to comment out compinit and compdef in my .zshrc.

Glanz 02-01-2003 08:43 PM

In the meantime, here's a power control script for you......
CODE
# pwrctl-local whoever
#!/bin/bash
logger=/usr/bin/logger

function do_warn()
{
local msg="Low battery, system will go down..."

(
/usr/X11R6/bin/xmessage -center -timeout 15 "$msg" || \
echo "$msg" | /usr/bin/wall
) &
}

function pwrctl_Core99()
{
case "$1" in
minimum)
# min power, set disk to spin down after 1 minute
[ -f /sbin/hdparm ] && hdparm -p -S 12 /dev/hda
case "$2" in
ac)
fblevel 12
;;
*)
fblevel 8
;;
esac
;;
medium)
# medium power, set disk to spin down after 2.5 minutes
[ -f /sbin/hdparm ] && hdparm -p -S 20 /dev/hda
case "$2" in
ac)
fblevel 15
;;
*)
fblevel 8
;;
esac
;;
maximum)
case "$2" in
ac)
# on mains, do not spin down
[ -f /sbin/hdparm ] && hdparm -p -S 50 /dev/hda
fblevel 15
;;
*)
# on battery, set disk to spin down after 5 minutes
[ -f /sbin/hdparm ] && hdparm -p -S 25 /dev/hda
fblevel 8
;;
esac
;;
warning)
do_warn
;;
lid-closed)
fblevel off
;;
lid-opened)
;;
sleep)
;;
wakeup)
$logger -p daemon.debug -t pwrctl "$0: Wake-up $1 $2"
case "$2" in
ac)
fblevel 15
;;
*)
fblevel 8
;;
esac
;;
*)
$logger -p daemon.error -t pwrctl "$0: invalid arg $1"
;;
esac
}

pwrctl_Core99 $1 $2
exit 1

CODE

Glanz 02-01-2003 08:55 PM

Keyboard again
 
A quick fix is to edit
/etc/console-tools/default.kmap.gz by hand, putting in the setting for
the key in question (or you can just copy across the file from /usr/share/keymaps).
############################
<<One more thing:::::
set CONFIG_MAC_ADBKEYCODES to NO in the kernel compile
config,
because the keymap is set to use Linux key codes, not adb>>>

is a note I got from somewhere..., I forget where.....
##############################

But this is the one that is most likely to work:::IMHO

(Switching to linux keycodes dinamically by setting /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
doesn't work. (I think it's because the ckeymap is loaded very early in the
boot process)

You have to unlock the keycodes first. Snippet from my /etc/sysctl.conf:

dev/mac_hid/keyboard_lock_keycodes = 0
dev/mac_hid/keyboard_sends_linux_keycodes = 1
dev/mac_hid/keyboard_lock_keycodes = 1

I remember that "0" keycodes are illegal in XFree because of security reasons


All times are GMT -5. The time now is 05:38 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.