1
0
mirror of https://github.com/AG7GN/nexus-utilities.git synced 2025-05-16 14:40:09 -07:00

Bump Version

This commit is contained in:
Steve Magnuson 2019-12-18 09:49:35 -08:00
parent 66dd1232ff
commit a7ff2a3b08
6 changed files with 134 additions and 1 deletions

BIN
NexusDeskTop.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

10
cups.desktop Normal file
View File

@ -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

17
desktop-items-0.conf Normal file
View File

@ -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

11
edit-desktop.desktop Normal file
View File

@ -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

95
edit-desktop.sh Normal file
View File

@ -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="<b><big><big>Desktop Text Editor</big></big>\n\n \
$MESSAGE</b>\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

View File

@ -1 +1 @@
VERSION="1.8.2" VERSION="1.9.0"