mirror of
https://github.com/shvedes/photoshop-linux.git
synced 2026-06-22 15:02:42 +00:00
Compare commits
15 Commits
650ab4aec1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 89e116eb37 | |||
| 3a285712dc | |||
| 4854dad81e | |||
| a365571566 | |||
| 03aa300dbf | |||
| bc7d519ac4 | |||
| 465419dc07 | |||
| 55e2743cdc | |||
| 491f36732c | |||
| 7754253619 | |||
| 76dc948390 | |||
| 0f9bd53282 | |||
| 9217d9aea9 | |||
| f9b50f3a1b | |||
| de5b843330 |
@@ -1,5 +0,0 @@
|
||||
uninstall.sh
|
||||
install.sh.bak
|
||||
install_log.log
|
||||
test.sh
|
||||
*.tar*
|
||||
@@ -1,25 +1,32 @@
|
||||
# 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
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### What works
|
||||
|
||||
- Drag and drop
|
||||
- Drag and drop ~~(doesn't work on Hyprland)~~ (should be fixed with recent update. Not tested)
|
||||
- Clipboard image pasting
|
||||
- Mime type association (right click menu, see [here](https://github.com/user-attachments/assets/eb5f7ab3-fb75-47e7-841b-a763ca5e3382))
|
||||
- GPU acceleration
|
||||
- GPU acceleration (no warranty to work)
|
||||
|
||||
**Tested on:**
|
||||
- Arch Linux
|
||||
- KDE Plasma 6.2 (Wayland)
|
||||
- wine 9.19
|
||||
- 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
|
||||
|
||||
### Known issues
|
||||
@@ -34,24 +41,13 @@ By providing this software, I do not give any guarantees of its work. This scrip
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
./install.sh
|
||||
./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
|
||||
|
||||
- [ ] Properly implement logging
|
||||
- [ ] Multi distro dependencies installer (for now only Arch Linux is supported)
|
||||
- [ ] 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 :)
|
||||
|
||||
+77
-38
@@ -15,6 +15,7 @@ XDG_DATA_HOME="$HOME/.local/share"
|
||||
if [ ! -d "$XDG_CACHE_HOME" ]; then
|
||||
XDG_CACHE_HOME="$HOME/.cache"
|
||||
fi
|
||||
|
||||
# LOGGING SYSTEM
|
||||
# #####################################################################
|
||||
#
|
||||
@@ -27,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}"
|
||||
|
||||
@@ -40,6 +41,7 @@ if [ -z "$XDG_DATA_HOME" ] && [ -z "$XDG_CACHE_HOME" ]; then
|
||||
fi
|
||||
|
||||
# Photoshop URL
|
||||
# TODO: change hosting server
|
||||
PHOTOSHOP_URL="https://spyderrock.com/kMnq2220-AdobePhotoshop2021.xz"
|
||||
|
||||
# sha256 checksum
|
||||
@@ -58,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
|
||||
@@ -74,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() {
|
||||
@@ -85,27 +91,32 @@ 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"
|
||||
["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"
|
||||
)
|
||||
|
||||
@@ -133,6 +144,7 @@ install_deps() {
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
# Deprecated. Will not be updated. Still works for listed distros
|
||||
# Refer to /etc/os-release for more info
|
||||
case "$ID" in
|
||||
"arch"|"cachyos")
|
||||
@@ -173,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."
|
||||
@@ -196,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.
|
||||
|
||||
@@ -270,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
|
||||
|
||||
@@ -294,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
|
||||
}
|
||||
@@ -308,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
|
||||
@@ -327,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
|
||||
@@ -424,6 +438,7 @@ install_launcher() {
|
||||
echo -e "$LOG Installing launcher."
|
||||
|
||||
# Thanks to Katy248 (https://github.com/Katy248) for the idea.
|
||||
# Note: some variables are not used at all; TODO: remove them
|
||||
{
|
||||
echo "#!/usr/bin/env bash"
|
||||
echo ""
|
||||
@@ -433,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
|
||||
@@ -460,29 +494,34 @@ main() {
|
||||
install_desktop_entry
|
||||
install_launcher
|
||||
|
||||
echo -e "$SUCCES Photoshop is successfully installed."
|
||||
echo -e "$SUCCES Photoshop was successfully installed."
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
get_help
|
||||
exit 0
|
||||
if [[ -n $1 && $1 != -* ]]; then
|
||||
echo "Invalid input: options must start with '-'"
|
||||
get_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while getopts "a:i:h" flag; do
|
||||
case $flag in
|
||||
a)
|
||||
LOCAL_ARCHIVE="$OPTARG"
|
||||
;;
|
||||
h)
|
||||
if [ -z "$1" ]; then
|
||||
get_help
|
||||
;;
|
||||
i)
|
||||
INSTALL_PATH="$OPTARG"
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG Use -h for help."
|
||||
exit 1
|
||||
;;
|
||||
fi
|
||||
|
||||
while getopts "a:i:u:h" opt; do
|
||||
case "$opt" in
|
||||
a)
|
||||
LOCAL_ARCHIVE="$OPTARG" ;;
|
||||
h)
|
||||
get_help && exit 0 ;;
|
||||
i)
|
||||
INSTALL_PATH="$OPTARG" ;;
|
||||
u)
|
||||
uninstall "$OPTARG" && exit 0;;
|
||||
:)
|
||||
echo "Option -${OPTARG} requires an argument" && exit 1 ;;
|
||||
?)
|
||||
echo "Invalid option. Use -h for help" && exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user