diff --git a/NexusDeskTop.jpg b/NexusDeskTop.jpg new file mode 100644 index 0000000..1cdb0a1 Binary files /dev/null and b/NexusDeskTop.jpg differ diff --git a/cups.desktop b/cups.desktop new file mode 100644 index 0000000..a0be736 --- /dev/null +++ b/cups.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Manage Printers +GenericName=Manage Printers +Comment=Install and configure printers +Exec=chromium-browser http://localhost:631/admin +Icon=/usr/share/icons/Adwaita/32x32/devices/printer-symbolic.symbolic.png +Terminal=false +Type=Application +Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings; +Comment[en_US]=Manage Auto-HotSpot diff --git a/desktop-items-0.conf b/desktop-items-0.conf new file mode 100644 index 0000000..b4d2f93 --- /dev/null +++ b/desktop-items-0.conf @@ -0,0 +1,17 @@ +[*] +wallpaper_mode=center +wallpaper_common=1 +wallpaper=/home/pi/Pictures/NexusDeskTop.jpg +desktop_bg=#012f13 +desktop_fg=#e8e8e8 +desktop_shadow=#012f13 +desktop_font=PibotoLt 12 +show_wm_menu=0 +sort=mtime;ascending; +show_documents=0 +show_trash=1 +show_mounts=1 + +[trash:///] +x=2 +y=989 diff --git a/edit-desktop.desktop b/edit-desktop.desktop new file mode 100644 index 0000000..01bdd5e --- /dev/null +++ b/edit-desktop.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Edit Desktop Background Text +GenericName=Edit Desktop Background Text +Comment=Edit Desktop Background Text +#Exec=lxterminal --geometry=30x10+10+10 -t "Edit Desktop Background Text" -e "/usr/local/bin/edit-desktop.sh" +Exec=sh -c /usr/local/bin/edit-desktop.sh +Icon=/usr/share/raspberrypi-artwork/raspitr.png +Terminal=false +Type=Application +Categories=Settings;DesktopSettings;GTK;X-LXDE-Settings; +Comment[en_US]=Edit Desktop Background Text diff --git a/edit-desktop.sh b/edit-desktop.sh new file mode 100644 index 0000000..72f0bb6 --- /dev/null +++ b/edit-desktop.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +VERSION="0.1.1" + +# This script allows the user to change the text of the default Nexus desktop background + + +TITLE="Desktop Text Editor $VERSION" +CONFIG_FILE="$HOME/desktop-text.conf" +PICTURE_DIR="$HOME/Pictures" +DEFAULT_BACKGROUND_IMAGE="$PICTURE_DIR/NexusDeskTop.jpg" +MESSAGE="Enter the text you want displayed below.\nDon't use any single or double quotation marks." + +trap errorReport INT + +function errorReport () { + echo + if [[ $1 == "" ]] + then + exit 0 + else + if [[ $2 == "" ]] + then + echo >&2 "$1" + exit 1 + else + echo >&2 "$1" + exit $2 + fi + fi +} + +[ -s $DEFAULT_BACKGROUND_IMAGE ] || errorReport "Default Nexus image not in $DEFAULT_BACKGROUND_IMAGE" 1 + +if ! command -v convert >/dev/null +then + sudo port update + sudo port install imagemagick +fi + +if [ -s "$CONFIG_FILE" ] +then # There is a config file + echo "$CONFIG_FILE found." + source "$CONFIG_FILE" +else # Set some default values in a new config file + echo "Config file $CONFIG_FILE not found. Creating a new one with default values." + echo "TEXT=\"N0ONE\"" > "$CONFIG_FILE" + echo "SHOW_HOSTNAME=\"TRUE\"" >> "$CONFIG_FILE" + source "$CONFIG_FILE" +fi + +while true +do + ANS="" + ANS="$(yad --title="$TITLE" \ + --text="Desktop Text Editor\n\n \ +$MESSAGE\n" \ + --item-separator="!" \ + --posx=10 --posy=50 \ + --align=right \ + --buttons-layout=center \ + --text-align=center \ + --align=right \ + --borders=20 \ + --form \ + --field="Background Text" "$TEXT" \ + --field="Include Hostname":CHK $SHOW_HOSTNAME \ + --focus-field 1 \ + )" + + [[ $? == 1 || $? == 252 ]] && errorReport # User has cancelled. + + [[ $ANS == "" ]] && errorReport "Error." 1 + + IFS='|' read -r -a TF <<< "$ANS" + + TEXT="${TF[0]}" + SHOW_HOSTNAME="${TF[1]}" + echo "TEXT=\"$TEXT\"" > "$CONFIG_FILE" + echo "SHOW_HOSTNAME=\"$SHOW_HOSTNAME\"" >> "$CONFIG_FILE" + + [[ $TEXT == "" ]] && { $(command -v pcmanfm) --set-wallpaper="$DEFAULT_BACKGROUND_IMAGE"; continue; } + + TARGET="$PICTURE_DIR/TEXT_$(echo $TEXT | tr -cd [a-zA-Z0-9]).jpg" + echo "Deleting $PICTURE_DIR/TEXT_*.jpg" + find "$PICTURE_DIR" -maxdepth 1 -name TEXT_*.jpg -type f -delete + + if [[ $SHOW_HOSTNAME == "TRUE" ]] + 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 + else + $(command -v convert) $DEFAULT_BACKGROUND_IMAGE -gravity south -pointsize 75 -fill white -annotate +0+25 "$TEXT" $TARGET + fi + $(command -v pcmanfm) --set-wallpaper="$TARGET" +done diff --git a/hampi-utilities.version b/hampi-utilities.version index 2f5d92d..8b5ca35 100644 --- a/hampi-utilities.version +++ b/hampi-utilities.version @@ -1 +1 @@ -VERSION="1.8.2" \ No newline at end of file +VERSION="1.9.0" \ No newline at end of file