add many fixes based on precommit
0
apps/acrobat-x-pro/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
0
apps/adobe-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 329 B |
0
apps/aftereffects-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 917 B |
0
apps/audition-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 329 B |
0
apps/bridge-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
apps/bridge-cs6-x86/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
apps/bridge-cs6/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
apps/illustrator-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 682 B |
0
apps/indesign-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 811 B After Width: | Height: | Size: 812 B |
0
apps/lightroom-cc/icon.svg
Executable file → Normal file
Before Width: | Height: | Size: 627 B After Width: | Height: | Size: 628 B |
@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 587 B |
@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 587 B |
@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 587 B |
@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
<path d="M496 819q49 0 78 19t29 72q0 23-10 37t-27 24-36 12-38 4h-92V819h96zm1552-482v1374q0 33-24 57t-57 24h-175v41q0 36-25 61t-62 26H599q-36 0-61-25t-26-62v-297H85q-35 0-60-25t-25-60V597q0-35 25-60t60-25h427V215q0-36 25-61t62-26h1106q36 0 61 25t26 62v41h175q33 0 57 24t24 57zM767 905q0-58-19-99t-54-68-80-38-100-12H243v671h157v-234h106q49 0 95-14t84-42 59-69 23-95zm897 887v-256H640v256h1024zm0-384v-320h-640v320h640zm0-448V256H640v256h299q35 0 60 25t25 60v363h640zm256 704V384h-128v1280h128z" fill="#37C6D0" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 587 B |
142
bin/winapps
@ -1,75 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -f "${HOME}/.config/winapps/winapps.conf" ] && [ ! -f "${HOME}/.winapps" ]; then
|
||||
echo "You need to create a ~/.config/winapps/winapps.conf configuration. Exiting..."
|
||||
exit
|
||||
echo "You need to create a ~/.config/winapps/winapps.conf configuration. Exiting..."
|
||||
exit
|
||||
fi
|
||||
DIR="$(dirname "$(readlink -f "$0")")"
|
||||
RUN="$(date)-${RANDOM}"
|
||||
|
||||
if [ ! -d "${HOME}/.local/share/winapps" ]; then
|
||||
mkdir -p "${HOME}/.local/share/winapps"
|
||||
mkdir -p "${HOME}/.local/share/winapps"
|
||||
fi
|
||||
|
||||
RDP_SCALE=100
|
||||
|
||||
if [ -f "${HOME}/.config/winapps/winapps.conf" ]; then
|
||||
. "${HOME}/.config/winapps/winapps.conf"
|
||||
. "${HOME}/.config/winapps/winapps.conf"
|
||||
else
|
||||
. "${HOME}/.winapps"
|
||||
. "${HOME}/.winapps"
|
||||
fi
|
||||
|
||||
function dprint() {
|
||||
if [ "${DEBUG}" = "true" ]; then
|
||||
echo "[${RUN}] ${1}" >>"${HOME}/.local/share/winapps/winapps.log"
|
||||
fi
|
||||
if [ "${DEBUG}" = "true" ]; then
|
||||
echo "[${RUN}] ${1}" >>"${HOME}/.local/share/winapps/winapps.log"
|
||||
fi
|
||||
}
|
||||
|
||||
dprint "START"
|
||||
|
||||
if [ -f "${HOME}/.local/share/winapps/run" ]; then
|
||||
LAST_RAN=$(stat -t -c %Y "${HOME}/.local/share/winapps/run")
|
||||
dprint "LAST_RAN:${LAST_RAN}"
|
||||
touch "${HOME}/.local/share/winapps/run"
|
||||
THIS_RUN=$(stat -t -c %Y "${HOME}/.local/share/winapps/run")
|
||||
dprint "THIS_RUN:${THIS_RUN}"
|
||||
if ((THIS_RUN - LAST_RAN < 2)); then
|
||||
exit
|
||||
fi
|
||||
LAST_RAN=$(stat -t -c %Y "${HOME}/.local/share/winapps/run")
|
||||
dprint "LAST_RAN:${LAST_RAN}"
|
||||
touch "${HOME}/.local/share/winapps/run"
|
||||
THIS_RUN=$(stat -t -c %Y "${HOME}/.local/share/winapps/run")
|
||||
dprint "THIS_RUN:${THIS_RUN}"
|
||||
if ((THIS_RUN - LAST_RAN < 2)); then
|
||||
exit
|
||||
fi
|
||||
else
|
||||
touch "${HOME}/.local/share/winapps/run"
|
||||
touch "${HOME}/.local/share/winapps/run"
|
||||
fi
|
||||
|
||||
if [ -z "${FREERDP_COMMAND}" ]; then
|
||||
if command -v xfreerdp &> /dev/null
|
||||
then
|
||||
FREERDP_COMMAND="xfreerdp"
|
||||
elif command -v xfreerdp3 &> /dev/null
|
||||
then
|
||||
FREERDP_COMMAND="xfreerdp3"
|
||||
fi
|
||||
if command -v xfreerdp &> /dev/null
|
||||
then
|
||||
FREERDP_COMMAND="xfreerdp"
|
||||
elif command -v xfreerdp3 &> /dev/null
|
||||
then
|
||||
FREERDP_COMMAND="xfreerdp3"
|
||||
fi
|
||||
elif command -v $FREERDP_COMMAND &> /dev/null
|
||||
then
|
||||
dprint "Using custom freerdp command ${FREERDP_COMMAND}"
|
||||
dprint "Using custom freerdp command ${FREERDP_COMMAND}"
|
||||
else
|
||||
echo "You have supplied a custom FreeRDP command, but the command is not available."
|
||||
exit
|
||||
echo "You have supplied a custom FreeRDP command, but the command is not available."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "${RDP_IP}" ]; then
|
||||
if [ ! "$(groups | grep -v libvirt)" ]; then
|
||||
echo "You are not a member of the libvirt group. Run the below then reboot."
|
||||
echo ' sudo usermod -a -G libvirt $(whoami)'
|
||||
echo ' sudo usermod -a -G kvm $(whoami)'
|
||||
exit
|
||||
fi
|
||||
if [ ! "$(virsh list | grep -v RDPWindows)" ]; then
|
||||
echo "RDPWindows is not running, run:"
|
||||
echo " virsh start RDPWindows"
|
||||
exit
|
||||
fi
|
||||
RDP_IP=$(virsh net-dhcp-leases default | grep RDPWindows | awk '{print $5}')
|
||||
RDP_IP=${RDP_IP%%\/*}
|
||||
if [ ! "$(groups | grep -v libvirt)" ]; then
|
||||
echo "You are not a member of the libvirt group. Run the below then reboot."
|
||||
echo ' sudo usermod -a -G libvirt $(whoami)'
|
||||
echo ' sudo usermod -a -G kvm $(whoami)'
|
||||
exit
|
||||
fi
|
||||
if [ ! "$(virsh list | grep -v RDPWindows)" ]; then
|
||||
echo "RDPWindows is not running, run:"
|
||||
echo " virsh start RDPWindows"
|
||||
exit
|
||||
fi
|
||||
RDP_IP=$(virsh net-dhcp-leases default | grep RDPWindows | awk '{print $5}')
|
||||
RDP_IP=${RDP_IP%%\/*}
|
||||
|
||||
fi
|
||||
|
||||
@ -81,43 +81,43 @@ dprint "@:${@}"
|
||||
|
||||
MULTI_FLAG="+span"
|
||||
if [ "${MULTIMON}" = "true" ]; then
|
||||
MULTI_FLAG="/multimon"
|
||||
MULTI_FLAG="/multimon"
|
||||
fi
|
||||
|
||||
if [ "${1}" = "windows" ]; then
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +dynamic-resolution +auto-reconnect +home-drive /wm-class:"Microsoft Windows" /v:${RDP_IP} 1>/dev/null 2>&1 &
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +dynamic-resolution +auto-reconnect +home-drive /wm-class:"Microsoft Windows" /v:${RDP_IP} 1>/dev/null 2>&1 &
|
||||
elif [ "${1}" = "check" ]; then
|
||||
dprint "CHECK"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /app:program:"explorer.exe" /v:${RDP_IP}
|
||||
dprint "CHECK"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /app:program:"explorer.exe" /v:${RDP_IP}
|
||||
elif [ "${1}" = "manual" ]; then
|
||||
dprint "MANUAL:${2}"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +home-drive +dynamic-resolution ${MULTI_FLAG} /app:program:"${2}" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
dprint "MANUAL:${2}"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +home-drive +dynamic-resolution ${MULTI_FLAG} /app:program:"${2}" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
elif [ "${1}" != "install" ]; then
|
||||
dprint "DIR:${DIR}"
|
||||
if [ -e "${DIR}/../apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${DIR}/../apps/${1}/info"
|
||||
ICON="${DIR}/../apps/${1}/icon.svg"
|
||||
elif [ -e "${HOME}/.local/share/winapps/apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${HOME}/.local/share/winapps/apps/${1}/info"
|
||||
ICON="${HOME}/.local/share/winapps/apps/${1}/icon.svg"
|
||||
elif [ -e "/usr/local/share/winapps/apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "/usr/local/share/winapps/apps/${1}/info"
|
||||
ICON="/usr/local/share/winapps/apps/${1}/icon.svg"
|
||||
else
|
||||
echo "You need to run 'installer.sh' first."
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${2}" ]; then
|
||||
dprint "HOME:${HOME}"
|
||||
FILE=$(echo "${2}" | sed 's|'"${HOME}"'|\\\\tsclient\\home|;s|/|\\|g;s|\\|\\\\|g')
|
||||
dprint "FILE:${FILE}"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +clipboard +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:program:"${WIN_EXECUTABLE}",icon:"${ICON}",name:"${FULL_NAME}",cmd:"\"$FILE\"" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
else
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +clipboard +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:program:"${WIN_EXECUTABLE}",icon:"${ICON}",name:"${FULL_NAME}" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
fi
|
||||
dprint "DIR:${DIR}"
|
||||
if [ -e "${DIR}/../apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${DIR}/../apps/${1}/info"
|
||||
ICON="${DIR}/../apps/${1}/icon.svg"
|
||||
elif [ -e "${HOME}/.local/share/winapps/apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "${HOME}/.local/share/winapps/apps/${1}/info"
|
||||
ICON="${HOME}/.local/share/winapps/apps/${1}/icon.svg"
|
||||
elif [ -e "/usr/local/share/winapps/apps/${1}/info" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "/usr/local/share/winapps/apps/${1}/info"
|
||||
ICON="/usr/local/share/winapps/apps/${1}/icon.svg"
|
||||
else
|
||||
echo "You need to run 'installer.sh' first."
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${2}" ]; then
|
||||
dprint "HOME:${HOME}"
|
||||
FILE=$(echo "${2}" | sed 's|'"${HOME}"'|\\\\tsclient\\home|;s|/|\\|g;s|\\|\\\\|g')
|
||||
dprint "FILE:${FILE}"
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +clipboard +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:program:"${WIN_EXECUTABLE}",icon:"${ICON}",name:"${FULL_NAME}",cmd:"\"$FILE\"" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
else
|
||||
$FREERDP_COMMAND ${RDP_FLAGS} /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /scale:${RDP_SCALE} +auto-reconnect +clipboard +home-drive -wallpaper +dynamic-resolution ${MULTI_FLAG} /wm-class:"${FULL_NAME}" /app:program:"${WIN_EXECUTABLE}",icon:"${ICON}",name:"${FULL_NAME}" /v:"${RDP_IP}" 1>/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
|
||||
dprint "END"
|
||||
|
@ -198,6 +198,3 @@ sudo systemctl restart libvirtd
|
||||
sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
|
||||
```
|
||||
You will likely need to reboot to ensure your current shell is added to the group.
|
||||
|
||||
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048">
|
||||
<path d="M0 268l768-107v735H0V268zM1920 0v896H896V143L1920 0zM896 1024h1024v896L896 1777v-753zm-896 0h768v735L0 1652v-628z" fill="#73A1FB" />
|
||||
<path d="M0 268l768-107v735H0V268zM1920 0v896H896V143L1920 0zM896 1024h1024v896L896 1777v-753zm-896 0h768v735L0 1652v-628z" fill="#73A1FB" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 216 B |
@ -219,4 +219,3 @@ Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\*" |
|
||||
"EXES+=(""$Exe"")"
|
||||
"ICONS+=(""$Icon"")"
|
||||
}
|
||||
|
||||
|
1186
install/inquirer.sh
554
installer.sh
@ -2,8 +2,8 @@
|
||||
|
||||
if ! command -v bc &> /dev/null
|
||||
then
|
||||
echo "You need bc!"
|
||||
exit
|
||||
echo "You need bc!"
|
||||
exit
|
||||
fi
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
@ -16,80 +16,80 @@ USEDEMO=0
|
||||
INSTALLED_EXES=()
|
||||
|
||||
function waUsage() {
|
||||
echo 'Usage:
|
||||
echo 'Usage:
|
||||
./installer.sh --user # Install everything in ${HOME}
|
||||
./installer.sh --system # Install everything in /usr'
|
||||
exit
|
||||
exit
|
||||
}
|
||||
|
||||
function waNoSudo() {
|
||||
echo 'You are attempting to switch from a --system install to a --user install.
|
||||
Please run "./installer.sh --system --uninstall" first.'
|
||||
exit
|
||||
echo 'You are attempting to switch from a --system install to a --user install.
|
||||
Please run "./installer.sh --system --uninstall" first.'
|
||||
exit
|
||||
}
|
||||
|
||||
function waInstall() {
|
||||
${SUDO} mkdir -p "${SYS_PATH}/apps"
|
||||
. "${DIR}/bin/winapps" install
|
||||
${SUDO} mkdir -p "${SYS_PATH}/apps"
|
||||
. "${DIR}/bin/winapps" install
|
||||
}
|
||||
|
||||
function waFindInstalled() {
|
||||
echo -n " Checking for installed apps in RDP machine (this may take a while)..."
|
||||
if [ $USEDEMO != 1 ]; then
|
||||
rm -f ${HOME}/.local/share/winapps/installed.bat
|
||||
rm -f ${HOME}/.local/share/winapps/installed.tmp
|
||||
rm -f ${HOME}/.local/share/winapps/installed
|
||||
rm -f ${HOME}/.local/share/winapps/detected
|
||||
cp "${DIR}/install/ExtractPrograms.ps1" ${HOME}/.local/share/winapps/ExtractPrograms.ps1
|
||||
for F in $(ls "${DIR}/apps"); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${F} >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" >>${HOME}/.local/share/winapps/installed.bat
|
||||
done
|
||||
echo "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >>${HOME}/.local/share/winapps/installed.bat
|
||||
echo "RENAME \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp installed" >>${HOME}/.local/share/winapps/installed.bat
|
||||
$FREERDP_COMMAND /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" +auto-reconnect +home-drive -wallpaper +span /app:program:"C:\Windows\System32\cmd.exe",cmd:"/C \\\\tsclient\\home\\.local\\share\\winapps\\installed.bat" /v:${RDP_IP} 1>/dev/null 2>&1 &
|
||||
COUNT=0
|
||||
while [ ! -f "${HOME}/.local/share/winapps/installed" ]; do
|
||||
sleep 5
|
||||
COUNT=$((COUNT + 1))
|
||||
if ((COUNT == 15)); then
|
||||
echo " Finished."
|
||||
echo ""
|
||||
echo "The RDP connection failed to connect or run. Please confirm FreeRDP can connect with:"
|
||||
echo " bin/winapps check"
|
||||
echo ""
|
||||
echo "If it cannot connect, this is most likely due to:"
|
||||
echo " - You need to accept the security cert the first time you connect (with 'check')"
|
||||
echo " - Not enabling RDP in the Windows VM"
|
||||
echo " - Not being able to connect to the IP of the VM"
|
||||
echo " - Incorrect user credentials in winapps.conf"
|
||||
echo " - Not merging install/RDPApps.reg into the VM"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
if [ $MAKEDEMO = 1 ]; then
|
||||
rm -rf /tmp/winapps_demo
|
||||
cp -a ${HOME}/.local/share/winapps /tmp/winapps_demo
|
||||
exit
|
||||
fi
|
||||
else
|
||||
rm -rf ${HOME}/.local/share/winapps
|
||||
cp -a /tmp/winapps_demo ${HOME}/.local/share/winapps
|
||||
#sleep 3
|
||||
fi
|
||||
echo " Finished."
|
||||
echo -n " Checking for installed apps in RDP machine (this may take a while)..."
|
||||
if [ $USEDEMO != 1 ]; then
|
||||
rm -f ${HOME}/.local/share/winapps/installed.bat
|
||||
rm -f ${HOME}/.local/share/winapps/installed.tmp
|
||||
rm -f ${HOME}/.local/share/winapps/installed
|
||||
rm -f ${HOME}/.local/share/winapps/detected
|
||||
cp "${DIR}/install/ExtractPrograms.ps1" ${HOME}/.local/share/winapps/ExtractPrograms.ps1
|
||||
for F in $(ls "${DIR}/apps"); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${F} >> \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp" >>${HOME}/.local/share/winapps/installed.bat
|
||||
done
|
||||
echo "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >>${HOME}/.local/share/winapps/installed.bat
|
||||
echo "RENAME \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp installed" >>${HOME}/.local/share/winapps/installed.bat
|
||||
$FREERDP_COMMAND /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" +auto-reconnect +home-drive -wallpaper +span /app:program:"C:\Windows\System32\cmd.exe",cmd:"/C \\\\tsclient\\home\\.local\\share\\winapps\\installed.bat" /v:${RDP_IP} 1>/dev/null 2>&1 &
|
||||
COUNT=0
|
||||
while [ ! -f "${HOME}/.local/share/winapps/installed" ]; do
|
||||
sleep 5
|
||||
COUNT=$((COUNT + 1))
|
||||
if ((COUNT == 15)); then
|
||||
echo " Finished."
|
||||
echo ""
|
||||
echo "The RDP connection failed to connect or run. Please confirm FreeRDP can connect with:"
|
||||
echo " bin/winapps check"
|
||||
echo ""
|
||||
echo "If it cannot connect, this is most likely due to:"
|
||||
echo " - You need to accept the security cert the first time you connect (with 'check')"
|
||||
echo " - Not enabling RDP in the Windows VM"
|
||||
echo " - Not being able to connect to the IP of the VM"
|
||||
echo " - Incorrect user credentials in winapps.conf"
|
||||
echo " - Not merging install/RDPApps.reg into the VM"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
if [ $MAKEDEMO = 1 ]; then
|
||||
rm -rf /tmp/winapps_demo
|
||||
cp -a ${HOME}/.local/share/winapps /tmp/winapps_demo
|
||||
exit
|
||||
fi
|
||||
else
|
||||
rm -rf ${HOME}/.local/share/winapps
|
||||
cp -a /tmp/winapps_demo ${HOME}/.local/share/winapps
|
||||
#sleep 3
|
||||
fi
|
||||
echo " Finished."
|
||||
}
|
||||
|
||||
function waConfigureApp() {
|
||||
if [ -z "${ICON}" ]; then
|
||||
ICON=${SYS_PATH}/apps/${1}/icon.${2}
|
||||
fi
|
||||
if [ -z "${ICON}" ]; then
|
||||
ICON=${SYS_PATH}/apps/${1}/icon.${2}
|
||||
fi
|
||||
|
||||
. "${SYS_PATH}/apps/${1}/info"
|
||||
echo -n " Configuring ${NAME}..."
|
||||
if [ ${USEDEMO} != 1 ]; then
|
||||
${SUDO} rm -f "${APP_PATH}/${1}.desktop"
|
||||
echo "[Desktop Entry]
|
||||
. "${SYS_PATH}/apps/${1}/info"
|
||||
echo -n " Configuring ${NAME}..."
|
||||
if [ ${USEDEMO} != 1 ]; then
|
||||
${SUDO} rm -f "${APP_PATH}/${1}.desktop"
|
||||
echo "[Desktop Entry]
|
||||
Name=${NAME}
|
||||
Exec=${BIN_PATH}/winapps ${1} %F
|
||||
Terminal=false
|
||||
@ -99,119 +99,119 @@ StartupWMClass=${FULL_NAME}
|
||||
Comment=${FULL_NAME}
|
||||
Categories=${CATEGORIES}
|
||||
MimeType=${MIME_TYPES}
|
||||
" | ${SUDO} tee "${APP_PATH}/${1}.desktop" >/dev/null
|
||||
${SUDO} rm -f "${BIN_PATH}/${1}"
|
||||
echo "#!/usr/bin/env bash
|
||||
" | ${SUDO} tee "${APP_PATH}/${1}.desktop" >/dev/null
|
||||
${SUDO} rm -f "${BIN_PATH}/${1}"
|
||||
echo "#!/usr/bin/env bash
|
||||
${BIN_PATH}/winapps ${1} $@
|
||||
" | ${SUDO} tee "${BIN_PATH}/${1}" >/dev/null
|
||||
${SUDO} chmod a+x "${BIN_PATH}/${1}"
|
||||
fi
|
||||
echo " Finished."
|
||||
" | ${SUDO} tee "${BIN_PATH}/${1}" >/dev/null
|
||||
${SUDO} chmod a+x "${BIN_PATH}/${1}"
|
||||
fi
|
||||
echo " Finished."
|
||||
|
||||
ICON=""
|
||||
ICON=""
|
||||
}
|
||||
|
||||
function waConfigureApps() {
|
||||
APPS=()
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
APPS+=("${FULL_NAME} (${F})")
|
||||
INSTALLED_EXES+=("$(echo "${WIN_EXECUTABLE##*\\}" | tr '[:upper:]' '[:lower:]')")
|
||||
done
|
||||
IFS=$'\n' APPS=($(sort <<<"${APPS[*]}"))
|
||||
unset IFS
|
||||
OPTIONS=("Set up all detected pre-configured applications" "Select which pre-configured applications to set up" "Do not set up any pre-configured applications")
|
||||
APPS=()
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
APPS+=("${FULL_NAME} (${F})")
|
||||
INSTALLED_EXES+=("$(echo "${WIN_EXECUTABLE##*\\}" | tr '[:upper:]' '[:lower:]')")
|
||||
done
|
||||
IFS=$'\n' APPS=($(sort <<<"${APPS[*]}"))
|
||||
unset IFS
|
||||
OPTIONS=("Set up all detected pre-configured applications" "Select which pre-configured applications to set up" "Do not set up any pre-configured applications")
|
||||
|
||||
if [ "${INSTALL_TYPE}" != 'User' ]; then
|
||||
menuFromArr APP_INSTALL "How would you like to handle WinApps pre-configured applications?" "${OPTIONS[@]}"
|
||||
else "grep -l -d skip"
|
||||
menuFromArr APP_INSTALL "How would you like to handle WinApps pre-configured applications? If any web browser is set-up, may be configured as default browser." "${OPTIONS[@]}"
|
||||
fi
|
||||
if [ "${APP_INSTALL}" = "Select which pre-configured applications to set up" ]; then
|
||||
checkbox_input "Which pre-configured apps would you like to set up?" APPS SELECTED_APPS
|
||||
echo "" >"${HOME}/.local/share/winapps/installed"
|
||||
for F in "${SELECTED_APPS[@]}"; do
|
||||
APP="${F##*(}"
|
||||
APP="${APP%%)}"
|
||||
echo "${APP}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
fi
|
||||
${SUDO} cp "${DIR}/bin/winapps" "${BIN_PATH}/winapps"
|
||||
COUNT=0
|
||||
if [ "${APP_INSTALL}" != "Do not set up any pre-configured applications" ]; then
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
COUNT=$((COUNT + 1))
|
||||
${SUDO} cp -r "apps/${F}" "${SYS_PATH}/apps"
|
||||
waConfigureApp "${F}" svg
|
||||
done
|
||||
fi
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
if [ "${INSTALL_TYPE}" != 'User' ]; then
|
||||
menuFromArr APP_INSTALL "How would you like to handle WinApps pre-configured applications?" "${OPTIONS[@]}"
|
||||
else "grep -l -d skip"
|
||||
menuFromArr APP_INSTALL "How would you like to handle WinApps pre-configured applications? If any web browser is set-up, may be configured as default browser." "${OPTIONS[@]}"
|
||||
fi
|
||||
if [ "${APP_INSTALL}" = "Select which pre-configured applications to set up" ]; then
|
||||
checkbox_input "Which pre-configured apps would you like to set up?" APPS SELECTED_APPS
|
||||
echo "" >"${HOME}/.local/share/winapps/installed"
|
||||
for F in "${SELECTED_APPS[@]}"; do
|
||||
APP="${F##*(}"
|
||||
APP="${APP%%)}"
|
||||
echo "${APP}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
fi
|
||||
${SUDO} cp "${DIR}/bin/winapps" "${BIN_PATH}/winapps"
|
||||
COUNT=0
|
||||
if [ "${APP_INSTALL}" != "Do not set up any pre-configured applications" ]; then
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
COUNT=$((COUNT + 1))
|
||||
${SUDO} cp -r "apps/${F}" "${SYS_PATH}/apps"
|
||||
waConfigureApp "${F}" svg
|
||||
done
|
||||
fi
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
}
|
||||
|
||||
function waConfigureAppsAllOfficiallySupported(){
|
||||
${SUDO} cp "${DIR}/bin/winapps" "${BIN_PATH}/winapps"
|
||||
COUNT=0
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
COUNT=$((COUNT + 1))
|
||||
${SUDO} cp -r "apps/${F}" "${SYS_PATH}/apps"
|
||||
waConfigureApp "${F}" svg
|
||||
done
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
${SUDO} cp "${DIR}/bin/winapps" "${BIN_PATH}/winapps"
|
||||
COUNT=0
|
||||
for F in $(cat "${HOME}/.local/share/winapps/installed" | sed 's/\r/\n/g'); do
|
||||
COUNT=$((COUNT + 1))
|
||||
${SUDO} cp -r "apps/${F}" "${SYS_PATH}/apps"
|
||||
waConfigureApp "${F}" svg
|
||||
done
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
}
|
||||
|
||||
function waConfigureDetectedApps() {
|
||||
if [ -f "${HOME}/.local/share/winapps/detected" ]; then
|
||||
sed -i 's/\r//g' "${HOME}/.local/share/winapps/detected"
|
||||
. "${HOME}/.local/share/winapps/detected"
|
||||
APPS=()
|
||||
for I in "${!NAMES[@]}"; do
|
||||
EXE=${EXES[$I]##*\\}
|
||||
EXE_LOWER=$(echo "${EXE}" | tr '[:upper:]' '[:lower:]')
|
||||
if (
|
||||
dlm=$'\x1F'
|
||||
IFS="$dlm"
|
||||
[[ "$dlm${INSTALLED_EXES[*]}$dlm" != *"$dlm${EXE_LOWER}$dlm"* ]]
|
||||
); then
|
||||
APPS+=("${NAMES[$I]} (${EXE})")
|
||||
fi
|
||||
done
|
||||
IFS=$'\n' APPS=($(sort <<<"${APPS[*]}"))
|
||||
unset IFS
|
||||
OPTIONS=("Set up all detected applications" "Select which applications to set up" "Do not set up any applications")
|
||||
menuFromArr APP_INSTALL "How would you like to handle other detected applications?" "${OPTIONS[@]}"
|
||||
if [ "${APP_INSTALL}" = "Select which applications to set up" ]; then
|
||||
checkbox_input "Which other apps would you like to set up?" APPS SELECTED_APPS
|
||||
echo "" >"${HOME}/.local/share/winapps/installed"
|
||||
for F in "${SELECTED_APPS[@]}"; do
|
||||
EXE="${F##*(}"
|
||||
EXE="${EXE%%)}"
|
||||
APP="${F% (*}"
|
||||
echo "${EXE}|${APP}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
elif [ "${APP_INSTALL}" = "Set up all detected applications" ]; then
|
||||
for I in "${!EXES[@]}"; do
|
||||
EXE=${EXES[$I]##*\\}
|
||||
echo "${EXE}|${NAMES[$I]}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
fi
|
||||
COUNT=0
|
||||
if [ -f "${HOME}/.local/share/winapps/installed" ]; then
|
||||
while read LINE; do
|
||||
EXE="${LINE%|*}"
|
||||
NAME="${LINE#*|}"
|
||||
for I in "${!NAMES[@]}"; do
|
||||
if [ "${NAME}" = "${NAMES[$I]}" ] && [[ "${EXES[$I]}" == *"\\${EXE}" ]]; then
|
||||
EXE=$(echo "${EXE}" | tr '[:upper:]' '[:lower:]')
|
||||
${SUDO} mkdir -p "${SYS_PATH}/apps/${EXE}"
|
||||
echo "# GNOME shortcut name
|
||||
if [ -f "${HOME}/.local/share/winapps/detected" ]; then
|
||||
sed -i 's/\r//g' "${HOME}/.local/share/winapps/detected"
|
||||
. "${HOME}/.local/share/winapps/detected"
|
||||
APPS=()
|
||||
for I in "${!NAMES[@]}"; do
|
||||
EXE=${EXES[$I]##*\\}
|
||||
EXE_LOWER=$(echo "${EXE}" | tr '[:upper:]' '[:lower:]')
|
||||
if (
|
||||
dlm=$'\x1F'
|
||||
IFS="$dlm"
|
||||
[[ "$dlm${INSTALLED_EXES[*]}$dlm" != *"$dlm${EXE_LOWER}$dlm"* ]]
|
||||
); then
|
||||
APPS+=("${NAMES[$I]} (${EXE})")
|
||||
fi
|
||||
done
|
||||
IFS=$'\n' APPS=($(sort <<<"${APPS[*]}"))
|
||||
unset IFS
|
||||
OPTIONS=("Set up all detected applications" "Select which applications to set up" "Do not set up any applications")
|
||||
menuFromArr APP_INSTALL "How would you like to handle other detected applications?" "${OPTIONS[@]}"
|
||||
if [ "${APP_INSTALL}" = "Select which applications to set up" ]; then
|
||||
checkbox_input "Which other apps would you like to set up?" APPS SELECTED_APPS
|
||||
echo "" >"${HOME}/.local/share/winapps/installed"
|
||||
for F in "${SELECTED_APPS[@]}"; do
|
||||
EXE="${F##*(}"
|
||||
EXE="${EXE%%)}"
|
||||
APP="${F% (*}"
|
||||
echo "${EXE}|${APP}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
elif [ "${APP_INSTALL}" = "Set up all detected applications" ]; then
|
||||
for I in "${!EXES[@]}"; do
|
||||
EXE=${EXES[$I]##*\\}
|
||||
echo "${EXE}|${NAMES[$I]}" >>"${HOME}/.local/share/winapps/installed"
|
||||
done
|
||||
fi
|
||||
COUNT=0
|
||||
if [ -f "${HOME}/.local/share/winapps/installed" ]; then
|
||||
while read LINE; do
|
||||
EXE="${LINE%|*}"
|
||||
NAME="${LINE#*|}"
|
||||
for I in "${!NAMES[@]}"; do
|
||||
if [ "${NAME}" = "${NAMES[$I]}" ] && [[ "${EXES[$I]}" == *"\\${EXE}" ]]; then
|
||||
EXE=$(echo "${EXE}" | tr '[:upper:]' '[:lower:]')
|
||||
${SUDO} mkdir -p "${SYS_PATH}/apps/${EXE}"
|
||||
echo "# GNOME shortcut name
|
||||
NAME=\"${NAME}\"
|
||||
|
||||
# Used for descriptions and window class
|
||||
@ -225,29 +225,29 @@ CATEGORIES=\"WinApps\"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES=\"\"
|
||||
" | sudo tee "${SYS_PATH}/apps/${EXE}/info" >/dev/null
|
||||
echo "${ICONS[$I]}" | base64 -d | sudo tee "${SYS_PATH}/apps/${EXE}/icon.ico" >/dev/null
|
||||
waConfigureApp "${EXE}" ico
|
||||
COUNT=$((COUNT + 1))
|
||||
fi
|
||||
done
|
||||
done <"${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
fi
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
fi
|
||||
" | sudo tee "${SYS_PATH}/apps/${EXE}/info" >/dev/null
|
||||
echo "${ICONS[$I]}" | base64 -d | sudo tee "${SYS_PATH}/apps/${EXE}/icon.ico" >/dev/null
|
||||
waConfigureApp "${EXE}" ico
|
||||
COUNT=$((COUNT + 1))
|
||||
fi
|
||||
done
|
||||
done <"${HOME}/.local/share/winapps/installed"
|
||||
rm -f "${HOME}/.local/share/winapps/installed"
|
||||
fi
|
||||
rm -f "${HOME}/.local/share/winapps/installed.bat"
|
||||
if (($COUNT == 0)); then
|
||||
echo " No configured applications."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function waConfigureWindows() {
|
||||
echo -n " Configuring Windows..."
|
||||
if [ ${USEDEMO} != 1 ]; then
|
||||
${SUDO} rm -f "${APP_PATH}/windows.desktop"
|
||||
${SUDO} mkdir -p "${SYS_PATH}/icons"
|
||||
${SUDO} cp "${DIR}/icons/windows.svg" "${SYS_PATH}/icons/windows.svg"
|
||||
echo "[Desktop Entry]
|
||||
echo -n " Configuring Windows..."
|
||||
if [ ${USEDEMO} != 1 ]; then
|
||||
${SUDO} rm -f "${APP_PATH}/windows.desktop"
|
||||
${SUDO} mkdir -p "${SYS_PATH}/icons"
|
||||
${SUDO} cp "${DIR}/icons/windows.svg" "${SYS_PATH}/icons/windows.svg"
|
||||
echo "[Desktop Entry]
|
||||
Name=Windows
|
||||
Exec=${BIN_PATH}/winapps windows %F
|
||||
Terminal=false
|
||||
@ -255,119 +255,119 @@ Type=Application
|
||||
Icon=${SYS_PATH}/icons/windows.svg
|
||||
StartupWMClass=Microsoft Windows
|
||||
Comment=Microsoft Windows
|
||||
" | ${SUDO} tee "${APP_PATH}/windows.desktop" >/dev/null
|
||||
${SUDO} rm -f "${BIN_PATH}/windows"
|
||||
echo "#!/usr/bin/env bash
|
||||
" | ${SUDO} tee "${APP_PATH}/windows.desktop" >/dev/null
|
||||
${SUDO} rm -f "${BIN_PATH}/windows"
|
||||
echo "#!/usr/bin/env bash
|
||||
${BIN_PATH}/winapps windows
|
||||
" | ${SUDO} tee "/${BIN_PATH}/windows" >/dev/null
|
||||
${SUDO} chmod a+x "${BIN_PATH}/windows"
|
||||
fi
|
||||
echo " Finished."
|
||||
" | ${SUDO} tee "/${BIN_PATH}/windows" >/dev/null
|
||||
${SUDO} chmod a+x "${BIN_PATH}/windows"
|
||||
fi
|
||||
echo " Finished."
|
||||
}
|
||||
|
||||
function waUninstallUser() {
|
||||
rm -f "${HOME}/.local/bin/winapps"
|
||||
rm -rf "${HOME}/.local/share/winapps"
|
||||
for F in $(grep -l -d skip "bin/winapps" "${HOME}/.local/share/applications/"* -s); do
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
for F in $(grep -l -d skip "bin/winapps" "${HOME}/.local/bin/"* -s); do
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
rm -f "${HOME}/.local/bin/winapps"
|
||||
rm -rf "${HOME}/.local/share/winapps"
|
||||
for F in $(grep -l -d skip "bin/winapps" "${HOME}/.local/share/applications/"* -s); do
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
for F in $(grep -l -d skip "bin/winapps" "${HOME}/.local/bin/"* -s); do
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
}
|
||||
|
||||
function waUninstallSystem() {
|
||||
${SUDO} rm -f "/usr/local/bin/winapps"
|
||||
${SUDO} rm -rf "/usr/local/share/winapps"
|
||||
for F in $(grep -l -d skip "bin/winapps" "/usr/share/applications/"* -s); do
|
||||
if [ -z "${SUDO}" ]; then
|
||||
waNoSudo
|
||||
fi
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
for F in $(grep -l -d skip "bin/winapps" "/usr/local/bin/"* -s); do
|
||||
if [ -z "${SUDO}" ]; then
|
||||
waNoSudo
|
||||
fi
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
${SUDO} rm -f "/usr/local/bin/winapps"
|
||||
${SUDO} rm -rf "/usr/local/share/winapps"
|
||||
for F in $(grep -l -d skip "bin/winapps" "/usr/share/applications/"* -s); do
|
||||
if [ -z "${SUDO}" ]; then
|
||||
waNoSudo
|
||||
fi
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
for F in $(grep -l -d skip "bin/winapps" "/usr/local/bin/"* -s); do
|
||||
if [ -z "${SUDO}" ]; then
|
||||
waNoSudo
|
||||
fi
|
||||
echo -n " Removing ${F}..."
|
||||
${SUDO} rm ${F}
|
||||
echo " Finished."
|
||||
done
|
||||
}
|
||||
|
||||
if [ -z "${1}" ]; then
|
||||
OPTIONS=(User System)
|
||||
menuFromArr INSTALL_TYPE "Would you like to install for the current user or the whole system?" "${OPTIONS[@]}"
|
||||
OPTIONS=(User System)
|
||||
menuFromArr INSTALL_TYPE "Would you like to install for the current user or the whole system?" "${OPTIONS[@]}"
|
||||
elif [ "${1}" = '--user' ]; then
|
||||
INSTALL_TYPE='User'
|
||||
INSTALL_TYPE='User'
|
||||
elif [ "${1}" = '--system' ]; then
|
||||
INSTALL_TYPE='System'
|
||||
INSTALL_TYPE='System'
|
||||
else
|
||||
waUsage
|
||||
waUsage
|
||||
fi
|
||||
|
||||
if [ "${INSTALL_TYPE}" = 'User' ]; then
|
||||
SUDO=""
|
||||
BIN_PATH="${HOME}/.local/bin"
|
||||
APP_PATH="${HOME}/.local/share/applications"
|
||||
SYS_PATH="${HOME}/.local/share/winapps"
|
||||
mkdir -p $BIN_PATH
|
||||
mkdir -p $APP_PATH
|
||||
mkdir -p $SYS_PATH
|
||||
if [ -n "${2}" ]; then
|
||||
if [ "${2}" = '--uninstall' ]; then
|
||||
# Uninstall
|
||||
echo "Uninstalling..."
|
||||
waUninstallUser
|
||||
exit
|
||||
elif [ "${2}" = '--setupAllOfficiallySupportedApps' ]; then
|
||||
echo "Setting up All Officially Supported Apps "
|
||||
echo "Removing any old configurations..."
|
||||
waUninstallUser
|
||||
waUninstallSystem
|
||||
waInstall
|
||||
waFindInstalled
|
||||
waConfigureWindows
|
||||
waConfigureAppsAllOfficiallySupported
|
||||
exit
|
||||
else
|
||||
usage
|
||||
fi
|
||||
fi
|
||||
SUDO=""
|
||||
BIN_PATH="${HOME}/.local/bin"
|
||||
APP_PATH="${HOME}/.local/share/applications"
|
||||
SYS_PATH="${HOME}/.local/share/winapps"
|
||||
mkdir -p $BIN_PATH
|
||||
mkdir -p $APP_PATH
|
||||
mkdir -p $SYS_PATH
|
||||
if [ -n "${2}" ]; then
|
||||
if [ "${2}" = '--uninstall' ]; then
|
||||
# Uninstall
|
||||
echo "Uninstalling..."
|
||||
waUninstallUser
|
||||
exit
|
||||
elif [ "${2}" = '--setupAllOfficiallySupportedApps' ]; then
|
||||
echo "Setting up All Officially Supported Apps "
|
||||
echo "Removing any old configurations..."
|
||||
waUninstallUser
|
||||
waUninstallSystem
|
||||
waInstall
|
||||
waFindInstalled
|
||||
waConfigureWindows
|
||||
waConfigureAppsAllOfficiallySupported
|
||||
exit
|
||||
else
|
||||
usage
|
||||
fi
|
||||
fi
|
||||
elif [ "${INSTALL_TYPE}" = 'System' ]; then
|
||||
SUDO="sudo"
|
||||
sudo ls >/dev/null
|
||||
BIN_PATH="/usr/local/bin"
|
||||
APP_PATH="/usr/share/applications"
|
||||
SYS_PATH="/usr/local/share/winapps"
|
||||
if [ -n "${2}" ]; then
|
||||
if [ "${2}" = '--uninstall' ]; then
|
||||
# Uninstall
|
||||
echo "Uninstalling..."
|
||||
waUninstallSystem
|
||||
exit
|
||||
elif [ "${2}" = '--setupAllOfficiallySupportedApps' ]; then
|
||||
echo "Setting up All Officially Supported Apps "
|
||||
echo "Removing any old configurations..."
|
||||
waUninstallUser
|
||||
waUninstallSystem
|
||||
SUDO="sudo"
|
||||
sudo ls >/dev/null
|
||||
BIN_PATH="/usr/local/bin"
|
||||
APP_PATH="/usr/share/applications"
|
||||
SYS_PATH="/usr/local/share/winapps"
|
||||
if [ -n "${2}" ]; then
|
||||
if [ "${2}" = '--uninstall' ]; then
|
||||
# Uninstall
|
||||
echo "Uninstalling..."
|
||||
waUninstallSystem
|
||||
exit
|
||||
elif [ "${2}" = '--setupAllOfficiallySupportedApps' ]; then
|
||||
echo "Setting up All Officially Supported Apps "
|
||||
echo "Removing any old configurations..."
|
||||
waUninstallUser
|
||||
waUninstallSystem
|
||||
|
||||
echo "Installing..."
|
||||
waInstall
|
||||
waFindInstalled
|
||||
waConfigureWindows
|
||||
waConfigureAppsAllOfficiallySupported
|
||||
exit
|
||||
else
|
||||
usage
|
||||
fi
|
||||
fi
|
||||
echo "Installing..."
|
||||
waInstall
|
||||
waFindInstalled
|
||||
waConfigureWindows
|
||||
waConfigureAppsAllOfficiallySupported
|
||||
exit
|
||||
else
|
||||
usage
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Removing any old configurations..."
|
||||
|
@ -208,4 +208,3 @@
|
||||
<imagelabel>+385601105:+385600513</imagelabel>
|
||||
</seclabel>
|
||||
</domain>
|
||||
|
||||
|