-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·76 lines (64 loc) · 2.59 KB
/
install.sh
File metadata and controls
executable file
·76 lines (64 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#################################################
# install script for Picture Label service menu #
#################################################
# check for installation of basic KDE commands
if [ ! `command -v awk` ] || [ ! `command -v sed` ] || [ ! `command -v kdialog` ] ; then
echo "Cannot find either \"awk\", \"sed\", or \"kdialog\". Please check your system installation."
exit
fi
# check for installation of either IM-6, IM-7, or IM-7 appimage
if [ ! `command -v convert` ] ; then
# echo "Cannot find \"convert\". Please check your system installation."
((strikes++))
fi
if [ ! `command -v magick` ]; then
# echo "Cannot find \"magic\". Please check your system installation."
((strikes++))
fi
if [ ! `command -v imagemagick` ]; then
# echo "Cannot find \"imagemagic\". Please check your system installation."
((strikes++))
fi
if [ $strikes -eq 3 ]; then
echo "Cannot find any installation of \"imagemagic\". Please check your system installation."
exit
fi
# places the .desktop file in either
# ~/.local/share/kio/servicemenus/
# or
# ~/.local/share/kservices5/
# depending on which version of plasma is running
# creating a folder path for the user, if necessary
if [[ "$KDE_SESSION_VERSION" == "6" ]]; then
INSTALL_DIR="$HOME/.local/share/kio/servicemenus"
if [[ ! -d $INSTALL_DIR ]]; then
# There is no local configuration path so must be created.
mkdir -p "$INSTALL_DIR"
fi
else
INSTALL_DIR="$HOME/.local/share/kservices5/"
if [[ ! -d $INSTALL_DIR ]]; then
# There is no local configuration path so must be created.
mkdir -p "$INSTALL_DIR"
fi
fi
# make a folder to hold the scripts and database files
# copy all the files into their proper location
mkdir -p $INSTALL_DIR/PictureLabel
cp -f picture_label.desktop $INSTALL_DIR/picture_label.desktop
cp -f picture-label.sh $INSTALL_DIR/PictureLabel/picture-label.sh
cp -f settings.sh $INSTALL_DIR/PictureLabel/settings.sh
cp -f setdb.txt $INSTALL_DIR/PictureLabel/setdb.txt
cp -f setdb.txt.bak $INSTALL_DIR/PictureLabel/setdb.txt.bak
# modify the path statements of installed .desktop and .sh files
# and make the .desktop and .sh files executable
sed -i "s|PATH_HOLDER|$INSTALL_DIR|" $INSTALL_DIR/picture_label.desktop
chmod +x $INSTALL_DIR/picture_label.desktop
sed -i "s|PATH_HOLDER|$INSTALL_DIR|" $INSTALL_DIR/PictureLabel/picture-label.sh
chmod +x $INSTALL_DIR/PictureLabel/picture-label.sh
sed -i "s|PATH_HOLDER|$INSTALL_DIR|" $INSTALL_DIR/PictureLabel/settings.sh
chmod +x $INSTALL_DIR/PictureLabel/settings.sh
echo
echo Picture Label servicemenu -- Installation Complete
echo