LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 12-03-2014, 09:14 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Display file date as m/d/y in Thunar


I have been very pleased with Thunar.

Is there a way to get it to display the file dates as

Month/Day/Year ?
Attached Thumbnails
Click image for larger version

Name:	M_D_Y.png
Views:	66
Size:	12.4 KB
ID:	17010  

Last edited by Fixit7; 12-03-2014 at 09:24 PM.
 
Old 12-04-2014, 07:23 PM   #2
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 441

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
It seems that this cannot be done, either in the application and in the configuration files. In fact Thunar's date styles are hard-wired in the C code, in the file named 'thunar-util.c', so one has to modify it and rebuild the application. But this can be done easily. The four date styles are called:

THUNAR_DATE_STYLE_SIMPLE (e.g. "Today")
THUNAR_DATE_STYLE_SHORT (e.g. "Today at 07:04:22 AM")
THUNAR_DATE_STYLE_LONG (e.g. "Fri 05 Dec 2014 07:04:22 AM CST")
THUNAR_DATE_STYLE_ISO (e.g. "2014-12-05 07:04:22")

The simplest way, apparently, is to modify either the 'ISO' or the 'LONG' style, since they are one-liners which do not involve conditional constructs. For example, if you want a date like '12/05/2014' you can do the following change to 'ISO' (which of course will not be ISO anymore) in 'thunar-util.c':

Code:
 
   {
     /* Use ISO date formatting */
-    return exo_strdup_strftime ("%Y-%m-%d %H:%M:%S", tfile)
+    return exo_strdup_strftime ("%m/%d/%Y", tfile)
   }
The modified line is 329 in Thunar 1.6.3. I wanted to have a format like "Dec 05 2014" instead (see image below), so I used "%b %m %Y". If you want to get rid of the "Today etc." thing completely, then you might want to modify the code for SIMPLE and/or SHORT by editing / commenting out the related conditional constructs (which are needed to choose between 'Today', 'Yesterday', 'Monday', etc.). Then rebuild (that's quick, even on a 10 years old machine) and reinstall. You might need to log out from Xfce for the changes to be enabled.
Attached Thumbnails
Click image for larger version

Name:	thunar_date.png
Views:	69
Size:	60.3 KB
ID:	17015  

Last edited by Philip Lacroix; 12-04-2014 at 07:41 PM.
 
Old 12-04-2014, 08:06 PM   #3
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Thanks.

I need some more info.

Like what compiler do I use etc.

Did I do this correctly ?
Quote:
else /* if (date_style == THUNAR_DATE_STYLE_ISO) */

{
/* Use ISO date formatting */
- return exo_strdup_strftime ("%Y-%m-%d %H:%M:%S", tfile)
+ return exo_strdup_strftime ("%m/%d/%Y", tfile)
}

}

/* the file_time is invalid */
return g_strdup (_("Unknown"));
}

Last edited by Fixit7; 12-04-2014 at 08:16 PM.
 
Old 12-05-2014, 06:13 AM   #4
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 441

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
Quote:
Originally Posted by Fixit7
Did I do this correctly?
You have to replace the first line with the second, and omit the '+' and '-', as they are only intended to show which line has to be replaced with the other.
Code:
 {
   /* Use ISO date formatting */
   return exo_strdup_strftime ("%m/%d/%Y", tfile)
 }
Quote:
Originally Posted by Fixit7
I need some more info. Like what compiler do I use etc.
You would essentially follow the "configure && make && make install" pattern. However, the default configuration will put everything in /usr/local and might not work on your system; libraries might not be found, etc. Therefore you should check how your system is configured, and how the original Thunar package was built, and which configuration flags were used.

That having been said, here is a disclaimer: these steps are not that difficult, but they involve doing things as root, which in turn can result in breaking the system badly and/or losing your data. For these reasons you should try this only if you are familiar with your system and with the command line, thus knowing what you are doing. I'm not familiar with Puppy Linux myself, and I don't know how Thunar is deployed there, so I guess that it's up to you to document yourself in order to get it right: that's how Linux works.

Last edited by Philip Lacroix; 12-05-2014 at 12:23 PM. Reason: typo
 
Old 12-05-2014, 01:30 PM   #5
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Thanks I make image backups, so if I decide to compile, I will make an image 1st. :-)
 
Old 12-10-2014, 06:45 PM   #6
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 441

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
Quote:
Originally Posted by Fixit7
Thanks I make image backups, so if I decide to compile, I will make an image 1st. :-)
That's fine. The following documents provide some useful and interesting information about the "configure && make && make install" process:

configure; make; make install
GNU Make Manual
Troubleshooting ./configure, make and make install

For an example of configure options for Thunar 1.6.3, below are the ones used on a 64 bit Slackware system (the backslashes tell the shell that the command continues on the following line). As you can see, nothing will go in '/usr/local', as on Slackware this directory is not used by default:

Code:
./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc \
  --mandir=/usr/man --docdir=/usr/doc/Thunar-1.6.3 --disable-static \
  --disable-debug --build=x86_64-slackware-linux
The best way to install, uninstall and upgrade software is probably by using packages that are compatible with your distribution. For this reason, I suggest that you learn how to package the software you build for Puppy Linux. I guess that this article by Barry Kauler himself is the best source:

PET packages

Last edited by Philip Lacroix; 12-10-2014 at 07:44 PM. Reason: English
 
  


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] Thunar: what is hot key to display path (e.g. for copy) catkin Linux - Desktop 4 08-10-2023 05:13 PM
Display lines of two date range from syslog file p2006.prashant Programming 4 07-03-2013 04:17 PM
how to display Missing date in a file newbie_adm Programming 5 03-21-2013 06:24 PM
thunar does not update date and time when a dot file is replaced allend Slackware 2 10-27-2012 04:36 PM
Thunar does not display thumbnails for some PDFs in -current solarfields Slackware 5 08-12-2012 11:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 05:46 AM.

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