mirror of
https://github.com/adi1090x/rofi.git
synced 2024-11-24 07:08:21 -05:00
Allow applet script to search path relative to the script for cli input themes
This commit is contained in:
parent
323f94069c
commit
bd18d5972b
@ -6,19 +6,24 @@
|
|||||||
## Applets : Run Applications as Root
|
## Applets : Run Applications as Root
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Favorite Applications
|
## Applets : Favorite Applications
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Battery
|
## Applets : Battery
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Brightness
|
## Applets : Brightness
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : MPD (music)
|
## Applets : MPD (music)
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Power Menu
|
## Applets : Power Menu
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Quick Links
|
## Applets : Quick Links
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Screenshot
|
## Applets : Screenshot
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6,19 +6,24 @@
|
|||||||
## Applets : Volume
|
## Applets : Volume
|
||||||
|
|
||||||
# Import Current Theme
|
# Import Current Theme
|
||||||
INPUT_THEME=$1
|
INPUT_THEME="$1"
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||||
if [ -z $INPUT_THEME ]; then
|
if [ -z "$INPUT_THEME" ]; then
|
||||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||||
theme="$type/$style"
|
theme="$type/$style"
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||||
echo "Usage: $0 [theme]"
|
echo "Usage: $0 [theme]"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
theme=$INPUT_THEME
|
theme="$INPUT_THEME"
|
||||||
if [ ! -d $theme ]; then
|
if [ ! -d $theme ];
|
||||||
echo "Theme not found!"
|
# prepend current script path if theme is not found
|
||||||
exit 1
|
theme="$SCRIPT_DIR/$theme"
|
||||||
|
|
||||||
|
if [ ! -d "$theme" ]; then
|
||||||
|
# fail if we still can't find it.
|
||||||
|
echo "Theme not found!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user