diff --git a/files/applets/bin/appasroot.sh b/files/applets/bin/appasroot.sh index f0e6944..7d0cad7 100755 --- a/files/applets/bin/appasroot.sh +++ b/files/applets/bin/appasroot.sh @@ -6,8 +6,10 @@ ## Applets : Run Applications as Root # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Theme Elements prompt='Applications' diff --git a/files/applets/bin/apps.sh b/files/applets/bin/apps.sh index 01d1e4d..45fe37d 100755 --- a/files/applets/bin/apps.sh +++ b/files/applets/bin/apps.sh @@ -6,8 +6,11 @@ ## Applets : Favorite Applications # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" + # Theme Elements prompt='Applications' @@ -22,12 +25,12 @@ elif [[ ( "$theme" == *'type-2'* ) || ( "$theme" == *'type-4'* ) ]]; then fi # CMDs (add your apps here) -term_cmd='alacritty' -file_cmd='thunar' -text_cmd='geany' -web_cmd='firefox' -music_cmd='alacritty -e ncmpcpp' -setting_cmd='xfce4-settings-manager' +term_cmd="${TERMINAL_CMD:-alacritty}" +file_cmd="${FILE_BROWSER_CMD:-thunar}" +text_cmd="${TEXT_EDITOR_CMD:-geany}" +web_cmd="${WEB_BROWSER_CMD:-firefox}" +music_cmd="${MUSIC_CMD:-alacritty -e ncmpcpp}" +setting_cmd="${SETTINGS_CMD:-xfce4-settings-manager}" # Options layout=`cat ${theme} | grep 'USE_ICON' | cut -d'=' -f2` diff --git a/files/applets/bin/battery.sh b/files/applets/bin/battery.sh index ef0dba6..139eec3 100755 --- a/files/applets/bin/battery.sh +++ b/files/applets/bin/battery.sh @@ -6,8 +6,10 @@ ## Applets : Battery # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Battery Info battery="`acpi -b | cut -d',' -f1 | cut -d':' -f1`" diff --git a/files/applets/bin/brightness.sh b/files/applets/bin/brightness.sh index 2c90a12..7a0f820 100755 --- a/files/applets/bin/brightness.sh +++ b/files/applets/bin/brightness.sh @@ -6,8 +6,10 @@ ## Applets : Brightness # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Brightness Info backlight="$(printf "%.0f\n" `light -G`)" diff --git a/files/applets/bin/mpd.sh b/files/applets/bin/mpd.sh index ce6a9e9..4c6db44 100755 --- a/files/applets/bin/mpd.sh +++ b/files/applets/bin/mpd.sh @@ -6,8 +6,11 @@ ## Applets : MPD (music) # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" + # Theme Elements status="`mpc status`" diff --git a/files/applets/bin/powermenu.sh b/files/applets/bin/powermenu.sh index 8ed9106..6646908 100755 --- a/files/applets/bin/powermenu.sh +++ b/files/applets/bin/powermenu.sh @@ -6,12 +6,17 @@ ## Applets : Power Menu # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Theme Elements prompt="`hostname`" -mesg="Uptime : `uptime -p | sed -e 's/up //g'`" + +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) + +mesg="Uptime : $uptime" if [[ ( "$theme" == *'type-1'* ) || ( "$theme" == *'type-3'* ) || ( "$theme" == *'type-5'* ) ]]; then list_col='1' diff --git a/files/applets/bin/quicklinks.sh b/files/applets/bin/quicklinks.sh index 11a38a8..9780b0e 100755 --- a/files/applets/bin/quicklinks.sh +++ b/files/applets/bin/quicklinks.sh @@ -6,8 +6,10 @@ ## Applets : Quick Links # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Theme Elements prompt='Quick Links' diff --git a/files/applets/bin/screenshot.sh b/files/applets/bin/screenshot.sh index 5e5286b..fd9325c 100755 --- a/files/applets/bin/screenshot.sh +++ b/files/applets/bin/screenshot.sh @@ -6,8 +6,10 @@ ## Applets : Screenshot # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" # Theme Elements prompt='Screenshot' diff --git a/files/applets/bin/volume.sh b/files/applets/bin/volume.sh index a194592..830871d 100755 --- a/files/applets/bin/volume.sh +++ b/files/applets/bin/volume.sh @@ -6,8 +6,11 @@ ## Applets : Volume # Import Current Theme -source "$HOME"/.config/rofi/applets/shared/theme.bash -theme="$type/$style" +SCRIPT_INVOCATION="$0" +INPUT_THEME="$1" +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +source "$SCRIPT_DIR/../shared/theme.bash" + # Volume Info mixer="`amixer info Master | grep 'Mixer name' | cut -d':' -f2 | tr -d \',' '`" diff --git a/files/applets/shared/colors.rasi b/files/applets/shared/colors.rasi index 103ad63..b208bcd 100644 --- a/files/applets/shared/colors.rasi +++ b/files/applets/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../colors/onedark.rasi" diff --git a/files/applets/shared/theme.bash b/files/applets/shared/theme.bash index 4807020..eeaa274 100755 --- a/files/applets/shared/theme.bash +++ b/files/applets/shared/theme.bash @@ -1,4 +1,19 @@ ## Current Theme +DEFAULT_TYPE='type-1' +DEFAULT_STYLE='style-1' -type="$HOME/.config/rofi/applets/type-1" -style='style-1.rasi' +# INPUT_THEME should be set by the script that sources this file, +# if the user wants to override the default theme. +if [ -z "$INPUT_THEME" ]; then + theme="$SCRIPT_DIR/../$DEFAULT_TYPE/$DEFAULT_STYLE.rasi" +elif [[ $1 == "-h" || $1 == "--help" ]]; then + echo "Usage: $SCRIPT_INVOCATION [theme]" + exit 0 +else + theme="$SCRIPT_DIR/../$theme.rasi" + if [ ! -f "$theme" ]; then + # fail if we still can't find it. + echo "Theme not found!" + exit 1 + fi +fi diff --git a/files/applets/type-4/style-1.rasi b/files/applets/type-4/style-1.rasi index 1823c56..0c4a002 100644 --- a/files/applets/type-4/style-1.rasi +++ b/files/applets/type-4/style-1.rasi @@ -64,7 +64,7 @@ inputbar { border-radius: 0px; border-color: @selected; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", width); + background-image: url("./images/a.png", width); text-color: @foreground; children: [ "textbox-prompt-colon", "prompt"]; } diff --git a/files/applets/type-4/style-2.rasi b/files/applets/type-4/style-2.rasi index 40a98ac..b90ab22 100644 --- a/files/applets/type-4/style-2.rasi +++ b/files/applets/type-4/style-2.rasi @@ -64,7 +64,7 @@ inputbar { border-radius: 20px; border-color: @selected; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", width); + background-image: url("./images/d.png", width); text-color: @foreground; children: [ "dummy", "textbox-prompt-colon", "prompt", "dummy"]; } diff --git a/files/applets/type-4/style-3.rasi b/files/applets/type-4/style-3.rasi index 0199650..2280c67 100644 --- a/files/applets/type-4/style-3.rasi +++ b/files/applets/type-4/style-3.rasi @@ -64,7 +64,7 @@ inputbar { border-radius: 40px; border-color: @selected; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", width); + background-image: url("./images/i.jpg", width); text-color: @foreground; children: [ "textbox-prompt-colon", "dummy", "prompt"]; } diff --git a/files/applets/type-5/style-1.rasi b/files/applets/type-5/style-1.rasi index 0fdc43d..15fbf9e 100644 --- a/files/applets/type-5/style-1.rasi +++ b/files/applets/type-5/style-1.rasi @@ -59,7 +59,7 @@ mainbox { /*****----- Imagebox -----*****/ imagebox { background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", height); + background-image: url("./images/e.jpg", height); children: [ "dummy", "inputbar", "dummy" ]; } diff --git a/files/applets/type-5/style-2.rasi b/files/applets/type-5/style-2.rasi index 5b9c5b1..aee5de0 100644 --- a/files/applets/type-5/style-2.rasi +++ b/files/applets/type-5/style-2.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { border-radius: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", height); + background-image: url("./images/j.jpg", height); children: [ "dummy", "inputbar", "dummy" ]; } diff --git a/files/applets/type-5/style-3.rasi b/files/applets/type-5/style-3.rasi index 416f51b..58bc082 100644 --- a/files/applets/type-5/style-3.rasi +++ b/files/applets/type-5/style-3.rasi @@ -62,7 +62,7 @@ imagebox { border-radius: 100%; border-color: @selected; background-color: transparent; - background-image: url("~/.config/rofi/images/g.png", height); + background-image: url("./images/g.png", height); children: [ "dummy", "inputbar", "dummy" ]; } diff --git a/files/launchers/type-1/launcher.sh b/files/launchers/type-1/launcher.sh index 85b7df4..f8b464a 100755 --- a/files/launchers/type-1/launcher.sh +++ b/files/launchers/type-1/launcher.sh @@ -11,10 +11,16 @@ ## style-6 style-7 style-8 style-9 style-10 ## style-11 style-12 style-13 style-14 style-15 -dir="$HOME/.config/rofi/launchers/type-1" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '15' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-1/shared/colors.rasi b/files/launchers/type-1/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/launchers/type-1/shared/colors.rasi +++ b/files/launchers/type-1/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/launchers/type-2/launcher.sh b/files/launchers/type-2/launcher.sh index 3422cd7..f8b464a 100755 --- a/files/launchers/type-2/launcher.sh +++ b/files/launchers/type-2/launcher.sh @@ -11,10 +11,16 @@ ## style-6 style-7 style-8 style-9 style-10 ## style-11 style-12 style-13 style-14 style-15 -dir="$HOME/.config/rofi/launchers/type-2" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '15' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-2/shared/colors.rasi b/files/launchers/type-2/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/launchers/type-2/shared/colors.rasi +++ b/files/launchers/type-2/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/launchers/type-3/launcher.sh b/files/launchers/type-3/launcher.sh index ae97b5f..2d383bd 100755 --- a/files/launchers/type-3/launcher.sh +++ b/files/launchers/type-3/launcher.sh @@ -10,10 +10,18 @@ ## style-1 style-2 style-3 style-4 style-5 ## style-6 style-7 style-8 style-9 style-10 -dir="$HOME/.config/rofi/launchers/type-3" -theme='style-10' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '10' '10' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi + + ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-3/shared/colors.rasi b/files/launchers/type-3/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/launchers/type-3/shared/colors.rasi +++ b/files/launchers/type-3/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/launchers/type-4/launcher.sh b/files/launchers/type-4/launcher.sh index 6572cda..ee0c7f9 100755 --- a/files/launchers/type-4/launcher.sh +++ b/files/launchers/type-4/launcher.sh @@ -10,10 +10,16 @@ ## style-1 style-2 style-3 style-4 style-5 ## style-6 style-7 style-8 style-9 style-10 -dir="$HOME/.config/rofi/launchers/type-4" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '10' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-4/shared/colors.rasi b/files/launchers/type-4/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/launchers/type-4/shared/colors.rasi +++ b/files/launchers/type-4/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/launchers/type-5/launcher.sh b/files/launchers/type-5/launcher.sh index e9d0a3a..e02b1d2 100755 --- a/files/launchers/type-5/launcher.sh +++ b/files/launchers/type-5/launcher.sh @@ -9,10 +9,16 @@ # ## style-1 style-2 style-3 style-4 style-5 -dir="$HOME/.config/rofi/launchers/type-5" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-5/style-1.rasi b/files/launchers/type-5/style-1.rasi index 21d8cba..abc859a 100644 --- a/files/launchers/type-5/style-1.rasi +++ b/files/launchers/type-5/style-1.rasi @@ -39,7 +39,7 @@ window { border-radius: 0px; border-color: black; cursor: "default"; - background-image: url("~/.config/rofi/images/paper.png", none); + background-image: url("./images/paper.png", none); } /*****----- Main Box -----*****/ diff --git a/files/launchers/type-5/style-2.rasi b/files/launchers/type-5/style-2.rasi index 185718f..31073bd 100644 --- a/files/launchers/type-5/style-2.rasi +++ b/files/launchers/type-5/style-2.rasi @@ -41,7 +41,7 @@ window { padding: 0px; border-radius: 12px; cursor: "default"; - background-image: url("~/.config/rofi/images/gradient.png", width); + background-image: url("./images/gradient.png", width); } /*****----- Main Box -----*****/ diff --git a/files/launchers/type-5/style-5.rasi b/files/launchers/type-5/style-5.rasi index 60e4e22..1c21f27 100644 --- a/files/launchers/type-5/style-5.rasi +++ b/files/launchers/type-5/style-5.rasi @@ -42,7 +42,7 @@ window { border-radius: 20px; cursor: "default"; background-color: #162022; - background-image: url("~/.config/rofi/images/flowers-1.png", width); + background-image: url("./images/flowers-1.png", width); } /*****----- Main Box -----*****/ @@ -63,7 +63,7 @@ inputbar { border: 2px; border-radius: 20px; border-color: white; - background-image: url("~/.config/rofi/images/flowers-3.png", none); + background-image: url("./images/flowers-3.png", none); children: [ "textbox-prompt-colon", "entry" ]; } @@ -108,7 +108,7 @@ listview { border: 2px; border-radius: 20px; border-color: white; - background-image: url("~/.config/rofi/images/flowers-2.png", width); + background-image: url("./images/flowers-2.png", width); cursor: "default"; } diff --git a/files/launchers/type-6/launcher.sh b/files/launchers/type-6/launcher.sh index c0b4d33..85e3579 100755 --- a/files/launchers/type-6/launcher.sh +++ b/files/launchers/type-6/launcher.sh @@ -9,11 +9,16 @@ # ## style-1 style-2 style-3 style-4 style-5 ## style-6 style-7 style-8 style-9 style-10 +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '10' "$INPUT_THEME") -dir="$HOME/.config/rofi/launchers/type-6" -theme='style-1' +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-6/style-1.rasi b/files/launchers/type-6/style-1.rasi index 198a4e0..af3b0c7 100644 --- a/files/launchers/type-6/style-1.rasi +++ b/files/launchers/type-6/style-1.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", height); + background-image: url("./images/a.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-10.rasi b/files/launchers/type-6/style-10.rasi index 07c375d..adfd9f3 100644 --- a/files/launchers/type-6/style-10.rasi +++ b/files/launchers/type-6/style-10.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", height); + background-image: url("./images/j.jpg", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-2.rasi b/files/launchers/type-6/style-2.rasi index 66a1de6..e13563b 100644 --- a/files/launchers/type-6/style-2.rasi +++ b/files/launchers/type-6/style-2.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/b.png", height); + background-image: url("./images/b.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-3.rasi b/files/launchers/type-6/style-3.rasi index a623e2f..d43cd0b 100644 --- a/files/launchers/type-6/style-3.rasi +++ b/files/launchers/type-6/style-3.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/c.png", height); + background-image: url("./images/c.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-4.rasi b/files/launchers/type-6/style-4.rasi index ddf2be1..7260a58 100644 --- a/files/launchers/type-6/style-4.rasi +++ b/files/launchers/type-6/style-4.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", height); + background-image: url("./images/d.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-5.rasi b/files/launchers/type-6/style-5.rasi index afc90fb..03cc6af 100644 --- a/files/launchers/type-6/style-5.rasi +++ b/files/launchers/type-6/style-5.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", height); + background-image: url("./images/e.jpg", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-6.rasi b/files/launchers/type-6/style-6.rasi index 7056c85..12c6af3 100644 --- a/files/launchers/type-6/style-6.rasi +++ b/files/launchers/type-6/style-6.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/f.png", height); + background-image: url("./images/f.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-7.rasi b/files/launchers/type-6/style-7.rasi index 77eed40..37f738b 100644 --- a/files/launchers/type-6/style-7.rasi +++ b/files/launchers/type-6/style-7.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/g.png", height); + background-image: url("./images/g.png", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-8.rasi b/files/launchers/type-6/style-8.rasi index 235dad7..c3b66f8 100644 --- a/files/launchers/type-6/style-8.rasi +++ b/files/launchers/type-6/style-8.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/h.jpg", height); + background-image: url("./images/h.jpg", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-6/style-9.rasi b/files/launchers/type-6/style-9.rasi index e30583f..63c6723 100644 --- a/files/launchers/type-6/style-9.rasi +++ b/files/launchers/type-6/style-9.rasi @@ -60,7 +60,7 @@ mainbox { imagebox { padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", height); + background-image: url("./images/i.jpg", height); orientation: vertical; children: [ "inputbar", "dummy", "mode-switcher" ]; } diff --git a/files/launchers/type-7/launcher.sh b/files/launchers/type-7/launcher.sh index aa45aa9..85e3579 100755 --- a/files/launchers/type-7/launcher.sh +++ b/files/launchers/type-7/launcher.sh @@ -9,11 +9,16 @@ # ## style-1 style-2 style-3 style-4 style-5 ## style-6 style-7 style-8 style-9 style-10 +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '10' "$INPUT_THEME") -dir="$HOME/.config/rofi/launchers/type-7" -theme='style-1' +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi ## Run rofi \ -show drun \ - -theme ${dir}/${theme}.rasi + -theme $theme diff --git a/files/launchers/type-7/style-1.rasi b/files/launchers/type-7/style-1.rasi index 092f4f8..04ea889 100644 --- a/files/launchers/type-7/style-1.rasi +++ b/files/launchers/type-7/style-1.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 80px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", width); + background-image: url("./images/a.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-10.rasi b/files/launchers/type-7/style-10.rasi index 124df89..f09c18e 100644 --- a/files/launchers/type-7/style-10.rasi +++ b/files/launchers/type-7/style-10.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 0px; padding: 100px 40px; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", width); + background-image: url("./images/j.jpg", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry" ]; diff --git a/files/launchers/type-7/style-2.rasi b/files/launchers/type-7/style-2.rasi index 40a2375..b07afc9 100644 --- a/files/launchers/type-7/style-2.rasi +++ b/files/launchers/type-7/style-2.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 80px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/b.png", width); + background-image: url("./images/b.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-3.rasi b/files/launchers/type-7/style-3.rasi index 6ac4900..27e666f 100644 --- a/files/launchers/type-7/style-3.rasi +++ b/files/launchers/type-7/style-3.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 100px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/c.png", width); + background-image: url("./images/c.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-4.rasi b/files/launchers/type-7/style-4.rasi index 9657878..b9b67a7 100644 --- a/files/launchers/type-7/style-4.rasi +++ b/files/launchers/type-7/style-4.rasi @@ -72,7 +72,7 @@ inputbar { spacing: 10px; padding: 40px 40px 155px; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", width); + background-image: url("./images/d.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry" ]; diff --git a/files/launchers/type-7/style-5.rasi b/files/launchers/type-7/style-5.rasi index 0edb39d..c8fa22b 100644 --- a/files/launchers/type-7/style-5.rasi +++ b/files/launchers/type-7/style-5.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 80px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", width); + background-image: url("./images/e.jpg", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-6.rasi b/files/launchers/type-7/style-6.rasi index d500569..0f96037 100644 --- a/files/launchers/type-7/style-6.rasi +++ b/files/launchers/type-7/style-6.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 100px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/f.png", width); + background-image: url("./images/f.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-7.rasi b/files/launchers/type-7/style-7.rasi index 98d135b..11dfbe4 100644 --- a/files/launchers/type-7/style-7.rasi +++ b/files/launchers/type-7/style-7.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 100px 40px; background-color: transparent; - background-image: url("~/.config/rofi/images/g.png", width); + background-image: url("./images/g.png", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry" ]; diff --git a/files/launchers/type-7/style-8.rasi b/files/launchers/type-7/style-8.rasi index 0ed4797..c9a41a8 100644 --- a/files/launchers/type-7/style-8.rasi +++ b/files/launchers/type-7/style-8.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 100px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/h.jpg", width); + background-image: url("./images/h.jpg", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/launchers/type-7/style-9.rasi b/files/launchers/type-7/style-9.rasi index ff3bf0a..aa26f5f 100644 --- a/files/launchers/type-7/style-9.rasi +++ b/files/launchers/type-7/style-9.rasi @@ -71,7 +71,7 @@ inputbar { spacing: 10px; padding: 80px 60px; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", width); + background-image: url("./images/i.jpg", width); text-color: @foreground; orientation: horizontal; children: [ "textbox-prompt-colon", "entry", "dummy", "mode-switcher" ]; diff --git a/files/powermenu/type-1/powermenu.sh b/files/powermenu/type-1/powermenu.sh index dd978af..69992cb 100755 --- a/files/powermenu/type-1/powermenu.sh +++ b/files/powermenu/type-1/powermenu.sh @@ -9,12 +9,17 @@ # ## style-1 style-2 style-3 style-4 style-5 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-1" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi # CMDs -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -31,7 +36,7 @@ rofi_cmd() { rofi -dmenu \ -p "$host" \ -mesg "Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -44,7 +49,7 @@ confirm_cmd() { -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Ask for confirmation diff --git a/files/powermenu/type-1/shared/colors.rasi b/files/powermenu/type-1/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/powermenu/type-1/shared/colors.rasi +++ b/files/powermenu/type-1/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/powermenu/type-2/powermenu.sh b/files/powermenu/type-2/powermenu.sh index 23d0795..53e4f1c 100755 --- a/files/powermenu/type-2/powermenu.sh +++ b/files/powermenu/type-2/powermenu.sh @@ -10,12 +10,17 @@ ## style-1 style-2 style-3 style-4 style-5 ## style-6 style-7 style-8 style-9 style-10 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-2" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '10' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi # CMDs -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -32,7 +37,7 @@ rofi_cmd() { rofi -dmenu \ -p "Uptime: $uptime" \ -mesg "Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -45,7 +50,7 @@ confirm_cmd() { -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Ask for confirmation diff --git a/files/powermenu/type-2/shared/colors.rasi b/files/powermenu/type-2/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/powermenu/type-2/shared/colors.rasi +++ b/files/powermenu/type-2/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/powermenu/type-3/powermenu.sh b/files/powermenu/type-3/powermenu.sh index 8c1e47f..f58d484 100755 --- a/files/powermenu/type-3/powermenu.sh +++ b/files/powermenu/type-3/powermenu.sh @@ -9,12 +9,18 @@ # ## style-1 style-2 style-3 style-4 style-5 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-3" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi + # CMDs -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -31,7 +37,7 @@ rofi_cmd() { rofi -dmenu \ -p "Uptime: $uptime" \ -mesg "Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -39,7 +45,7 @@ confirm_cmd() { rofi -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/shared/confirm.rasi + -theme ${SCRIPT_DIR}/shared/confirm.rasi } # Ask for confirmation diff --git a/files/powermenu/type-3/shared/colors.rasi b/files/powermenu/type-3/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/powermenu/type-3/shared/colors.rasi +++ b/files/powermenu/type-3/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/powermenu/type-4/powermenu.sh b/files/powermenu/type-4/powermenu.sh index 17f20c7..16a6aa0 100755 --- a/files/powermenu/type-4/powermenu.sh +++ b/files/powermenu/type-4/powermenu.sh @@ -9,12 +9,19 @@ # ## style-1 style-2 style-3 style-4 style-5 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-4" -theme='style-5' + +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '5' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi + # CMDs -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -31,7 +38,7 @@ rofi_cmd() { rofi -dmenu \ -p "Goodbye ${USER}" \ -mesg "Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -39,7 +46,7 @@ confirm_cmd() { rofi -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/shared/confirm.rasi + -theme ${SCRIPT_DIR}/shared/confirm.rasi } # Ask for confirmation diff --git a/files/powermenu/type-4/shared/colors.rasi b/files/powermenu/type-4/shared/colors.rasi index 103ad63..66a0a2e 100644 --- a/files/powermenu/type-4/shared/colors.rasi +++ b/files/powermenu/type-4/shared/colors.rasi @@ -15,4 +15,4 @@ /* Import color-scheme from `colors` directory */ -@import "~/.config/rofi/colors/onedark.rasi" +@import "../../../colors/onedark.rasi" diff --git a/files/powermenu/type-4/style-5.rasi b/files/powermenu/type-4/style-5.rasi index 96b483c..a630933 100644 --- a/files/powermenu/type-4/style-5.rasi +++ b/files/powermenu/type-4/style-5.rasi @@ -83,7 +83,7 @@ userimage { border-radius: 100%; border-color: white; background-color: transparent; - background-image: url("~/.config/rofi/images/user.jpeg", both); + background-image: url("./images/user.jpeg", both); } /*****----- Inputbar -----*****/ diff --git a/files/powermenu/type-5/powermenu.sh b/files/powermenu/type-5/powermenu.sh index 561e30c..e6e3e34 100755 --- a/files/powermenu/type-5/powermenu.sh +++ b/files/powermenu/type-5/powermenu.sh @@ -9,13 +9,19 @@ # ## style-1 style-2 style-3 style-4 style-5 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-5" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi + # CMDs lastlogin="`last $USER | head -n1 | tr -s ' ' | cut -d' ' -f5,6,7`" -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -33,7 +39,7 @@ rofi_cmd() { rofi -dmenu \ -p " $USER@$host" \ -mesg " Last Login: $lastlogin |  Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -46,7 +52,7 @@ confirm_cmd() { -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Ask for confirmation diff --git a/files/powermenu/type-5/style-1.rasi b/files/powermenu/type-5/style-1.rasi index ed3633c..71bc03f 100644 --- a/files/powermenu/type-5/style-1.rasi +++ b/files/powermenu/type-5/style-1.rasi @@ -64,7 +64,7 @@ inputbar { spacing: 0px; padding: 100px 80px; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", width); + background-image: url("./images/a.png", width); children: [ "textbox-prompt-colon", "dummy","prompt"]; } diff --git a/files/powermenu/type-5/style-2.rasi b/files/powermenu/type-5/style-2.rasi index ae737ca..4320034 100644 --- a/files/powermenu/type-5/style-2.rasi +++ b/files/powermenu/type-5/style-2.rasi @@ -64,7 +64,7 @@ inputbar { spacing: 0px; padding: 100px 80px; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", width); + background-image: url("./images/d.png", width); children: [ "textbox-prompt-colon", "dummy","prompt"]; } diff --git a/files/powermenu/type-5/style-3.rasi b/files/powermenu/type-5/style-3.rasi index 6f80ee1..4b4efc6 100644 --- a/files/powermenu/type-5/style-3.rasi +++ b/files/powermenu/type-5/style-3.rasi @@ -64,7 +64,7 @@ inputbar { spacing: 0px; padding: 100px 40px; background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", width); + background-image: url("./images/e.jpg", width); children: [ "textbox-prompt-colon", "dummy","prompt"]; } diff --git a/files/powermenu/type-5/style-4.rasi b/files/powermenu/type-5/style-4.rasi index 247693a..9d5af97 100644 --- a/files/powermenu/type-5/style-4.rasi +++ b/files/powermenu/type-5/style-4.rasi @@ -64,7 +64,7 @@ inputbar { spacing: 0px; padding: 150px 40px; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", width); + background-image: url("./images/i.jpg", width); children: [ "textbox-prompt-colon", "dummy","prompt"]; } diff --git a/files/powermenu/type-5/style-5.rasi b/files/powermenu/type-5/style-5.rasi index 4492512..266f888 100644 --- a/files/powermenu/type-5/style-5.rasi +++ b/files/powermenu/type-5/style-5.rasi @@ -64,7 +64,7 @@ inputbar { spacing: 20px; padding: 100px 40px; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", width); + background-image: url("./images/j.jpg", width); children: [ "textbox-prompt-colon", "prompt"]; } diff --git a/files/powermenu/type-6/powermenu.sh b/files/powermenu/type-6/powermenu.sh index ad93faf..0a952b4 100755 --- a/files/powermenu/type-6/powermenu.sh +++ b/files/powermenu/type-6/powermenu.sh @@ -9,13 +9,18 @@ # ## style-1 style-2 style-3 style-4 style-5 -# Current Theme -dir="$HOME/.config/rofi/powermenu/type-6" -theme='style-1' +INPUT_THEME=$1 +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +theme=$($SCRIPT_DIR/../../shared/theme.sh "$SCRIPT_DIR" '1' '5' "$INPUT_THEME") + +if [ $? -ne 0 ]; then + echo $theme + exit 1 +fi # CMDs lastlogin="`last $USER | head -n1 | tr -s ' ' | cut -d' ' -f5,6,7`" -uptime="`uptime -p | sed -e 's/up //g'`" +uptime=$($SCRIPT_DIR/../../shared/uptime.sh) host=`hostname` # Options @@ -33,7 +38,7 @@ rofi_cmd() { rofi -dmenu \ -p " $USER@$host" \ -mesg " Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Confirmation CMD @@ -46,7 +51,7 @@ confirm_cmd() { -dmenu \ -p 'Confirmation' \ -mesg 'Are you Sure?' \ - -theme ${dir}/${theme}.rasi + -theme $theme } # Ask for confirmation diff --git a/files/powermenu/type-6/style-1.rasi b/files/powermenu/type-6/style-1.rasi index 2af8289..77cfef2 100644 --- a/files/powermenu/type-6/style-1.rasi +++ b/files/powermenu/type-6/style-1.rasi @@ -57,7 +57,7 @@ imagebox { spacing: 30px; padding: 30px; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", height); + background-image: url("./images/a.png", height); children: [ "inputbar", "dummy", "message" ]; } @@ -68,7 +68,7 @@ userimage { border-radius: 10px; border-color: @background-alt; background-color: transparent; - background-image: url("~/.config/rofi/images/a.png", height); + background-image: url("./images/a.png", height); } /*****----- Inputbar -----*****/ diff --git a/files/powermenu/type-6/style-2.rasi b/files/powermenu/type-6/style-2.rasi index f437590..04978ce 100644 --- a/files/powermenu/type-6/style-2.rasi +++ b/files/powermenu/type-6/style-2.rasi @@ -57,7 +57,7 @@ imagebox { spacing: 20px; padding: 20px; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", height); + background-image: url("./images/d.png", height); children: [ "inputbar", "dummy", "message" ]; } @@ -68,7 +68,7 @@ userimage { border-radius: 10px; border-color: @background-alt; background-color: transparent; - background-image: url("~/.config/rofi/images/d.png", height); + background-image: url("./images/d.png", height); } /*****----- Inputbar -----*****/ diff --git a/files/powermenu/type-6/style-3.rasi b/files/powermenu/type-6/style-3.rasi index c03a032..335bd28 100644 --- a/files/powermenu/type-6/style-3.rasi +++ b/files/powermenu/type-6/style-3.rasi @@ -57,7 +57,7 @@ imagebox { spacing: 0px; padding: 30px; background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", width); + background-image: url("./images/e.jpg", width); children: [ "inputbar", "dummy", "message" ]; } @@ -68,7 +68,7 @@ userimage { border-radius: 10px; border-color: @background-alt; background-color: transparent; - background-image: url("~/.config/rofi/images/e.jpg", height); + background-image: url("./images/e.jpg", height); } /*****----- Inputbar -----*****/ diff --git a/files/powermenu/type-6/style-4.rasi b/files/powermenu/type-6/style-4.rasi index 89978d1..c82b723 100644 --- a/files/powermenu/type-6/style-4.rasi +++ b/files/powermenu/type-6/style-4.rasi @@ -59,7 +59,7 @@ imagebox { spacing: 0px; padding: 100px; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", height); + background-image: url("./images/i.jpg", height); children: [ "inputbar", "dummy", "message" ]; } @@ -70,7 +70,7 @@ userimage { border-radius: 0px; border-color: @background-alt; background-color: transparent; - background-image: url("~/.config/rofi/images/i.jpg", height); + background-image: url("./images/i.jpg", height); } /*****----- Inputbar -----*****/ diff --git a/files/powermenu/type-6/style-5.rasi b/files/powermenu/type-6/style-5.rasi index ad5525a..2bc4527 100644 --- a/files/powermenu/type-6/style-5.rasi +++ b/files/powermenu/type-6/style-5.rasi @@ -59,7 +59,7 @@ imagebox { spacing: 0px; padding: 100px; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", height); + background-image: url("./images/j.jpg", height); children: [ "inputbar", "dummy", "message" ]; } @@ -70,7 +70,7 @@ userimage { border-radius: 0px; border-color: @background-alt; background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", height); + background-image: url("./images/j.jpg", height); } /*****----- Inputbar -----*****/ diff --git a/files/shared/theme.sh b/files/shared/theme.sh new file mode 100755 index 0000000..8698951 --- /dev/null +++ b/files/shared/theme.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +SOURCE_DIR=$1 +DEFAULT_THEME=$2 +MAX_THEME=$3 +INPUT_THEME=$4 + +if [ -z "$INPUT_THEME" ]; then + theme="$SOURCE_DIR/style-$DEFAULT_THEME.rasi" +elif [[ "$INPUT_THEME" == "-h" || "$INPUT_THEME" == "--help" ]]; then + echo "Usage: $SOURCE_DIR [1..$MAX_THEME]" + exit 1 +elif [[ "$INPUT_THEME" -gt "$MAX_THEME" || "$INPUT_THEME" -lt 1 ]]; then + echo "Invalid theme number! Theme must be between 1 and $MAX_THEME" + exit 1 +else + theme="$SOURCE_DIR/style-$INPUT_THEME.rasi" + if [ ! -f "$theme" ]; then + echo "Theme not found at $theme" + exit 1 + fi +fi + +echo -n "$theme" diff --git a/files/shared/uptime.sh b/files/shared/uptime.sh new file mode 100755 index 0000000..2b5a842 --- /dev/null +++ b/files/shared/uptime.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +uptime_seconds=$(cat /proc/uptime | sed 's/^\([0-9]\+\)\..*/\1/') + +# Format the uptime +days=$(( uptime_seconds / 86400 )) +hours=$(( (uptime_seconds % 86400) / 3600 )) +minutes=$(( (uptime_seconds % 3600) / 60 )) + +# Helper function for pluralization +pluralize() { + local value=$1 + local singular=$2 + local plural=$3 + if [ "$value" -eq 1 ]; then + echo "$value $singular" + else + echo "$value $plural" + fi +} + +# Construct the uptime string +if [ "$days" -gt 0 ]; then + uptime="$(pluralize $days day days), $(pluralize $hours hour hours), $(pluralize $minutes minute minutes)" +elif [ "$hours" -gt 0 ]; then + uptime="$(pluralize $hours hour hours), $(pluralize $minutes minute minutes)" +else + uptime="$(pluralize $minutes minute minutes)" +fi + +echo "$uptime" + diff --git a/setup.sh b/setup.sh index 52d365c..3413abf 100755 --- a/setup.sh +++ b/setup.sh @@ -10,46 +10,64 @@ Color_Off='\033[0m' BBlack='\033[1;30m' BRed='\033[1;31m' BGreen='\033[1;32m' BYellow='\033[1;33m' BBlue='\033[1;34m' BPurple='\033[1;35m' BCyan='\033[1;36m' BWhite='\033[1;37m' + ## Directories ---------------------------- -DIR=`pwd` -FONT_DIR="$HOME/.local/share/fonts" -ROFI_DIR="$HOME/.config/rofi" +ROFI_INSTALL_DIR=$1 +FONT_INSTALL_DIR=$2 + +if [ -z "$ROFI_INSTALL_DIR" ]; then + ROFI_INSTALL_DIR="$HOME/.config/rofi" + FONT_DIR="$HOME/.local/share/fonts" + ROFI_DIR="$HOME/.config/rofi" +else + if [ -z "$FONT_INSTALL_DIR" ]; then + FONT_DIR="$ROFI_INSTALL_DIR/fonts" + else + FONT_DIR="$FONT_INSTALL_DIR" + fi + ROFI_DIR="$ROFI_INSTALL_DIR" +fi + +DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" # Install Fonts install_fonts() { - echo -e ${BBlue}"\n[*] Installing fonts..." ${Color_Off} - if [[ -d "$FONT_DIR" ]]; then - cp -rf $DIR/fonts/* "$FONT_DIR" - else + echo -e ${BBlue}"\n[*] Installing fonts to $FONT_DIR ${Color_Off}" + + if [ ! -d "$FONT_DIR" ]; then mkdir -p "$FONT_DIR" - cp -rf $DIR/fonts/* "$FONT_DIR" fi - echo -e ${BYellow}"[*] Updating font cache...\n" ${Color_Off} + + cp -rf $DIR/fonts/* "$FONT_DIR" + + echo -e ${BYellow}"[*] Updating font cache" ${Color_Off} fc-cache } # Install Themes install_themes() { - if [[ -d "$ROFI_DIR" ]]; then - echo -e ${BPurple}"[*] Creating a backup of your rofi configs..." ${Color_Off} + if [ -d "$ROFI_DIR" ]; then + echo -e ${BPurple}"[*] Creating a backup of your rofi configs in '${ROFI_DIR}.${USER}'" ${Color_Off} mv "$ROFI_DIR" "${ROFI_DIR}.${USER}" fi - echo -e ${BBlue}"[*] Installing rofi configs..." ${Color_Off} + echo -e ${BBlue}"[*] Installing rofi configs in '$ROFI_DIR'" ${Color_Off} { mkdir -p "$ROFI_DIR"; cp -rf $DIR/files/* "$ROFI_DIR"; } - if [[ -f "$ROFI_DIR/config.rasi" ]]; then - echo -e ${BGreen}"[*] Successfully Installed.\n" ${Color_Off} + if [ -f "$ROFI_DIR/config.rasi" ]; then + echo -e ${BGreen}"[*] Successfully Installed." ${Color_Off} exit 0 else - echo -e ${BRed}"[!] Failed to install.\n" ${Color_Off} + echo -e ${BRed}"[!] Failed to install." ${Color_Off} exit 1 fi } # Main main() { - install_fonts install_themes + echo "" + install_fonts + echo "" } main