diff mbox

[OpenWrt-Devel] base-files: Enhancements to /etc/profile.

Message ID owrt-patches-20141225-1@vittgam.net
State Rejected
Headers show

Commit Message

Vittorio Gambaletta Dec. 25, 2014, 1:28 a.m. UTC
- Update terminal window title with current directory and hostname like on Ubuntu.
- Add an optional colored prompt, in case user wants to enable it.
- Add ll, an useful alias to ls.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

Comments

Felix Fietkau Jan. 6, 2015, 11:18 a.m. UTC | #1
On 2014-12-25 02:28, Vittorio G (VittGam) wrote:
> - Update terminal window title with current directory and hostname like on Ubuntu.
> - Add an optional colored prompt, in case user wants to enable it.
> - Add ll, an useful alias to ls.
> 
> Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
This is a matter of personal preference, which should be put into the
wiki instead of the default /etc/profile.

- Felix
Vittorio Gambaletta Jan. 6, 2015, 1:02 p.m. UTC | #2
Il 06.01.2015 12:18 Felix Fietkau ha scritto:
> On 2014-12-25 02:28, Vittorio G (VittGam) wrote:
>> - Update terminal window title with current directory and hostname 
>> like on Ubuntu.
>> - Add an optional colored prompt, in case user wants to enable it.
>> - Add ll, an useful alias to ls.
>>
>> Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
> This is a matter of personal preference, which should be put into the
> wiki instead of the default /etc/profile.

Well, the terminal window title and ll alias are standard in many Linux 
distributions, like Ubuntu and its derivatives, so that's why I proposed 
them for inclusion in OpenWrt. The colored prompt is just a personal 
preference instead :)

>
> - Felix

Cheers,
Vittorio
diff mbox

Patch

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3dd58e1..cee7faf 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -5,7 +5,10 @@ 
 export PATH=/usr/bin:/usr/sbin:/bin:/sbin
 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 export HOME=${HOME:-/root}
-export PS1='\u@\h:\w\$ '
+export PS1='\[\e]0;\u@\h: \w\a\]\u@\h \w \$ '
+
+# If you want a colored prompt, uncomment the following line:
+#export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;33m\]\u\[\033[01;34m\]@\[\033[01;32m\]\h \[\033[01;31m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
 
 [ -x /bin/more ] || alias more=less
 [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
@@ -14,3 +17,5 @@  export PS1='\u@\h:\w\$ '
 
 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+alias ll='ls -alF --color=auto'