mirror of
https://github.com/AG7GN/nexus-utilities.git
synced 2025-05-18 07:30:07 -07:00
Added Pi model information to edit-desktop.sh
This commit is contained in:
parent
3aea20b8aa
commit
60d000aa8f
@ -8,7 +8,7 @@
|
|||||||
#% DESCRIPTION
|
#% DESCRIPTION
|
||||||
#% This script allows you to edit the text on the default Nexus DR-X Desktop.
|
#% This script allows you to edit the text on the default Nexus DR-X Desktop.
|
||||||
#% You can, for example add your call sign and select whether or not to include
|
#% You can, for example add your call sign and select whether or not to include
|
||||||
#% the Pi's hostname.
|
#% the Pi's hostname and Pi model.
|
||||||
#%
|
#%
|
||||||
#% OPTIONS
|
#% OPTIONS
|
||||||
#% -h, --help Print this help
|
#% -h, --help Print this help
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#%
|
#%
|
||||||
#================================================================
|
#================================================================
|
||||||
#- IMPLEMENTATION
|
#- IMPLEMENTATION
|
||||||
#- version ${SCRIPT_NAME} 1.1.8
|
#- version ${SCRIPT_NAME} 1.2.0
|
||||||
#- author Steve Magnuson, AG7GN
|
#- author Steve Magnuson, AG7GN
|
||||||
#- license CC-BY-SA Creative Commons License
|
#- license CC-BY-SA Creative Commons License
|
||||||
#- script_id 0
|
#- script_id 0
|
||||||
@ -96,6 +96,38 @@ PICTURE_DIR="$HOME/Pictures"
|
|||||||
DEFAULT_BACKGROUND_IMAGE="$PICTURE_DIR/NexusDeskTop.jpg"
|
DEFAULT_BACKGROUND_IMAGE="$PICTURE_DIR/NexusDeskTop.jpg"
|
||||||
MESSAGE="Enter the text you want displayed below.\nDon't use any single or double quotation marks."
|
MESSAGE="Enter the text you want displayed below.\nDon't use any single or double quotation marks."
|
||||||
|
|
||||||
|
declare -A MODELS
|
||||||
|
MODELS[a02082]="1GB RAM"
|
||||||
|
MODELS[a020d3]="1GB RAM"
|
||||||
|
MODELS[a22082]="1GB RAM"
|
||||||
|
MODELS[a32082]="1GB RAM"
|
||||||
|
MODELS[a52082]="1GB RAM"
|
||||||
|
MODELS[a22083]="1GB RAM"
|
||||||
|
MODELS[a32082]="1GB RAM"
|
||||||
|
MODELS[a220a0]="1GB RAM"
|
||||||
|
MODELS[a02100]="1GB RAM"
|
||||||
|
MODELS[a03111]="1GB RAM"
|
||||||
|
MODELS[b03111]="2GB RAM"
|
||||||
|
MODELS[b03112]="2GB RAM"
|
||||||
|
MODELS[c03111]="4GB RAM"
|
||||||
|
MODELS[c03112]="4GB RAM"
|
||||||
|
MODELS[d03114]="8GB RAM"
|
||||||
|
#MODELS[a02082]="1GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[a020d3]="1GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[a22082]="1GB RAM Manufacturer: Embest"
|
||||||
|
#MODELS[a32082]="1GB RAM Manufacturer: Sony Japan"
|
||||||
|
#MODELS[a52082]="1GB RAM Manufacturer: Stadium"
|
||||||
|
#MODELS[a22083]="1GB RAM Manufacturer: Embest"
|
||||||
|
#MODELS[a32082]="1GB RAM Manufacturer: Sony Japan"
|
||||||
|
#MODELS[a220a0]="1GB RAM Manufacturer: Embest"
|
||||||
|
#MODELS[a02100]="1GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[a03111]="1GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[b03111]="2GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[b03112]="2GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[c03111]="4GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[c03112]="4GB RAM Manufacturer: Sony UK"
|
||||||
|
#MODELS[d03114]="8GB RAM Manufacturer: Sony UK"
|
||||||
|
|
||||||
#============================
|
#============================
|
||||||
# PARSE OPTIONS WITH GETOPTS
|
# PARSE OPTIONS WITH GETOPTS
|
||||||
#============================
|
#============================
|
||||||
@ -203,6 +235,11 @@ else # Set some default values in a new config file
|
|||||||
source "$CONFIG_FILE"
|
source "$CONFIG_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
MODEL="$(egrep "^Model" /proc/cpuinfo | sed -e 's/ //;s/\t//g' | cut -d: -f2)"
|
||||||
|
REVISION="$(egrep "^Revision" /proc/cpuinfo | sed -e 's/ //;s/\t//g' | cut -d: -f2)"
|
||||||
|
SERIAL="$(egrep "^Serial" /proc/cpuinfo | sed -e 's/ //;s/\t//g' | cut -d: -f2)"
|
||||||
|
[[ -z $MODEL ]] && INFO ="" || INFO="$MODEL with ${MODELS[$REVISION]}"
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
ANS=""
|
ANS=""
|
||||||
@ -218,7 +255,7 @@ $MESSAGE</b>\n" \
|
|||||||
--borders=20 \
|
--borders=20 \
|
||||||
--form \
|
--form \
|
||||||
--field="Background Text" "$TEXT" \
|
--field="Background Text" "$TEXT" \
|
||||||
--field="Include Hostname":CHK $SHOW_HOSTNAME \
|
--field="Include Hostname and Pi model":CHK $SHOW_HOSTNAME \
|
||||||
--focus-field 1 \
|
--focus-field 1 \
|
||||||
)"
|
)"
|
||||||
|
|
||||||
@ -241,9 +278,13 @@ $MESSAGE</b>\n" \
|
|||||||
|
|
||||||
if [[ $SHOW_HOSTNAME == "TRUE" ]]
|
if [[ $SHOW_HOSTNAME == "TRUE" ]]
|
||||||
then
|
then
|
||||||
$(command -v convert) $DEFAULT_BACKGROUND_IMAGE -gravity south -pointsize 20 -fill white -annotate 0 $(hostname) -gravity south -pointsize 75 -fill white -annotate +0+25 "$TEXT" $TARGET
|
$(command -v convert) $DEFAULT_BACKGROUND_IMAGE \
|
||||||
|
-gravity south -pointsize 20 -fill yellow -annotate 0 $(hostname) \
|
||||||
|
-gravity south -pointsize 18 -fill white -annotate +0+25 "$INFO" \
|
||||||
|
-gravity south -pointsize 75 -fill yellow -annotate +0+40 "$TEXT" $TARGET
|
||||||
else
|
else
|
||||||
$(command -v convert) $DEFAULT_BACKGROUND_IMAGE -gravity south -pointsize 75 -fill white -annotate +0+25 "$TEXT" $TARGET
|
$(command -v convert) $DEFAULT_BACKGROUND_IMAGE \
|
||||||
|
-gravity south -pointsize 75 -fill yellow -annotate +0+25 "$TEXT" $TARGET
|
||||||
fi
|
fi
|
||||||
$(command -v pcmanfm) --set-wallpaper="$TARGET"
|
$(command -v pcmanfm) --set-wallpaper="$TARGET"
|
||||||
done
|
done
|
||||||
|
@ -1 +1 @@
|
|||||||
VERSION="2.3.28"
|
VERSION="2.3.29"
|
Loading…
x
Reference in New Issue
Block a user