I would like every new file I create in MX Linux XFCE using the right mouse button to have a default name in the form of a current date in YYYYMMDD format followed by my name instead of the name "New file". Similarly, I would like every new directory I create to have a default name in the form of a date in the format YYYYMMDD followed by my name instead of "New Directory".
For example, every new file or directory created today should have the default name offered by Thunar "20231212 Wirtualny".
Is this achievable?
I would like to change the default name of newly created files and directories from Thunar [Solved]
- dolphin_oracle
- Developer
- Posts: 22717
- Joined: Sun Dec 16, 2007 12:17 pm
Re: I would like to change the default name of newly created files and directories from Thunar
You can't change the default thunar action, but you can create a custom right click action for that. You can even give it a shortcut key combo if you like.
the command would be something like
the command would be something like
Code: Select all
touch "$(date +%Y%m%d) $USER"
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
Re: I would like to change the default name of newly created files and directories from Thunar [Solved]
I have something very similar to that, but I could never get the touch command to work from my custom action.
I created a script ( LogDate.sh ) , and then set a custom action to run that. Then in LogDate.sh I have the following:
This allows me to not have to change the action, only the LogDate.sh script and i can add / modify any way I want.
If OP wanted, then a NewFile.sh with the following content should work:
( remove the _%I%M%p if you dont want time )
Then, Thunar | Custom Actions
create a new Custom Action and set the NewFile.sh as the command, and Name it something like New File.
Right click on white space in thunar and choose the New File entry approx halfway down the list.
I created a script ( LogDate.sh ) , and then set a custom action to run that. Then in LogDate.sh I have the following:
Code: Select all
touch "log_$(date +"%Y%m%d_%I%M%p").log"
If OP wanted, then a NewFile.sh with the following content should work:
Code: Select all
touch "$(date +"%Y%m%d_%I%M%p Wirtualny")"
Then, Thunar | Custom Actions
create a new Custom Action and set the NewFile.sh as the command, and Name it something like New File.
Right click on white space in thunar and choose the New File entry approx halfway down the list.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!
Re: I would like to change the default name of newly created files and directories from Thunar
...+
Code: Select all
mkdir "$(date +%Y%m%d) $USER"
Re: I would like to change the default name of newly created files and directories from Thunar
Thank you very much! :)
It's greater than I have expected!
It's greater than I have expected!