Page 45 - Raspberry Pi as a Foundation for Boosting Computer and Technology Literacy
P. 45
Customizing the system and the shell 3.4
Figure 3.19 Editing the .profile file
The ‘&’ character is yet another chain operator that sends the pro-
cess to be executed in the background, preventing it from otherwise
freezing the entire session.
lxterminal &
Save the file by pressing ‘CTRL+O’ and then ‘Enter’. Exit the file by
pressing ‘CTRL+X’. Finally, log out and log back in, and the terminal
window should appear automatically.
Automating tasks using cron jobs
What if a user wants to automate a certain recurring task, such as
reminders? There is a built-in tool to do this called cron, which will
perform a certain job at specified times. To edit the schedule, run the
following command and navigate to the end of the document:
export EDITOR=nano && crontab -e
The first part of the command specifies that we want to use the Nano
editor to edit the schedule, as the default editor is Vim ( https://
www.vim.org/). Since we are already somewhat familiar with Nano, we
will stick to it.
For instance, we would like to be reminded to take a break from
learning shell commands every hour. To do this, append the following
command at the end of the document (Figure 3.20), save, and exit (as
described in the previous subsection).
0 * * * * export DISPLAY=:0 && xmessage -timeout
3 “Take a break now!”
45