bash – change theme for gtk in gnome and take screenshot from script.
I wrote a blog on bash script to change the icon/cursor theme using a bash script. Lets extend the same concept a little more and use the script to change the gtk theme for gnome and at the same time take a screenshot also.
#!/bin/bash
path=”/tmp/screenshot”
[[ ”$1” == ”” ]] && time=5 || time=$1
[[ ”$2” == ”” ]] && (
cd ~/.themes
cont=”y”
echo ”Select one of the icon themes”
echo ”When you like some theme just press Ctrl+c”
for i in *
do
[[ -d $i/cursors ]] || (
echo ”Now trying …. : $i”
gconftool-2 –type string -s /desktop/gnome/interface/gtk_theme ”$i”
sleep 1
j=$(echo ”$path/$i”).jpg
import -window root -quality 95 ”$j”
sleep $time
)
done
) || gconftool-2 –type string -s /desktop/gnome/interface/gtk_theme ”$2”
This use’s the import command to take the screenshot. Hope you like it. You can specify the path for the screenshots in the path variable at the begining of the script.
Related Articles:
- 2010/02/04 Bash styling(themeing), the stylist way.
- 2010/01/21 shotwell- Photo organizer for Linux in Gnome
- 2009/12/02 gnome-shell and gnome-do on F11 Screenshots
- 2010/03/23 Add a image to the list of background files in gnome
- 2010/03/23 unbound variable – bash completion not working and having issues with other stuff like command not found.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.