diff --git a/gamewrapper.sh b/gamewrapper.sh index 87ad068..1564b54 100755 --- a/gamewrapper.sh +++ b/gamewrapper.sh @@ -1,14 +1,29 @@ #!/usr/bin/env bash -init () { - kill $(pidof redshift) - fanmode.sh 1 +init() { + /usr/bin/asusctl profile -p | cut -d' ' -f4 > /tmp/pre-gamerun.state + /usr/bin/asusctl profile -P Performance + #notify-send "`asusctl profile -p`" } -deinit () { - exec redshift & - fanmode.sh 0 +deinit() { + /usr/bin/asusctl profile -P `echo /tmp/pre-gamerun.state` + rm /tmp/pre-gaemrun.state + #notify-send "`asusctl profile -p`" } -init && /usr/bin/prime-run $@ && deinit +usage() { + echo "Usage: ${0} [start|stop]" +} +case ${1} in + start) + init + ;; + stop) + deinit + ;; + *) + usage + ;; +esac diff --git a/remoteoffice.sh b/remoteoffice.sh index d165417..cf2d605 100755 --- a/remoteoffice.sh +++ b/remoteoffice.sh @@ -2,15 +2,19 @@ set -x +# Paths +PASS="`which pass`" +RDP="`which xfreerdp`" + # VPN NMCONN="49088a1e-18c2-48aa-a664-f212eb83a727" # RDP DEF_RESOLUTION="1920x1080" DRIVE="`xdg-user-dir DOCUMENTS`/Work" -DOMAIN="$(pass show Work/AD-LOGIN | awk '/domain:/ {print $2}')" -USER="$(pass show Work/AD-LOGIN | awk '/user:/ {print $2}')" -REMOTE="$(pass show Work/AD-LOGIN | awk '/remote:/ {print $2}')" -PASSWORD="$(pass show Work/AD-LOGIN | head -1)" +DOMAIN="`pass show Work/AD-LOGIN | awk '/domain:/ {print $2}'`" +USER="`pass show Work/AD-LOGIN | awk '/user:/ {print $2}'`" +REMOTE="`pass show Work/AD-LOGIN | awk '/remote:/ {print $2}'`" +PASSWORD="`pass show Work/AD-LOGIN | head -1`" [[ ! -d "${DRIVE}" ]] && mkdir -p ${DRIVE} @@ -34,11 +38,11 @@ rdp() { } -if [ $(nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}') == "activated" ]; then +if [ `nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}'` = "activated" ]; then rdp else nmcli --ask con up ${NMCONN} - while [ $(nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}') != "activated" ]; do + while [ `nmcli con show ${NMCONN} | awk '/GENERAL.STATE/ {print $2}'` != "activated" ]; do sleep 1 done sleep 3 diff --git a/unlock_adb_device.sh b/unlock_adb_device.sh index 5800cf1..813f989 100755 --- a/unlock_adb_device.sh +++ b/unlock_adb_device.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -x + unlock() { ### Activates the screen and unlocks the phone # Reads the current screen state eturns any combination of ON/OFF and