at 18.09-beta 54 lines 1.6 kB view raw
1diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector 2index 0646e4bc..f827dbfe 100755 3--- a/script/rofi-theme-selector 4+++ b/script/rofi-theme-selector 5@@ -42,34 +42,7 @@ function find_themes() 6 DIRS=${XDG_DATA_DIRS} 7 OLDIFS=${IFS} 8 IFS=: 9- if [ -z "${XDG_DATA_DIRS}" ] 10- then 11- echo "XDG_DATA_DIRS needs to be set for this script to function correctly." 12- echo -n "Using dirs from \$PATH: " 13- DIRS= 14- # Iterate over items in $PATH 15- for p in ${PATH}; do 16- # Remove trailing / if exists. 17- x=${p%/} 18- # remove both /bin and /sbin and /games from end 19- x=${x%/bin} 20- x=${x%/sbin} 21- x=${x%/games} 22- # Add /share 23- x=${x}/share 24- # Check if entry exists Prepend : so :${x}: matches nicely 25- case ":${DIRS}" in 26- *$x:*);; 27- *) DIRS+="$x:";; 28- esac 29- done 30- # Remove trailing : 31- DIRS=${DIRS%:} 32- echo "${DIRS}" 33- fi 34- # Add user dir. 35- DIRS+=":${HOME}/.local/share/" 36- DIRS+=":${HOME}/.config/" 37+ DIRS+=":%ROFIOUT%/" 38 for p in ${DIRS}; do 39 p=${p%/} 40 TD=${p}/rofi/themes 41@@ -164,7 +137,12 @@ Current theme: <b>${CUR}</b>""" 42 ### 43 function set_theme() 44 { 45- CDIR="${HOME}/.config/rofi/" 46+ if [ -d "${XDG_CONFIG_HOME}" ]; then 47+ CDIR="${XDG_CONFIG_HOME}/rofi/" 48+ else 49+ CDIR="${HOME}/.config/rofi/" 50+ fi 51+ 52 if [ ! -d "${CDIR}" ] 53 then 54 mkdir -p ${CDIR}