gcd() {
local CDTO=`zenity --title="cd" --file-selection --directory`
if [ -n "${CDTO}" ] ; then
cd "${CDTO}"
fi
}
Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts
Thursday, November 27, 2008
Graphical cd
The following bash function allows you to change directory using a Directory chooser:
Tuesday, October 14, 2008
Reclaim Ctrl+C and Ctrl+V for familiar Copy and Paste in gnome-terminal
Most people work with graphical desktops. Most desktop (GUI) applications use the Ctrl+C and Ctrl+V for Copy and Paste actions respectively. One gets use to these really fast. However, when working with bash shell running inside a gnome-terminal those key bindings mean something different i.e. Ctrl+C sends the kill signal to the foreground process and Ctrl+V is used for quoted insert functionality (i.e. to enter control keys literally). This is the legacy of the command line oriented Unix terminals based on tty (stty - program that controls the settings of tty devices).
In this entry I describe how to make Ctrl+C and Ctrl+V do Copy and Paste in gnome-terminals. Here is how to do it:
Open a gnome-terminal window and type the following commands:
Close and reopen the terminal window. And now Ctrl+C will copy and Ctrl+V will paste.
In this entry I describe how to make Ctrl+C and Ctrl+V do Copy and Paste in gnome-terminals. Here is how to do it:
Open a gnome-terminal window and type the following commands:
Add the following to .bashrc
> stty intr ^K # free Ctrl+C for copy
> stty lnext ^- # free Ctrl+V for paste
> stty -g
> stty -g > ~/.stty # store the settings in home directory
case $- inNow using the gconf-editor, edit the gnome-terminal's key bindings (@ /apps/gnome-terminal/keybindings key).
*i*)
stty `cat ~/.stty` # reload the stored stty settings
bind -u quoted-insert # unbind the quoted-insert function of bash - free Ctrl+V for paste
esac
Close and reopen the terminal window. And now Ctrl+C will copy and Ctrl+V will paste.
Labels:
bash,
copy,
gnome-terminal,
keybindings,
paste,
Ubuntu
Subscribe to:
Comments (Atom)