[SOLVED] For those who said xfce is boring ....

Forum rules
Before you post please read how to get help
Post Reply
User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

[SOLVED] For those who said xfce is boring ....

Post by secureIT » Sat Aug 10, 2019 3:25 pm

For those who said xfce is boring …… : i created some yad-scripts with animations connected to several progs.

Lagging of presentation-speed is because of vokoscreen, i used for recording.
The normal display on the screen is much more fluid …… also the processor utilization is much lower in real life (without that vokoscreen-recording)

See the vids ….. and tell me if it is worth goin on.

xfce-network-yad

https://streamable.com/umn55

xfce-radiotray-ng-yad-panel

https://streamable.com/vqjy1


xfce-qmmpstart-yad

https://streamable.com/aytoh

xfc-custom-yad-panel-vlc-start

https://streamable.com/zmadh
Last edited by secureIT on Tue Aug 13, 2019 3:42 pm, edited 1 time in total.
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Crippled

Re: For those who said xfce is boring ....

Post by Crippled » Sat Aug 10, 2019 3:58 pm

Thank you for sharing. A lot can be done with Xfce. I always tell those critics, no desktop environment has an application menu as good as the Whisker menu. :wink:

User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

Re: For those who said xfce is boring ....

Post by secureIT » Sat Aug 10, 2019 4:13 pm

Hi Crippled,

thanks for your response.

I figured out, how to set gif. animations within xfce by use of yad-sripts
But it is much manual work, to do that.

I can make it common with an automated script, that let you use your own animations in xfce on the wall of your screen.

This will be much work to automate that, but if there is a good response of people, who are interested in this thing, i will go on ...... may be with the help of other scripters ............
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Crippled

Re: For those who said xfce is boring ....

Post by Crippled » Sat Aug 10, 2019 4:25 pm

secureIT, too bad you haven't figured out how to do it by creating a G.U.I. configuration application which will make it easy for anyone.

deck_luck
Level 3
Level 3
Posts: 185
Joined: Mon May 27, 2019 6:57 pm
Location: here

Re: For those who said xfce is boring ....

Post by deck_luck » Sat Aug 10, 2019 4:31 pm

I use XFCE exclusively on my laptop. I want a light weight DE without the meaningless bloated heavy weight desktop environment. To get better battery run time the XFCE DE was my obvious choice. It is light weight, but it is very functional.

You have some funky going on with your desktop. :D
💡Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime. ✝️

all41
Level 15
Level 15
Posts: 5573
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: For those who said xfce is boring ....

Post by all41 » Sat Aug 10, 2019 10:45 pm

Whoever said that should be eating crow

User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

Re: For those who said xfce is boring ....

Post by secureIT » Sun Aug 11, 2019 3:55 pm

Hi, Crippled,
secureIT, too bad you haven't figured out how to do it by creating a G.U.I. configuration application which will make it easy for anyone.
So here we go :

some time ago i tested „gifondesktop“ from
http://murga-linux.com/puppy/viewtopic. ... 3d9d3542a5

To use it, one had to install : gifview, gtkdialog and gtkdesklet.

Not easy, while not all into repos, but possible the manual way ……….

Did it, and was disappointed, while gtkdialog shows up with window, window-title, buttons, window-borders and no transparency.

May be in puppy it is not so, but xfce is not puppy !

Every window, that is be shown in Xfce depends on the theme.

So i thought about a way, to let it show without window-frame and without window-title.

I came across YAD and with it is possible to do so.

I tested it within a YAD-Script, and window title doesnt show up, but unfortunately window-borders would be shown and there is no transparency.
For that window-borders i found a theme called „mini“ from here :
https://github.com/cedl38/mini-xfwm4-theme
….. and with the code-snippet :

Code: Select all

GTK_THEME=mini yad…………….
it was possible to show the window without disturbing borders.
But as i found no theme, that has really good transparency, only way, to integrate the .gif in wallpaper, was to copy the background of the position, where animation should be, and set it as background of the .gif.
This could be done online with the help of screenshot-app or manual with gimp.

I did all the things of scripting, positioning and setting background for .gif manual.

So to make it easier for other users, i adapted the gifondesktop script from fredx181 on murga-linux.com/puppy/ ……
and modified it for viewing gif-files with YAD.

The script let you test the view and screen-position of the .gif.
If you tested it and push ok-button, script will be created in ~/home directory and name of script is name of <gif-file with dimensions selected> .sh.
It will be marked as executable by script …… and to run - simply doubleclick on it.

If you test the view, you can set the delay to e.g. 50 …. so that you are able to use the screenshot app by „select area“
…. and select the area of the shown .gif.
After .gif delays you can make that screenshot …… and now you have a background for the .gif.
Then set the delay back to which one you want, and click "ok button"

Now you can append the screenshot of background to the .gif
online :
https://ezgif.com/maker
or do it manual with the help of gimp (may be better results)

Here is the script :

Name it as you would and copy it as .txt file to your home in :
~/bin
If the folder does not exist ….. simply create it.
After that open thunar and navigate to the location of the file.
Rename it to .sh
Then we have to make it executable.
Easy way is in thunar : rightclick on it and in the following dialog select : <characteristics> <access rights>
and mark : <File may be started as a program>
Thats it …..
Now you can start it with doubleclick ….. or by a launcher.

I know, overall, it's still a bit complicated, but maybe someone will find a better solution for the transparent appearance.

Code: Select all

#!/bin/bash
#
#Create a script for to run animated gif on the desktop
#
# original script was "gifondesktop" from fredx181 on murga-linux.com/puppy/
# modyfied for Xfce by secureIT on forums.linuxmint.com to view .gif with yad instead of gifwiew gtk-dialog and gtkdesklet
#
if [ -z "$(which xwininfo)" ]; then
echo "Sorry, xwininfo not found, please install x11-utils"
yad --width=330 --center --title="xwininfo not found" --text="  Sorry, xwininfo not found, please install <b>x11-utils</b> \n  Press Close to Exit  " --button="gtk-close:0"
exit
fi
#
info () {
echo -e '           *** Setup Animated gif on Desktop ***  \n\n Create a script for to run animated gif on the desktop \n\n if you tested it and push ok-button script will be created in ~/home directory  \n\n name of script is name of <gif-file with dimensions selected> .sh \n\n it is marked as executable by script \n\n to run - syimply doubleclick on it
'  | yad --margins 7 --title="Info Setup Animated gif on Desktop" --height=420 --width=680 --text-info --wrap --button="gtk-close:0"
}
export -f info
#---------------------------------
# 
#Detect screen resolution
#
#---------------------------------
ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
[ -n $1 ] && GIF="$1"
[ -z $GIF ] && GIF="$HOME/*"
[ -z $XPOS ] && XPOS="$ROOTX"
[ -z $YPOS ] && YPOS="$ROOTY"
[ -z $TIMEOUT ] && TIMEOUT="5"
#--------------------------------
#
#YAD query window is created
#
#--------------------------------
SETTINGS=$(yad --width=530 --title="Setup Animated gif" --text="  <b>Create script to display animated gif on the Desktop</b>  \n  \n  Screen size: ${ROOTX}x${ROOTY} \n  Select .gif and set the desired geometry \n  Negative values are supported (transformed to positive though), e.g. \n  x -40 y -50 (bottom-right)  Or: x -1280 -y -40 (bottom-left) \n  Click 'Preview' first, then, if is as desired, click OK to create the script " --form --center \
--field="Select .gif image:          :FL" "$GIF" \
--field="Change x position:          :NUM" $XPOS!-$ROOTX..$ROOTX!2 \
--field="Change y position:          :NUM" $YPOS!-$ROOTY..$ROOTY!2 \
--field="Set Timeout in Seconds (0=infinite):           :NUM" $TIMEOUT!0..10000!1 \
--button="gtk-info:bash -c info" --button="Preview:2" --button="gtk-cancel:1" --button="gtk-ok:0")
#--------------------------------
#
ret=$?
echo $SETTINGS
export GIF="`echo $SETTINGS | cut -d "|" -f 1`"
export XPOS="`echo $SETTINGS | cut -d "|" -f 2 | cut -f1 -d"."`"
export YPOS="`echo $SETTINGS | cut -d "|" -f 3 | cut -f1 -d"."`"
export TIMEOUT="`echo $SETTINGS | cut -d "|" -f 4 | cut -f1 -d"."`"
[ "${XPOS:0:1}" != '-' ] && XPOS=+"${XPOS}"
[ "${YPOS:0:1}" != '-' ] && YPOS=+"${YPOS}"

echo $XPOS
echo $YPOS

preview () {
gif="$GIF"
x="$XPOS"
y="$YPOS"
timeout=10

exitfn () {
    trap SIGINT              # Resore signal handling for SIGINT
kill $dlgPID 2> /dev/null
exit
}
trap "exitfn" 1 2 15

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
margin=5

ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${x}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi
fi

echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
export XPOS=${X#?}
export YPOS=${Y#?}
echo $XPOS
echo $YPOS
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=$TIMEOUT &
export dlgPID=$!
#[ ${timeout} -eq 0 2> /dev/null ] && wait $dlgPID
yad --center --on-top --button="  Stop Preview  :0" --undecorated --skip-taskbar # 
kill $dlgPID
echo 'EXIT="Exit on timeout"'
} 
export -f preview

case $ret in
	0)
ifgif=`echo "${GIF##*.}"`
if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi

SCRIPT="$(basename "$GIF")"
#-----------------------
# create script step 1 (variables)
------------------------
echo '#!/bin/bash

gif='"$GIF"'
x='"$XPOS"'
y='"$YPOS"'
timeout='"$TIMEOUT"'
' > "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
#----------------------
# create script step 2
#----------------------
cat >> "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh <<'EOF'

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
margin=5

ifgif=`echo "${gif##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${y}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi
fi

echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=${timeout}

fi
EOF
#------------------
# make executable
#------------------
chmod +x "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
[ -f "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh ] && yad --center --title="Script created" --text="  Script:  \n  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh has been created  " --button="Run It:2" --button="gtk-close:0"
[ $? -eq 2 ]  &&  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
;;
	1)
exit 1
;;
	2)
ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi
preview

exec $0 "$GIF"
;;
esac
Last edited by secureIT on Mon Aug 12, 2019 4:52 am, edited 3 times in total.
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

Re: For those who said xfce is boring ....

Post by secureIT » Mon Aug 12, 2019 4:09 am

As i noticed that fredx181 sets margin of 5 pix around the .gif that will not be needed by YAD, and leads to ongoing changes to the specifications during testing, i modyfied the script again with the lines :

Code: Select all

# set here the margin if needed
#
margin=0
so here once more complete script :

Code: Select all

#!/bin/bash
#
#Create a script for to run animated gif on the desktop
#
# original script was "gifondesktop" from fredx181 on murga-linux.com/puppy/
# modyfied for Xfce by secureIT on forums.linuxmint.com to view .gif with yad instead of gifwiew gtk-dialog and gtkdesklet
# new version 1.0
if [ -z "$(which xwininfo)" ]; then
echo "Sorry, xwininfo not found, please install x11-utils"
yad --width=330 --center --title="xwininfo not found" --text="  Sorry, xwininfo not found, please install <b>x11-utils</b> \n  Press Close to Exit  " --button="gtk-close:0"
exit
fi
#
info () {
echo -e '           *** Setup Animated gif on Desktop ***  \n\n Create a script for to run animated gif on the desktop \n\n if you tested it and push ok-button script will be created in ~/home directory  \n\n name of script is name of <gif-file with dimensions selected> .sh \n\n it is marked as executable by script \n\n to run - syimply doubleclick on it
'  | yad --margins 7 --title="Info Setup Animated gif on Desktop" --height=420 --width=680 --text-info --wrap --button="gtk-close:0"
}
export -f info
#---------------------------------
# 
#Detect screen resolution
#
#---------------------------------
ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
[ -n $1 ] && GIF="$1"
[ -z $GIF ] && GIF="$HOME/*"
[ -z $XPOS ] && XPOS="$ROOTX"
[ -z $YPOS ] && YPOS="$ROOTY"
[ -z $TIMEOUT ] && TIMEOUT="5"
#--------------------------------
#
#YAD query window is created
#
#--------------------------------
SETTINGS=$(yad --width=530 --title="Setup Animated gif" --text="  <b>Create script to display animated gif on the Desktop</b>  \n  \n  Screen size: ${ROOTX}x${ROOTY} \n  Select .gif and set the desired geometry \n  Negative values are supported (transformed to positive though), e.g. \n  x -40 y -50 (bottom-right)  Or: x -1280 -y -40 (bottom-left) \n  Click 'Preview' first, then, if is as desired, click OK to create the script " --form --center \
--field="Select .gif image:          :FL" "$GIF" \
--field="Change x position:          :NUM" $XPOS!-$ROOTX..$ROOTX!2 \
--field="Change y position:          :NUM" $YPOS!-$ROOTY..$ROOTY!2 \
--field="Set Timeout in Seconds (0=infinite):           :NUM" $TIMEOUT!0..10000!1 \
--button="gtk-info:bash -c info" --button="Preview:2" --button="gtk-cancel:1" --button="gtk-ok:0")
#--------------------------------
#
ret=$?
echo $SETTINGS
export GIF="`echo $SETTINGS | cut -d "|" -f 1`"
export XPOS="`echo $SETTINGS | cut -d "|" -f 2 | cut -f1 -d"."`"
export YPOS="`echo $SETTINGS | cut -d "|" -f 3 | cut -f1 -d"."`"
export TIMEOUT="`echo $SETTINGS | cut -d "|" -f 4 | cut -f1 -d"."`"
[ "${XPOS:0:1}" != '-' ] && XPOS=+"${XPOS}"
[ "${YPOS:0:1}" != '-' ] && YPOS=+"${YPOS}"

echo $XPOS
echo $YPOS

preview () {
gif="$GIF"
x="$XPOS"
y="$YPOS"
timeout=10

exitfn () {
    trap SIGINT              # Resore signal handling for SIGINT
kill $dlgPID 2> /dev/null
exit
}
trap "exitfn" 1 2 15

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
#
# set here the margin if needed
#
margin=0

ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${x}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi
fi


echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
export XPOS=${X#?}
export YPOS=${Y#?}
echo $XPOS
echo $YPOS
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=$TIMEOUT &
export dlgPID=$!
#[ ${timeout} -eq 0 2> /dev/null ] && wait $dlgPID
yad --center --on-top --button="  Stop Preview  :0" --undecorated --skip-taskbar # 
kill $dlgPID
echo 'EXIT="Exit on timeout"'
} 
export -f preview

case $ret in
	0)
ifgif=`echo "${GIF##*.}"`
if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi

SCRIPT="$(basename "$GIF")"
#-----------------------
# create script step 1 (variables)
------------------------
echo '#!/bin/bash

gif='"$GIF"'
x='"$XPOS"'
y='"$YPOS"'
timeout='"$TIMEOUT"'
' > "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
#----------------------
# create script step 2
#----------------------
cat >> "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh <<'EOF'

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
margin=5

ifgif=`echo "${gif##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${y}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi
fi

echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=${timeout}

fi
EOF
#------------------
# make executable
#------------------
chmod +x "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
[ -f "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh ] && yad --center --title="Script created" --text="  Script:  \n  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh has been created  " --button="Run It:2" --button="gtk-close:0"
[ $? -eq 2 ]  &&  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
;;
	1)
exit 1
;;
	2)
ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi
preview

exec $0 "$GIF"
;;
esac
Please tell me, if you noticed anything else, that should be changed .........
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Hoser Rob
Level 14
Level 14
Posts: 5439
Joined: Sat Dec 15, 2012 8:57 am

Re: For those who said xfce is boring ....

Post by Hoser Rob » Mon Aug 12, 2019 9:16 am

Xfrce isn't boring, it's just vanilla. If someone actually cames up with a DE that actually does something substantially different I'd get more interested. Seriously, they all do the same thing really.

I don't bother with adding animaations et al but users should realize that if you take a light, fast DE like Xfce or LXDE and start adding all the eye candy, it's not going to be such a llight, fast DE any more. With that caveat, give 'er.

User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

Re: For those who said xfce is boring ....

Post by secureIT » Mon Aug 12, 2019 1:10 pm

Hi, Hoser Rob

wise words ....... but for them who wants it : a little bit of eyecany can not hurt :)

By the way : noticed another bug i made in script.
I didnt change that marging thing to zero in "create script step two" ..... that results in difference between test and created script.

Sorry for that :(

Changed it.

So here again script in version 1.1 :

Code: Select all

#!/bin/bash
#
#Create a script for to run animated gif on the desktop
#
# original script was "gifondesktop" from fredx181 on murga-linux.com/puppy/
# modyfied for Xfce by secureIT on forums.linuxmint.com to view .gif with yad instead of gifwiew gtk-dialog and gtkdesklet
# new version 1.1
if [ -z "$(which xwininfo)" ]; then
echo "Sorry, xwininfo not found, please install x11-utils"
yad --width=330 --center --title="xwininfo not found" --text="  Sorry, xwininfo not found, please install <b>x11-utils</b> \n  Press Close to Exit  " --button="gtk-close:0"
exit
fi
#
info () {
echo -e '           *** Setup Animated gif on Desktop ***  \n\n Create a script for to run animated gif on the desktop \n\n if you tested it and push ok-button script will be created in ~/home directory  \n\n name of script is name of <gif-file with dimensions selected> .sh \n\n it is marked as executable by script \n\n to run - syimply doubleclick on it
'  | yad --margins 7 --title="Info Setup Animated gif on Desktop" --height=420 --width=680 --text-info --wrap --button="gtk-close:0"
}
export -f info
#---------------------------------
# 
#Detect screen resolution
#
#---------------------------------
ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
[ -n $1 ] && GIF="$1"
[ -z $GIF ] && GIF="$HOME/*"
[ -z $XPOS ] && XPOS="$ROOTX"
[ -z $YPOS ] && YPOS="$ROOTY"
[ -z $TIMEOUT ] && TIMEOUT="5"
#--------------------------------
#
#YAD query window is created
#
#--------------------------------
SETTINGS=$(yad --width=530 --title="Setup Animated gif" --text="  <b>Create script to display animated gif on the Desktop</b>  \n  \n  Screen size: ${ROOTX}x${ROOTY} \n  Select .gif and set the desired geometry \n  Negative values are supported (transformed to positive though), e.g. \n  x -40 y -50 (bottom-right)  Or: x -1280 -y -40 (bottom-left) \n  Click 'Preview' first, then, if is as desired, click OK to create the script " --form --center \
--field="Select .gif image:          :FL" "$GIF" \
--field="Change x position:          :NUM" $XPOS!-$ROOTX..$ROOTX!2 \
--field="Change y position:          :NUM" $YPOS!-$ROOTY..$ROOTY!2 \
--field="Set Timeout in Seconds (0=infinite):           :NUM" $TIMEOUT!0..10000!1 \
--button="gtk-info:bash -c info" --button="Preview:2" --button="gtk-cancel:1" --button="gtk-ok:0")
#--------------------------------
#
ret=$?
echo $SETTINGS
export GIF="`echo $SETTINGS | cut -d "|" -f 1`"
export XPOS="`echo $SETTINGS | cut -d "|" -f 2 | cut -f1 -d"."`"
export YPOS="`echo $SETTINGS | cut -d "|" -f 3 | cut -f1 -d"."`"
export TIMEOUT="`echo $SETTINGS | cut -d "|" -f 4 | cut -f1 -d"."`"
[ "${XPOS:0:1}" != '-' ] && XPOS=+"${XPOS}"
[ "${YPOS:0:1}" != '-' ] && YPOS=+"${YPOS}"

echo $XPOS
echo $YPOS

preview () {
gif="$GIF"
x="$XPOS"
y="$YPOS"
timeout=10

exitfn () {
    trap SIGINT              # Resore signal handling for SIGINT
kill $dlgPID 2> /dev/null
exit
}
trap "exitfn" 1 2 15

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
#
# set here the margin if needed
#
margin=0

ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${x}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  X=+"${X#?}"
  else
  X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  Y=+"${Y#?}"
  else
  Y=+"$Y"
  fi
fi


echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
export XPOS=${X#?}
export YPOS=${Y#?}
echo $XPOS
echo $YPOS
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=$TIMEOUT &
export dlgPID=$!
#[ ${timeout} -eq 0 2> /dev/null ] && wait $dlgPID
yad --center --on-top --button="  Stop Preview  :0" --undecorated --skip-taskbar # 
kill $dlgPID
echo 'EXIT="Exit on timeout"'
} 
export -f preview

case $ret in
	0)
ifgif=`echo "${GIF##*.}"`
if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi

SCRIPT="$(basename "$GIF")"
#-----------------------
# create script step 1 (variables)
------------------------
echo '#!/bin/bash

gif='"$GIF"'
x='"$XPOS"'
y='"$YPOS"'
timeout='"$TIMEOUT"'
' > "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
#----------------------
# create script step 2
#----------------------
cat >> "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh <<'EOF'

ROOTGEOM="`xwininfo -root | grep -o ' \\-geometry .*' | cut -f 3 -d ' '`" #ex: 1280x800+0+0
ROOTX=`echo -n "$ROOTGEOM" | cut -f 1 -d 'x'`
ROOTY=`echo -n "$ROOTGEOM" | cut -f 1 -d '+' | cut -f 2 -d 'x'`
#
# set here the margin if needed
#
margin=0

ifgif=`echo "${gif##*.}"`

if [ "$ifgif" != "gif" ]; then
echo "No .gif file provided, exiting..."
exit
fi

WIDTH=$(file "$gif" | awk -F " x " '{print $1}' | awk '{print $NF}')
HEIGHT=$(file "$gif" | awk -F " x " '{print $2}' | awk '{print $1}')
MAXWIDTH=$((${ROOTX}-${WIDTH}))
MAXHEIGHT=$((${ROOTY}-${HEIGHT}))
MAXX=${x#?}
MAXY=${y#?}

if [ "${x:0:1}" = '-' ]; then
X="$((${ROOTX}${x}-$margin))"
    if [ "${x#?}" -lt "${WIDTH}" ]; then
    X="$((${ROOTX}${y}-${WIDTH}-$margin))"
    fi
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi

else
[ ${MAXX} -gt ${MAXWIDTH} ] && x=+"$MAXWIDTH"
X="$((${x}-$margin))"
  if [ "${X:0:1}" = '-' ]; then
  export X=+"${X#?}"
  else
  export X=+"$X"
  fi
fi

if [ "${y:0:1}" = '-' ]; then
Y="$((${ROOTY}${y}-$margin))"
if [ "${y#?}" -lt "${HEIGHT}" ]; then
Y="$((${ROOTY}${y}-${HEIGHT}-$margin))"
fi
echo Y0=$Y
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi

else
[ ${MAXY} -gt ${MAXHEIGHT} ] && y=+"$MAXHEIGHT"
Y="$((${y}-$margin))"
  if [ "${Y:0:1}" = '-' ]; then
  export Y=+"${Y#?}"
  else
  export Y=+"$Y"
  fi
fi

echo screen-x=$ROOTX
echo screen-y=$ROOTY
echo X=$X
echo Y=$Y
#
GTK_THEME=mini yad --picture --width=${WIDTH} --height=${HEIGHT} --geometry=${WIDTH}x${HEIGHT}+${X}+${Y} --undecorated --no-buttons --borders=0 --size=fit --filename=$gif --timeout=${timeout}

fi
EOF
#------------------
# make executable
#------------------
chmod +x "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
[ -f "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh ] && yad --center --title="Script created" --text="  Script:  \n  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh has been created  " --button="Run It:2" --button="gtk-close:0"
[ $? -eq 2 ]  &&  "$HOME/$SCRIPT"_${XPOS}${YPOS}.sh
;;
	1)
exit 1
;;
	2)
ifgif=`echo "${GIF##*.}"`

if [ "$ifgif" != "gif" ]; then
yad --width=300 --center --title="No .gif provided" --text="  Please select a .gif file  " --button="gtk-close:0"
unset XPOS YPOS TIMEOUT
exec $0
fi
preview

exec $0 "$GIF"
;;
esac
edit:
you can also use the script for creating your own animations depending on wallpaper of desktop.
In this case you dont need to set a background.
Simply make a screenshot of the area you want to create .gif animation.
save the .png-file
After that open up gimp, and open .png-file.
Then export it as .jpg
Now create new layers "out of the visible" and change hereby all the things you want to be changed.
After that export it as .gif.
Then with help of the script position it about the area and give ok

Here a short example, created in 5 minutes :
look for that headlights of the mint-oldtimer-car and the "Hackberry" sign on top-right ....

see vid :

https://streamable.com/pq475
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

User avatar
secureIT
Level 3
Level 3
Posts: 150
Joined: Wed Dec 05, 2018 1:26 pm

Re: For those who said xfce is boring ....

Post by secureIT » Tue Aug 13, 2019 3:41 pm

Will close this thread now and mark as solved........

then will test the script and other things a while.
After that i will make a tutorial of it.

One last example what could be done with it :D :

Xfce-whiskermenu-yad-animation-right-side

see vid :

https://streamable.com/l0hd0

bye.
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Post Reply

Return to “Xfce”