How to Show the Day in Ubuntu

Trapped inside during COVID-19. Spending days on your computer either working or looking for work or just searching for something interesting to keep your mind off the four walls it is easy to lose track of the day. Those of us who write software for a living can get so far into what we are doing we even forget to eat. When someone finally does get our attention coming back to reality is like waking from a coma.

Default Ubuntu Date Display

Few can understand why Ubuntu chose to leave the day off. Thankfully you can fix it rather easily.

If you don’t already have a bin directory under your $HOME create one now. You probably want to log out and log back in as well. By default, if you have a bin directory in your home directory Ubuntu will add it to your path. This is where you put your personal scripts and executables that you want available from the command line.

Now open your favorite text editor and paste in the following code:

#
first="$1"
param="${first,,}"

case "$param" in
	"false"|"0") 	gsettings set org.gnome.desktop.interface clock-show-weekday false ;;
	""|"true"|"1") 	gsettings set org.gnome.desktop.interface clock-show-weekday true ;;
	*) 				echo "invalid parameter"
esac

exit

Save the file in your bin directory under the name “show-day”. Use the file browser and navigate to the file you just created. Right click on it. Select “Properties” from the menu that appears.

Select Properties

Navigate to permissions and flag the file executable.

Make executable

Close the dialog and you should be good to go. Run this command in a terminal using nothing, true, or 1 as a parameter and the day will appear on your display. This setting will remain until you manually change it (or Ubuntu pushes out an untested update that whacks it.)

If you want to get rid of the day for some reason run this script in a terminal again passing either false or 0 (that’s a zero) as the parameter. That will turn it off and the setting will persist the same.

Roland Hughes started his IT career in the early 1980s. He quickly became a consultant and president of Logikal Solutions, a software consulting firm specializing in OpenVMS application and C++/Qt touchscreen/embedded Linux development. Early in his career he became involved in what is now called cross platform development. Given the dearth of useful books on the subject he ventured into the world of professional author in 1995 writing the first of the "Zinc It!" book series for John Gordon Burke Publisher, Inc. A decade later he released a massive (nearly 800 pages) tome "The Minimum You Need to Know to Be an OpenVMS Application Developer" which tried to encapsulate the essential skills gained over what was nearly a 20 year career at that point. From there "The Minimum You Need to Know" book series was born. Three years later he wrote his first novel "Infinite Exposure" which got much notice from people involved in the banking and financial security worlds. Some of the attacks predicted in that book have since come to pass. While it was not originally intended to be a trilogy, it became the first book of "The Earth That Was" trilogy: Infinite Exposure Lesedi - The Greatest Lie Ever Told John Smith - Last Known Survivor of the Microsoft Wars When he is not consulting Roland Hughes posts about technology and sometimes politics on his blog. He also has regularly scheduled Sunday posts appearing on the Interesting Authors blog.