Enable theme specification via cli

This commit is contained in:
Jacoby6000 2024-07-16 19:36:40 -05:00
parent 9060e5c6e1
commit 323f94069c
22 changed files with 324 additions and 35 deletions

View File

@ -6,8 +6,21 @@
## Applets : Run Applications as Root
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
prompt='Applications'

View File

@ -6,8 +6,22 @@
## Applets : Favorite Applications
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
prompt='Applications'

View File

@ -6,8 +6,22 @@
## Applets : Battery
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Battery Info
battery="`acpi -b | cut -d',' -f1 | cut -d':' -f1`"

View File

@ -6,8 +6,21 @@
## Applets : Brightness
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Brightness Info
backlight="$(printf "%.0f\n" `light -G`)"

View File

@ -6,8 +6,22 @@
## Applets : MPD (music)
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
status="`mpc status`"

View File

@ -6,8 +6,22 @@
## Applets : Power Menu
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
prompt="`hostname`"

View File

@ -6,8 +6,21 @@
## Applets : Quick Links
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
prompt='Quick Links'

View File

@ -6,8 +6,22 @@
## Applets : Screenshot
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Theme Elements
prompt='Screenshot'

View File

@ -6,8 +6,22 @@
## Applets : Volume
# Import Current Theme
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../shared/theme.bash
theme="$type/$style"
INPUT_THEME=$1
if [ -z $INPUT_THEME ]; then
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/../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
fi
fi
# Volume Info
mixer="`amixer info Master | grep 'Mixer name' | cut -d':' -f2 | tr -d \',' '`"

View File

@ -11,8 +11,22 @@
## style-6 style-7 style-8 style-9 style-10
## style-11 style-12 style-13 style-14 style-15
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..15]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -11,8 +11,21 @@
## style-6 style-7 style-8 style-9 style-10
## style-11 style-12 style-13 style-14 style-15
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..15]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-10'
if [ -z $INPUT_THEME ]; then
theme='style-10'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -9,9 +9,21 @@
#
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -8,9 +8,21 @@
## Available Styles
#
## style-1 style-2 style-3 style-4 style-5
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..5]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -9,9 +9,21 @@
#
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -9,9 +9,21 @@
#
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
## Run
rofi \

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..5]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
uptime="`uptime -p | sed -e 's/up //g'`"

View File

@ -11,8 +11,21 @@
## style-6 style-7 style-8 style-9 style-10
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
uptime="`uptime -p | sed -e 's/up //g'`"

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..10]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
uptime="`uptime -p | sed -e 's/up //g'`"

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-5'
if [ -z $INPUT_THEME ]; then
theme='style-5'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..5]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
uptime="`uptime -p | sed -e 's/up //g'`"

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..5]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
lastlogin="`last $USER | head -n1 | tr -s ' ' | cut -d' ' -f5,6,7`"

View File

@ -10,8 +10,21 @@
## style-1 style-2 style-3 style-4 style-5
# Current Theme
INPUT_THEME=$1
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
theme='style-1'
if [ -z $INPUT_THEME ]; then
theme='style-1'
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $0 [style-1..5]"
exit 0
else
theme=$INPUT_THEME
if [ ! -d ${dir}/$theme.rasi ]; then
echo "Theme not found!"
exit 1
fi
fi
# CMDs
lastlogin="`last $USER | head -n1 | tr -s ' ' | cut -d' ' -f5,6,7`"