I'd like to define an alias that runs the following two commands consecutively.
gnome-screensaver
gnome-screensaver-command --lock
Right now I've added
alias lock='gnome-screensaver-command --lock'
to my .bashrc but since I lock my workstation so often it would be easier to just type one command.
Try:
alias lock='gnome-screensaver; gnome-screensaver-command --lock'
or
lock() {
gnome-screensaver
gnome-screensaver-command --lock
}
in your .bashrc
The second solution allows you to use arguments.