Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#1
I hate the default that scrot has to name your shots. I knew it would take other arguments to properly name them but you would have to do this via the command line. Since Anti would like antiX to be new user friendly I tried to wright a script that would let you name your screen shots what ever you like and this is what I came up with. We already have scrot and zenity installed so it should work with no problems.

You the will either have to edit the existing screenshot entry in your menu or add a new one. I use wbar so I just added an entry there with an icon.

Let me know what you think.

UPDATE: I have added to Zenscreen and it now will let take a shot of a specific area of your screen which you select with the cursor.

Unpack the download and read the"README". It will tell you how to use the install script. Enjoy!
Zenscreen-2.5
Zenscreen-2.5
Last edited by eriefisher on 11 Nov 2008, 12:21, edited 11 times in total.
OU812
Posts: 1,081
OU812
Joined: 29 Sep 2007
#2
Looks good and works great. Maybe anti will include it in the next release. If so, I'll make the necessary adjustments in icewm. Thanks!

john
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#3
Let me know it something should be different. I might put a kill in it so it will cancel before it takes the shot. Zenity will allow for this. I will look at it more. Thanks John.
Posts: 1,081
OU812
Joined: 29 Sep 2007
#4
Erie - I've been playing around with your script. May I suggest the following mods?

Code: Select all

FILE=$(zenity --title"Name Of Shot" --entry --text"Name Of Shot:")

if [ $? = 0 ] ; then
   scrot -d 5 $n"$FILE".png && zenity --title"Saved" --info --text"Your screenshot has been saved as\n $HOME/$FILE"
fi
The if statement allows a user to cancel the screenshot process. The"-d 5" allows a 5 second delay before the screenshot. The"\n" escape sequence allows the path to be displayed on a separate line. I hope you don't mind.

john
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#5
That's exactly what I was thinking, thank you. I also want to put a"cancel" in a second if statment. I will edit and repost.

Thanks again John.
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#6
Ok I have edited and added a second if statement so it will cancel.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#7
Excellent work eriefisher and OU812.

Is there an easy way to add an option for user to choose to save as jpg or png?
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#8
Yes there is. Right now it defaults to .png but I can change this so it entered by the user. I will see what I can do.
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#9
OK, you now have to enter <name>.<extension> ie: screenshot.jpg or mydesktop.png.
Posts: 609
dark-D
Joined: 02 Jun 2008
#10
great script erie! now john can justify for keeping zenity __{{emoticon}}__ . just a memo: add it to the fluxbox keys as well anti.
Posts: 253
mariel77
Joined: 13 Sep 2007
#11
eriefisher wrote:Yes there is. Right now it defaults to .png but I can change this so it entered by the user. I will see what I can do.
I tried this and it works great; I'm going to keep using it saving as a png too.
I forgot to say thank you! Nice work!
Posts: 1,081
OU812
Joined: 29 Sep 2007
#12
I definitely like the ability to name files as .jpg or .png. For example, I just found out the hard that in this forum, you can only upload .jpg attachments. So while I wait for a finished version, I've already edited the early version of the script to save images as .jpg. Keep up the good work and I am definitely looking forward to the next version. So, does antix now have another developer?

john
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#13
I have now rewrote it a little to simplify and added some more functionality. You can now just pick the image type from a list. If you would like it to default to a certain file type then just edit the script and change FALSE to TRUE beside the image type you prefer. You will only save one click though.

Good luck and enjoy.
Posts: 253
mariel77
Joined: 13 Sep 2007
#14
Thanks, eriefisher! This is a great little addition to antiX.
Posts: 516
oldhoghead
Site Admin
Joined: 01 Oct 2007
#15
Very helpful script eriefisher, thank you

cheers
oldhoghead