How to get Orage Calendar to open by clicking the MX-21 Xfce Panel time display

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
Stuart_M
Posts: 708
Joined: Wed Aug 07, 2019 7:10 pm

How to get Orage Calendar to open by clicking the MX-21 Xfce Panel time display

#1 Post by Stuart_M »

The below shows how to integrate the Orage Calendar into the MX-21 Xfce 4.16 Panel so that it functions similar to how it does in MX-19. The MX-21 default "Datetime" can be replaced with a script using "date" to provide the strftime functions. That allows the Datetime Calendar, which is very basic and cannot be configured, to be replaced with the feature-rich Orage Calendar that is much more than just a calendar.

Note that the Orage Panel Clock no longer functions in MX-21 like it does in MX-19 so the Clock preferences are no longer available, at least not in a GUI. They are:
  • Show frame
  • Foreground color
    Note that the text color can be changed by editing ~/.config/gtk-3.0/gtk.css (see https://forum.mxlinux.org/viewtopic.php?p=675333 Step 5).
  • Background color
  • Set height and width
  • Rotation
  • Set timezone
  • Line 1 strftime format
    This includes strftime format, font, font size, and additional line option, however all that can be changed in the Step 7 script below.
  • Tooltip strftime format
    This can be changed in the Step 7 script below.
  • "fix time after suspend/hibernate"



First a script must be made that will show and hide the calendar. This is to allow opening and closing the calendar by clicking on the Panel time like it does in MX-19:

1. Install "orage" from the MXPI Stable Repository (installing only "orage" will automatically install both "orage" and "orage-data").

After installation the Orage Calendar and Orage Globaltime can now be launched from the Whisker Menu. To get it into the Panel and behave somewhat like it does in MX-19 do the following.

2. Go to ~/.config/ and create a file named orage-flip.

3. Make orage-flip executable:

Code: Select all

chmod -c a+x ~/.config/orage-flip
4. Put the following text in the orage-flip file:

Code: Select all

#!/bin/bash
pidof orage >/dev/null && orage -t || orage



The following will display the date/time in the Panel:

5. Create ~/.config/orage-cal.

6. Make it executable:

Code: Select all

chmod -c a+x ~/.config/orage-cal
7. Put the following text in the orage-cal file:

Code: Select all

#!/bin/bash
echo "<txt>$(date '+%A, %-d %B  %T')</txt><txtclick>$HOME/.config/orage-flip</txtclick>"

echo "<tool>$(date +%j)</tool>"
The above script is an example using a horizontal Panel with the format "Monday, 26 September 16:25:56" (there are two spaces after the month). The second "echo" line is for the Tooltip popup, in this example showing the Julian date (multiple lines in the Tooltip popup are used with multiple "echo" lines in the script - see the link at the end for an example).

Change the strftime values to get the desired format. To see the strftime formats see man strftime or better, look at one of the many on-line sites that show it more clearly such as https://www.php.net/manual/en/function.strftime.php that I use.

For the Tooltip popup I am using the Julian date (%j). Change as desired.
  • If you don't want a Tooltip from the script then delete or comment out that line.
    If no Tooltip is used then the "Generic Monitor" Tooltip will be displayed.
  • If there are spaces between the strftime values then the string should be enclosed in single or double-quotes like I did in the first "echo" line.
The below is an example using two lines on the Panel for the date/time, the bottom line showing the date representation based on locale (%x), e.g. MM/DD/YYYY:

Code: Select all

#!/bin/bash
echo "<txt>$(date '+%A, %-d %B  %T')"
echo "$(date +%x)</txt><txtclick>$HOME/.config/orage-flip</txtclick>"

echo "<tool>$(date +%j)</tool>"

Remember that changing the Panel time font and font size is done in the "Generic Monitor" Preferences.

8. Lastly, add "Generic Monitor" to the Panel and place it where you want the time displayed. Use the following values in its Preferences:
  • Command: /home/<user_name>/.config/orage-cal
  • Label: leave blank
  • Period(s): 1.00
  • Font: As desired
That's it to get the time on the Panel and allow opening/closing the Orage Calendar by clicking on the Panel time, just like it does in MX-19. (The time is displayed identical to Datetime".) Note that:
  • A horizontal Panel is used in this example.
    For a vertical panel use a shorter time output or use multiple lines (see Step 7 for an example of multiple lines).
  • The two scripts were placed in ~/.config/ in this example. They can be placed elsewhere but remember to:
    update the script in orage-cal for the location of "orage-flip".
    update the location in the command field of "Generic Monitor"



To receive Calendar Appointment audio and visual notifications, the Orage Calendar must be running (see Step 9 below to automatically start it). To see if it's running run ps -e | grep orage.

9. To automatically start Orage Calender after logging in, add an entry to “Session and Startup” and use orage in the command field. The other fields can be whatever you like.

Ensure that Orage Preferences > "Calendar window" > "Calendar start" heading > "Hide" is enabled, which it is by default.
  • If "Show" is enabled then the Calendar will open every time it is launched. That means that it will be displayed after every login if it is configured to autostart as shown above. When "Hide" is enabled it will hide the Calendar BUT ONLY with the first launch.
10. If Orage Globaltime is wanted to auto-start then add an entry to "Session and Startup" and use globaltime in the command field (the other fields can be whatever you like).




https://davespagnol.wordpress.com/2022/ ... ge-returns is the basis of much of the above scripts. I edited the calendar script:
  • Replaced the backticks (command substitution) `...` with the new-style "$(...)" which I prefer.
  • Used quotation marks inside the strftime values to allow spaces.
  • Relocated the two scripts to ~/.config/ vice /usr/local/bin/ for easier use.

Return to “Tips & Tricks by users (not for help)”