3 ###############################################
4 ## script for instantOS autostart ##
5 ###############################################
8 if uname -m | grep -q '^arm'; then
9 if [ -e /tmp/osautostart ]; then
10 echo "already running"
13 touch /tmp/osautostart
17 bashes=$(pgrep bash | wc -l)
18 if [ "$bashes" -gt 2 ]; then
19 echo "already running"
28 if ! iconf -i dotfiles; then
29 echo "installing dotfiles"
34 echo "installing ranger plugins"
35 mkdir -p ~/.config/ranger/plugins
36 cp -r /usr/share/rangerplugins/* ~/.config/ranger/plugins/
40 # find out if we're on an installation medium
41 if command -v calamares_polkit &>/dev/null; then
43 echo "live session detected"
46 # fix small graphical glitch on status bar startup
47 NMON=$(iconf names | wc -l)
48 for i in $(eval "echo {1..$NMON}"); do
49 xdotool key 'super+2' && sleep 0.1
50 xdotool key 'super+0' && sleep 0.1
51 xdotool key 'super+c' && sleep 0.1
52 xdotool key 'super+1' && sleep 0.1
53 xdotool key 'super+comma' && sleep 0.1
56 if [ -n "$ISRASPI" ]; then
57 # enable double drawing for moving floating windows
58 # greatly increases smoothness
59 xdotool key super+alt+shift+d
60 if ! [ -e ~/.config/instantos/israspi ]; then
61 echo "marking machine as raspi"
62 mkdir -p ~/.config/instantos
63 touch ~/.config/instantos/israspi
64 # logo does not work on raspi
69 if iconf islaptop; then
70 export ISLAPTOP="true"
71 echo "laptop detected"
76 if ! [ -e /opt/instantos/potato ]; then
79 echo "your computer is a potato"
82 if ! iconf -i instantthemes; then
85 iconf -i instantthemes 1
88 # dynamically switch between light and dark gtk theme
90 if [ "$DATEHOUR" -gt "20" ]; then
96 mkdir -p /tmp/notifications &>/dev/null
97 if ! pgrep dunst; then
108 # set up oh-my-zsh config if not existing already
111 if [ -z "$ISLIVE" ]; then
113 if ! iconf -i max; then
117 if [ -e ~/instantos/monitor.sh ]; then
118 bash ~/instantos/monitor.sh &
119 elif [ -e ~/.config/autorandr/instantos/config ]; then
120 autorandr instantos &
123 if ping google.com -c 2; then
126 # fall back to already installed wallpapers
127 instantwallpaper offline
128 for i in $(seq 10); do
129 if ping google.com -c 2; then
138 # apply keybpard layout
139 if [ -e ~/instantos/keyboard ]; then
140 setxkbmap -layout $(cat ~/instantos/keyboard)
142 CURLOCALE=$(locale | grep LANG | sed 's/.*=\(.*\)\..*/\1/')
149 echo "no keyboard layout found for your locale"
154 shuf /usr/share/instantwidgets/tooltips.txt | head -1 >~/.cache/tooltip
155 conky -c /usr/share/instantwidgets/tooltips.conf &
157 # don't need applet for ethernet
158 if [ -e ~/.cache/haswifi ]; then
161 if ! pgrep nm-applet; then
170 feh --bg-scale /usr/share/instantwallpaper/defaultphoto.png
171 conky -c /usr/share/instantwidgets/install.conf &
174 if ! pgrep nm-applet; then
183 # laptop specific background jobs
184 if [ -n "$ISLAPTOP" ]; then
185 echo "libinput gestures"
186 command -v libinput-gestures \
191 source /usr/bin/instantstatus &
194 # welcome greeter app
195 if iconf -b welcome; then
199 # user declared autostart
200 if [ -e ~/.instantautostart ]; then
201 bash ~/.instantautostart