OSDN Git Service

instance detection fix
[instantos/instantOS.git] / autostart.sh
1 #!/bin/bash
2
3 ####################################################
4 ## script for paperbenni-dwm autostart            ##
5 ####################################################
6
7 for i in $(pidof -x autostart.sh); do
8         echo "pid $i"
9         if [ -z "$AUTOSTARTPID" ]; then
10                 AUTOSTARTPID="$i"
11         else
12                 echo "other instance of dwm autostart already running"
13                 exit
14         fi
15 done
16
17 if command -v mpv && [ -e ~/paperbenni/boot.wav ]; then
18         mpv ~/paperbenni/boot.wav &
19 fi &
20
21 while :; do
22         date="$(date)"
23         ping -q -c 1 -W 1 8.8.8.8 && date="$date|""🌍"
24         date="$date|🔊$(amixer get Master | egrep -o '[0-9]{1,3}%' | head -1)"
25         xsetroot -name "$date"
26         sleep 1m
27
28 done &
29 compton &
30
31 if ! pgrep mate-settings; then
32         while :; do
33                 if command -v mate-settings-daemon; then
34                         mate-settings-daemon
35                 else
36                         /usr/lib/mate-settings-daemon/mate-settings-daemon
37                 fi
38                 sleep 1
39         done &
40 fi
41
42 sleep 1
43
44 if ! pgrep deadd; then
45         while :; do
46                 deadd
47                 sleep 1
48         done &
49 fi
50
51 if [ -e ~/paperbenni/wallpaper.sh ]; then
52         bash ~/paperbenni/wallpaper.sh
53 fi