adding date to filename (creating a quick screenshot button)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
adding date to filename (creating a quick screenshot button)
hey! as the subject suggests, i'm trying to make a screenshot button for my XFCE toolbar.
I make a launcher and add the lines:
import -window root /home/user/quick.png
It works great! But, I want to add the current time and date for three reasons:
1) organization
2) it doesn't overwrite the old "quick.png"
3) .. well organization i guess.
Can anyone help me? The only other thread i've found explains:
DATE=`date '+[add format here]'`... or something. I've tried that and then following it with:
ls > txt_$DATE.txt
but not as a launcher.
The DATE=.. thing doesn't work with a launcher.. it has an error saying file not found... but it seems to work in the console. I know i'm probably using more energy asking; but oh well
Can someone tell me how to add Date and/or time to my filenames while using import?
indeed this is the way to do it, just dont forget to set the permission flags of the script to executable. If you dump it somewhere in your $PATH, e.g. /usr/local/bin, you can just call it by 'wincapture.sh' from anywhere anytime.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.