3

My Ubuntu 18.04 laptop has a desktop shortcut link that opens my Google Calendar. Someone else set it up for me; I don't know how they did it. I installed Ubuntu 20.04 on my desktop computer and would like it there too. I can't find how to do it. I've had suggestions on how to sync entries with GNOME Calendar, but that's not the same. Is there that much difference between Bionic and Focal, or did I receive especially advanced help three years ago setting up my laptop?

2
2

You most certainly can ... though the method is not exactly the most intuitive.

Here's how to do it with Firefox:

  1. Click on the icon to the immediate left of the URL you want to open. This will probably be a lock as Google Calendar uses SSL: Firefox - The Lock

  2. Drag that lock over to the desktop and let go. This will give you an ugly icon:

    Ugly Icon

    Note: If the ugly icon is "good enough", there's nothing more you need to do. Double-clicking the icon will open your preferred browser to the page that you have specified.

  3. To make the icon less of an eye-sore, right click the item and choose "Properties"

  4. Change the name to something you would prefer, and set an image if you have one that you'd like to see:

    Properties

    Note: You'll see the name on the desktop change as you change the name, but the icon will not update to the one you've specified. This is in the next step.

  5. Click the "Permissions" tab, and check "Allow executing file as program": Execute

  6. Enjoy your desktop shortcut: Just ask!

That's all there is to it.

3
  • There's no lock icon. Clicking anywhere on that bar drags the whole URL, but it won't drop. I tried to copy and paste the URL to an empty folder I created on the desktop, and when I opened it, it was in a different format
    – Frank P
    Jun 6 at 10:17
  • Vanadium indicates anyone with basic computer skills should be able to implement these answers. I've spent hundreds of hours trying to learn basic computing, and still can't understand instructions. ("It will be easier to just copy the Firefox launcher (or any browser you user for Calendar) and edit that one.") How do I do that?
    – Frank P
    Jun 6 at 10:42
  • I created an empty folder on the desktop, and pasted the URL there. When I opened it, it was in another format. I created a new file there and tried to drag and drop the URL. I was told it was an invalid drag and drop action.
    – Frank P
    Jun 6 at 10:56
0

I found an old askubuntu quistion with you answer :) You can create an HTML page on your desktop that refreshes to any website. The code you will need for AskUbuntu is:

<html>
<head>
<meta http-equiv="refresh" content="0; url=https://askubuntu.com" /> 
<!-- change the url flag to change the shortcut website -->
</head>
<body>
</body>
</html>

Source: Create a shortcut for URL?

0

Option 1: Application launcher

Application launchers in Linux are .desktop text files. Unfortunatelly, graphical tools to create them are not anymore readily available. Since these are text files, you can easily create your own, however.

In this case, you easily can just modify an existing launcher forethe browser you use. Assuming you use the default browser Firefox, then copy the file firefox.desktop in the system folder /usr/share/applications/ (Look under "Other locations", "Computer" to find the folder usr then navigate down to share and next applications) to the folder .local/share/applications under your home directory. (.local is a hidden folder in your home folder. Enable the display of hidden files to see them).

Open the file in your text editor, and find the line

Exec=firefox %u

Replace %u by the URI of your calendar (i.e., while in your calendar, copy the URI that is displayed in the address bar of your browser), e.g.

Exec=firefox https://calendar.google.com/calendar/r?pli=1 

If you wish a different icon, you can change the line Icon=firefox, where you replace firefox by the file path of your own icon, e.g. Icon=/home/<yourlogin>/Pictures/calendar.svg, where you change by your own login name , and Pictures/calendar.svg by the actual path and file name of your custom icon file.

Advanced tip: starter that switches to calendar if it is already running

You can create a .desktop launcher on your desktop to start or switch to Google Calendar. Create a file google-calendar.desktop with following content

[Desktop Entry]
Version=1.0
Name=Google Calendar
GenericName=Calendar
Keywords=Mail;Email
Exec=jumpapp -t "Google Calendar" firefox "https://calendar.google.com/calendar/r?pli=1"
Terminal=false
Type=Application
Icon=google-calendar
Categories=GNOME;GTK;Network;WebBrowser;

You could simply have an Exec= line that reads like:

Exec=firefox "https://calendar.google.com/calendar/r?pli=1"

That would directly call Firefox and open a window with your calendar. Next time you click the launcher, it would launch a new window. I use jumpapp (https://github.com/mkropat/jumpapp), a bash script that actually relies on wmctrl:

Exec=jumpapp -t "Google Calendar" firefox "https://calendar.google.com/calendar/r?pli=1"

This causes the launcher to first look if Calendar is already open. If it is open, it switches to the running instance. Else, it opens a new instance.

Option 2 - URL launcher

Another option is to use an URL launcher instead. This is also a .desktop file. Depending on the Ubuntu version you have, these may easily be created by dragging the URL bar to the desktop. See the answer of matigo for detailed instructions.

Bonus tips

  • In addition to placing that .desktop file on your desktop, you can place it in your ~/.local/share/applications folder. This way, it will be included in the application overview, from where you could pin it to the dock.
  • In addition, you could assign a shortcut key. I launch or switch to Google Calendar using the shortcut key Super+L (where I disable the default binding, to lock the screen, first). To launch a .desktop file through a command, install dex from the Ubuntu software repositories (sudo apt install dex). The command for the shortcutkey is then dex /home/<yourlogin>/.local/share/applications/google-calendar.desktop. (replace ` by your user name).
2
  • I am unfamiliar with command lines. After many attempts to follow the instructions, with various explanations given for the failures (no such file or folder found, possible broken packages, process possibly already running somewhere else, and other things I don't understand), I was prompted to write the command: "sudo apt install google-calendar.desktop" This resulted in: "Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 8580 (synaptic)..." After the waiting counting into the thousands of seconds, I'm thinking it;s not going to unlock.
    – Frank P
    Jun 4 at 23:46
  • Opening basic text files, copying and pasting text in it, saving it to a location in your home directory bears little relation with "command lines", and is a basic computer skill. My answer, though, is not the most simple approach. It will be easier to just copy the Firefox launcher (or any browser you user for Calendar) and edit that one. I will add that as the first part, but leave the others for the benefit of slightly more advanced users.
    – vanadium
    Jun 5 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.