2024-07-16 18:33:38 +00:00
|
|
|
#!/usr/bin/env bash
|
2025-01-21 01:25:25 +00:00
|
|
|
# Export all variables
|
|
|
|
|
set -a
|
|
|
|
|
|
|
|
|
|
# Abort if an error is encountered
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# SSH config
|
|
|
|
|
if [ -f ~/.ssh/id_ed25519 ]
|
|
|
|
|
then
|
|
|
|
|
chmod 0600 ~/.ssh/id_ed25519
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Create base directories
|
2025-01-21 07:00:08 +00:00
|
|
|
for dir in ssh config/tigervnc config/i3 config/menus
|
2025-01-21 01:25:25 +00:00
|
|
|
do
|
|
|
|
|
[ -d ~/.${dir} ] || mkdir -p ~/.${dir}/
|
|
|
|
|
done
|
|
|
|
|
|
2024-07-16 18:33:38 +00:00
|
|
|
# Check for MYVNC_VNCPASS variable
|
|
|
|
|
if [ -z ${MYVNC_VNCPASS} ]
|
|
|
|
|
then
|
|
|
|
|
echo "MYVNC_VNCPASS env variable is missing"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Configure tigervnc auth
|
2025-01-21 01:25:25 +00:00
|
|
|
if [ ! -f ~/.config/tigervnc/passwd ]
|
2024-07-16 18:33:38 +00:00
|
|
|
then
|
2025-01-21 01:25:25 +00:00
|
|
|
echo "${MYVNC_VNCPASS}" | vncpasswd -f >~/.config/tigervnc/passwd
|
|
|
|
|
chmod 0600 ~/.config/tigervnc/passwd
|
2024-07-16 18:33:38 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Remove VNCPASS env
|
|
|
|
|
unset MYVNC_VNCPASS
|
|
|
|
|
|
|
|
|
|
# VNC xstartup
|
2025-01-21 01:25:25 +00:00
|
|
|
install /dev/stdin ~/.config/tigervnc/xstartup <<- xstartup
|
2024-07-16 18:33:38 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
unset SESSION_MANAGER
|
|
|
|
|
unset DBUS_SESSION_BUS_ADDRESS
|
|
|
|
|
exec ${STARTXBIN}
|
|
|
|
|
xstartup
|
|
|
|
|
|
|
|
|
|
# Turn vnc sharing on/off
|
|
|
|
|
if [[ ${MYVNC_VNCSHARING} == "true" ]] || [[ ${MYVNC_VNCSHARING} == "1" ]]
|
|
|
|
|
then
|
|
|
|
|
_MYVNC_VNCSHARING=alwaysshared
|
|
|
|
|
else
|
|
|
|
|
_MYVNC_VNCSHARING=nevershared
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# VNC config
|
2025-01-21 01:25:25 +00:00
|
|
|
cat >~/.config/tigervnc/config <<- vncconfig
|
2024-07-16 18:33:38 +00:00
|
|
|
session=i3
|
2025-01-21 01:25:25 +00:00
|
|
|
dpi=192
|
2024-07-16 18:33:38 +00:00
|
|
|
geometry=1920x1080
|
|
|
|
|
framerate=60
|
|
|
|
|
depth=32
|
|
|
|
|
${_MYVNC_VNCSHARING}
|
|
|
|
|
vncconfig
|
|
|
|
|
|
2025-01-21 06:55:33 +00:00
|
|
|
# Dolphin default apps fix
|
|
|
|
|
kbuildsycoca6
|
2025-01-21 01:25:25 +00:00
|
|
|
|
2025-01-21 01:53:17 +00:00
|
|
|
# i3 status
|
|
|
|
|
cat >~/.i3status.conf <<- 'i3status'
|
|
|
|
|
# i3status configuration file.
|
|
|
|
|
# see "man i3status" for documentation.
|
|
|
|
|
|
|
|
|
|
# It is important that this file is edited as UTF-8.
|
|
|
|
|
# The following line should contain a sharp s:
|
|
|
|
|
# ß
|
|
|
|
|
# If the above line is not correctly displayed, fix your editor first!
|
|
|
|
|
|
|
|
|
|
general {
|
|
|
|
|
colors = true
|
|
|
|
|
interval = 5
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
order += "tztime local"
|
|
|
|
|
|
|
|
|
|
tztime local {
|
|
|
|
|
format = "%Y-%m-%d %H:%M:%S"
|
|
|
|
|
}
|
|
|
|
|
i3status
|
|
|
|
|
|
2025-01-21 01:25:25 +00:00
|
|
|
# Launch Tigervnc
|
|
|
|
|
/usr/bin/dbus-launch vncserver :0
|