[HowTo] Dated Screenshot script

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
cpedretti
Level 3
Level 3
Posts: 199
Joined: Tue Mar 10, 2020 12:06 am

[HowTo] Dated Screenshot script

Post by cpedretti »

[HowTo] Dated Screenshot script

A script who make dated screenshots like this:

Image


We’re going to install a powerful image-editing tool => imagemagick

Code: Select all

sudo apt-get install imagemagick -y
Let's be lazy and automate it with a small script:

Code: Select all

#!/bin/sh

set -e
set -u

date=`date +%d_%m_%Y-%H%M%S`
import -pause 2 /home/$USER/Images/screenshot_$date.jpg

exit 1
Edit and save it in .sh.

Then make the script executable:

Code: Select all

chmod +x script_path
Don't forget to creating a launcher on the desktop.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 6 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
AMD Ryzen 7 3700X - 32GB DDR4 RGB White - RTX4060TI O8GB White- SSD NVME Crucial P5 500GB - Mobo Gigabyte AORUS ELITE B550 V2 - PSU Corsair RM750 White - Case Corsair 5000D Airflow White 7 fans AF120 ARGB - AIO Corsair H100I Cappelix 240 White
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: [Tutorial] Backdated Screenshot script

Post by Moonstone Man »

cpedretti wrote: Tue Mar 10, 2020 11:27 am Don't forget to creating a launcher on the desktop.
Don't forget to describe what this is for. Reading the code, I can see what it does but others may not be able to. The title "Backdated Screenshot script" is meaningless. What is the word 'backdated' supposed to convey?
User avatar
cpedretti
Level 3
Level 3
Posts: 199
Joined: Tue Mar 10, 2020 12:06 am

Re: [Tutorial] Backdated Screenshot script

Post by cpedretti »

Kadaitcha Man wrote: Tue Mar 10, 2020 5:11 pm
cpedretti wrote: Tue Mar 10, 2020 11:27 am Don't forget to creating a launcher on the desktop.
Don't forget to describe what this is for. Reading the code, I can see what it does but others may not be able to. The title "Backdated Screenshot script" is meaningless. What is the word 'backdated' supposed to convey?
Thanks for your reply, i add a description of my script.

It is an dated script and show the output:

Image
Last edited by cpedretti on Mon May 25, 2020 6:25 am, edited 1 time in total.
AMD Ryzen 7 3700X - 32GB DDR4 RGB White - RTX4060TI O8GB White- SSD NVME Crucial P5 500GB - Mobo Gigabyte AORUS ELITE B550 V2 - PSU Corsair RM750 White - Case Corsair 5000D Airflow White 7 fans AF120 ARGB - AIO Corsair H100I Cappelix 240 White
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: [Tutorial] Backdated Screenshot script

Post by Moonstone Man »

cpedretti wrote: Tue Mar 10, 2020 7:14 pm Thanks for your reply, i add a description of my script.

It is an dated script and show the output:

Image
Now it will make sense to newcomers :)
User avatar
cpedretti
Level 3
Level 3
Posts: 199
Joined: Tue Mar 10, 2020 12:06 am

Re: [HowTo] Dated Screenshot script

Post by cpedretti »

I updated my script above, i added the $USER variable to facilitate the information of the current user, this better script can be now used by any Linux Mint User :)
AMD Ryzen 7 3700X - 32GB DDR4 RGB White - RTX4060TI O8GB White- SSD NVME Crucial P5 500GB - Mobo Gigabyte AORUS ELITE B550 V2 - PSU Corsair RM750 White - Case Corsair 5000D Airflow White 7 fans AF120 ARGB - AIO Corsair H100I Cappelix 240 White
Locked

Return to “Scripts & Bash”