3 ######################################################
4 ## installs all system wide programs for instantOS ##
5 ######################################################
7 if ! [ $(whoami) = "root" ]; then
8 echo "please run this as root"
12 mkdir -p /opt/instantos
14 # add group and add users to group
16 groupadd "$1" &>/dev/null
17 for USER in $(ls /home/ | grep -v '+'); do
18 if ! sudo su "$USER" -c groups | grep -Eq " $1|$1 "; then
19 sudo gpasswd -a "$USER" "$1"
27 RAW="https://raw.githubusercontent.com"
29 # adds permanent global environment variable
31 [ -e /etc/environment ] || touch /etc/environment
32 if [ "$1" = "-f" ]; then
37 if grep -q "$1=" /etc/environment; then
38 if [ -z "$FORCE" ]; then
39 echo "key already existing"
42 sed -i "s~$1=.*~$1=$2~g" /etc/environment
45 echo "$1=$2" >>/etc/environment
49 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
50 addenv -f "PAGER" "less"
51 addenv -f "EDITOR" "$(which nvim)"
53 # needed for instantLOCK
54 if grep -q 'nobody' </etc/groups || grep -q 'nobody' </etc/group; then
55 echo "nobody workaround not required"
60 # fix java gui appearing empty on instantWM
61 if ! grep -q 'instantwm' </etc/profile; then
62 echo "fixing java windows for instantwm in /etc/profile"
63 echo '# fix instantwm java windows' >>/etc/profile
64 echo 'export _JAVA_AWT_WM_NONREPARENTING=1' >>/etc/profile
66 echo "java workaround already applied"
69 # color scheme for tty
70 if ! grep -q '# nord colors' /etc/profile; then
71 echo "applying color scheme"
73 echo '# nord colors' >>/etc/profile
74 echo 'if [ "$TERM" = "linux" ]; then' >>/etc/profile
76 cat <<EOT >>/etc/profile
77 echo -en "\e]P0383c4a" #black
78 echo -en "\e]P8404552" #darkgrey
79 echo -en "\e]P19A4138" #darkred
80 echo -en "\e]P9E7766B" #red
81 echo -en "\e]P24BEC90" #darkgreen
82 echo -en "\e]PA3CBF75" #green
83 echo -en "\e]P3CFCD63" #brown
84 echo -en "\e]PBFFD75F" #yellow
85 echo -en "\e]P45294e2" #darkblue
86 echo -en "\e]PC579CEF" #blue
87 echo -en "\e]P5CE50DD" #darkmagenta
88 echo -en "\e]PDE7766B" #magenta
89 echo -en "\e]P66BE5E7" #darkcyan
90 echo -en "\e]PE90FDFF" #cyan
91 echo -en "\e]P7CCCCCC" #lightgrey
92 echo -en "\e]PFFFFFFF" #white
93 clear #for background artifacting
100 if [ -e /etc/lightdm/lightdm.conf ] && ! grep -q 'instantwm' /etc/lightdm/lightdm.conf; then
101 sudo sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf
102 sudo sed -i '# user-session = Session to load for users/user-session=instantwm/g' /etc/lightdm/lightdm.conf
105 rm -rf /tmp/instantinstall
106 mkdir /tmp/instantinstall
107 cd /tmp/instantinstall
109 echo "the theme is $THEME"
114 # check if computer is a potato
115 if grep -iq 'Ryzen' /proc/cpuinfo || lshw -C display | grep -q 'nvidia'; then
116 echo "classifying pc as not a potato"
118 echo "looks like your pc is a potato"
119 mkdir -p /opt/instantos
120 echo "true" >/opt/instantos/potato
123 # install a custom repo
124 if ! grep -q '\[instant\]' /etc/pacman.conf; then
125 echo "instantos repo not found"
127 echo '# paperbegin' >>/etc/pacman.conf
128 echo '[instant]' >>/etc/pacman.conf
129 echo 'SigLevel = Optional TrustAll' >>/etc/pacman.conf
130 echo 'Server = http://instantos.surge.sh' >>/etc/pacman.conf
131 echo '# paperend' >>/etc/pacman.conf
134 echo "instantOS repo found"