-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_desktop.sh
executable file
·93 lines (79 loc) · 2.6 KB
/
install_desktop.sh
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
sudo apt-get --allow-unauthenticated -qy install xserver-xorg xfce4 xinit xdm gmpc gmpc-plugins gedit
mkdir /home/botmaster/Desktop/
mkdir /home/botmaster/music/drop_your_music_here
mkdir -p /home/botmaster/.config/autostart/
ln -s /home/botmaster/music/ /home/botmaster/Desktop/music_of_your_bot
# Enable autostart for gmpc
mkdir /home/botmaster/.config/gmpc/
cp /usr/share/applications/gmpc.desktop /home/botmaster/.config/autostart/
# And also create a shortcut on the desktop
cp /usr/share/applications/gmpc.desktop /home/botmaster/Desktop/
# Do not run first start assistant of gmpc
cat<<EOF > /home/botmaster/.config/gmpc/gmpc.cfg
# Do not edit this file!!!
[Default]
first_run="0"
EOF
# Create config for gmpc
cat<<EOF > /home/botmaster/.config/gmpc/profiles.cfg
[Default]
hostname="localhost"
name="Default"
password=""
portnumber="7701"
useauth="0"
music directory="/home/botmaster/music/"
db update time="1445647261"
EOF
# Create .desktop for bot live logging and write it to autostart
cat<<EOF > /home/botmaster/.config/autostart/botlogging.desktop
[Desktop Entry]
Exec=/home/botmaster/src/mumble-ruby-pluginbot/scripts/manage.sh log
GenericName=Watch bot logs live
Icon=logviewer
MimeType=
Name=Watch bot logs live
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
EOF
# Create .desktop for bot restart and write it to autostart
cat<<EOF > /home/botmaster/.config/autostart/botrestart.desktop
[Desktop Entry]
Exec=/home/botmaster/src/mumble-ruby-pluginbot/scripts/manage.sh restart
GenericName=Restart your bot
Icon=view-refresh
MimeType=
Name=Restart your bot
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
EOF
# Create .desktop for editing the bots configuration file and write it to autostart
cat<<EOF > /home/botmaster/.config/autostart/botedit.desktop
[Desktop Entry]
Exec=/usr/bin/gedit /home/botmaster/src/bot1_conf.yml
GenericName=Edit your bots configuration file
Icon=gconf-editor
MimeType=
Name=Edit your bots configuration file
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
EOF
# Also copy bot shortcuts to Desktop
cp /home/botmaster/.config/autostart/botlogging.desktop /home/botmaster/Desktop/
cp /home/botmaster/.config/autostart/botrestart.desktop /home/botmaster/Desktop/
cp /home/botmaster/.config/autostart/botedit.desktop /home/botmaster/Desktop/
# Set appropriate permissions to avoid security message on start
chmod u+x /home/botmaster/Desktop/botlogging.desktop
chmod u+x /home/botmaster/Desktop/botrestart.desktop
chmod u+x /home/botmaster/Desktop/botedit.desktop
chmod u+x /home/botmaster/Desktop/gmpc.desktop
sudo systemctl enable xdm