3 ######################################################
4 ## installs all system wide programs for instantOS ##
5 ######################################################
6 source <(curl -Ls https://git.io/JerLG)
10 if ! [ $(whoami) = "root" ]; then
11 echo "please run this as root"
15 mkdir -p /opt/instantos
17 # add group and add users to group
19 groupadd "$1" &>/dev/null
20 for USER in $(ls /home/ | grep -v '+'); do
21 if ! sudo su "$USER" -c groups | grep -Eq " $1|$1 "; then
22 sudo gpasswd -a $USER $1
30 RAW="https://raw.githubusercontent.com"
32 curl -s "$RAW/instantOS/instantASSIST/master/install.sh" | bash
34 # fallback wallpaper if others fail to load
35 if ! [ -e /opt/instantos/wallpapers/default.png ]; then
36 mkdir /opt/instantos/wallpapers
37 wget -qO /opt/instantos/wallpapers/default.png \
38 "$RAW/instantOS/instantLOGO/master/wallpaper/defaultwall.png"
41 # adds permanent global environment variable
43 [ -e /etc/environment ] || touch /etc/environment
44 if [ "$1" = "-f" ]; then
49 if grep -q "$1=" /etc/environment; then
50 if [ -z "$FORCE" ]; then
51 echo "key already existing"
54 sed -i "s~$1=.*~$1=$2~g" /etc/environment
57 echo "$1=$2" >>/etc/environment
61 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
62 addenv -f "PAGER" "less"
63 command -v nvim &>/dev/null && addenv -f "EDITOR" "$(which nvim)"
65 # needed for instantLOCK
66 if grep -q 'nobody' </etc/groups || grep -q 'nobody' </etc/group; then
67 echo "nobody workaround not required"
72 # fix java gui appearing empty on instantWM
73 if ! grep -q 'instantwm' </etc/profile; then
74 echo "fixing java windows for instantwm in /etc/profile"
75 echo '# fix instantwm java windows' >>/etc/profile
76 echo 'export _JAVA_AWT_WM_NONREPARENTING=1' >>/etc/profile
78 echo "java workaround already applied"
81 if [ -e /etc/lightdm/lightdm.conf ] && ! grep -q 'instantwm' /etc/lightdm/lightdm.conf; then
82 sudo sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf
83 sudo sed -i '# user-session = Session to load for users/user-session=instantwm/g' /etc/lightdm/lightdm.conf
86 rm -rf /tmp/instantinstall
87 mkdir /tmp/instantinstall
88 cd /tmp/instantinstall
90 git clone --depth=1 https://github.com/instantOS/instantOS.git
98 echo "installing $FILENAME"
99 if ! [ -e "$i" ]; then
100 echo "error processing $i"
103 cat $i | sudo tee /usr/local/bin/$FILENAME &>/dev/null
104 sudo chmod 755 /usr/local/bin/"$FILENAME"
108 # session for lightdm
109 sudo mv instantwm.desktop /usr/share/xsessions/
110 sudo chmod 644 /usr/share/xsessions/instantwm.desktop
114 # laptop specific stuff
115 if acpi | grep -q '[0-9]%' &>/dev/null; then
116 # fix tap to click not working with tiling wms
117 if ! [ -e /etc/X11/xorg.conf.d/90-touchpad.conf ] ||
118 ! cat /etc/X11/xorg.conf.d/90-touchpad.conf | grep -iq 'tapping.*"on"'; then
120 sudo mkdir -p /etc/X11/xorg.conf.d && sudo tee /etc/X11/xorg.conf.d/90-touchpad.conf <<'EOF' 1>/dev/null
122 Identifier "touchpad"
125 Option "Tapping" "on"
130 # three and four finger swipes on laptop
131 if ! command -v libinput-gestures &>/dev/null; then
132 git clone --depth=1 https://github.com/bulletmark/libinput-gestures.git
136 rm -rf libinput-gestures
140 echo "system is on a desktop"
143 if ! command -v pfw &>/dev/null; then
144 echo "installing wmutils"
146 mkdir -p /tmp/wmutils
148 git clone --depth=1 https://github.com/wmutils/core.git
155 echo "the theme is $THEME"
159 gitclone instantOS/$1 &>/dev/null
160 if [ -e "$1"/build.sh ]; then
169 rm -rf /tmp/instantosbin &>/dev/null
170 mkdir /tmp/instantosbin
180 mkdir -p /opt/instantos/scripts
181 cd /opt/instantos/scripts
182 curl -s "$RAW/instantOS/instantWALLPAPER/master/wall.sh" >wall.sh
183 curl -s "$RAW/instantOS/instantWALLPAPER/master/offlinewall.sh" >offlinewall.sh
184 curl -s "$RAW/instantOS/instantOS/master/monitor.sh" >monitor.sh
185 curl -s "$RAW/instantOS/instantOS/master/autostart.sh" >autostart.sh