-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_steam
executable file
·35 lines (28 loc) · 968 Bytes
/
my_steam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Since this runs in the background, capture everything to a log file
#exec 1> >(logger -s -t "$(basename "$0")" 2>&1)
#exec 2> >(logger -s -t "$(basename "$0")")
# I run this oddly sometimes, need to make sure it is in the path
PATH="/usr/games/:$PATH"
# Check if Steam is already started
if pgrep -f steam.sh > /dev/null
then
echo "Steam is already started. Since you lost it, we'll find it for you."
steam ||
exit 1
exit
fi
# Fix for bug with Gnome Activities not allowing window switching with wmctrl
dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.hide();'
steam &
# We wait for Steam network to come up
# Try 10 times, since we might wait for an update
for i in $(seq 1 10)
do
if ! netstat -lp 2>&1 | grep -i steam > /dev/null
then
sleep 1
echo "$i time waiting for Steam to start (Steam network ports not reserved)"
fi
done
steam steam://open/bigpicture &