aboutsummaryrefslogtreecommitdiff
path: root/wall.sh
diff options
context:
space:
mode:
authorNeodarZ <neodarz@neodarz.net>2017-03-17 02:42:53 +0100
committerNeodarZ <neodarz@neodarz.net>2017-03-17 02:42:53 +0100
commitf1159ef93b8d29a245a83e487653f17127cb1175 (patch)
tree2a5c4e038a08d8ccce7d4d5695fd28cbfdb58bb0 /wall.sh
downloadwallpaper-master.tar.xz
wallpaper-master.zip
Add some wallpaperHEADmaster
Diffstat (limited to 'wall.sh')
-rwxr-xr-xwall.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/wall.sh b/wall.sh
new file mode 100755
index 0000000..412fb3a
--- /dev/null
+++ b/wall.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Uses xwinwrap to display given animated .gif in the center of the screen
+
+if [ $# -ne 1 ]; then
+ echo 1>&2 Usage: $0 image.gif
+ exit 1
+ fi
+
+#get screen resolution
+SCRH=`xrandr | awk '/current/ { print $8 }'`
+SCRW=`xrandr | awk '/current/ { print $10 }'`
+SCRW=${SCRW%\,}
+
+#get gif resolution
+IMGHW=`gifsicle --info $1 | awk '/logical/ { print $3 }'`
+IMGH=${IMGHW%x*}
+IMGW=${IMGHW#*x}
+
+#calculate position
+POSH=$((($SCRH/2)-($IMGH/2)))
+POSW=$((($SCRW/2)-($IMGW/2)))
+
+xwinwrap -g ${IMGHW}+${POSH}+${POSW} -ov -ni -s -nf -- gifview -w WID $1 -a
+
+exit 0