How to see the date created, modified etc. in Thunar?  [Solved]

Message
Author
User avatar
Melber
Developer
Posts: 1389
Joined: Tue Mar 23, 2021 4:19 pm

Re: How to see the date created, modified etc. in Thunar?

#11 Post by Melber »

@andymx
I'm not 100% sure I understand how you want Thunar to show dates.

A: All dates to be shown in your preferred format
or
B: Recent files to show "Today" and older files in your preferred format, with the option to show the date for "Today" files.

If A then, as CharlesV said, just choose the Custom option instead of Today/Custom and edit the format to your liking.

If B you could try this
edit > configure custom actions > click on the + button to create a new action
On the Basic Tab
- Enter "Show Date" in the Name section
- Paste this into the Command section

Code: Select all

IFS=_;yad --text="%n\n$(bash -c "date -r %f")" --undecorated --class=showdate --center --button=close
On the Appearance Conditions tab
- Select all file types
Click OK and then close

When you now right click on a file the option "Show Date" should appear in the pop-up menu.
Select Show Date and a small window will show the date and time the file was last modified.

andymx
Posts: 434
Joined: Mon Sep 11, 2023 7:10 pm

Re: How to see the date created, modified etc. in Thunar?

#12 Post by andymx »

@Melber It was B that I was looking for and thank you for your help. I believe it shows the date the file was modified. Can it be adapted to also show the date of file creation and last accessed?

By chance this was an opportunity for me to learn about the existence of custom actions! There's so much to learn in Linux... :linuxlove:
"While I may not get any money from Linux, I get a huge personal satisfaction from having written something that people really enjoy using, and that people find to be the best alternative for their needs."
~ Linus Torvalds
:linuxlove:

Jakob77
Posts: 658
Joined: Thu Feb 09, 2023 3:09 am

Re: How to see the date created, modified etc. in Thunar?

#13 Post by Jakob77 »

andymx

It is a matter of taste if the detail will be a progress. I would not let it complicate my configuration.
But if you want to make Thunar and other Xfce software better there is also this forum:

https://forum.xfce.org/

And when it gets more serious they also have this page:

https://gitlab.xfce.org/xfce/thunar/-/issues/931


Just be prepared the manpower is limited and Xfce is a supertanker with a lot of priorities. Especially with Thunar reliability outranks everything else. So things takes time.

andymx
Posts: 434
Joined: Mon Sep 11, 2023 7:10 pm

Re: How to see the date created, modified etc. in Thunar?

#14 Post by andymx »

@Jakob77 Thank you for the links.
"While I may not get any money from Linux, I get a huge personal satisfaction from having written something that people really enjoy using, and that people find to be the best alternative for their needs."
~ Linus Torvalds
:linuxlove:

Charlie Brown

Re: How to see the date created, modified etc. in Thunar?

#15 Post by Charlie Brown »

I always do it as Charles mentioned: Select "Custom" (just custom)

Then , i.e.

Code: Select all

%d.%m.%Y %H:%M
Looks like this (for today: 10.10.2023 ) :
You do not have the required permissions to view the files attached to this post.

Jakob77
Posts: 658
Joined: Thu Feb 09, 2023 3:09 am

Re: How to see the date created, modified etc. in Thunar?

#16 Post by Jakob77 »

andymx

Well I guess I am the one who ought to say thank you to you for bringing it up.
Like others I misunderstood at first but I have actually been annoyed by the silly 'today' stamp for a long time without doing anything about it.
Please not as many tool tips as in Windows but if you ask for another default, I can only agree. And in general I think we ought to discuss better defaults a lot more.
At the moment I am testing this fat one:

Code: Select all

%c-%m-%d %H:%M:%S
We can also right click on the status bar in the bottom and change a little there. :-)

User avatar
Melber
Developer
Posts: 1389
Joined: Tue Mar 23, 2021 4:19 pm

Re: How to see the date created, modified etc. in Thunar?

#17 Post by Melber »

andymx wrote: Tue Oct 10, 2023 1:31 am Can it be adapted to also show the date of file creation and last accessed?
The info you're looking for is already available under right click on a file > Properties.


If you want a custom action you could try this script

1. First make a directory for your scripts.
Open a terminal (Ctrl+Alt+T) and enter the following (or copy/paste using right click menu)

Code: Select all

mkdir $HOME/bin
2. Now make a new file named fileinfo.sh in that directory.
In terminal enter

Code: Select all

touch $HOME/bin/fileinfo.sh
3. Open the file in Featherpad text editor.
In terminal enter

Code: Select all

fpad $HOME/bin/fileinfo.sh
4. Copy and paste the following into the empty file in featherpad. Save and close.

Code: Select all

#!/bin/bash

FILENAME="$@"
CREATED=$(stat -c %w $FILENAME | cut -d'.' -f1)
MODIFIED=$(stat -c %y $FILENAME | cut -d'.' -f1)
ACCESSED=$(stat -c %x $FILENAME | cut -d'.' -f1)

yad --class=fileinfo --undecorated \
--borders=10 --center \
--button=close \
--form --columns=2 \
--text="<b>$FILENAME</b>\n" \
--field="Created:":LBL "" \
--field="Modified:":LBL "" \
--field="Accessed:":LBL "" \
--field="$CREATED":LBL "" \
--field="$MODIFIED":LBL "" \
--field="$ACCESSED":LBL ""
5. Make the file executable
In terminal enter

Code: Select all

chmod u+x $HOME/bin/fileinfo.sh
6. Close terminal

7. Open Thunar to edit the Show Date custom action from last time.
edit > configure custom actions >select Show Date and gear icon to edit.
Change Name to "File Info"
Delete the contents of Command and replace with this

Code: Select all

$HOME/bin/fileinfo.sh %f;
OK and Close.

Right click on a file should now show a small dialogue with Created, Modified and Accessed info.

User avatar
Jerry3904
Administrator
Posts: 23410
Joined: Wed Jul 19, 2006 6:13 am

Re: How to see the date created, modified etc. in Thunar?

#18 Post by Jerry3904 »

Nice! I've got to try that out, though I usually put such scripts in a hidden

$HOME/.local/bin
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
Melber
Developer
Posts: 1389
Joined: Tue Mar 23, 2021 4:19 pm

Re: How to see the date created, modified etc. in Thunar?

#19 Post by Melber »

Jerry3904 wrote: Tue Oct 10, 2023 5:33 pm Nice! I've got to try that out, though I usually put such scripts in a hidden $HOME/.local/bin
For any specific reason or just out of habit?

User avatar
Jerry3904
Administrator
Posts: 23410
Joined: Wed Jul 19, 2006 6:13 am

Re: How to see the date created, modified etc. in Thunar?

#20 Post by Jerry3904 »

Just that's where I have often see it recommended to be placed, but I see other locations as well. My preference is based on trying to keep system and app data files out of my face when I just have Thunar not showing hidden files for everyday operations.

EDIT: That works very well, so we might suggest it to @dolphin_oracle for standard inclusion.
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

Post Reply

Return to “Software / Configuration”