Go Back   The macosxhints Forums > OS X Help Requests > UNIX - X11



Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 01-19-2003, 09:26 PM   #21
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
17- Switching from USA to Italian Pro Keyboard in X11

- by sao -


Check the following site:

http://php.tevac.com/artview.php?art_id=5733
Phil St. Romain is offline  
Old 01-19-2003, 09:27 PM   #22
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
18- Specific German keymapping Problem

- by sao -


This is specific to the German keymapping and it's not just a problem with Apple's X11, but with XDarwin etc. as well.

If you launch X11 like this:

/Applications/X11.app/Contents/MacOS/X11 --xquartz-be-xinit -keymap /System/Library/Keyboards/Deutsch.keymapping

and use

xmodmap -e 'keycode 66 = Mode_switch'

You can use the German keyboard layout just fine.

But the @ character is mapped to Shift-Alt-1 (one), just like it used to be up to Mac OS 8.6.
With the introduction of Mac OS 9 Apple moved that character to Alt-L. The file Deutsch.keymapping does not seem to reflect that.


Some keymappings in /System/Library/Keyboards have not been updated from a long time. This could explain the problem with the German keymapping.
Phil St. Romain is offline  
Old 01-19-2003, 09:28 PM   #23
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
19. Japanese keyboard input

- by sao -

With X11 applications now, the way to get Japanese keyboard input is to run kinput2 and Canna (or some other back end). Keyboard switching and input is all done using the XIM protocol. The X11 application talks to kinput2, which in turn uses Canna to do kanna to kanji conversion.

OSX has a perfectly good keyboard layout and input method for Japanese already. What would be really nice is if Apple could write their own XIM server to replace kinput2. Apple's could use all the powerful stuff they already have to implement this.
Phil St. Romain is offline  
Old 01-19-2003, 09:31 PM   #24
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
20 - Spanish keyboard in X11

- posted by sao -

(Thanks to Artemio Gonzalez Lopez <artemiog@mac.com>)


The usual way to start X11 from the terminal with the command:

/Applications/X11.app/Contents/MacOS/X11 --xquartz-be-xinit -keymap /System/Library/Keyboards/YourDesiredLayout.keymapping

*doesn't work* with the Spanish ISO keyboard. Apple's Spanish.keymapping es very old and doesn't match the modern ISO keyboard.

The way to do it is as follows:

Write in your .xinitrc file:

xmodmap ~/.MyXmodmap
xmodmap -e 'keycode 66 = Mode_switch'

To create .MyXmodmap file:

Copy/paste the following to .MyXmodmap file in your home directory.

.MyXmodmap, is a simple keymap that works very well with xterm.

It has the necessary modification to the USA keymapping in order that all the characters that are drawn in the Spanish ISO keyboard will appear as indicated by the drawings on the keyboard. Including the characters like @#~ that are called with the option key.


.MyXmodmap file:
Code:
keycode  18 = masculine ordfeminine backslash backslash
keycode  22 = e E EuroSign cent
keycode  26 = 1 exclam bar exclamdown
keycode  27 = 2 quotedbl at oneeighth
keycode  28 = 3 periodcentered numbersign sterling
keycode  29 = 4 dollar asciitilde dollar
keycode  30 = 6 ampersand notsign fiveeighths
keycode  32 = exclamdown questiondown asciitilde asciitilde
keycode  33 = 9 parenright
keycode  34 = 7 slash paragraph doubledagger
keycode  35 = apostrophe question
keycode  36 = 8 parenleft
keycode  37 = 0 equal
keycode  38 = plus asterisk bracketright dead_macron
keycode  41 = dead_grave dead_circumflex bracketleft dead_abovering
keycode  47 = dead_acute dead_diaeresis braceleft braceleft
keycode  49 = ntilde Ntilde asciitilde dead_doubleacute
keycode  50 = ccedilla Ccedilla braceright dead_breve
keycode  51 = comma semicolon
keycode  52 = minus underscore endash emdash
keycode  55 = period colon
keycode  58 = less greater bar brokenbar
keycode  66 = Mode_switch

Last edited by sao; 01-23-2003 at 04:48 AM.
Phil St. Romain is offline  
Old 01-19-2003, 09:32 PM   #25
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
21- Hover events from underlying app:

- by sao -


An X application in the background still gets hover events when it should not. Little tooltips pop up from the underlying app even though you are in the Apple Mail application for example or if you have a GTK+ app open, and then move a non-X11 window over the GTK+ app, then the GTK+ tooltips appear over the non-X11 window.

This is caused by the way in which the X server gets pointer events from the real window server. They have recently fixed most of these problems, but fixing all cases may have to wait for the next version of the operating system.
Phil St. Romain is offline  
Old 01-19-2003, 09:33 PM   #26
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
22- Cut and Paste Problem:

- by sao -


Apple X11 currently does not support cut and paste between other window managers and Aqua in the current beta release. This may get resolved in the next release.
Phil St. Romain is offline  
Old 01-19-2003, 09:34 PM   #27
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
23- Resize gadget completely covers the scroll arrow:

- by sao -


For those X-windows that have rightside scroll-bars that are the full height of the window and have a bottom scroll arrow, the quartz-wm resize gadget completely covers the scroll arrow.

Workaround:
The only workaround at present is to use a different window manager.
Apple is aware of this problem and are trying to find a way to make the resize box less intrusive..
Phil St. Romain is offline  
Old 01-19-2003, 09:36 PM   #28
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
24- How to run apps at launch:

- by sao -


To run a bunch of apps at launch, add them to your ~/.xinitrc file together with 'exec quartz-wm' to run the Apple window manager.
Phil St. Romain is offline  
Old 01-19-2003, 09:38 PM   #29
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
25- Trouble getting ssh-agent working with Apple X11:

- by sao -


On other Unix-like systems I have ssh-agent launch the window manager, so I tried the following in my ~/.xinitrc:

exec ssh-agent /usr/X11R6/bin/quartz-wm

the agent is running...but the window manager isn't passing crucial env vars to its child processes, so trying to run ssh-add in an xterm results in "Could not open a connection to your authentication agent."

Workaround:
The problem is that quartz-wm has no child processes, it's the X server that spawns the commands in the Applications menu. So to make this work the way you want, you'll need to get the SSH_ variables into the initial environment of the X server, perhaps by starting it by hand from a shell
Phil St. Romain is offline  
Old 01-19-2003, 09:38 PM   #30
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
26 - Problem with zombies:

- posted by sao -

(conversation I read at Apple's x11-users list)

When ever I exit from X, menu->quit, I get an X11 zombie that is left around.

-It's a known problem, and has been mentioned on this list a couple of times. I believe the suggestion is that it will be fixed in the proverbial Upcoming Release.

If I log out, all the zombies disappear.

-Yup. That's when zombies are reaped.

What does the system do to get rid of the zombies??

-"The system" doesn't do anything. The parent of the zombified children either exits, in which case 'init' collects them and disposes of them; or it calls (or should call) wait(2) or one of its friends to collect them. That's not happening right now. Logging out will cause the former to occur.

Can I kill off the zombies without logging out??

-They're already dead, Jim. As has been observed at least once before, zombies are fairly benign, unlike movies about them. They essentially take up a process slot, but no (or few) other resources. Unless you are churning out a lot of processes, you shouldn't have to worry. It's mostly a cosmetic deal (which will be corrected, in the fullness of time).

Last edited by sao; 01-23-2003 at 04:56 AM.
Phil St. Romain is offline  
Old 01-19-2003, 09:40 PM   #31
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
27- Problem with KDE and Apple's X11:

- by sao -


If you open up any window in KDE, it stays behind the current windows you have open in Mac OS X. If you put the mouse pointer over the window, it activates it, but does not bring it above the OS X window.

This is one of the known bugs of Apple's X11.app. They have promised to fix it in the next release. You cannot do anything about it, except hide the Aqua windows.
Phil St. Romain is offline  
Old 01-19-2003, 09:41 PM   #32
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
28- Problems replacing Fink Xfree86 with Apple's X11

- by sao -


If you had Fink's XFree86 installed, and you replaced it with Apple's X11, and now everything's crashing:

First of all, if you previously had the "threaded" versions of Fink's XFree86 packages installed, you may need to rebuild the application that is crashing. Some programs check for the availability of threading at build time, and then from then on believe that threading is available to them.

Secondly, you may have just hit an Apple X11 bug. As of the time of this writing, a number of bugs are known by the Apple team and are being worked on.
Phil St. Romain is offline  
Old 01-19-2003, 09:42 PM   #33
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
29- Confusion with Fink 'system-xfree86' placeholder package

- by sao -


Many people get confused between Fink's:

'xfree86-base' and 'xfree86-rootless' packages (used to install XFree86)

and Fink's:

'system-xfree86' package (actually empty)

which is just a placeholder package for an "outside Fink" installed Xfree86, in this case Apple's X11, which installs it's own version of XFree86.

So, if you want to work with Fink and you install 'Apple X11' be sure to install Fink 'system-xfree86' placeholder package version 4.2-3 or higher.
Phil St. Romain is offline  
Old 01-19-2003, 09:43 PM   #34
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
30- Reflections on Firewall rule for X11 usage

- by sao -


What would be a good firewall rule on the Mac, so you can use x11 without having to switch off the firewall ?

IANA has ports 6000-6063 registered to the X Window System:

x11 6000-6063/tcp X Window System
x11 6000-6063/udp X Window System


If X11.app is like every other X server around, it listens by default on port 6000 for display :0. If you open up port 6000, you should be fine.

-----------

This works, of course, but pundits will be quick to point out that it's low on the security scale. A better scheme, if it works for you, is to use "X forwarding", via ssh. Cf the ssh man page for details.

-----------

You do _not_ need to change _any_ firewall settings to use X11 through ssh if ssh is already working. That's the whole idea of X11 forwarding in ssh -- everything will go through your ssh session on port 22.

It is a _bad_ idea to open ports 6000-60xx and connect directly through this. Anybody listening to you connecting will see all key presses in clear text. Just think of, what this means when you enter passwords.

BTW: Using X11 forward in ssh saves you a lot of trouble setting things up.

-----------

Ssh and Xauth:

Ssh does encryption and compression of the stream. The encryption is why it's secure, but it can make the connection very slow. In my experience, and that of pretty much everyone else I work with, the delays necessitated by ssh encoding make the connection tremendously slower than if you bypass ssh. You may want to try turning on compression in ssh (with the -C option or a config file setting). It will very much depend on the bandwidth of your network.

However, if you bypass ssh, you have to ensure security. If you do not secure your connection somehow, you've pretty much opened your machine to anyone who cares to listen. Even the keyboard "locking" that xterm provides does not protect you from snoopers.

X11 has a good per-user authentication mechanism called xauth. Do not use the older "xhost", as it only does per-machine authentication. If you use xauth authentication, opening ports 6000-6063 is not a security hole.

For setup time speed, use ssh to forward the connection. It's the easiest way to get going. It may also be the slowest network route, though. Run some tests and decide what's best for your setup.

----------

Xauth is very basic. When using the MIT-MAGIC-COOKIE-1 scheme the authentication is done by sending a random number known to both server and client across the network. If the numbers match, the connection is allowed. However, the number is sent unencrypted, so it's possible for anyone watching the network stream to capture the random number and
connect to your server.

Also, the data sent across the connection isn't encrypted either, so even if the authentication method is secure, eavesdroppers can still see everything sent between server and client, e.g. the keys you type.

In summary:

If you're connecting across an unsecure network use ssh.
Phil St. Romain is offline  
Old 01-19-2003, 09:44 PM   #35
Phil St. Romain
Site Admin
 
Join Date: Dec 2001
Location: Wichita, KS
Posts: 2,350
31- How to pause a Fink installation for X11

- posted by sao -


When you install a large package it can take up to several hours to compile it. If you want to do some other work in the meantime, the compilation in the background sometimes slows down the work which can be annoying. Is it possible to pause a compilation for a while and then after the other work is done to resume it.

If you started the installation manually in Terminal.app, you can just press Ctrl+Z while you're in the Terminal.app window that "contains" the compilation process. The process will be stopped and put to sleep in the background. You can then go and do the other work, and when you're ready to continue just return to the Terminal.app window where you stopped the process and type "fg" (without quotes). fg = foreground.

If you are not sure whether you have stopped jobs in a given Terminal.app window, just type "jobs" and you will get a list of jobs that you have put in the background. If there are several of them they will be marked with a number. Type for instance "fg 2" to continue with job 2.

You could also say "bg 2" to continue job 2 in the background. You are then free to type other commands on the shell prompt while the job runs in the background. Note that the background job will still send all output to the screen as if it were in the foreground. This can interfere with the output of another command that you have started in the meantime, or even with the command that you're typing right now. The interference is actually harmless - it will not affect how another command is executed, nor will the output mix with anything that you type. If you're not sure about this, just fool around with harmless commands such as "find" that generate lots of output.

If you find yourself in a situation where a "runaway" background job is wildly polluting your window with output and it seems you're helpless, just try the following

- blindly type "fg x" (where x is the number of the runaway job)
- now you have the job in the foreground and you can just type Ctrl+Z to put it to sleep, or Ctrl+C to abort it.


If you'd like to start a job in the background from the first moment, just type your command as normal and then append an & (ampersand) to the very end of the command.

If you started the installation with FinkCommander:

Just find the pid of the fink process (by 'ps aux | grep fink' or something) then 'kill -STOP thePid', which is similar to Ctrl+Z. And when you want to continue it 'kill -CONT thePid', which is similar to 'fg'. Make sure you don't close the shell though.

Last edited by sao; 01-23-2003 at 04:49 AM.
Phil St. Romain is offline  
Old 01-22-2003, 10:53 AM   #36
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
32- To tell Matlab to use Apple's X11 public beta

From a terminal type: /Applications/MATLAB6p5/bin/matlab &


Or you can set things up so that you have a click-able icon, courtesy of John Iversen <iversen@nsi.edu>...

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

To convert matlab to smoothly use Apple's X11 for OS X:

Go in to /Applications/MATLAB6p5/LaunchMatlab.app/Contents and you'll find a file called 'launch_matlab.sh'. Copy this to something else for safekeeping (e.g. 'launch_matlab.sh.oroborosx'). I then replaced the original launch_matlab.sh with the following, which works:
Code:
--------------------------------------------
#!/bin/sh
# $Revision: 1.1 $
# Copyright 1997-2002 The MathWorks, Inc.

#modification to work with Apple's X11
# 1/7/03 John Iversen (iversen@nsi.edu)

if [ "`ps xc | grep X11`" ]; then
# Bounce less if X11 for OS X is already started (starts up much 
faster than oroborosx)
         sleeptime=10
         echo LaunchMatlab: Using previously started X11 for OS X
else
         sleeptime=15
         echo LaunchMatlab: Starting X11 for OS X
fi

open /Applications/X11.app

cd ../..

bin/mac/setsid bin/matlab -desktop -display :0.0 &

# Bounce to let user know MATLAB is starting up.
/bin/sleep $sleeptime
----------------------------------------
You can modify yours to match. The only important thing is adding the line reading "open /Applications/X11.app", and commenting out the line opening oroborosx. The rest is just to let you know what it's doing.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
sao is offline  
Old 01-25-2003, 03:16 PM   #37
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
33- To make xterm in Apple's X11 behave more like Terminal.app...

Courtesy of Mathias Meyer <mathmeye@users.sourceforge.net>


If you want to make xterm in Apple X11 behave more like Terminal.app you can create a file called .Xdefaults in your home directory or just add the following if it already exists:
Code:
## XTERM SETTINGS
## see /usr/X11R6/lib/X11/doc/html/xterm.1.html
## or man xterm
*XTerm*deleteIsDEL:              true
    xterm*saveLines:             10000
    xterm*scrollBar:             true
    xterm*rightScrollBar:        true
    xterm*jumpScroll:            true
    xterm*cursorColor:           grey30
    xterm*colorBD:               darkblue
    xterm*colorBDMode:           true
    xterm*highlightColor:        grey70
    xterm*activeIcon:            false
    xterm*awaitInput:            true 
    xterm*scrollTtyOutput:       false
    xterm*scrollKey:             true

    xterm*Background:            DarkSlateBlue
    xterm*Foreground:            black

## TERMINAL KEY SETTINGS
## Adjust to OSX Terminal.app behaviour
*VT100.translations: #override\
    <Key>Prior:                 scroll-back(1,pages) \n\
    <Key>Next:                  scroll-forw(1,pages)\n\
    Meta <Key> K:               send-signal(int) clear-saved-lines() \n\
    Meta <Key> P:               print() \n\
    Meta <Key> minus:           smaller-vt-font() \n\
    Meta <Key> KP_Subtract:     smaller-vt-font() \n\
    Meta <Key> plus:            larger-vt-font() \n\
    Meta <Key> KP_Add:          larger-vt-font() \n\
    Meta <Key> C:               select-cursor-start() \
                                select-cursor-end(PRIMARY, CUT_BUFFER0) \n\
    Meta <Key> V:               insert-selection(PRIMARY, CUT_BUFFER0) \n\
    Meta <Key> M:               iconify() \n\


## EXTRA SETTINGS FOR XAW SCROLLBAR
## see /usr/X11R6/include/X11/Xaw/Scrollbar.h
## for full reference of available recources
*Scrollbar.background:          gray50
*Scrollbar.foreground:          gray50
*Scrollbar.borderWidth:         0
*Scrollbar.shadowWidth:         0
*Scrollbar.thickness:           14
*Scrollbar.minimumThumb:        20
*Scrollbar.backgroundPixmap: gradient:horizontal?dimension=14&start=gray80&end=white
*Scrollbar.borderPixmap: gradient:horizontal?dimension=14&start=white&end=grey80

*Scrollbar.translations: #override\
     <Btn2Down>:   StartScroll(Forward) \n\
     <Btn1Down>:   StartScroll(Continuous) MoveThumb() NotifyThumb() \n\
     <Btn3Down>:   StartScroll(Backward) \n\
     <Btn1Motion>: MoveThumb() NotifyThumb() \n\
     <BtnUp>:      NotifyScroll(Proportional) EndScroll()

Last edited by sao; 04-22-2003 at 09:07 AM.
sao is offline  
Old 01-27-2003, 03:53 AM   #38
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
34- Apple's x11 won't start anymore

The console output would read something like this:
Code:
Fatal server error:
Could not create server lock file: /tmp/.X0-lock
Workaround:

If you don't quit X11 via "Quit" in its menu but by some other method then it leaves behind the lock file:

/tmp/.X0-lock

and maybe also a file:

/tmp/.X11-unix/X0

You have to manually remove these files first before you can start X11.app again.


To have this done automatically: (Thanks to wgscott)

Add a -LogoutHook switch to the console line of the /etc/ttys file. Then after -LogoutHook put in the absolute path to a shell script that contains the following:

#!/bin/csh
chmod a+w /tmp/.X0-lock
chmod -R a+w /tmp/.X11-unix
rm -f /tmp/.X0-lock
rm -f -R /tmp/.X11-unix
exit

You have to restart to get it to work.

The -LoginHook and -LogoutHook are documented here: (tip by Gary Kerbaugh)

http://developer.apple.com/techpubs...Procedures.html
sao is offline  
Old 01-27-2003, 02:35 PM   #39
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
35- Apple X11 Library Warning

The following was posted on Fink's news on 2003-01-26:

<<While Apple's X11 works just fine with existing binaries, it has a bug in the install name of the libraries that can cause some software to build incorrectly, and will break forward-compatibility with future X11 releases.

Ben Hines has created a script that you can use that will fix the install_name entries in Apple's X11 libraries, but it will not repair software you have already built against the broken libraries>>.
Code:
#!/usr/bin/perl

use File::Find;
my $newlibrary, @liblist, $libdir = "/usr/X11R6/lib";

if(`id -u` != 0)
{
	print "you must be root to run this!";
	exit 1;
}

if (! -e "/usr/bin/install_name_tool")
{
	print "can't run /usr/bin/install_name_tool";
	exit 2;
}

find ({ wanted => \&process }, $libdir);
sub process {
  if (/(.+)\.([0-9])\.([0-9])\.dylib$/)
  {
    push  @liblist, $File::Find::name;
  }
}

find ({ wanted => \&process2 }, $libdir);
sub process2 {
  if (/(.+)\.([0-9])\.([0-9])\.dylib$/)
  {
    print "fixing $_ references... \n";
    $newlibrary = "$File::Find::dir/$1.$2.dylib";
    `/usr/bin/install_name_tool -id $newlibrary $_\n`;
    foreach (@liblist)
    {
      /(.+)\.([0-9])\.([0-9])\.dylib$/;
      {
        `/usr/bin/install_name_tool -change $File::Find::name $newlibrary $_\n`;
      }
    }
  }
}
The reponse from Apple via Haroon Sheikh (Manager Graphics Software, Apple Computer, Inc.) has been:

<<We are looking into this issue and hope to have it resolved in the next public release of X11ForMacOSX (no comments on when that will be).>>
sao is offline  
Old 02-05-2003, 02:01 AM   #40
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
36- Integrating LyX for Apple's X11

Ronald Florence wrote a HOWTO for LyX on Mac OSX, including installation, enabling drag-and-drop and double-click for LyX files with OpenLyX, configuring a META key, DVI, PDF, and Postscript viewers, printing, faxing, and printing envelopes.

Please read the section integrating LyX FOR APPLE X11.


http://www.18james.com/lyx_on_osx.html
sao is offline  
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:08 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.