-
Notifications
You must be signed in to change notification settings - Fork 1
/
faugus-session
50 lines (38 loc) · 1.6 KB
/
faugus-session
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
FAUGUS_LAUNCHER_DIR="$CONFIG_DIR/faugus-launcher"
SESSION_FILE="$FAUGUS_LAUNCHER_DIR/session.ini"
SCREEN_WIDTH=$(grep -i "SCREEN_WIDTH" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
SCREEN_HEIGHT=$(grep -i "SCREEN_HEIGHT" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
INTERNAL_WIDTH=$(grep -i "INTERNAL_WIDTH" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
INTERNAL_HEIGHT=$(grep -i "INTERNAL_HEIGHT" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
REFRESH_RATE=$(grep -i "REFRESH_RATE" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
ADAPTIVE_SYNC=$(grep -i "ADAPTIVE_SYNC" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
HDR=$(grep -i "HDR" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
PREFER_OUTPUT=$(grep -i "PREFER_OUTPUT" "$SESSION_FILE" | cut -d'=' -f2 | xargs)
GAMESCOPE_PARAMS=""
if [ -n "$SCREEN_WIDTH" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS -W $SCREEN_WIDTH"
fi
if [ -n "$SCREEN_HEIGHT" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS -H $SCREEN_HEIGHT"
fi
if [ -n "$INTERNAL_WIDTH" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS -w $INTERNAL_WIDTH"
fi
if [ -n "$INTERNAL_HEIGHT" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS -h $INTERNAL_HEIGHT"
fi
if [ -n "$REFRESH_RATE" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS -r $REFRESH_RATE"
fi
if [ -n "$PREFER_OUTPUT" ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS --prefer-output $PREFER_OUTPUT"
fi
if [ "$ADAPTIVE_SYNC" == 1 ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS --adaptive-sync"
fi
if [ "$HDR" == 1 ]; then
GAMESCOPE_PARAMS="$GAMESCOPE_PARAMS --hdr-enabled"
fi
gamescope $GAMESCOPE_PARAMS -- faugus-launcher session