Skip to content

Commit

Permalink
Various fixes and adjustments for remote ssh clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Aug 26, 2024
1 parent 7784108 commit 8102a73
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
8 changes: 7 additions & 1 deletion config/ssh/config
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ Host maxocull.com
HostName maxocull.com
User entourage
IdentityFile ~/.ssh/id_rsa
ForwardX11 yes
ForwardX11Trusted yes

Host leviathan
HostName 192.168.1.72
HostName 192.168.1.11
#ProxyJump maxocull.com
User max
IdentityFile ~/.ssh/id_rsa
ForwardX11 yes
ForwardX11Trusted yes

Host rb3011
HostName 192.168.1.1
Expand All @@ -38,3 +42,5 @@ host libreelec
HostName 192.168.1.30
User root
IdentityFile ~/.ssh/id_rsa
ForwardX11 yes
ForwardX11Trusted yes
47 changes: 45 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ link_source "config/fontconfig/" 0 ".config/fontconfig"
link_source "config/pcmanfm/" 1 ".config/pcmanfm"
link_source "config/xmrig.json" 1 ".config/xmrig.json"
link_source "config/redrum.ini" 1 ".config/redrum.ini"
link_source "config/mimeapps.list" 1 ".config/mimeapps.list"
link_source "config/mimeapps.list" 1 ".local/share/applications/mimeapps.list"
link_source "config/btop/" 1 ".config/btop"
link_source "config/Kvantum/" 1 ".config/Kvantum"

mkdir -p "${HOME}/.local/share/applications/"
link_source "config/mimeapps.list" 1 ".config/mimeapps.list"
link_source "config/mimeapps.list" 1 ".local/share/applications/mimeapps.list"

mkdir -p "${HOME}/.config/variety"
link_source "config/variety/variety.conf" 1 ".config/variety/variety.conf"

Expand Down Expand Up @@ -383,6 +385,9 @@ case "$response" in
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein-installer.vim/master/installer.sh)" -- "${HOME}/.cache/dein" --use-neovim-config
fi

# Forcibly fix permissions on the GnuPG directory
chmod u+rwx,go-rwx "${HOME}/.gnupg"

# Pull GPG keys for [email protected]
gpg --receive-keys 9AC8DC8D17BA0401CBD0F4E16077844530A4A68E

Expand Down Expand Up @@ -1220,6 +1225,44 @@ case "$response" in
;;
esac

read -r -p "Would you like to remotely share the clipboard over SSH on this system? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
# install xvfb, xauth, xsel for all systems
if [[ -x "$(command -v dnf)" ]]; then
sudo dnf install -y \
xorg-x11-server-Xvfb \
xorg-x11-xauth \
xsel
elif [[ -x "$(command -v apt)" ]]; then
sudo apt install -y \
xauth \
xvfb \
xsel
elif [[ -x "$(command -v pacman)" ]]; then
sudo pacman -Syu --needed "$AUTOMATED_PACMAN_FLAGS" \
xorg-xauth \
xorg-server-xvfb \
xsel
elif [[ -x "$(command -v pkg)" ]]; then
sudo pkg install \
xauth \
xorg-vfbserver \
xsel
fi

# ensure that X11Forwarding yes is set in /etc/ssh/sshd_config
if grep -q '^X11Forwarding no' /etc/ssh/sshd_config; then
sudo sed -i 's/^X11Forwarding no/X11Forwarding yes/' /etc/ssh/sshd_config
else
sudo echo "X11Forwarding yes" | sudo tee -a "/etc/ssh/sshd_config"
fi
;;
*)
echo "Skipping remote clipboard setup"
;;
esac

read -r -p "Would you like to setup system permissions? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
Expand Down

0 comments on commit 8102a73

Please sign in to comment.