Extend your N900's Xterm: Go BASH
All about Maemo Applications, reviews, news, questions, etc.
by Nokia 5700 » 21 Apr 2011, 13:47
So, me, as a Linux user, think that Busybox (the default shell on Maemo 5) is a bit... Boring. There is no color in the ls-command, and it doesn't look as good as the desktop version. So what are you to do?
Change it, of course!
Just before I start... If you don't understand what this is, don't do it. This is for power-users who know what they do when fiddling around with Xterm all day. That's why I don't make a deep tutorial with commands and all that.
So, there are several things you can do. One that I like is to switch to BASH. (Do note that Ctrl+Shift+X is fixed to Busybox. I don't know how to change that (yet).)
You can simply do this by making a new entry in the menu. This is how mine looks:
You're free to customize it as you wish, but the important part is to put it inside a .desktop-file in /usr/share/applications/hildon/.
Secondly I found a mod for ls. It gives you colors!
You need to install coreutils-gnu, and afterwards do:
It will make it look like home to those used to desktops, where this is on by default.
And as I said, this is not for those new to Xterm. The default one can be just as fine, this just finetunes it for the experienced ones.
I'll add some more later if I find something useful.
Change it, of course!
Just before I start... If you don't understand what this is, don't do it. This is for power-users who know what they do when fiddling around with Xterm all day. That's why I don't make a deep tutorial with commands and all that.
So, there are several things you can do. One that I like is to switch to BASH. (Do note that Ctrl+Shift+X is fixed to Busybox. I don't know how to change that (yet).)
You can simply do this by making a new entry in the menu. This is how mine looks:
- Code: Select all
[Desktop Entry]
Encoding=UTF-8
Version=2.05b
Type=Application
Terminal=true
Name=BASH
Exec=/usr/bin/osso-xterm 'bash'
Icon=terminal
Type=Application
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
You're free to customize it as you wish, but the important part is to put it inside a .desktop-file in /usr/share/applications/hildon/.
Secondly I found a mod for ls. It gives you colors!
You need to install coreutils-gnu, and afterwards do:
- Code: Select all
alias ls='/bin/gnu/ls --color=auto'
It will make it look like home to those used to desktops, where this is on by default.
And as I said, this is not for those new to Xterm. The default one can be just as fine, this just finetunes it for the experienced ones.
I'll add some more later if I find something useful.
No ideas for signature again 
-
Moderator
-
Posts: 2958
Joined: 09 Sep 2008, 12:08
Location: Norway
Phone model: Nokia N900, Samsung Galaxy S III
Firmware: CSSU, Android 4.1.2
by Mr Pingu » 21 Apr 2011, 17:01
Thats nice default xterm is quite boring
Also I thought that I read about changing shortcuts somewhere, will digg the web for a solution
Also I thought that I read about changing shortcuts somewhere, will digg the web for a solution
-
Symbian Freak
-
Posts: 3655
Joined: 07 Mar 2009, 13:55
Location: The Netherlands
Phone model: Nokia N900@805mhz
Firmware: PR 1.3.1 + CSSU-Thumb2
by Mr Pingu » 26 Mar 2012, 13:33
It seems you can replace busybox fully with bash3.2 
Just "apt-get install bash3"
Then "bash-setup" and you get bash3 as default shell
Just "apt-get install bash3"
Then "bash-setup" and you get bash3 as default shell
-
Symbian Freak
-
Posts: 3655
Joined: 07 Mar 2009, 13:55
Location: The Netherlands
Phone model: Nokia N900@805mhz
Firmware: PR 1.3.1 + CSSU-Thumb2
by Nokia 5700 » 26 Mar 2012, 15:15
Is this true..?
I'll check if this is the case with Bash4 as well.
...
Nope, didn't work. I like to stick to the latest version, so I can keep shellscripts identical between Ubuntu and N900. (I don't want to go with ancient Bash 2 again...
)
WARNING FOR THOSE WHO DO NOT READ EVERYTHING: This method is potentially harmful to your system if used without care. I'm not responsible for such accidents, as I've written the warning in bold already.
Just if anyone is interested, this is how to embed a file into a script, like the pros do it:
This is very handy to keep it self-contained. I used it to make an automatic image cropper with a specific transparent frame. (For N900 icons. Transforming pictures from Google into Hildon-like ones.)
My suggestion is making it either a tar or a tgz so that you have capacity for multiple files.
However, watch out: when you edit the script, you see the binary, and it won't be saved correctly. Important to know. I'd suggest removing the binary on every edit, or at least keep it outside until you've finalized your script. And of course, keep a local copy of the embedded file. On the final revision, apply it, and remember to set the script for reading the correct line. I typically make a couple of newlines, and it is most important to put an "exit 0" (or other return value) on the end of the script. If you do not do this, very bad things may happen as binary is interpreted as shell commands. For applying the embedded file, I highly suggest using cat. Just do it as so: (Keep a backup of both files before doing this)
Remember to use ">>", as it will append, not overwrite the file like if you used ">". These make a lot of sense if you understand the logic.
If these are used correctly, you can make awesome scripts, without dependencies!
I'll check if this is the case with Bash4 as well.
...
Nope, didn't work. I like to stick to the latest version, so I can keep shellscripts identical between Ubuntu and N900. (I don't want to go with ancient Bash 2 again...
WARNING FOR THOSE WHO DO NOT READ EVERYTHING: This method is potentially harmful to your system if used without care. I'm not responsible for such accidents, as I've written the warning in bold already.
Just if anyone is interested, this is how to embed a file into a script, like the pros do it:
- Code: Select all
tail -n +NN $0 | pipe it somewhere
This is very handy to keep it self-contained. I used it to make an automatic image cropper with a specific transparent frame. (For N900 icons. Transforming pictures from Google into Hildon-like ones.)
My suggestion is making it either a tar or a tgz so that you have capacity for multiple files.
However, watch out: when you edit the script, you see the binary, and it won't be saved correctly. Important to know. I'd suggest removing the binary on every edit, or at least keep it outside until you've finalized your script. And of course, keep a local copy of the embedded file. On the final revision, apply it, and remember to set the script for reading the correct line. I typically make a couple of newlines, and it is most important to put an "exit 0" (or other return value) on the end of the script. If you do not do this, very bad things may happen as binary is interpreted as shell commands. For applying the embedded file, I highly suggest using cat. Just do it as so: (Keep a backup of both files before doing this)
- Code: Select all
cat >> Script.sh < File.tar.gz
Remember to use ">>", as it will append, not overwrite the file like if you used ">". These make a lot of sense if you understand the logic.
If these are used correctly, you can make awesome scripts, without dependencies!
No ideas for signature again 
-
Moderator
-
Posts: 2958
Joined: 09 Sep 2008, 12:08
Location: Norway
Phone model: Nokia N900, Samsung Galaxy S III
Firmware: CSSU, Android 4.1.2
by Mr Pingu » 26 Mar 2012, 15:55
Hmm, I won't play with that embedding
Well I was used to that ancient bash2.05 and busybox so for me is it an upgrade. And on my desktop, still I think nothing beats win7. It kinda grew into me =/
Anyway, Nokia 5700, where are you at MSN? I kinda miss the talks about the N900, did you move to some other IM or are you just really busy?
Well I was used to that ancient bash2.05 and busybox so for me is it an upgrade. And on my desktop, still I think nothing beats win7. It kinda grew into me =/
Anyway, Nokia 5700, where are you at MSN? I kinda miss the talks about the N900, did you move to some other IM or are you just really busy?
-
Symbian Freak
-
Posts: 3655
Joined: 07 Mar 2009, 13:55
Location: The Netherlands
Phone model: Nokia N900@805mhz
Firmware: PR 1.3.1 + CSSU-Thumb2
by Nokia 5700 » 26 Mar 2012, 21:22
I'm still online, same address, same network (MSN). 
Kinda sad that Ovi went down. (Still using Ovi/Nokia Mail, though.)
I'm on between ~4 to 10/11 on weekdays, all day in weekends.
(I could randomly be away and not there to answer. We've got a dog and all...)
Throughout this week I'm pretty busy most of the time. Final week before easter holiday. It will be sweet victory.
Lately, most of my experiments on N900 have been booting Ubuntu. Kubuntu works nicely, but Ubuntu needs some work. It's all out on the Maemo forums. But I must say, U-boot is kind of creepy. It's tricky to boot back to Power Kernel.
Kinda sad that Ovi went down. (Still using Ovi/Nokia Mail, though.)
I'm on between ~4 to 10/11 on weekdays, all day in weekends.
Throughout this week I'm pretty busy most of the time. Final week before easter holiday. It will be sweet victory.
Lately, most of my experiments on N900 have been booting Ubuntu. Kubuntu works nicely, but Ubuntu needs some work. It's all out on the Maemo forums. But I must say, U-boot is kind of creepy. It's tricky to boot back to Power Kernel.
No ideas for signature again 
-
Moderator
-
Posts: 2958
Joined: 09 Sep 2008, 12:08
Location: Norway
Phone model: Nokia N900, Samsung Galaxy S III
Firmware: CSSU, Android 4.1.2
by Mr Pingu » 27 Mar 2012, 07:13
Wow, MSN in playin up? You're were not in my list of contacts, no wonder you weren't online lately
Don't ask me how you disappeared from there, I have really no clue...
-
Symbian Freak
-
Posts: 3655
Joined: 07 Mar 2009, 13:55
Location: The Netherlands
Phone model: Nokia N900@805mhz
Firmware: PR 1.3.1 + CSSU-Thumb2
by darkzul » 27 Mar 2012, 10:01
don't worry, i wont ask. 
-
.: [ VIP ]:.
-
Posts: 7369
Joined: 25 Jul 2008, 08:57
Location: Kuala Lumpur, Malaysia
Phone model: N8
Firmware: refresh own cfw. \m/
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Online Friends
Birthdays
No birthdays today
Style switcher
Dark-Orange |
Light-Orange |
Dark-Red | Light-Red |
Dark-Blue | Light-Blue |
Dark-Green | Light-Green |
Dark-Red | Light-Red |
Dark-Blue | Light-Blue |
Dark-Green | Light-Green |



