-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-config-gnome.sh
121 lines (101 loc) · 3.27 KB
/
post-config-gnome.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
#xfce_desktop by Wamphyre (Somekind of FreeBSD Studio and Workstation)
#Version 2.5
test $? -eq 0 || exit 1 "NEED TO BE ROOT TO RUN THIS"
echo "Welcome to BSD-GNOME base script"
echo "This will install a complete, secure and optimized GNOME desktop in your FreeBSD system"
echo "WARNING!! - Execute only in a fresh vanilla installation"
sleep 5
## CHANGE FreeBSD REPOS TO LATEST
sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
## REBUILD AND UPDATE PKG DATABASE
echo "Upgrading packages..."
echo ""
pkg update && pkg upgrade -y
echo ""
## COMPILE CPU OPTIMIZED APPLICATIONS
touch /etc/make.conf
CPUCORES=$(sysctl hw.ncpu | cut -d ":" -f2 | cut -d " " -f2)
echo "CPUTYPE?=native" >> /etc/make.conf
echo "MAKE_JOBS_NUMBER?=$CPUCORES" >> /etc/make.conf
echo "OPTIONS_SET=OPTIMIZED_CFLAGS CPUFLAGS" >> /etc/make.conf
## INSTALLS BASE DESKTOP AND CORE UTILS
echo "Installing desktop..."
echo ""
xargs pkg install -y < system_packages_gnome
echo 'proc /proc procfs rw 0 0' >> /etc/fstab
## ENABLES BASIC SYSTEM SERVICES
echo "Enabling basic services"
sysrc hostname="freebsd"
sysrc moused_enable="YES"
sysrc dbus_enable="YES"
sysrc gdm_enable="YES"
echo ""
## CHANGE SLIM THEME TO FBSD
sed -i '' 's/current_theme default/current_theme fbsd/g' /usr/local/etc/slim.conf
## CREATES .xinitrc SCRIPT FOR A REGULAR DESKTOP USER
echo ; read -p "Want to enable GNOME for a regular user? (yes/no): " X;
echo ""
if [ "$X" = "yes" ]
then
echo ; read -p "For what user? " user;
# touch /usr/home/$user/.xinitrc
# echo 'exec xfce4-session' >> /usr/home/$user/.xinitrc
# echo ""
# echo "$user enabled"
#else fi
## ADDS USER TO CORE GROUPS
echo "Adding $user to video/realtime/wheel/operator groups"
pw groupmod video -m $user
pw groupmod audio -m $user
pw groupmod realtime -m $user
pw groupmod wheel -m $user
pw groupmod operator -m $user
pw groupmod network -m $user
pw groupmod wheel -m $user
echo ""
## ADDS USER TO SUDOERS
echo "Adding $user to sudo"
echo '%wheel ALL=(ALL) ALL' >> /usr/local/etc/sudoers
echo ""
fi
## ENABLES LINUX COMPAT LAYER
echo "Enabling Linux compat layer..."
echo ""
kldload linux.ko
sysrc linux_enable="YES"
echo ""
echo "Enabling mouse in Qemu VirtualMachine"
echo 'utouch_load="YES"' >> /boot/loader.conf
echo ""
touch /etc/pf.conf
echo 'block in all' >> /etc/pf.conf
echo 'pass out all keep state' >> /etc/pf.conf
## CONFIGURES MORE CORE SYSTEM SERVICES
echo "Enabling additional system services..."
echo ""
sysrc pf_enable="YES"
sysrc pf_rules="/etc/pf.conf"
sysrc pflog_enable="YES"
sysrc pflog_logfile="/var/log/pflog"
sysrc sendmail_enable="NO"
sysrc sendmail_msp_queue_enable="NO"
sysrc sendmail_outbound_enable="NO"
sysrc sendmail_submit_enable="NO"
sysrc jackd_enable="YES"
sysrc jackd_user="$user"
sysrc jackd_rtprio="YES"
## Change JACK /dev/dsp7 by your own interfaces
sysrc jackd_args="-doss -r48000 -p256 -n1 -w16 --capture /dev/dsp0 --playback /dev/dsp0"
echo ""
## CLEAN CACHES AND AUTOREMOVES UNNECESARY FILES
echo "Cleaning system..."
echo ""
pkg clean -y
pkg autoremove -y
echo ""
## DONE, PLEASE RESTART
echo "Installation done"
echo "Don't forget to reboot your system after that"
echo "To restore gnome settings run as user dconf load -f / < gnome-settings.ini"
echo "BSD-GNOME by Wamphyre :)"