diff options
author | Rasmus Steinke <rasi@xssn.at> | 2018-06-03 08:58:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 08:58:40 +0200 |
commit | ba08df8a3ec14c292a5f7bb9e6711b239b98a1b9 (patch) | |
tree | f49c7917884fe128a05a4a3ba732188fd37164de | |
parent | abeddb6a576de2f5b8077268af664c9dc53b0372 (diff) |
Get rid of if condition, honour XDG_DATA_HOME
-rwxr-xr-x | script/rofi-theme-selector | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector index 38467df0..4184ebcb 100755 --- a/script/rofi-theme-selector +++ b/script/rofi-theme-selector @@ -68,8 +68,8 @@ function find_themes() echo "${DIRS}" fi # Add user dir. - DIRS+=":${HOME}/.local/share/" - DIRS+=":${HOME}/.config/" + DIRS+=":${XDG_DATA_HOME:-${HOME}/.local/share}" + DIRS+=":${XDG_CONFIG_HOME:-${HOME}/.config}" for p in ${DIRS}; do p=${p%/} TD=${p}/rofi/themes @@ -164,12 +164,7 @@ Current theme: <b>${CUR}</b>""" ### function set_theme() { - if [ -d "${XDG_CONFIG_HOME}" ]; then - CDIR="${XDG_CONFIG_HOME}/rofi/" - else - CDIR="${HOME}/.config/rofi/" - fi - + CDIR="${XDG_CONFIG_HOME:-${HOME}/.config}/rofi" if [ ! -d "${CDIR}" ] then mkdir -p ${CDIR} |