diff --git a/config b/config new file mode 100644 index 0000000..5a6a675 --- /dev/null +++ b/config @@ -0,0 +1,6 @@ +#threshold 30 +incremental +#noNice +nice 5 +delay 1000 +#dir maid diff --git a/jessie/descr b/jessie/descr new file mode 100644 index 0000000..34a615a --- /dev/null +++ b/jessie/descr @@ -0,0 +1,8 @@ +7 +jessie_0.png +jessie_1.png +jessie_2.png +jessie_3.png +jessie_4.png +jessie_5.png +jessie_6.png diff --git a/jessie/jessie_0.png b/jessie/jessie_0.png new file mode 100644 index 0000000..fc7cbf8 Binary files /dev/null and b/jessie/jessie_0.png differ diff --git a/jessie/jessie_1.png b/jessie/jessie_1.png new file mode 100644 index 0000000..eb8d192 Binary files /dev/null and b/jessie/jessie_1.png differ diff --git a/jessie/jessie_2.png b/jessie/jessie_2.png new file mode 100644 index 0000000..72681e8 Binary files /dev/null and b/jessie/jessie_2.png differ diff --git a/jessie/jessie_3.png b/jessie/jessie_3.png new file mode 100644 index 0000000..28654f0 Binary files /dev/null and b/jessie/jessie_3.png differ diff --git a/jessie/jessie_4.png b/jessie/jessie_4.png new file mode 100644 index 0000000..7480880 Binary files /dev/null and b/jessie/jessie_4.png differ diff --git a/jessie/jessie_5.png b/jessie/jessie_5.png new file mode 100644 index 0000000..e7e0422 Binary files /dev/null and b/jessie/jessie_5.png differ diff --git a/jessie/jessie_6.png b/jessie/jessie_6.png new file mode 100644 index 0000000..608115b Binary files /dev/null and b/jessie/jessie_6.png differ diff --git a/maid/descr b/maid/descr new file mode 100644 index 0000000..2d8c9af --- /dev/null +++ b/maid/descr @@ -0,0 +1,14 @@ +13 +maid_00.png +maid_01.png +maid_02.png +maid_03.png +maid_04.png +maid_05.png +maid_06.png +maid_07.png +maid_08.png +maid_09.png +maid_10.png +maid_11.png +maid_12.png diff --git a/maid/maid_00.png b/maid/maid_00.png new file mode 100644 index 0000000..121c670 Binary files /dev/null and b/maid/maid_00.png differ diff --git a/maid/maid_01.png b/maid/maid_01.png new file mode 100644 index 0000000..9777b9f Binary files /dev/null and b/maid/maid_01.png differ diff --git a/maid/maid_02.png b/maid/maid_02.png new file mode 100644 index 0000000..24981ab Binary files /dev/null and b/maid/maid_02.png differ diff --git a/maid/maid_03.png b/maid/maid_03.png new file mode 100644 index 0000000..8968a96 Binary files /dev/null and b/maid/maid_03.png differ diff --git a/maid/maid_04.png b/maid/maid_04.png new file mode 100644 index 0000000..8444bee Binary files /dev/null and b/maid/maid_04.png differ diff --git a/maid/maid_05.png b/maid/maid_05.png new file mode 100644 index 0000000..38b9f39 Binary files /dev/null and b/maid/maid_05.png differ diff --git a/maid/maid_06.png b/maid/maid_06.png new file mode 100644 index 0000000..61855a9 Binary files /dev/null and b/maid/maid_06.png differ diff --git a/maid/maid_07.png b/maid/maid_07.png new file mode 100644 index 0000000..b5c7782 Binary files /dev/null and b/maid/maid_07.png differ diff --git a/maid/maid_08.png b/maid/maid_08.png new file mode 100644 index 0000000..3508a48 Binary files /dev/null and b/maid/maid_08.png differ diff --git a/maid/maid_09.png b/maid/maid_09.png new file mode 100644 index 0000000..642ab67 Binary files /dev/null and b/maid/maid_09.png differ diff --git a/maid/maid_10.png b/maid/maid_10.png new file mode 100644 index 0000000..689ab5b Binary files /dev/null and b/maid/maid_10.png differ diff --git a/maid/maid_11.png b/maid/maid_11.png new file mode 100644 index 0000000..205653e Binary files /dev/null and b/maid/maid_11.png differ diff --git a/maid/maid_12.png b/maid/maid_12.png new file mode 100644 index 0000000..c7589be Binary files /dev/null and b/maid/maid_12.png differ diff --git a/move.sh b/move.sh new file mode 100644 index 0000000..5656ff7 --- /dev/null +++ b/move.sh @@ -0,0 +1,138 @@ +#!/bin/sh +#### Configuration/Defaults #### + +# Theme directory name +theme=${1:-default} # Will default hot-babe theme, if it can be found + +# Margins set in integer percentage points +XmarginPct=${2:-2} # Default 2% of screen width +YmarginPct=${3:-0} # Default no vertical margin + +# Alignment; left/right and top/bottom +Xalign=${4:-right} # Default right-edge +Yalign=${5:-bottom} # Default bottom-edge + + +#### Do not modify beyond this line #### +usage() { + echo '${0} - Position hot-babe on screen.' + echo 'Usage:' + echo " ${0} [ ]" + echo ' where' + echo ' is the name of a theme directory in ~/.hot-babe or "default",' + echo ' is given in percentage of screensize (integer only), and' + echo ' is given as left/right and top/bottom, respectively.' + echo + echo 'Note that this script will only make a limited effort at locating the' + echo 'files for the default theme; locate it and copy to your ~/.hot-babe if' + echo 'this fails.' + echo + exit 1 +} + +if [ "${2}" ] ; then + if [ -z "${5}" ] ; then + echo "If any positional options are given, all must be given." + echo + usage + fi +fi + +# Determine where the themes are (typically where this script is run from, or +# the default theme directory), and the first file in the animation +if [ "${theme}" = 'default' ] ; then + case $(uname) in + FreeBSD) + first="$(pkg info -l hot-babe|grep '\.png$'|head -1)" + ;; + NetBSD|OpenBSD) + first="$(pkg_info -L hot-babe|grep '\.png$'|head -1)" + ;; + *) + echo "Platform $(uname) not supported." + usage + esac + dir="$(dirname "$first")" +else + dir="$(dirname $(realpath $0))/${theme}" + first="${dir}/$(head -2 "${dir}/descr" | tail -1)" +fi + +if ! [ -f "${dir}/descr" ] ; then + echo "Could not locate theme config in ${dir}! Bailing.." + exit 1 +fi + +# Extract screen dimensions from xprop +IFS=' ' set -- $(xprop -root _NET_DESKTOP_GEOMETRY|tr -d ,|cut -f 3,4 -d ' ') +scrwidth=$1 +scrheigth=$2 +unset IFS + +if ! [ "$scrwidth" -gt 0 ] || ! [ "$scrheigth" -gt 0 ] ; then + echo "Could not determine screen dimensions. Does 'xprop' work at all?" + exit 1 +fi + +# Calculate margins +marginX=$((scrwidth*XmarginPct/100)) +marginY=$((scrheigth*YmarginPct/100)) + +if ! [ "$marginX" -ge 0 ] || ! [ "$marginY" -ge 0 ] ; then + echo "Could not calculate margins." + usage +fi + +# Get dimensions of first image in the animation +IFS=' ' set -- $(file "${first}"|grep -Eo '[0-9]{1,4} x [0-9]{1,4}'|cut -f 1,3 -d ' ') +imgwidth=$1 +imgheigth=$2 +unset IFS + +if ! [ "$imgwidth" -gt 0 ] || ! [ "$imgheigth" -gt 0 ] ; then + echo "Could not determine image dimensions. Check that the 'file' command gives sane output." + echo "Its output must contain image dimensions matching the regex '[0-9]{1,4} x [0-9]{1,4}'." + exit 1 +fi + +case $Xalign in + right) + posX=$(((scrwidth-marginX)-imgwidth)) + ;; + left) + posX=$marginX + ;; + *) + echo "Xalign not correctly specified ('right' or 'left')" + usage +esac + +case $Yalign in + top) + posY=$marginY + ;; + bottom) + posY=$(((scrheigth-marginY)-imgheigth)) + ;; + *) + echo "Yalign not correctly specified ('top' or 'bottom')" + usage +esac + +wait=0 +while [ $wait -lt 10 ] ; do + if [ $(xdotool search --name hot-babe | wc -l) -gt 0 ] ; then + echo "The Hot Babe is here, relocating.." + sleep 0.5 + xdotool search --name hot-babe windowmove %2 $posX $posY windowstate --add BELOW %2 + exit 0 + else + wait=$((wait+2)) + if [ $wait -ge 10 ] ; then + break + fi + sleep 2 + fi +done + +echo 'Waited too long for the Hot Babe. Bailing out!'