Compare commits

...

11 Commits

Author SHA1 Message Date
shvedes 89e116eb37 discontinued 2025-07-30 20:01:07 +02:00
shvedes 3a285712dc README.md update 2025-05-25 14:48:21 +02:00
shvedes 4854dad81e use $0 instead of hardcoded help menu 2025-05-25 13:17:50 +02:00
shvedes a365571566 do not verbose rm command 2025-05-25 13:15:45 +02:00
shvedes 03aa300dbf use wine instead of wine64 2025-05-25 12:54:21 +02:00
shved. bc7d519ac4 Merge pull request #10 from 0x01422/main
Update photoshop.sh
2025-05-24 16:20:39 +02:00
0x01 465419dc07 Update photoshop.sh
Changed "validade" to "validate"
Made relative paths available and also tried $pwd for verification, since that works for me.
2025-05-24 04:49:17 +00:00
shvedes 55e2743cdc comment update 2025-05-02 20:02:58 +02:00
shvedes 491f36732c new dependency, refer to https://github.com/shvedes/photoshop-linux/issues/8 2025-03-06 14:51:02 +01:00
shvedes 7754253619 added: little fix 2025-02-24 19:05:09 +01:00
shvedes 76dc948390 added: uninstall function 2025-02-24 12:33:44 +01:00
2 changed files with 71 additions and 51 deletions
+14 -17
View File
@@ -1,12 +1,20 @@
# Adobe Photoshop CC 2021 on Linux
## Discontinued
This project is no longer supported because I have lost the desire to maintain it. I remind you that this is not a standalone project, but a wrapper of [this](https://github.com/LinSoftWin/Photoshop-CC2022-Linux) repository, which in turn is maintained and actively updated. If you were a user of my project, please take a look at the work of [LinSoftWin](https://github.com/LinSoftWin).
## Disclaimer
By providing this software, I do not give any guarantees of its work. This script was inspired by the work of [LinSoftWin](https://github.com/LinSoftWin/Photoshop-CC2022-Linux). This is only its adaptation. This script will be maintained and developed until I get bored and/or have free time. PR is welcome.
Please note that this code is a piece of garbage. Although it works in most cases, I do not guarantee that it will work completely. Please read the source before using it.
## Showcase
![image](https://github.com/user-attachments/assets/5f4edc77-a67e-49c5-8332-b436f1d6134d)
![install](https://github.com/user-attachments/assets/3a4fb514-360e-4e10-a7a6-793d70b7ca91)
![delete](https://github.com/user-attachments/assets/0308a1e3-8e9d-4fb0-b7f1-409d7e961891)
### What works
@@ -16,7 +24,7 @@ By providing this software, I do not give any guarantees of its work. This scrip
- GPU acceleration (no warranty to work)
**Tested on:**
- Arch Linux / CachyOS
- Arch Linux / CachyOS / NixOS / Linux Mint
- KDE Plasma 6.2 (Wayland) / Hyprland
- wine 9.19+ / wine-staging 9.20+ / ~~wine-cachyos 9.20+~~ window freezes
- AMD GPU
@@ -35,22 +43,11 @@ By providing this software, I do not give any guarantees of its work. This scrip
```bash
./photoshop.sh
Usage: ./install.sh [options...] <path>
-a Use already existing Photoshop.tar.xz
-i Install Photoshop
-h Show this help
-a Use already existing Photoshop.tar.xz
-i Install Photoshop
-u <install path> Uninstall Photoshop
-h Show this help
```
## To Do
- [x] Properly implement loging
- [ ] Multi distro dependencies installer (for now only Arch Linux and CachyOS supported)
- [x] Create universal functions for repetitive actions
- [x] Implement colored logging in a different way, making the code more readable
- [ ] Allow the user to use a different source to download Photoshop
- [ ] Allow the user to skip checksum verification of downloaded files
- [ ] Uninstall script
- [x] More checks in the install script
- [x] Ability for the user to select a default installation folder
## Support
Just follow me on GitHub :)
+57 -34
View File
@@ -28,7 +28,7 @@ RESET="\e[0m" # Reset colors
LOG="${BLUE}[LOG]${RESET}"
WARNING="${YELLOW}[WARNING]${RESET}"
ERORR="${RED}[ERROR]${RESET}"
ERROR="${RED}[ERROR]${RESET}"
SUCCES="${GREEN}[SUCCES]${RESET}"
CHECK="${GREEN}[CHECK]${RESET}"
@@ -60,10 +60,10 @@ on_interrupt() {
if [ -d "$INSTALL_PATH" ]; then
if ask_user "Do you want to ${RED}delete${RESET} a newly created folder?"; then
if rm -rfv "${INSTALL_PATH:?}" 2>>./install_log.log; then
if rm -rfv "${INSTALL_PATH:?}" &>>./install_log.log; then
exit 0
else
echo -e "$ERORR The last command ended with an error."
echo -e "$ERROR The last command ended with an error."
exit 1
fi
else
@@ -76,10 +76,14 @@ on_interrupt() {
}
get_help() {
echo "Usage: ./install.sh [options...] <absolute path>"
echo " -a Use already existing Photoshop.tar.xz"
echo " -i Install Photoshop"
echo " -h Show this help"
echo "Usage: $0 [options...] <path>"
echo " -a Use already existing Photoshop.tar.xz"
echo " -i Install Photoshop"
echo " -u <install path> Uninstall Photoshop"
echo " -h Show this help"
echo ""
echo "Please familiarize yourself with the script code before using it."
echo "I do not guarantee its correct operation. Also, it may contain potentially dangerous functions"
}
ask_user() {
@@ -87,27 +91,30 @@ ask_user() {
read -r -p "$(echo -e "${WARNING} $* (yes/no): ")" answer
case "$answer" in
[yY] | [yY][eE][sS])
[yY]|[yY][eE][sS])
return 0
;;
[nN] | [nN][oO])
[nN]|[nN][oO])
return 1
;;
*)
echo "Invalid input, try again"
;;
esac
done
}
# Imagemagick is needed in case you are not using Papirus Icons.
# One of the functions will load a Photoshop `.webp` icon and convert it to `.png`. The `.png` file will be used in the `.desktop` entry.
# Keep in mind, that script will check the installation of icon pack, not an icon pack in use.
# So if you have Papirus installed, but don't using it, script will not pull an icon from the internet.
check_deps() {
declare -A packages=(
["curl"]="curl" # Usually pre-installed on most distributions
["wine"]="wine"
["winetricks"]="winetricks"
["7z"]="p7zip"
# TODO: do not install ImageMagick if the user is using Papirus.
["magick"]="imagemagick"
@@ -178,7 +185,7 @@ is_path_exists() {
echo -e "$WARNING The specified path '${YELLOW}${1}${RESET}' already exists."
if ask_user "Do you want to ${RED}delete${RESET} previous installation?"; then
if rm -rfv "${1:?}" 2>>./install_log.log; then
if rm -rfv "${1:?}" &>>./install_log.log; then
echo -e "$LOG Deleted old installation."
else
echo -e "$ERROR Something went wrong."
@@ -201,14 +208,14 @@ setup_wine() {
echo -e "$LOG Downloading and installing core components for wine prefix. This could take some time."
if ! winetricks --unattended corefonts win10 vkd3d dxvk2030 msxml3 msxml6 gdiplus &>./install_log.log; then
echo -e "$ERORR Winetricks terminated with an error."
echo -e "$ERROR Winetricks terminated with an error."
echo -e "$ERROR Please open an issue by mentioning the contents of ${YELLOW}./install_log.log${RESET}."
exit 1
fi
{
echo "---------------------------------------------------------------------"
echo " Downloading Visual C++ Libraries "
echo " Downloading Visual C++ Libraries "
echo "---------------------------------------------------------------------"
} >>./install_log.log # Thanks to Katy248 for the idea.
@@ -275,12 +282,14 @@ download_photoshop() {
}
verify_path() {
local path="$1"
# test $1, if that fails test $pwd
# relative paths are also working now
local path="$(realpath "${1:-$(pwd)}")"
# Check the validity of the path if the user has specified the absolute path manually. This is necessary in case the user accidentally misspells $HOME paths.
# https://github.com/shvedes/photoshop-linux/issues/1
if [[ ! "$path" == "$HOME"* ]]; then
echo -e "$ERROR Cannot validade ${YELLOW}\$HOME${RESET} path."
echo -e "$ERROR Cannot validate ${YELLOW}\$HOME${RESET} path."
exit 1
fi
@@ -299,7 +308,7 @@ verify_path() {
echo -e "$CHECK Directory '${YELLOW}${reformatted_path}${RESET}' exist."
fi
else
echo -e "$ERORR Path $reformatted_path does not exist!"
echo -e "$ERROR Path $reformatted_path does not exist!"
exit 1
fi
}
@@ -313,7 +322,7 @@ install_photoshop() {
echo -e "$LOG Extracting Photoshop."
if ! tar xvf "$filename" &>>./install_log.log; then
echo -e "$ERORR An error occurred while unpacking the archive."
echo -e "$ERROR An error occurred while unpacking the archive."
exit 1
# TODO:
# A separate function so you don't have to write this code multiple times
@@ -332,7 +341,7 @@ install_photoshop() {
echo -e "$LOG Using given local Photoshop archive."
if [[ ! "$LOCAL_ARCHIVE" = *.tar.xz ]]; then
echo -e "$ERORR Only tar.xz is accepted for now."
echo -e "$ERROR Only tar.xz is accepted for now."
exit 1
# TODO:
# Allow user to use not only tar.xz / archive from another sources
@@ -439,13 +448,32 @@ install_launcher() {
echo "DXVK_STATE_CACHE_PATH=\"\$WINEPREFIX/dxvk_cache\""
echo "PHOTOSHOP=\"\$WINEPREFIX/drive_c/Program Files/Adobe Photoshop 2021/photoshop.exe\""
echo ""
echo "echo -e \"All logs are saved in \$LOG_FILE\""
echo "wine64 \"\$PHOTOSHOP\" \"\$@\" &> \"\$LOG_FILE\" "
echo "echo \"All logs are saved in \$LOG_FILE\""
echo "wine \"\$PHOTOSHOP\" \"\$@\" &> \"\$LOG_FILE\" "
} >"$LAUNCHER"
chmod +x "$LAUNCHER"
}
uninstall() {
if [ -d "$1" ]; then
if ask_user "The script will delete '$1'. Continue?"; then
echo -e "$LOG Uninstalling old installation."
rm -rfv "${1:?}" &>>./uninstall_log.log
echo -e "$LOG Removing launcher & app icon."
[ -d "$HOME/.local/bin/photoshop" ] && rm -rfv $HOME/.local/bin/photoshop &> ./uninstall_log.log
[ -f "$XDG_DATA_HOME/applications/photoshop.desktop" ] && rm -rv $XDG_DATA_HOME/applications/photoshop.desktop &> ./uninstall_log.log
echo -e "$SUCCES Photoshop was successfully deleted."
else
exit 1
fi
else
echo -e "$ERROR "$1" does not exist!"
exit 1
fi
}
main() {
if ! check_deps; then
install_deps
@@ -466,7 +494,7 @@ main() {
install_desktop_entry
install_launcher
echo -e "$SUCCES Photoshop is successfully installed."
echo -e "$SUCCES Photoshop was successfully installed."
}
if [[ -n $1 && $1 != -* ]]; then
@@ -480,25 +508,20 @@ if [ -z "$1" ]; then
exit 1
fi
while getopts "a:i:h" opt; do
while getopts "a:i:u:h" opt; do
case "$opt" in
a)
LOCAL_ARCHIVE="$OPTARG"
;;
LOCAL_ARCHIVE="$OPTARG" ;;
h)
get_help
;;
get_help && exit 0 ;;
i)
INSTALL_PATH="$OPTARG"
;;
INSTALL_PATH="$OPTARG" ;;
u)
uninstall "$OPTARG" && exit 0;;
:)
echo "Option -${OPTARG} requires an argument"
exit 1
;;
echo "Option -${OPTARG} requires an argument" && exit 1 ;;
?)
echo "Invalid option: -$OPTARG Use -h for help."
exit 1
;;
echo "Invalid option. Use -h for help" && exit 1 ;;
esac
done