Page 2 of 6

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

Posted: Mon Oct 09, 2023 6:44 pm
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.

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

Posted: Tue Oct 10, 2023 1:31 am
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:

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

Posted: Tue Oct 10, 2023 4:36 am
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.

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

Posted: Tue Oct 10, 2023 4:51 am
by andymx
@Jakob77 Thank you for the links.

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

Posted: Tue Oct 10, 2023 9:38 am
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 ) :

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

Posted: Tue Oct 10, 2023 1:52 pm
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. :-)

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

Posted: Tue Oct 10, 2023 5:19 pm
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.

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

Posted: Tue Oct 10, 2023 5:33 pm
by Jerry3904
Nice! I've got to try that out, though I usually put such scripts in a hidden

$HOME/.local/bin

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

Posted: Tue Oct 10, 2023 6:29 pm
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?

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

Posted: Tue Oct 10, 2023 7:09 pm
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.