Posts Tagged ‘command line’

‘Keymap’ mods

Fish allows us to use the bind builtin to modify the way it interprets keys. This allows to to easily make ‘keymaps’ for Fish. We can bind commands to keys as well, so we can make it switch back and forth…

Really, this isn’t the way to handle it… One should try and do it at another level. I’m toying with the idea of trying to make a kernel module to do this. And simultaneously make cap-locks actually useful. By changing what it does.

Information Bar

We can also create a information bar. We need a function that returns the cursor to where it started once it has made the bar. How? We use tput sc (save cursor) and tput rc (return cursor). Here’s the function, as a straight line, with a colored background…

One of the greatest features of Linux is the command line. Sadly, it has been somewhat neglected as of late. The purpose of this “Blog Entry” is to point out some command line features and possibilities that are not often taken advantage of.

The explanations provided are intended for an Ubuntu user using BASH as a shell, but could easily be modified for others. Some of the things mentioned in this entry are well known while other are not. The well known ones are here in case someone doesn’t know.

Color Arguments

Several programs produce color output when given certain arguments. To make this default, add the following to ~/.bashrc.

Escape Codes in Raw Text Files

One Idea (that I haven’t seen anywhere else yet… UPDATE: I found another site with this…) is to put escape codes in files like /etc/motd or /etc/issue.

The following is my /etc/motd.tail (which forms /etc/motd on startup on Ubuntu systems). It is based on the normal Ubuntu one.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in [32m/usr/share/doc/*/copyright[39;49m.
Ubuntu comes with [33mABSOLUTELY NO WARRANTY[39;49m, to the extent permitted by
applicable law.
To access official Ubuntu documentation, please visit
[32mhttp://help.ubuntu.com/[39;49m

It renders as:

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

One could do the same with /etc/issue which is printed right before login starts.

Others

One interesting thing to do is use lesspipe. There is a detailed entry about this on another blog.

It is also interesting to change the text printed out by the init functions. More information on this can be found on Ubuntu Forums.

Readers may also wish to look into framebuffers, which allow the displaying of pictures ( and pdfs, etc… once installed see fbi and links2 -g) and smaller fonts in the ttys. A good tutorial can be found on Ubuntu Forums.

I would advise readers to install gpm (general purpose mouse) which allows the use of a mouse in a tty.

It is also worth making sure that the readers are aware that vim, emacs and nano can all do syntax highlighting.