3 ###############################################
4 ## script for instantOS autostart ##
5 ###############################################
7 # run userinstall to determine device properties
8 if ! iconf -i userinstall; then
9 /usr/share/instantutils/userinstall.sh
12 # architecture detection
14 if uname -m | grep -q '^arm'; then
18 if [ "$(ps aux | grep bash | grep instantautostart | wc -l)" -gt 2 ]; then
19 echo "already running"
29 if ! iconf -i rangerplugins; then
31 echo "installing ranger plugins"
32 mkdir -p ~/.config/ranger/plugins
33 cp -r /usr/share/rangerplugins/* ~/.config/ranger/plugins/
37 # find out if it's a live session
38 if [ -e /usr/share/liveutils ] &>/dev/null; then
40 echo "live session detected"
43 # fix small graphical glitch on status bar startup
44 NMON=$(iconf names | wc -l)
45 for i in $(eval "echo {1..$NMON}"); do
46 echo "found monitor $i"
47 xdotool key super+comma
48 if iconf -i nobar; then
53 if [ -n "$ISRASPI" ]; then
54 # enable double drawing for moving floating windows
55 # greatly increases smoothness
57 if ! [ -e ~/.config/instantos/israspi ]; then
58 echo "marking machine as raspi"
59 mkdir -p ~/.config/instantos
60 touch ~/.config/instantos/israspi
61 # logo does not work on raspi
66 if iconf -i islaptop; then
67 export ISLAPTOP="true"
68 echo "laptop detected"
75 if ! iconf -i notheming; then
78 iconf -i instantthemes 1
81 # dynamically switch between light and dark gtk theme
83 if [ "$DATEHOUR" -gt "20" ] || [ "$DATEHOUR" -lt "7" ]; then
85 touch /tmp/instantdarkmode
86 [ -e /tmp/instantlightmode ] && rm /tmp/instantlightmode
89 touch /tmp/instantlightmode
90 [ -e /tmp/instantdarkmode ] && rm /tmp/instantdarkmode
93 mkdir -p /tmp/notifications &>/dev/null
94 if ! pgrep dunst; then
96 # wait for theming before starting dunst
97 if [ -e /tmp/instantdarkmode ] || [ -e /tmp/instantlightmode ]; then
108 # set up oh-my-zsh config if not existing already
110 if ! [ iconf -i userinstall ]; then
111 bash /usr/share/instantutils/userinstall.sh
114 # fix resolution on virtual machine
115 if ! iconf -i novmfix && cat /proc/cpuinfo | grep -q hypervisor; then
116 if echo "virtual machine detected.
117 Would you like to switch to a 1080p resolution?" | imenu -C; then
118 echo "applying virtualbox workaround"
119 /opt/instantos/menus/dm/tv.sh
121 if ! imenu -c "ask again next session"; then
127 if [ -z "$ISLIVE" ]; then
128 echo "not a live session"
129 if [ -e /opt/instantos/installtrigger ]; then
130 zenity --info --text "finishing installation in background" &
131 sudo instantpostinstall
136 if ! iconf -i max; then
140 if [ -e ~/instantos/monitor.sh ]; then
141 bash ~/instantos/monitor.sh &
142 elif [ -e ~/.config/autorandr/instantos/config ]; then
143 autorandr instantos &
146 if ping archlinux.org -c 2; then
149 # fall back to already installed wallpapers
150 instantwallpaper offline
151 for i in $(seq 10); do
152 if ping archlinux.org -c 2; then
161 # apply keybpard layout
162 if [ -e ~/instantos/keyboard ]; then
163 setxkbmap -layout $(cat ~/instantos/keyboard)
165 CURLOCALE=$(locale | grep LANG | sed 's/.*=\(.*\)\..*/\1/')
171 echo "no keyboard layout found for your locale"
177 if iconf mousespeed; then
178 echo "setting mousespeed"
179 instantmouse s "$(iconf mousespeed)"
182 if ! iconf -i noconky; then
183 shuf /usr/share/instantwidgets/tooltips.txt | head -1 >~/.cache/tooltip
184 conky -c /usr/share/instantwidgets/tooltips.conf &
188 echo "live session detected"
191 iconf -i wifiapplet 1
192 instantwallpaper set /usr/share/instantwallpaper/defaultphoto.png
193 conky -c /usr/share/instantwidgets/install.conf &
196 if ! pgrep python; then
204 if iconf -i highfps; then
205 xdotool key super+alt+shift+d
208 # make built in status optional
209 if ! iconf -i nostatus; then
210 source /usr/bin/instantstatus &
214 xfce4-power-manager &
216 while iconf -i wifiapplet:; do
217 if ! pgrep nm-applet; then
223 # welcome greeter app
224 if iconf -b welcome; then
228 # prompt to fix configuration if installed from the AUR
229 if ! iconf -i norootinstall && [ -z "$ISLIVE" ]; then
230 if ! command -v imenu || ! command -v instantmenu; then
231 notify-send "please install instantmenu and imenu"
233 if ! [ -e /opt/instantos/rootinstall ]; then
234 imenu -m "instantOS is missing some configuration"
235 while ! [ -e /tmp/rootskip ]; do
236 if imenu -c "would you like to fix that?"; then
237 touch /tmp/topinstall
238 instantsudo bash -c "instantutils root"
241 if imenu -c "Are you sure? this will prevent parts of instantOS from functioning correctly"; then
252 if iconf -i desktopicons; then
253 rox --pinboard Default
256 # user declared autostart
257 if [ -e ~/.instantautostart ]; then
258 bash ~/.instantautostart