mirror of
https://github.com/adi1090x/rofi.git
synced 2024-12-26 14:28:22 -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
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Favorite Applications
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Battery
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Brightness
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : MPD (music)
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Power Menu
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Quick Links
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Screenshot
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -6,19 +6,24 @@
|
||||
## Applets : Volume
|
||||
|
||||
# Import Current Theme
|
||||
INPUT_THEME=$1
|
||||
|
||||
if [ -z $INPUT_THEME ]; then
|
||||
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
|
||||
INPUT_THEME="$1"
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
if [ -z "$INPUT_THEME" ]; then
|
||||
source "$SCRIPT_DIR/../shared/theme.bash"
|
||||
theme="$type/$style"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "Usage: $0 [theme]"
|
||||
exit 0
|
||||
else
|
||||
theme=$INPUT_THEME
|
||||
if [ ! -d $theme ]; then
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
theme="$INPUT_THEME"
|
||||
if [ ! -d $theme ];
|
||||
# prepend current script path if theme is not found
|
||||
theme="$SCRIPT_DIR/$theme"
|
||||
|
||||
if [ ! -d "$theme" ]; then
|
||||
# fail if we still can't find it.
|
||||
echo "Theme not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user