Skip to content

Commit

Permalink
Merge pull request #230 from WhitewaterFoundry/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
crramirez committed Mar 4, 2020
2 parents a41681d + 93f5527 commit f96263a
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 16 deletions.
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Vcs-Git: https://github.com/WhitewaterFoundry/pengwin-setup.git

Package: pengwin-setup
Architecture: all
Depends: ${misc:Depends}, git, wslu, pengwin-base (>= 0.1-175)
Depends: ${misc:Depends}, git, wslu, pengwin-base (>= 0.1-392)
Description: Setup tool for Pengwin.
Essential: yes
4 changes: 2 additions & 2 deletions pengwin-setup.d/gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function main() {
"SYNAPTIC" "Install the Synaptic package manager" off \
"VCXSRV" "Install the VcXsrv open source X-server" off \
"WINTHEME" "Install a Windows 10 theme along with the LXAppearance theme switcher " off \
"X410" "View a link to the X410 X-server on the Microsoft Store" off \
"X410" "Configure X410 to start on Pengwin launch or view a link to install it" off \
3>&1 1>&2 2>&3)

Expand All @@ -27,7 +27,7 @@ function main() {

if [[ ${menu_choice} == *"X410"* ]] ; then
echo "X410"
bash ${SetupDir}/x410.sh "$@"
bash ${SetupDir}/x410.sh "$@"
fi

if [[ ${menu_choice} == *"VCXSRV"* ]] ; then
Expand Down
8 changes: 4 additions & 4 deletions pengwin-setup.d/nodejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ if [[ ${menu_choice} == "N" ]]; then
sh -c "cat > $FISH_CONF" <<EOF
#!/bin/fish
set -x N_PREFIX $HOME/n
set -x N_PREFIX "\$HOME/n"
if not contains -- $N_PREFIX/bin $PATH
set PATH $N_PREFIX/bin $PATH
if not contains -- \$N_PREFIX/bin "\$PATH"
set PATH "\$N_PREFIX/bin:\$PATH"
end
EOF

Expand Down Expand Up @@ -166,7 +166,7 @@ EOF
#echo "Defaults secure_path=\"${SUDO_PATH}:${NVM_DIR}/bin\"" | sudo EDITOR='tee ' visudo --quiet --file=/etc/sudoers.d/npm-path

echo "Installing latest Node.js release"
nvm install "$(nvm ls-remote | tail -1 | sed -e 's|^\s||g')" --latest-npm
nvm install node --latest-npm

# Add npm to bash completion
npm completion | sudo tee /etc/bash_completion.d/npm
Expand Down
4 changes: 2 additions & 2 deletions pengwin-setup.d/pythonpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if (whiptail --title "PYTHON" --yesno "Would you like to download and install Py
if [ -d ${HOME}/.config/fish ]; then
echo "" >>${HOME}/.bashrc
echo "set -x PATH \"${HOME}/.pyenv/bin\" \$PATH" >>${HOME}/.config/fish/config.fish
echo 'status --is-interactive; and . (pyenv init -|psub)' >>${HOME}/.config/fish/config.fish
echo 'status --is-interactive; and . (pyenv virtualenv-init -|psub)' >>${HOME}/.config/fish/config.fish
echo 'status --is-interactive; and pyenv init -| source' >>${HOME}/.config/fish/config.fish
echo 'status --is-interactive; and pyenv virtualenv-init -| source' >>${HOME}/.config/fish/config.fish
fi

echo "installing Python 3.8"
Expand Down
6 changes: 5 additions & 1 deletion pengwin-setup.d/shortcut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ function create_shortcut_from_desktop() {
/usr/share/icons/hicolor/128x128/apps \
/usr/share/icons/hicolor/scalable/apps \
/usr/share/icons/hicolor/48x48/apps \
/usr/share/icons/breeze/apps/64 \
/usr/share/icons/Adwaita/48x48/apps \
/usr/share/icons/gnome/48x48/apps \
/usr/share/icons/Adwaita/512x512/places \
/usr/share/icons/Adwaita/256x256/devices \
${HOME}/.local/share/icons/hicolor/256x256/apps \
/usr/share/icons \
\
-maxdepth 1 -name "${value}*" -type f,l | head -n 1)
Expand Down Expand Up @@ -190,7 +193,8 @@ function main() {

filelistarray+=("$REPLY")

done < <(find /usr/share/applications -name '*.desktop' -print0)
done < <(find /usr/share/applications \
${HOME}/.local/share/applications -name '*.desktop' -print0)

#Be sure the executable is updated

Expand Down
6 changes: 6 additions & 0 deletions pengwin-setup.d/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function main() {
"VCXSRV" "Remove VcXsrv X-server" off \
"VSCODE" "Remove Visual Studio Code for Linux" off \
"WINTHEME" "Remove Windows 10 theme and LXAppearance" off \
"X410" "Remove the X410 X-server autostart" off \
3>&1 1>&2 2>&3)

Expand Down Expand Up @@ -216,6 +217,11 @@ function main() {
bash ${UninstallDir}/theme.sh "$@"
fi

if [[ ${menu_choice} == *"X410"* ]] ; then
echo "X410"
bash ${UninstallDir}/x410.sh "$@"
fi

}

main "$@"
2 changes: 1 addition & 1 deletion pengwin-setup.d/uninstall/vcxsrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
fi

echo "Removing PATH modifier..."
sudo_rem_file "/etc/profile.d/vcxsrv.sh"
sudo_rem_file "/etc/profile.d/02-vcxsrv.sh"

}

Expand Down
12 changes: 12 additions & 0 deletions pengwin-setup.d/uninstall/x410.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

source $(dirname "$0")/uninstall-common.sh

function main() {
echo "Removing PATH modifier..."
sudo_rem_file "/etc/profile.d/02-x410.sh"
}

if show_warning "x410" "$@" ; then
main "$@"
fi
2 changes: 1 addition & 1 deletion pengwin-setup.d/vcxsrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source $(dirname "$0")/common.sh "$@"

if (whiptail --title "VCXSRV" --yesno "Would you like to install the VcXsrv X-server? This will be installed to your Windows home directory under .vcxsrv" 8 80) then
echo "Installing VcXsrv"
VcxsrvUrl="https://sourceforge.net/projects/vcxsrv/files/vcxsrv/1.20.5.1/vcxsrv-64.1.20.5.1.installer.exe/download"
VcxsrvUrl="https://sourceforge.net/projects/vcxsrv/files/vcxsrv/1.20.6.0/vcxsrv-64.1.20.6.0.installer.exe/download"

echo "Installing required install dependencies"
sudo apt-get install -y -q wget unzip p7zip-full mesa-utils
Expand Down
27 changes: 23 additions & 4 deletions pengwin-setup.d/x410.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
#!/bin/bash

if (whiptail --title "X410" --yesno "Would you like to view a link to X410 (recommended) on the Microsoft Store?" 8 80) then
echo "Running $ wslview <link>"
wslview https://afflnk.microsoft.com/c/1291904/433017/7593?u=https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fp%2Fx410%2F9nlp712zmn9q%23activetab%3Dpivot%3Aoverviewtab
# check if x410 exists
if [ -x "$(command -v x410.exe)" ]; then
if (whiptail --title "X410" --yesno "It seems that X410 is already installed on your machine. Would you like to start it every time that Pengwin launchs?" 10 80) then
echo "Configuring X410 to start on Pengwin launch"
sudo bash -c 'cat > /etc/profile.d/02-x410.sh' << EOF
#!/bin/bash
if [ -n "${WSL2}" ]; then
(cmd-exe /c x410.exe /wm /public &> /dev/null &)
else
(cmd-exe /c x410.exe /wm &> /dev/null &)
fi
EOF
else
echo "Skipping X410"
fi
else
echo "Skipping X410"
if (whiptail --title "X410" --yesno "It seems that X410 is not installed on your machine. Would you like to view a link to X410 (recommended) on the Microsoft Store?" 10 80) then
echo "Running $ wslview <link>"
wslview https://afflnk.microsoft.com/c/1291904/433017/7593?u=https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fp%2Fx410%2F9nlp712zmn9q%23activetab%3Dpivot%3Aoverviewtab
else
echo "Skipping X410"
fi
fi

0 comments on commit f96263a

Please sign in to comment.