Skip to content
Snippets Groups Projects
Commit 75d208ed authored by tobiglaser's avatar tobiglaser
Browse files

desktop and vnc files

parent 2f17a0a3
No related branches found
No related tags found
No related merge requests found
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Arduino Control
Exec=letsgoing-rpi-arduinocontrol
Comment=Control your Arduino from here!
Icon=/home/pi/SMack.jpg
Terminal=false
Categories=Development;Engineering;Electronics
\ No newline at end of file
......@@ -49,6 +49,7 @@
sudo chown -R $myuser:$myuser /home/$myuser/.vnc
sudo chmod 0600 /home/$myuser/.vnc/passwd
# thx https://askubuntu.com/questions/328240/assign-vnc-password-using-script
sudo cp vnc/xstartup /home/$myuser/.vnc/xstartup
echo " VNC Password: $mypasswd"
......@@ -60,64 +61,28 @@
echo " Installing tightvnc."
sudo apt -qq install -qq -y tightvncserver
echo " Copy start up script."
for i in $(seq 1 $vncCount)
do
echo " Checking for autostart service."
VNC=$(systemctl status vncserver)
VNC=$(systemctl status vncserver$vncCount)
if [ -z "$VNC" \
-o -n "$(echo $VNC | grep "not found")" \
-o -n "$(echo $VNC | grep "Active: failed")" ] # empty -> could not be found
then
echo " Creating autostart service."
# echo "[Unit]
# Description=TightVNC remote desktop server
# After=network.target
#
# [Service]
# User=pi
# Type=forking
# ExecStart=/usr/bin/vncserver :1 -geometry 1440x900
# ExecStop=/usr/bin/vncserver -kill :1
#
# [Install]
# WantedBy=multi-user.target" > vncserver.service
for i in $(seq 1 $vncCount)
do
echo "[Unit]
Description=$i TightVNC remote desktop server
After=syslog.target network.target
[Service]
User=pi$i
Type=forking
PIDFile=/home/pi$i/.vnc/%H:$i.pid
ExecStartPre=-/usr/bin/vncserver -kill :$i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver :$i -depth 16 -geometry 1600x800
ExecStop=/usr/bin/vncserver -kill :$i
[Install]
WantedBy=multi-user.target" > vncserver$i.service
# done
# echo "[Unit]
# Description=Start TightVNC server at startup
# After=syslog.target network.target
#
# [Service]
# Type=forking
# User=pi%i
# PIDFile=/home/pi%i/.vnc/%H:%i.pid
# ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
# ExecStart=/usr/bin/vncserver :%i -depth 16 -geometry 1600x800
# ExecStop=/usr/bin/vncserver -kill :%i
#
# [Install]
# WantedBy=multi-user.target" > vncserver.service
# sudo mv vncserver.service /etc/systemd/system/vncserver.service
sudo mv vncserver$i.service /etc/systemd/system/vncserver$i.service
done
for i in $(seq 1 $vncCount)
do
cat vnc-config/vncserver.service | \
sed -e "s/USER/$vncBaseName$i/" | \
sed -e "s/NUM/$i/" > vncserver$i.service
sudo mv vncserver$i.service /etc/systemd/system/vncserver$i.service
done
sudo systemctl daemon-reload
else
echo " Autostart service already present."
......@@ -172,24 +137,14 @@
wget -qO- http://letsgoing.org/img/personen/SMack.jpg > /home/pi/SMack.jpg
echo "[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Arduino Control
Exec=letsgoing-rpi-arduinocontrol
Comment=Control your Arduino from here!
Icon=/home/pi/SMack.jpg
Terminal=false
Categories=Development;Engineering;Electronics" > arduinocontrol.desktop
#start menu
sudo cp arduinocontrol.desktop /usr/share/applications/
sudo cp desktop-shortcuts/arduinocontrol.desktop /usr/share/applications/
#desktops
for i in $(seq 1 $vncCount)
do
sudo mkdir -p /home/pi$i/Desktop/
sudo cp arduinocontrol.desktop /home/pi$i/Desktop/
sudo cp desktop-shortcuts/arduinocontrol.desktop /home/pi$i/Desktop/
done
echo "Creating desktop shortcuts for Arduino IDE."
......@@ -209,7 +164,6 @@
# Camera Stuff...
#sudo systemctl daemon-reload ?
#python3 -m pip install --upgrade --force-reinstall Pillow
# https://gist.github.com/melissacoleman/8e6bf42089ccb2a5ee60c0bea26c2061
# sudo userdel -r -f pi5
......
[Unit]
Description=NUM TightVNC remote desktop server
After=syslog.target network.target
[Service]
User=USER
Type=forking
PIDFile=/home/USER/.vnc/%H:NUM.pid
ExecStartPre=-/usr/bin/vncserver -kill :NUM > /dev/null 2>&1
ExecStart=/usr/bin/vncserver :NUM -depth 16 -geometry 1600x800
ExecStop=/usr/bin/vncserver -kill :NUM
[Install]
WantedBy=multi-user.target
\ No newline at end of file
#!/bin/sh
xrdb "$HOME/.Xresources"
xsetroot -solid grey -cursor_name left_ptr
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
#/etc/X11/Xsession
/usr/bin/startlxde
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment