Active Topics

 



Notices


Reply
Thread Tools
Guest | Posts: n/a | Thanked: 0 times | Joined on
#1
// 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:
  • more efficient use of the screenspace
  • a lot less typing needed
  • some useful functions
  • files directly linked to apps(i.e. './movie.avi' loads it in mplayer, ...)
  • workaround for some hard to press keys(at least on my layout[de])
  • ...

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
The script first tests, if wget and libncursesw5 are already installed, if not, it apt-gets both of them. After that, it downloads and extracts the tarball containing zsh. Then it makes the needed chmod/chown to get compinit working, downloads the config- and env-files and finally changes the default shell to zsh for the user-account (if you also want it for root, uncomment the corresponding line - risky!).

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
now also simply works as
Code:
/some/path
b) some named-directories are setup, thus
Code:
cd ~cam
changes the directory to '/home/user/MyDocs/DCIM/'
of course
Code:
cp somefile ~cam/
also works

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
autocompletes. Same for apt-get {auto}remove/purge, apt-cache search, etc.

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

Last edited by avx; 2011-01-23 at 22:37. Reason: new instructions
 

The Following 5 Users Say Thank You to For This Useful Post:
Posts: 255 | Thanked: 107 times | Joined on Nov 2010
#2
thank you, this is great
edit: damn, had to reflash too

Last edited by Char; 2011-01-22 at 19:39.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#3
Originally Posted by Char View Post
edit: damn, had to reflash too
Sorry for that, hope you didn't loose too much data of value.

I'm looking into this, I guess the init-scripts are borked, but I'm not sure, yet.
 
Banned | Posts: 358 | Thanked: 160 times | Joined on Dec 2010
#4
Could u please make a .deb package?
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#5
Originally Posted by epitaph View Post
Could u please make a .deb package?
For what, the config?

Maybe I could, but I'd need to read up on it, since I'm more of the .ebuild guy
 
Posts: 255 | Thanked: 107 times | Joined on Nov 2010
#6
Originally Posted by avx View Post
Sorry for that, hope you didn't loose too much data of value.

I'm looking into this, I guess the init-scripts are borked, but I'm not sure, yet.
emmc was saved and my latest backup was recent enough so all's good

do hope you figure out how to get it running properly though!
 
Posts: 10 | Thanked: 13 times | Joined on Feb 2010
#7
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 "$@" || :
Make sure it's all on one line. Spelt out, it says "if I am an interactive shell, and I'm not running the Xsession script, then run zsh instead, otherwise return 0"

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
 

The Following 2 Users Say Thank You to BernardB For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#8
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.
 
Posts: 10 | Thanked: 13 times | Joined on Feb 2010
#9
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 || :
I checked that it allows Xsession to run correctly, but I still haven't been game to boot my phone with it like that. Wouldn't mind confirmation of that either

Last edited by BernardB; 2011-01-23 at 16:54. Reason: added missing || : to shell line
 

The Following User Says Thank You to BernardB For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#10
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?
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:41.