-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Encoding=UTF-8 | ||
Name=Dindo Bot (dev mode) | ||
GenericName=Dindo Bot (dev mode) | ||
Comment=Farming bot for Dofus game | ||
#Icon=icons/logo.png | ||
Icon=/usr/share/icons/hicolor/128x128/apps/dindo-bot.png | ||
#Exec=bot.py | ||
Exec=sh -e -c "chmod +x \\"\\$(dirname \\"\\$0\\")/bot.py\\" && exec \\"\\$(dirname \\"\\$0\\")/bot.py\\" --dev" %k | ||
Terminal=false | ||
StartupNotify=false | ||
Categories=Application;Game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# root detection | ||
if [ "$(id -u)" != "0" ]; then | ||
echo “This script must be run as root” 2>&1 | ||
exit 1 | ||
fi | ||
|
||
# run uninstall script first | ||
sh uninstall.sh | ||
|
||
# package manager detection | ||
APT_CMD=$(which apt) | ||
PACMAN_CMD=$(which pacman) | ||
|
||
# install dependencies | ||
if [[ ! -z $APT_CMD ]]; then | ||
sudo apt -y install python-gi gir1.2-gtk-3.0 gir1.2-wnck-3.0 python-xlib python3-xlib python-pil python3-pil scrot | ||
elif [[ ! -z $PACMAN_CMD ]]; then | ||
sudo pacman -S python-gobject gtk3 libwnck3 python-xlib python-pillow scrot | ||
else | ||
echo "error can't install dependencies" | ||
exit 1 | ||
fi | ||
|
||
# get script path | ||
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
|
||
# create symlink | ||
ln -s $SCRIPT_PATH/bot.py /usr/local/bin/dindo-bot | ||
chmod 755 /usr/local/bin/dindo-bot | ||
|
||
# copy & update desktop files | ||
cp dindo-bot.desktop /usr/share/applications/dindo-bot.desktop | ||
sed -i 's/^Exec=.*$/Exec=dindo-bot/g' /usr/share/applications/dindo-bot.desktop | ||
chmod 755 /usr/share/applications/dindo-bot.desktop | ||
|
||
cp dindo-bot-dev.desktop /usr/share/applications/dindo-bot-dev.desktop | ||
sed -i 's/^Exec=.*$/Exec=dindo-bot --dev/g' /usr/share/applications/dindo-bot-dev.desktop | ||
chmod 755 /usr/share/applications/dindo-bot-dev.desktop | ||
|
||
# copy icons | ||
cp icons/logo.png /usr/share/icons/hicolor/128x128/apps/dindo-bot.png | ||
chmod 644 /usr/share/icons/hicolor/128x128/apps/dindo-bot.png | ||
|
||
# refresh icons cache | ||
gtk-update-icon-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
if [ "$(id -u)" != "0" ]; then | ||
echo “This script must be run as root” 2>&1 | ||
exit 1 | ||
fi | ||
|
||
# remove symlink | ||
rm -f /usr/local/bin/dindo-bot | ||
|
||
# remove desktop files | ||
rm -f /usr/share/applications/dindo-bot.desktop | ||
rm -f /usr/share/applications/dindo-bot-dev.desktop | ||
|
||
# remove icons | ||
rm -f /usr/share/icons/hicolor/128x128/apps/dindo-bot.png |