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