Skip to content

Commit

Permalink
v3.15.00-dev-pre-rev-0 (#66)
Browse files Browse the repository at this point in the history
* revs

revs

* GPG pub key

GPG pub key

* Notes rev

Notes rev

* bash libs revs

bash libs revs

* ubuntu compatibility (unfinished)

ubuntu compatibility (unfinished)

* finished ubuntu compatibility, cleanup, refactoring

finished ubuntu compatibility, cleanup, refactoring
  • Loading branch information
taoteh1221 authored Nov 8, 2024
1 parent ad8dc0d commit b5f97ce
Show file tree
Hide file tree
Showing 14 changed files with 754 additions and 150 deletions.
533 changes: 460 additions & 73 deletions DOCUMENTATION-ETC/RASPBERRY-PI/EASTER-EGG.bash

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions DOCUMENTATION-ETC/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,14 @@ v3.14.0
---------------------------------------------------------


---------------------------------------------------------
v3.14.1

-FIX: Fixed auto-installer compatibility support for Ubuntu, related to LXDE Desktop installation and configuration

---------------------------------------------------------





9 changes: 9 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: Mike@DragonFr

Open source / 100% FREE real time slideshow crypto price ticker for Raspberry Pi LCD screens, including 24 hour volume and CoinGecko / Binance / Coinbase Pro / Kraken / Kucoin / Bitstamp / Bitfinex / HitBTC / OKex / Gate.io support (more market support coming in the future).


NOTES FOR BLACKHATS:

P̵̫̊h̴̪̑ì̶̯s̵̫̀h̸̠̆i̶̔͜n̸̞͒g̶̳̏ ̸̺͐a̴͎̓n̷̜̕d̴̻͆ ̵̙̕b̶͓͝ř̵̗u̵̼̔t̷͖͐e̴̢͑ ̵̦͊f̸̱̃ö̶̦́r̷͉͌c̴̍͜ê̸͈ ̶̬̍l̴̙̾ō̸̗g̵̫̿ḯ̴̱ṅ̸̖ ̴̘́/̴̣̅ ̸̳̈d̶̡̃ẹ̶̈c̸̲͂r̶̰̋ỹ̵̨p̶̥͂t̷͍̎i̶̮̕o̸̝̎n̸̟͑ ̴͎͑/̶̹̑ ̶͉̎O̵̦̿T̵̜̄H̶̗̓Ę̶͗R̸̪̋ ̸̦̾ȃ̷̰t̸̪̂ṯ̸̐ä̶͈́c̸̫̈k̶͈̍s̴̳̀ ̸͇̎w̸̢͝i̶͕̍l̵̦͗l̵̗̽ ̷̱̀Ň̴͍Ō̶͓T̶̙́ ̸̺̆w̶̖̓o̸̠͝r̴̪̃k̵̞͠ ̴̪̎o̴͎̽n̸͎͘ ̸̗͘m̴̖͗ẽ̸̠,̴̨̆ ̴͙̇G̵̬̿Ĭ̴͍V̶͉̇E̸̳̐ ̴̯̾U̸̺͂P̶̩̀ ̴̨͌A̵͋͜L̴̤̎R̷̖͘Ē̸͕Â̸͍D̸̨̒Ÿ̶͜!̶͖͛

GITHUB SECURITY NOTICE:

As of 2024/11/02, I am signing EVERY GITHUB CODE COMMIT with my GPG key. For verification, see the file: taoteh1221-gpg-pub-key.asc (in the app main directory)

Supports running in "slideshow mode", to show all the markets you want.

Example on a 3.5" LCD: https://www.youtube.com/watch?v=dXAhs8HXCn4
Expand Down
145 changes: 115 additions & 30 deletions TICKER-INSTALL.bash
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ CURRENT_TIMESTAMP=$(date +%s)
# Are we running on Ubuntu OS?
IS_UBUNTU=$(cat /etc/os-release | grep "PRETTY_NAME" | grep "Ubuntu")

# Are we already using lightdm, as the display manager?
LIGHTDM_DISPLAY=$(cat /etc/X11/default-display-manager | grep "lightdm")


# If a symlink, get link target for script location
# WE ALWAYS WANT THE FULL PATH!
Expand Down Expand Up @@ -302,6 +305,18 @@ app_path_result="${app_path_result#*$1:}"
elif [ "$1" == "rsyslogd" ] && [ -f "/etc/debian_version" ]; then
SYS_PACK="rsyslog"

# xorg (debian package name differs)
elif [ "$1" == "xorg" ] && [ -f "/etc/debian_version" ]; then
SYS_PACK="xserver-xorg"

# chromium-browser (debian package name differs)
elif [ "$1" == "chromium-browser" ] && [ -f "/etc/debian_version" ]; then
SYS_PACK="chromium"

# epiphany-browser (debian package name differs)
elif [ "$1" == "epiphany-browser" ] && [ -f "/etc/debian_version" ]; then
SYS_PACK="epiphany"

else
SYS_PACK="$1"
fi
Expand Down Expand Up @@ -566,12 +581,18 @@ JQ_PATH=$(get_app_path "jq")
# less
LESS_PATH=$(get_app_path "less")

# lightdm (NEEDED TO BE USED AS THE DISPLAY MANAGER, FOR LXDE / AUTOBOOT)
LIGHTDM_PATH=$(get_app_path "lightdm")

# sed
SED_PATH=$(get_app_path "sed")

# wget
WGET_PATH=$(get_app_path "wget")

# xorg (NEEDED TO BE USED AS THE WINDOW SYSTEM, FOR LXDE / AUTOBOOT)
XORG_PATH=$(get_app_path "xorg")

# PRIMARY dependency lib's paths END


Expand Down Expand Up @@ -675,7 +696,7 @@ echo " "

echo "${red}USE A #FULL# DESKTOP SETUP, #NOT# LITE, OR YOU LIKELY WILL HAVE SOME #UNICODE SYMBOL ISSUES# WITH CHROMIUM BROWSER EVEN AFTER UPGRADING TO GUI / CHROME (trust me)."
echo " "
echo "(Chromium, Epiphany, and Firefox are supported [firefox is recommended for reliability, all these browsers will be installed if available])${reset}"
echo "Chromium, Epiphany, and Firefox are supported (firefox is recommended for reliability, all these browsers will be installed if available). IF A BROWSER DOES NOT WORK, PLEASE CHECK MANUALLY THAT IT IS INSTALLED PROPERLY, AND MAKE SURE IT IS NOT CRASHING ON STARTUP!${reset}"
echo " "


Expand Down Expand Up @@ -735,13 +756,13 @@ echo " "


# If we are NOT running raspi os, AND lxde desktop IS NOT INSTALLED,
# then we offer the option to install LXDE
# (UNLESS IT'S UBUNTU, WHICH DOES NOT LIKE OUR AUTO-CONFIG *TO SAY THE LEAST*)
if [ "$IS_UBUNTU" == "" ] && [ ! -f /usr/bin/raspi-config ] && [ ! -d /etc/xdg/lxsession ]; then
# then we offer the option to install LXDE, AND WE SET THE DISPLAY MANAGER TO LIGHTDM (IF NOT ALREADY SET)
if [ "$LIGHTDM_PATH" != "" ] && [ ! -f /usr/bin/raspi-config ] && [ ! -d /etc/xdg/lxsession ]; then

echo "${red}WE NEED TO MAKE SURE LXDE #AND# LIGHTDM ARE INSTALLED, IF YOU WANT THE TICKER TO #AUTOMATICALLY RUN ON SYSTEM STARTUP# / REBOOT."
echo "${red}WE NEED TO MAKE SURE LXDE #AND# LIGHTDM ARE SETUP, IF YOU WANT THE TICKER TO #AUTOMATICALLY RUN ON SYSTEM STARTUP# / REBOOT."
echo " "
echo "CHOOSE \"LIGHTDM\" IF ASKED, FOR \"AUTO-LOGIN AT BOOT\" CAPABILITIES.${reset}"
echo "CHOOSE \"LIGHTDM\" IF ASKED, FOR \"AUTO-LOGIN AT BOOT\" CAPABILITIES."
echo "(THIS SCRIPT WILL ALSO AUTO-SETUP LIGHTDM, EVEN IF YOU DO NOT GET A PROMPT)${reset}"
echo " "
echo "${yellow}Select 1 or 2 to choose whether to install LXDE Desktop, or skip.${reset}"
echo " "
Expand All @@ -755,18 +776,46 @@ echo " "
echo "${cyan}Installing LXDE desktop and required components, please wait...${reset}"
echo " "

$PACKAGE_INSTALL xserver-xorg lightdm lxde -y
$PACKAGE_INSTALL lxde -y

sleep 3

echo " "
echo "${cyan}LXDE desktop has been installed.${reset}"
echo " "

if [ "$LIGHTDM_DISPLAY" == "" ]; then

# Set lightdm as the new display manager
echo -e "$LIGHTDM_PATH" > /etc/X11/default-display-manager

echo " "
echo "${cyan}'lightdm' has been set as the display manager.${reset}"
echo " "

else

echo " "
echo "${cyan}'lightdm' was already set as the display manager.${reset}"
echo " "

fi


# Enable GUI on boot
systemctl set-default graphical

# Assure lightdm is being used
dpkg-reconfigure lightdm

# Assure a graphical TARGET is set, or system MAY hang on boot
# https://askubuntu.com/questions/74551/lightdm-not-starting-on-boot/939995#939995
rm /etc/systemd/system/default.target

echo " "
echo "${cyan}LXDE desktop has been installed.${reset}"
systemctl set-default graphical.target
echo " "


break
elif [ "$opt" = "skip" ]; then
echo " "
Expand All @@ -775,20 +824,21 @@ echo " "
fi
done

elif [ "$IS_UBUNTU" != "" ]; then

echo "${red}THIS AUTO-INSTALL SCRIPT IS *NOT* CURRENTLY COMPATIBLE WITH UBUNTU (LXDE auto-login does NOT work, and CORRUPTS Ubuntu's Desktop login screen). PLEASE USE A DIFFERENT OPERATING SYSTEM FOR NOW (Debian / RaspberryPi OS, Armbian, etc)."

echo "${yellow} "
read -n1 -s -r -p $"PRESS ANY KEY to exit..." key
echo "${reset} "

if [ "$key" = 'y' ] || [ "$key" != 'y' ]; then
echo " "
echo "${green}Exiting...${reset}"
echo " "
exit
fi
elif [ "$LIGHTDM_PATH" == "" ]; then

echo "${red}'lightdm' (display manager) could NOT be found or installed. PLEASE INSTALL MANUALLY, OR TRY A DIFFERENT OPERATING SYSTEM (Ubuntu, Debian, RaspberryPi OS, Armbian, etc)."

echo "${yellow} "
read -n1 -s -r -p $"PRESS ANY KEY to exit..." key
echo "${reset} "

if [ "$key" = 'y' ] || [ "$key" != 'y' ]; then
echo " "
echo "${green}Exiting...${reset}"
echo " "
exit
fi

fi

Expand Down Expand Up @@ -867,7 +917,12 @@ echo " "

# Auto-login LXDE logic...

if [ -d /etc/lightdm/lightdm.conf.d ]; then
if [ -d /usr/share/lightdm/lightdm.conf.d ]; then
LIGHTDM_CONF_DIR="/usr/share/lightdm/lightdm.conf.d"
CHECK_LIGHTDM_D=$(ls /usr/share/lightdm/lightdm.conf.d)
CHECK_LIGHTDM_D=$(echo "${CHECK_LIGHTDM_D}" | xargs) # trim whitespace
elif [ -d /etc/lightdm/lightdm.conf.d ]; then
LIGHTDM_CONF_DIR="/etc/lightdm/lightdm.conf.d"
CHECK_LIGHTDM_D=$(ls /etc/lightdm/lightdm.conf.d)
CHECK_LIGHTDM_D=$(echo "${CHECK_LIGHTDM_D}" | xargs) # trim whitespace
else
Expand All @@ -882,8 +937,8 @@ echo " "
read -r -d '' LXDE_AUTO_LOGIN <<- EOF
\r
autologin-user=$APP_USER
user-session=LXDE
autologin-session=lxde
user-session=$LXDE_PROFILE
autologin-session=$LXDE_PROFILE
\r
EOF

Expand All @@ -898,6 +953,8 @@ EOF

DETECT_AUTOLOGIN=$(sudo sed -n '/autologin-user=/p' /etc/lightdm/lightdm.conf)

DETECT_AUTOLOGIN_SESSION=$(sudo sed -n '/autologin-session=/p' /etc/lightdm/lightdm.conf)


if [ "$DETECT_AUTOLOGIN" != "" ]; then
sed -i "s/#autologin-user=.*/autologin-user=${APP_USER}/g" /etc/lightdm/lightdm.conf
Expand All @@ -909,19 +966,29 @@ EOF


sleep 2


if [ "$DETECT_AUTOLOGIN_SESSION" != "" ]; then
sed -i "s/#autologin-session=.*/autologin-session=${LXDE_PROFILE}/g" /etc/lightdm/lightdm.conf
sleep 2
sed -i "s/autologin-session=.*/autologin-session=${LXDE_PROFILE}/g" /etc/lightdm/lightdm.conf
elif [ "$DETECT_AUTOLOGIN_SESSION" == "" ]; then
sudo bash -c "echo 'autologin-session=${LXDE_PROFILE}' >> /etc/lightdm/lightdm.conf"
fi

sed -i "s/user-session=.*/user-session=LXDE/g" /etc/lightdm/lightdm.conf
sed -i "s/autologin-session=.*/autologin-session=lxde/g" /etc/lightdm/lightdm.conf
sed -i "s/user-session=.*/user-session=${LXDE_PROFILE}/g" /etc/lightdm/lightdm.conf


elif [ -n "$CHECK_LIGHTDM_D" ]; then

# Find the PROPER config file in the /lightdm.conf.d/ directory
LIGHTDM_CONFIG_FILE=$(grep -r 'user-session' /etc/lightdm/lightdm.conf.d | awk -F: '{print $1}')
LIGHTDM_CONFIG_FILE=$(grep -r 'user-session' $LIGHTDM_CONF_DIR | awk -F: '{print $1}')
LIGHTDM_CONFIG_FILE=$(echo "${LIGHTDM_CONFIG_FILE}" | xargs) # trim whitespace

DETECT_AUTOLOGIN=$(sudo sed -n '/autologin-user=/p' $LIGHTDM_CONFIG_FILE)

DETECT_AUTOLOGIN_SESSION=$(sudo sed -n '/autologin-session=/p' $LIGHTDM_CONFIG_FILE)


if [ "$DETECT_AUTOLOGIN" != "" ]; then
sed -i "s/#autologin-user=.*/autologin-user=${APP_USER}/g" $LIGHTDM_CONFIG_FILE
Expand All @@ -933,8 +1000,17 @@ EOF


sleep 2
sed -i "s/user-session=.*/user-session=LXDE/g" $LIGHTDM_CONFIG_FILE
sed -i "s/autologin-session=.*/autologin-session=lxde/g" $LIGHTDM_CONFIG_FILE


if [ "$DETECT_AUTOLOGIN_SESSION" != "" ]; then
sed -i "s/#autologin-session=.*/autologin-session=${LXDE_PROFILE}/g" $LIGHTDM_CONFIG_FILE
sleep 2
sed -i "s/autologin-session=.*/autologin-session=${LXDE_PROFILE}/g" $LIGHTDM_CONFIG_FILE
elif [ "$DETECT_AUTOLOGIN_SESSION" == "" ]; then
sudo bash -c "echo 'autologin-session=${LXDE_PROFILE}' >> ${LIGHTDM_CONFIG_FILE}"
fi

sed -i "s/user-session=.*/user-session=${LXDE_PROFILE}/g" $LIGHTDM_CONFIG_FILE


else
Expand Down Expand Up @@ -1000,6 +1076,15 @@ select opt in $OPTIONS; do

echo " "

# FORCE UBUNTU SNAP INSTALLS
# (included snaps can be messed up, especially on Ubuntu Armbian)
if [ "$IS_UBUNTU" != "" ]; then
$UBUNTU_SNAP_INSTALL firefox
$UBUNTU_SNAP_INSTALL chromium
$UBUNTU_SNAP_INSTALL epiphany
fi


# Firefox on raspbian
$PACKAGE_INSTALL firefox-esr -y

Expand Down
9 changes: 1 addition & 8 deletions bash/browser-support/chromium.bash
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/bin/bash

# Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: [email protected] (leave this copyright / attribution intact in ALL forks / copies!)


FIND_DISPLAY=$(w -h $USER | awk '$3 ~ /:[0-9.]*/{print $3}')

DISPLAY=$FIND_DISPLAY

export DISPLAY=$FIND_DISPLAY


# Chromium's FULL PATH
CHROMIUM_PATH=$(which chromium)

Expand Down
7 changes: 0 additions & 7 deletions bash/browser-support/epiphany.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
# Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: [email protected] (leave this copyright / attribution intact in ALL forks / copies!)


FIND_DISPLAY=$(w -h $USER | awk '$3 ~ /:[0-9.]*/{print $3}')

DISPLAY=$FIND_DISPLAY

export DISPLAY=$FIND_DISPLAY


# Create epiphany user directory if it doesn't exist yet
if [ ! -d ~/.config/epiphany ]; then
mkdir -p ~/.config/epiphany
Expand Down
9 changes: 1 addition & 8 deletions bash/browser-support/firefox.bash
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/bin/bash

# Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: [email protected] (leave this copyright / attribution intact in ALL forks / copies!)


FIND_DISPLAY=$(w -h $USER | awk '$3 ~ /:[0-9.]*/{print $3}')

DISPLAY=$FIND_DISPLAY

export DISPLAY=$FIND_DISPLAY


# Firefox's FULL PATH
FIREFOX_PATH=$(which firefox-esr)

Expand Down
13 changes: 11 additions & 2 deletions bash/cron/cron.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

# Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: [email protected] (leave this copyright / attribution intact in ALL forks / copies!)

# Authentication of X sessions
export XAUTHORITY=~/.Xauthority


# EXPLICITLY set any dietpi paths
# Export too, in case we are calling another bash instance in this script
if [ -f /boot/dietpi/.version ]; then
PATH=/boot/dietpi:$PATH
export PATH=$PATH
fi

# EXPLICITLY set any ~/.local/bin paths
# Export too, in case we are calling another bash instance in this script
Expand All @@ -19,10 +29,9 @@ export PATH=$PATH
fi



# Cache updating
bash ~/slideshow-crypto-ticker/bash/cron/cache.bash


# Keep screensaver off
bash ~/slideshow-crypto-ticker/bash/cron/keep-screensaver-off.bash

8 changes: 1 addition & 7 deletions bash/cron/keep-screensaver-off.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@

# Copyright 2019-2024 GPLv3, Slideshow Crypto Ticker by Mike Kilday: [email protected] (leave this copyright / attribution intact in ALL forks / copies!)


FIND_DISPLAY=$(w -h $USER | awk '$3 ~ /:[0-9.]*/{print $3}')

DISPLAY=$FIND_DISPLAY

export DISPLAY=$FIND_DISPLAY

# Virtually type the ctrl key
xdotool key ctrl
Loading

0 comments on commit b5f97ce

Please sign in to comment.