![]() |
.zshrc for N900 (updated, now works for me[tm])
// couldn't find a better place, move/merge if needed.
Update: now works flawless for me. Guide is rewritten from the original. There's still a chance to brick the device, but not permanently, so reflashing is possible. You've been warned, you'd better have a backup. A .deb would be really useful, if you're capable of doing so, please don't hesitate :) -- I made some modifications to my desktop's .zshrc to better fit (my) needs on the N900:
I'd like to share this with you, so maybe someone else can benefit and I'd be glad to receive patches(diffs) or additions. Getting started: a) you need to be able to become root b) you need extras-{devel,testing} both enabled c) open the terminal d) become root e) fetch this file: http://phorcix.org/proj/n900/conf/zsh-setup f) run Code:
sh /path/to/zsh-setup When all this is done, have a quick look over the command's output and make sure, there are no errors. If everything looks ok, reboot the device. Note:ZSHs first start will take a relatively long time, since it's building the entries needed for autocompletion. This is one time only, so after that, it shouldn't be slow at all. -- A little overview of what's possible with it - please forgive me, if I use zsh-terms too often... a) auto_cd is on, thus Code:
cd /some/path Code:
/some/path Code:
cd ~cam of course Code:
cp somefile ~cam/ some other named-dirs are also setup, namely for the paths of documents, sounds, images, videos, backups and some more c) shortcuts for things like apt-get are setup, thus i.e. Code:
agi nc d) ' P ' works as ' | ' e) easy layout switching, in my case de<->dvorak f) '+'/'-' to turn up/down the volume g) easy 'chmod'/'chown', ie '755 file' h) shortcuts for a lot of commands, i.e. A,E,G,L -> awk,echo,grep,less and more i) associations for most commonly used files, espacially media is assigned to mplayer j) setup to 55 colums, so its easily editable on the N900 in vim with 'set number' -- Love, praise, thoughts, critics, deathwishes are welcome. In the hope that someone finds it useful, cheers, avx PS: a little screeny of what my setup looks like, can be found in this post |
Re: .zshrc for N900
thank you, this is great
edit: damn, had to reflash too :( |
Re: .zshrc for N900
Quote:
I'm looking into this, I guess the init-scripts are borked, but I'm not sure, yet. |
Re: .zshrc for N900
Could u please make a .deb package?
|
Re: .zshrc for N900
Quote:
Maybe I could, but I'd need to read up on it, since I'm more of the .ebuild guy ;) |
Re: .zshrc for N900
Quote:
do hope you figure out how to get it running properly though! :) |
Re: .zshrc for N900
The bricking issue appears to be that zsh is used to execute /etc/X11/Xsession at startup. The output of run-parts in that script is delimited by newlines, which ash and bash recognise as field separators and split appropriately when it is used in the following for loop. Zsh isn't splitting at newlines and tries to execute the entire output of run-parts as one command.
Does somebody who's willing to risk bricking their phone want to try adding this line to your /home/user/.profile ? It shouldn't brick it :) It should get busybox to run zsh in xterms and ssh sessions. Code:
[ -n "$PS1" ] && [ "$0" != "/etc/X11/Xsession" ] && exec /bin/zsh "$@" || : I'm 99% confident that it will do the right thing(tm), but not confident enough to try it myself before I board a plane in a few hours. Please forgive my sensibility :) |
Re: .zshrc for N900
Thanks, BernardB, will try that later tonight.
Also thanks for the hint on Xsession, I'll have a look at that, too and hopefully found a solution. |
Re: .zshrc for N900
Oh, what may also work (and be slightly more efficient as it avoids starting two shells each time), is to set zsh as your default shell, but to add this line to your .zshenv file:
Code:
[ "$0" = "/etc/X11/Xsession" ] && emulate sh || : |
Re: .zshrc for N900
Does anyone of you know, if/how I could get access when it stops at the moving balls? Either drop me into a shell or connect to my wlan and enable ssh?
|
Re: .zshrc for N900
Ok, I think I've got some kind of little breakthrough.
I did 'chsh -s /bin/zsh' for both user & root, run 'sed -i "s@/bin/sh@/bin/zsh@"' on everything in /etc/X11/* and put your command in .zshenv of both user & root. Rebooted and it booted straight up, and 'echo $SHELL' reports zsh for both users. The one thing I left out right now, is the chmod&chown-part described above, to properly use compinit. So I'll create a backup now and see if maybe the chown/chmod is causing the havoc. Edit, holy hell, it still works. Edit2, I also added 'PATH=/sbin:/bin/:...' to the .zshrc of root, since that didn't get set correctly and somehow only had /usr/{sbin} in it, so that could have been the problem, too. Edit3, for now I'm happy, I'll do a backup, grab something to eat, do a full reflash and if it works again, rewrite the guide. Thanks for the hints so far :) Edit4, if someone with more knowledge of Debian internals knows how to make a .deb out of this, a simple guide or a working .deb itself would be nice. Thanks. |
Re: .zshrc for N900
Guys, thankyou so much for this. I panicked when I killed my phone doing this, eventually reflashed. I then had a look on the 'net for "n900 zsh" and found this, and followed it successfully :) and only then noticed it was dated today! I registered to say thanks, and I'm happy to try to create a .deb if people want :)
|
Re: .zshrc for N900
Welcome to the forums, Snark1994 :)
I'm currently writing a zsh-setup script, which automates the steps I've taken, so that'll get a little easier. Of course, a .deb would be really appreciated, so it could go easier to -testing/devel if it works. |
Re: .zshrc for N900
Quote:
Awesome that it worked though. I also wouldn't recommend changing it for root. A lot of scripts (e.g. package install scripts) expect the default shell to be bash or ash. For root you could use the .profile exec /bin/zsh trick. |
Re: .zshrc for N900
Dunno why/if it's needed to run the sed-stuff, I just happened to try it and it worked and I didn't yet try it without it.
As for root, I consider your argument as valid, but imho the packages are broken, if they rely on bashisms or other non-standard stuff. Anyway, I finished the setup-script, will reflash the phone and try it now, wish me luck :p Edit, #commented out the change for root and left a note. |
Re: .zshrc for N900
Quote:
Anyway, good luck! |
Re: .zshrc for N900
So, got it working, tried two times incl. complete vanilla+rootfs flashing, both times success. I'll go and update the first post.
|
Re: .zshrc for N900
Awesome. Cheers!
|
Re: .zshrc for N900 (updated, now works for me[tm])
If you've already got a .sh script, then this seems to describe a variety of methods + packages for making it into a .deb :)
|
Re: .zshrc for N900 (updated, now works for me[tm])
Quote:
cheers, avx |
Re: .zshrc for N900 (updated, now works for me[tm])
A safer way of doing this would be to change the XTerm launch script to run "osso-xterm /bin/zsh". That way you're nowhere near risking a brick. I'm not taking any more risks after I bricked the first time, so this is how I have it running right now (with the default shell set as sh) and I have no problem. Thanks a lot, zsh makes using the terminal way less of a pain :P
|
Re: .zshrc for N900 (updated, now works for me[tm])
Thanks for the guide, avx. I'm happily using zsh now with grml's config (however, you'll want to delete everything with "limit" in the config, as it produces a warning, and also "ls", because it calls the busybox with wrong parameters).
Oh and I also almost bricked the phone... good to have the recovery console installed :) I've then changed the shell back to /bin/sh in /etc/passwd :) I recommend that you don't set the shell for any user by default. Let the user do this, if he thinks that he's ready. I'll go with Char's solution to change the launcher. /bin/zsh can also be set in PuTTY as start command, in case anyone uses that too :) EDIT: works great now! I've added some aliases, so I'll always have zsh instead of bash (you might need to customize that if you use gainroot, I don't): /home/user/.zshrc.local alias su="sudo su -c /bin/zsh"/root/.zshrc.local alias suu="su user -c /bin/zsh" |
Re: .zshrc for N900 (updated, now works for me[tm])
Did you use the zsh binaries from http://talk.maemo.org//showthread.php?p=1356894
? |
All times are GMT. The time now is 22:15. |
vBulletin® Version 3.8.8