From d390c1f28b92bf90ef15541f6c05fbca3dd4daec Mon Sep 17 00:00:00 2001 From: MeexReay Date: Mon, 16 Jun 2025 02:46:08 +0300 Subject: [PATCH] fix makefile install --- Makefile | 2 +- misc/bRAC.desktop | 12 ------------ misc/create-desktop.sh | 16 ++++++++++++++++ misc/system-install.bat | 2 +- misc/system-install.sh | 4 +++- misc/system-uninstall.sh | 4 +++- misc/user-install.sh | 2 +- 7 files changed, 25 insertions(+), 17 deletions(-) delete mode 100644 misc/bRAC.desktop create mode 100644 misc/create-desktop.sh diff --git a/Makefile b/Makefile index f728950..453d0e4 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ install: target/release/bRAC chmod +x ~/.local/bin/bRAC mkdir ~/.local/share/bRAC -p cp misc/bRAC.png ~/.local/share/bRAC/icon.png - cp misc/bRAC.desktop ~/.local/share/applications/ru.themixray.bRAC.desktop + ./misc/create-desktop.sh > ~/.local/share/applications/ru.themixray.bRAC.desktop uninstall: rm -rf ~/.config/bRAC ~/.local/share/bRAC rm -f ~/.local/share/applications/ru.themixray.bRAC.desktop diff --git a/misc/bRAC.desktop b/misc/bRAC.desktop deleted file mode 100644 index 07ad132..0000000 --- a/misc/bRAC.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=bRAC -Version=0.1.4 -Type=Application -Comment=better RAC client -Icon=~/.local/share/bRAC/icon.png -Exec=~/.local/bin/bRAC -Categories=Network; -StartupNotify=true -DBusActivatable=true -Terminal=false -X-GNOME-UsesNotifications=true \ No newline at end of file diff --git a/misc/create-desktop.sh b/misc/create-desktop.sh new file mode 100644 index 0000000..917447f --- /dev/null +++ b/misc/create-desktop.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +version=$(grep -m1 '^version' Cargo.toml | sed -E 's/version *= *"(.*)"/\1/') + +echo "[Desktop Entry]" +echo "Name=bRAC" +echo "Version=$version" +echo "Type=Application" +echo "Comment=better RAC client" +echo "Icon=$HOME/.local/share/bRAC/icon.png" +echo "Exec=$HOME/.local/bin/bRAC" +echo "Categories=Network;" +echo "StartupNotify=true" +echo "DBusActivatable=true" +echo "Terminal=false" +echo "X-GNOME-UsesNotifications=true" diff --git a/misc/system-install.bat b/misc/system-install.bat index a28aa3f..838b017 100644 --- a/misc/system-install.bat +++ b/misc/system-install.bat @@ -27,4 +27,4 @@ set "v=%TEMP%\_s.vbs" >>"%v%" echo l.Save wscript "%v%" >nul del "%v%" >nul -exit /b \ No newline at end of file +exit /b diff --git a/misc/system-install.sh b/misc/system-install.sh index a037e7d..6f6b04a 100644 --- a/misc/system-install.sh +++ b/misc/system-install.sh @@ -1,5 +1,7 @@ #!/bin/bash +echo "this script is deprecated, fix it yourself if you wanna to"; exit + if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 @@ -8,4 +10,4 @@ fi cp bRAC /bin/bRAC chmod +x /bin/bRAC cp ru.themixray.bRAC.png /usr/share/pixmaps -cp ru.themixray.bRAC.desktop /usr/share/applications \ No newline at end of file +cp ru.themixray.bRAC.desktop /usr/share/applications diff --git a/misc/system-uninstall.sh b/misc/system-uninstall.sh index 9b42014..67150fc 100755 --- a/misc/system-uninstall.sh +++ b/misc/system-uninstall.sh @@ -1,5 +1,7 @@ #!/bin/bash +echo "this script is deprecated, fix it yourself if you wanna to"; exit + if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 @@ -11,4 +13,4 @@ done rm -f /bin/bRAC rm -f /usr/share/pixmaps/ru.themixray.bRAC.png -rm -f /usr/share/applications/ru.themixray.bRAC.desktop \ No newline at end of file +rm -f /usr/share/applications/ru.themixray.bRAC.desktop diff --git a/misc/user-install.sh b/misc/user-install.sh index 54fe446..fd320c4 100755 --- a/misc/user-install.sh +++ b/misc/user-install.sh @@ -4,4 +4,4 @@ cp bRAC ~/.local/bin/bRAC chmod +x ~/.local/bin/bRAC mkdir ~/.local/share/bRAC -p cp misc/bRAC.png ~/.local/share/bRAC/icon.png -cp misc/bRAC.desktop ~/.local/share/applications/ru.themixray.bRAC.desktop \ No newline at end of file +./misc/create-desktop.sh > ~/.local/share/applications/ru.themixray.bRAC.desktop