LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-23-2014, 03:45 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
How to format Mate clock applet?


I am seeking help with formatting the Mate desktop clock applet. I want the clock and date to wrap to two rows and use a smaller font.

I use several distros. The only one that has this feature is Linux Mint with the Mint-X theme.

In all other distros none of the installed themes have this feature, defaulting to one row.

I can force the clock to wrap to two rows when I use a panel height larger than I desire in conjuntion with an application font smaller than I desire.

I appreciate any guidance.

Thanks.
 
Old 11-24-2014, 07:52 AM   #2
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Customizable fonts and a multiline display are why I like the orage clock applet in XFCE. Currently running Mate in Fedora Rawhide. Thought I'd try something like
Code:
%a %d-%b\n%R:%S
as the format, but every time I attempt to modify the Mate clock format, the clock applet crashes
 
Old 11-24-2014, 11:48 AM   #3
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
This might help
http://forums.mate-desktop.org/viewtopic.php?f=2&t=1593

Mate seems to be getting too like Gnome 3 in such matters. I think the answer is Xfce!
 
Old 11-26-2014, 12:08 AM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
This might help
Thank you.

Solving this was not intuitive but I did stumble across the solution.

The file /usr/share/glib-2.0/schemas/org.mate.panel.applet.clock.gschema.xml provided clues.

* Open dconf-editor.
* Open org.mate.panel.objects.clock.prefs.
* Manually change the format key to custom.

Without using the custom format, trying to otherwise modify the clock display is futile. The GUI for the clock only supports the 12-hour and 24-hour formats, but as explained in the gschema.xml file, there also are the internet, unix, and custom formats.

After changing the dconf format key to custom, any changes to the custom-format key will occur in real-time (immediately). The options to use are explained in the strftime man page.

I used the following string:

Code:
<b>%l:%M %P</b>%n%a %b %e
This custom format places the time in bold in the first row, the %n option introduces a newline character, and the date is placed in the clock's second row. Like this:

Code:
 11:52 pm
Tue Nov 25
I wasn't quite finished. I needed to change the font size.

I added the following in ~/.gtkrc-2.0:

Code:
style "clock-applet"
{
  fg[NORMAL] = "#444AA9"
  font_name = "Arial 9"
}
widget "*.clock-applet-button.*" style "clock-applet"
I added the font color to match the desktop color (I don't use wallpaper).

I don't know how the Mint-X theme performs the same basic magic, but I am content with what I discovered. I hope this information helps others.
 
Old 11-26-2014, 08:06 AM   #5
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
I pulled up this thread (but couldn't seethe whole thing), went to dconf-editor to take another stab at changing the format, put in my desired format (to no effect), then thought, maybe if I change the format entry from 24-hour to custom it'll work. I did it, it works, then I scrolled down the page and saw upnort's response. Now I need to try modifying .gtkrc
 
Old 11-26-2014, 11:42 AM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
I'd forgotten the %b code; actually, the codes for setting the date are the same as those used in the function strftime — see its man page.
 
Old 11-28-2014, 04:50 AM   #7
kevinmilan2014
LQ Newbie
 
Registered: Nov 2014
Posts: 17

Rep: Reputation: 1
After couple of hours I've managed to find a workaround. I will try to describe it step by step.

IMPORTANT !!! The workaround is tested under "debian wheezy" only. The names of the files or directories may vary depending on the distro. !!!

Before making any changes, please backup all the files that you are going to modify in this workaround.

-- All the commands below are execute with user root.

Step 1:
Go to "/usr/share/glib-2.0/schemas/" and edit the file named "mate-debian.gschema.override" (for your distro, the name of the file may vary) adding the following code:

Code:
[org.mate.panel.applet.clock]
format='custom'
custom-format=''
where for "custom-format" value, you have to put your own custom string. Mine is e.g.

Code:
custom-format='<span size="xx-large" color="#f5f5f5"><b>%H:%M</b></span>'
Save the file.
 
Old 06-25-2015, 03:03 PM   #8
Milan Knizek
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by kevinmilan2014 View Post
Step 1:
Go to "/usr/share/glib-2.0/schemas/" and edit the file named "mate-debian.gschema.override" (for your distro, the name of the file may vary) adding the following code:
As mentioned by others earlier, there is no need to modify /usr/share/glib-2.0/schemas/... (which will not survive next update of the clock applet). Just do the same as you suggested in "dconf-editor" run as a regular user (not root).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] network manager applet on MATE desktop mzzxx11 Linux - Newbie 4 11-16-2013 03:12 AM
Wanted: Details on weather applet for Gnome/MATE panels Doc CPU Linux - Desktop 9 08-06-2013 11:28 AM
Calendar applet for MATE in Mint 13 crosstalk Linux Mint 1 08-07-2012 09:05 AM
Customise date format in Gnome clock applet tooltip? genogebot Linux - Desktop 3 06-04-2011 12:54 AM
clock applet ekdya Debian 2 04-14-2006 07:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration