[welcome] shellcheck related changes

This commit is contained in:
manuel
2026-06-22 11:20:58 +03:00
parent e62ae44738
commit 5fc9daae04
2 changed files with 24 additions and 24 deletions
+15 -15
View File
@@ -25,7 +25,7 @@ test -r $EOS_SCRIPTS_YAD || {
echo "ERROR: cannot find $EOS_SCRIPTS_YAD" >&2
exit 1
}
source $EOS_SCRIPTS_YAD
source $EOS_SCRIPTS_DIR/eos-script-lib-yad
unset EOS_SCRIPTS_YAD
@@ -1343,20 +1343,20 @@ GetIsoDateStr() {
echo "ISO: $ISO_VERSION"
}
SetCalamaresVersionInfo() {
if [ -n "$ISO_VERSION" ] ; then
local file=/etc/calamares/branding/endeavouros/branding.desc
if [ -f $file ] ; then
local str
for str in "version:" "shortVersion:" ; do
if [ "$(grep -w "$str" $file | awk '{print $2}')" != "$ISO_VERSION" ] ; then
sudo sed -i $file -E "s|^([ ]+$str[ ]+).*|\1$ISO_VERSION|"
fi
done
fi
fi
}
# SetCalamaresVersionInfo() {
# if [ -n "$ISO_VERSION" ] ; then
# local file=/etc/calamares/branding/endeavouros/branding.desc
# if [ -f "$file" ] ; then
# local str
#
# for str in "version:" "shortVersion:" ; do
# if [ "$(grep -w "$str" "$file" | awk '{print $2}')" != "$ISO_VERSION" ] ; then
# sudo sed -i "$file" -E "s|^([ ]+$str[ ]+).*|\1$ISO_VERSION|"
# fi
# done
# fi
# fi
# }
VerboseLog() {
if [ "$WELCOME_VERBOSE_LOG" = "yes" ] ; then
+9 -9
View File
@@ -17,7 +17,7 @@ export -f eos_yad
DndCreateConfigFile() {
if [ ! -r "$configfile" ] ; then
cat <<EOF > $configfile
cat <<EOF > "$configfile"
#!/bin/bash
local welcome_own_commands=(
@@ -81,10 +81,10 @@ DndAddField() {
DndDesktopFile() {
local file="${arg#file://}"
local icon="$(grep "^Icon=" "$file" | head -n 1 | cut -d '=' -f 2)"
local name="$(grep "^Name=" "$file" | head -n 1 | cut -d '=' -f 2)"
local generic_name="$(grep "^GenericName=" "$file" | head -n 1 | cut -d '=' -f 2)"
local comment="$(grep "^Comment=" "$file" | head -n 1 | cut -d '=' -f 2)"
local icon="$(grep -m1 "^Icon=" "$file" | cut -d '=' -f 2)"
local name="$(grep -m1 "^Name=" "$file" | cut -d '=' -f 2)"
local generic_name="$(grep -m1 "^GenericName=" "$file" | cut -d '=' -f 2)"
local comment="$(grep -m1 "^Comment=" "$file" | cut -d '=' -f 2)"
local description="Description not available."
local command="dex '$file'"
@@ -101,16 +101,16 @@ DndDocumentFile() {
local file="${arg#file://}"
local desktopfile="$(xdg-mime query default $(xdg-mime query filetype "$file"))"
local dt2="$(find /usr/share/applications -name "$desktopfile")"
test -n "$dt2" || dt2="$(find "$HOME/.local/share/applications" -name "$desktopfile")"
[ "$dt2" ] || dt2="$(find "$HOME/.local/share/applications" -name "$desktopfile")"
case "$file" in
/*) ;;
*) file="$PWD/$file" ;;
esac
local ending="${file##*.}"
local name="$(basename "$file")"
local name="${file##*/}" #"$(basename "$file")"
local description="A $ending file"
local command="xdg-open '$file'"
local icon="$(grep "^Icon=" "$dt2" | head -n 1 | cut -d '=' -f 2)"
local icon="$(grep -m1 "^Icon=" "$dt2" | cut -d '=' -f 2)"
DndAddField
}
@@ -140,7 +140,7 @@ DndServerStart() {
text+="- .desktop file (=launcher) shortcut from the start menu"
local yadcmd=(eos_yad --dnd
--$handler
--"$handler"
--title="Welcome: Personal Commands drag & drop support"
--text="$text"
--width=500 --height=200