From a1104f39c31aeb66704c3710437052b5e10a4c28 Mon Sep 17 00:00:00 2001 From: ciricode Date: Sat, 14 Aug 2021 19:44:00 +0700 Subject: [PATCH 1/2] Refactor --- install.sh | 8 ++++---- lib-core.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 8ce3a17..d50b734 100755 --- a/install.sh +++ b/install.sh @@ -150,11 +150,11 @@ else # rm -rf "${THEME_SRC_DIR}/sass/_gtk-base-temp.scss" - if (is_my_distro "arch" || is_my_distro "void") && has_command xfce4-session; then - msg="XFCE: you may need to logout after changing your theme to fix your panel opacity." - elif (is_my_distro "solus") && has_command gnome-shell; then + if (is_running "xfce4-session"); then + msg="XFCE: you may need to run 'xfce4-panel -r' after changing your theme to fix your panel opacity." + elif (is_running "gnome-session") && [[ "${GNOME_VERSION}" == "new" ]]; then msg="GNOME: you may need to disable 'User Themes' extension to fix your dock." - elif (is_my_distro "debian") && [[ "${GNOME_VERSION}" == "old" ]]; then + elif (is_running "gnome-session") && [[ "${GNOME_VERSION}" == "old" ]]; then msg="GNOME: you may need to disable 'User Themes' extension to fix your logout and authentication dialog." fi diff --git a/lib-core.sh b/lib-core.sh index b29c749..67f11ff 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -171,8 +171,8 @@ has_snap_app() { snap list "${1}" &> /dev/null || return 1 } -is_my_distro() { - [[ "$(cat '/etc/os-release' | awk -F '=' '/ID/{print $2}')" =~ "${1}" ]] +is_running() { + pgrep "$1" &> /dev/null } ############################################################################### From 7dc77ce37df1bae9ab39174b423117aa4452b7b6 Mon Sep 17 00:00:00 2001 From: ciricode Date: Sun, 15 Aug 2021 10:35:20 +0700 Subject: [PATCH 2/2] Revert --- install.sh | 2 +- lib-core.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index d50b734..efbedc0 100755 --- a/install.sh +++ b/install.sh @@ -152,7 +152,7 @@ else if (is_running "xfce4-session"); then msg="XFCE: you may need to run 'xfce4-panel -r' after changing your theme to fix your panel opacity." - elif (is_running "gnome-session") && [[ "${GNOME_VERSION}" == "new" ]]; then + elif (is_my_distro "solus") && (is_running "gnome-session"); then msg="GNOME: you may need to disable 'User Themes' extension to fix your dock." elif (is_running "gnome-session") && [[ "${GNOME_VERSION}" == "old" ]]; then msg="GNOME: you may need to disable 'User Themes' extension to fix your logout and authentication dialog." diff --git a/lib-core.sh b/lib-core.sh index 67f11ff..3ab08aa 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -171,6 +171,10 @@ has_snap_app() { snap list "${1}" &> /dev/null || return 1 } +is_my_distro() { + [[ "$(cat '/etc/os-release' | awk -F '=' '/ID/{print $2}')" =~ "${1}" ]] +} + is_running() { pgrep "$1" &> /dev/null }