You are not logged in.

#1 2006-04-13 16:21:44

tom.deb
Member
From: manchester/UK
Registered: 2005-06-20
Posts: 42
Website

zsh, DM and $PATH

I just noticed that zsh prevents normal functions of XDM/KDM/GDM.

Because the . function is not supported in zsh, /etc/profile generates error when sourcing /etc/profile.d/*.sh

I switched back to bash and configured konsole to run zsh for normal shells, eventhough i could have modified /etc/profile to use the "source function"


t o m d e b
_______________________________________
"the urge to destroy is a creative urge."
                                                 Mikhail Bakunin.

Offline

#2 2006-04-13 17:18:18

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: zsh, DM and $PATH

my .zshrc

. ~/.zsh/zle
. ~/.zsh/style
. ~/.zsh/opts

export PATH=$PATH:/sbin:/usr/sbin:/home/codemac:/home/codemac/bin:/opt/e17/bin:/opt/java/jre/bin:/opt/ati/bin:/opt/mozilla/bin:/opt/azureus:/opt/eclipse:/opt/mono/bin:.
export MOZILLA_FIVE_HOME=/opt/mozilla/bin/mozilla
export EDITOR=vim
export MANPAGER="col -b | vim -c 'set ft=man nonu nomod nolist' -"
#export MANPAGER=most
export MAIL=/home/codemac/.mail/default
export PACKAGER="codemac <j@codemac.net>"

alias nowifi="sudo ifconfig eth0 down; sudo route add default gw 192.168.1.1"
alias themini="ssh 192.168.1.2"
alias mv="mv -v --backup=existing"
alias rm="rm -v"
alias cp="cp -v"
alias wget="wget --timeout 10"
alias c="clear"
alias l="ls -hl --color | more"
alias ll="ls -ahl | more"
alias e="TERM=rxvt-unicode emacs -nw"
alias firefox="aoss firefox"
alias cdc="cd; c"
alias screen="TERM=screen screen"
alias mplayer="mplayer -idx"
alias WoW="cd /mnt/files/World Of Warcraft/; LD_PRELOAD=/home/codemac/bin/libmemwrapper.so WINEPRELOADER_SETVALEGACY="no" wine WoW.exe -opengl -windowed"
alias wh="when ci --past=0 --future=3"
alias g="cd ~/gtd; python gtd.py; sleep 1; vi todo.txt"
alias nsl='netstat -alnp --protocol=inet | grep -v CLOSE_WAIT'
alias vi="vim"
alias ciq="TERM=rxvt-unicode centericq"
alias cslab="rdesktop -u codemac -p - -K -a 16 -g 1150x767  rlogin.cs.vt.edu"
alias grep="grep --color=auto"

# auto open images
alias -s jpg="feh -FZd"
alias -s JPG="feh -FZd"
alias -s jpeg="feh -FZd"
alias -s JPEG="feh -FZd"
alias -s png="feh -FZd"
alias -s gif="feh -FZd"

# auto open movies
alias -s mpg="mplayer -idx"
alias -s mpeg="mplayer -idx"
alias -s avi="mplayer -idx"
alias -s ogm="mplayer -idx"
alias -s wmv="mplayer -idx"
alias -s m4v="mplayer -idx"
alias -s mp4="mplayer -idx"
alias -s mov="mplayer -idx"

# auto open audio
alias -s mp3="cplay"
alias -s ogg="cplay"
alias -s wav="cplay"

# auto open web addresses
alias -s html="firefox"
alias -s php="firefox"
alias -s com="firefox"
alias -s net="firefox"
alias -s org="firefox"
alias -s gov="firefox"

alias -s txt="vim"

. ~/.zsh/prompt

ZSH definitely supports the . function.

Offline

#3 2006-04-13 17:40:54

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: zsh, DM and $PATH

'.' is actually much more portable than 'source' - dash and busybox shells do not support 'source'.

Offline

#4 2006-04-13 17:45:34

tom.deb
Member
From: manchester/UK
Registered: 2005-06-20
Posts: 42
Website

Re: zsh, DM and $PATH

I typoed the $path and $PATH in my zshrc. I fixed my PATH variable and switched back to zsh as my default shell.

but then why dhy do you think /etc/profiled/*sh didgn't get source ?


t o m d e b
_______________________________________
"the urge to destroy is a creative urge."
                                                 Mikhail Bakunin.

Offline

#5 2006-04-13 17:53:58

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: zsh, DM and $PATH

tom.deb wrote:

but then why dhy do you think /etc/profiled/*sh didgn't get source ?

I'd venture a guess that you're not running a login shell.  /etc/profile is only sourced on a login shell.  That is also the difference between something like "bash_profile" and "bashrc"

Offline

#6 2006-04-13 17:58:41

tom.deb
Member
From: manchester/UK
Registered: 2005-06-20
Posts: 42
Website

Re: zsh, DM and $PATH

i am loging in through g/k/xdm

isn't that supposed to be a login shell ?


t o m d e b
_______________________________________
"the urge to destroy is a creative urge."
                                                 Mikhail Bakunin.

Offline

#7 2006-04-13 20:32:33

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: zsh, DM and $PATH

tom.deb wrote:

i am loging in through g/k/xdm

isn't that supposed to be a login shell ?

Your terminology is off, which may be the confusion.  g/k/xdm are called "display managers" or "login managers" or something to that effect.  They control logins to X.  X, however, is not a shell.  Your shell, in this case, is zsh.  Shells are run via a terminal or possibly the linux console.

For the sake of simplicity, I will assume you're using xterm.  From 'man xterm', we get:

-ls
    This option indicates that the shell that is started in the xterm window will be a login shell (i.e., the first character of argv[0] will be a dash, indicating to the shell that it should read the user's .login or .profile).
...
loginShell (class LoginShell)
    Specifies whether or not the shell to be run in the window should be started as a login shell. The default is ``false.''

In order to make xterm invoke your shell as a login shell, you need to either start it as "xterm -ls" _or_ set "xterm*loginShell: true" in your ~/.Xdefaults.

Offline

#8 2006-04-13 23:51:08

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: zsh, DM and $PATH

Uhm, the '.' function is supported in zsh. I use it all the time to load up environmental vars for working on my packages. maybe i have a setting enabling it... *shrug*

https://iphitus.no-ip.org/zshrc.txt

Offline

Board footer

Powered by FluxBB