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"
28 RAW="https://raw.githubusercontent.com"
30 # adds permanent global environment variable
32 [ -e /etc/environment ] || touch /etc/environment
33 if [ "$1" = "-f" ]; then
38 if grep -q "$1=" /etc/environment; then
39 if [ -z "$FORCE" ]; then
40 echo "key already existing"
43 sed -i "s~$1=.*~$1=$2~g" /etc/environment
46 echo "$1=$2" >>/etc/environment
50 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
51 addenv -f "PAGER" "less"
52 addenv -f "EDITOR" "$(which nvim)"
54 # needed for instantLOCK
55 if grep -q 'nobody' </etc/groups &>/dev/null || grep -q 'nobody' </etc/group &>/dev/null; then
56 echo "nobody workaround not required"
61 # fix java gui appearing empty on instantWM
62 if ! grep -q 'instantwm' </etc/profile; then
63 echo "fixing java windows for instantwm in /etc/profile"
64 echo '# fix instantwm java windows' >>/etc/profile
65 echo 'export _JAVA_AWT_WM_NONREPARENTING=1' >>/etc/profile
67 echo "java workaround already applied"
70 # color scheme for tty
71 if ! grep -q '# nord colors' /etc/profile; then
72 echo "applying color scheme"
74 echo '# nord colors' >>/etc/profile
75 echo 'if [ "$TERM" = "linux" ]; then' >>/etc/profile
77 cat <<EOT >>/etc/profile
78 echo -en "\e]P0383c4a" #black
79 echo -en "\e]P8404552" #darkgrey
80 echo -en "\e]P19A4138" #darkred
81 echo -en "\e]P9E7766B" #red
82 echo -en "\e]P24BEC90" #darkgreen
83 echo -en "\e]PA3CBF75" #green
84 echo -en "\e]P3CFCD63" #brown
85 echo -en "\e]PBFFD75F" #yellow
86 echo -en "\e]P45294e2" #darkblue
87 echo -en "\e]PC579CEF" #blue
88 echo -en "\e]P5CE50DD" #darkmagenta
89 echo -en "\e]PDE7766B" #magenta
90 echo -en "\e]P66BE5E7" #darkcyan
91 echo -en "\e]PE90FDFF" #cyan
92 echo -en "\e]P7CCCCCC" #lightgrey
93 echo -en "\e]PFFFFFFF" #white
94 clear #for background artifacting
101 if [ -e /etc/lightdm/lightdm.conf ] && ! grep -q 'instantwm' /etc/lightdm/lightdm.conf; then
102 sudo sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf
103 sudo sed -i '# user-session = Session to load for users/user-session=instantwm/g' /etc/lightdm/lightdm.conf
106 rm -rf /tmp/instantinstall
107 mkdir /tmp/instantinstall
108 cd /tmp/instantinstall
110 echo "the theme is $THEME"
115 # check if computer is a potato
116 MEMAMOUNT="$(free -m | grep -vi swap | grep -o '[0-9]*' | sort -n | tail -1)"
118 if grep -iq 'Ryzen' /proc/cpuinfo || lshw -C display | grep -q 'nvidia' || [ "$MEMAMOUNT" -gt 3500 ]; then
119 echo "classifying pc as not a potato"
121 echo "looks like your pc is a potato"
122 mkdir -p /opt/instantos
123 echo "true" >/opt/instantos/potato
126 # install a custom repo
127 if ! grep -q '\[instant\]' /etc/pacman.conf; then
128 /usr/share/instantutils/repo.sh
130 echo "instantOS repo found"
133 # fix brightness permissions
134 bash /opt/instantos/menus/data/backlight.sh