Skip to content

Commit

Permalink
[eos-bash-shared] using POSIX compatible function names
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-192 committed Aug 21, 2024
1 parent 96edbd9 commit a5213ba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ChangeDisplayResolution
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion eos-download-wallpapers
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion eos-script-lib-yad
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos-shifttime
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos-wallpaper-set
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
}

Expand Down
2 changes: 1 addition & 1 deletion paccache-service-manager
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5213ba

Please sign in to comment.