[script] Get_madame could get a range of madame

This commit is contained in:
Mathieu 2011-08-24 00:38:05 +02:00 committed by Mathieu Maret
parent ceb2587638
commit a5191597a9

View File

@ -8,13 +8,36 @@
# Link : http://www.magetys.com # Link : http://www.magetys.com
# Version : 1.0.1 # Version : 1.0.1
# Dependency : libnotify-bin # Dependency : libnotify-bin
# Optionnal : imagemagick
# Note : Works on Gnome and Xfce # Note : Works on Gnome and Xfce
# #
########################################### ###########################################
page= page=
set -x
function usage {
script_name=`basename "$0"`
echo "Usage $script_name [Day]"
echo "Day to displae (1 for today, 2 for yesterday, 3 for the day before ...)"
}
function is_a_number {
if echo $1 | grep '^[0-9]+$' &> /dev/null
then
return 0
else
return 1
fi
}
if [ $# != 0 ] if [ $# != 0 ]
then then
if is_a_number $1 ;
then
usage
exit
fi
page="/page/${1}" page="/page/${1}"
fi fi
@ -42,7 +65,13 @@ function fixdbus {
function resize { function resize {
# Get screen size # Get screen size
res=
if [ -e /usr/bin/xrandr ];
then
res=$(xrandr | tail -1 | awk '{print $1}')
else
res=$(xdpyinfo | grep dimensions | awk '{print $2}') res=$(xdpyinfo | grep dimensions | awk '{print $2}')
fi
tailleX=$(echo $res | awk -F "x" '{print $1}'); tailleX=$(echo $res | awk -F "x" '{print $1}');
tailleY=$(echo $res | awk -F "x" '{print $2}'); tailleY=$(echo $res | awk -F "x" '{print $2}');
echo "Screen Size is X: $tailleX, Y: $tailleY" echo "Screen Size is X: $tailleX, Y: $tailleY"