From a5213ba3d08468f347ec1fe134ec8c8a46b3498f Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 21 Aug 2024 17:09:01 +0300 Subject: [PATCH] [eos-bash-shared] using POSIX compatible function names --- ChangeDisplayResolution | 2 +- eos-download-wallpapers | 2 +- eos-script-lib-yad | 4 +++- eos-shifttime | 2 +- eos-wallpaper-set | 2 +- paccache-service-manager | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeDisplayResolution b/ChangeDisplayResolution index abe0ed2..200bfd8 100755 --- a/ChangeDisplayResolution +++ b/ChangeDisplayResolution @@ -30,7 +30,7 @@ export -f Restart_me yad_ChangeDisplayResolution() { local reso="$1" local progname=${0##*/} - eos-assert-deps $progname xorg-xrandr yad || return 1 + eos_assert_deps $progname xorg-xrandr yad || return 1 local query="$(xrandr --query)" local output="$(echo "$query" | grep -m1 " connected " | awk '{print $1}')" local xrandr="xrandr --output $output --mode" diff --git a/eos-download-wallpapers b/eos-download-wallpapers index a992f81..7537290 100755 --- a/eos-download-wallpapers +++ b/eos-download-wallpapers @@ -187,7 +187,7 @@ Main() local retval=0 local oldies - eos-assert-deps $progname yad || return 1 + eos_assert_deps $progname yad || return 1 [ -n "$implementation_default" ] || implementation_default=git diff --git a/eos-script-lib-yad b/eos-script-lib-yad index c5df8f1..2b52f74 100644 --- a/eos-script-lib-yad +++ b/eos-script-lib-yad @@ -31,6 +31,8 @@ source /etc/eos-script-lib-yad.conf # for EOS_ROOTER and other configs export EOS_WICON=/usr/share/endeavouros/EndeavourOS-icon.png export EOS_YAD_STARTER_CMD="/usr/bin/yad --window-icon=$EOS_WICON" +# Avoid hyphens in function names because of POSIX standard, use underscores instead. + eos_yad() { GDK_BACKEND=x11 $EOS_YAD_STARTER_CMD "$@"; } translations_dir=/usr/share/endeavouros/scripts # needed in translations.bash @@ -51,7 +53,7 @@ yad_missing_check() { fi } -eos-assert-deps() { # params: prog deps +eos_assert_deps() { # params: prog deps local -r prog="$1" shift local failcount=0 diff --git a/eos-shifttime b/eos-shifttime index c8611fd..d1ff1e8 100755 --- a/eos-shifttime +++ b/eos-shifttime @@ -39,7 +39,7 @@ Main() x86_64) ;; *) DIE "This program is supported only on x86_64 machines." ;; # because of mirrors... esac - eos-assert-deps $progname yad || return 1 + eos_assert_deps $progname yad || return 1 local date=$(/usr/bin/date +%Y%m%d-%H%M) # for temporary backup file local stopdate="$(/usr/bin/date +%Y/%m/%d)" # for checking if user selected this date local mlist=/etc/pacman.d/mirrorlist diff --git a/eos-wallpaper-set b/eos-wallpaper-set index 6cc221b..f8cc461 100755 --- a/eos-wallpaper-set +++ b/eos-wallpaper-set @@ -58,7 +58,7 @@ WallpaperSelect() { height=$hmin fi - eos-assert-deps $progname yad || exit 1 + eos_assert_deps $progname yad || exit 1 pic="$(eos_yad --file --filename="$picfolder" --width=700 --height=$height --title="Choose wallpaper file")" } diff --git a/paccache-service-manager b/paccache-service-manager index 0b304a3..41a31fd 100755 --- a/paccache-service-manager +++ b/paccache-service-manager @@ -88,7 +88,7 @@ AddCommand() { _paccache_cleaner_manager() { local progname=paccache-service-manager - eos-assert-deps $progname yad || return 1 + eos_assert_deps $progname yad || return 1 local dir=/etc/systemd/system local dir2=/usr/lib/systemd/system # current values may be only here... local service=$dir/paccache.service