#!/bin/bash themedir=/usr/share/entrance/themes if [ -z "$1" ] then # if no arguments are given call the original entrance_edit file # without arguments entrance_edit else if [ "$(echo ${1} | fgrep -e '-h')" == "$1" ]; then entrance_edit --help exit else if [ "$(echo ${1} | fgrep -e '--attempts')" == "$1" ]; then entrance_edit --attempts $2 exit else if [ "$(echo ${1} | fgrep -e '--xserver')" == "$1" ]; then entrance_edit --xserver $2 exit else if [ "$(echo ${1} | fgrep -e '--theme=/')" == "$1" ]; then fp="$(echo ${1} | sed -e 's/--theme=//')" echo "==>> installing theme to /usr/share/entrance/themes..." install -m644 $fp /usr/share/entrance/themes/ drname=$(dirname $fp)/ theme_name="$(echo ${fp} | sed -e "s|$drname||")" echo "==>> setting theme..." entrance_edit --theme=$theme_name else if [ "$(echo ${1} | fgrep -e '--theme=')" == "$1" ]; then theme_name="$(echo ${1} | sed -e 's/--theme=//')" if test -e "$themedir/$theme_name" ; then echo "==>> Good the theme exists in the entrance theme dir" echo "==>> Setting entrance theme" entrance_edit --theme=$theme_name exit else echo "==>> the theme you are trying to set does not exist inside the entrance theme dir." echo "==>> to install a new theme use" echo "==>> entrance_edit --theme=/full/path/to/theme.edj" echo "==>> exiting" fi exit 1 fi fi fi fi fi fi