diff options
author | AJ | 2015-12-20 18:47:28 -0600 |
---|---|---|
committer | AJ | 2015-12-20 18:47:28 -0600 |
commit | eaf6292e8cc36f909c0d2a3abe8972fd88e0c4ab (patch) | |
tree | 95f34628e00b1e4415bd8e67c62accb41be3f800 | |
parent | 707876d1ee9ce1c28445af55b13b50afd29f8631 (diff) | |
download | aur-systemd-vgaswitcheroo-units.tar.gz |
Only turn off the discrete GPU if it is not the active one
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rwxr-xr-x | check_active_gpu.sh | 9 | ||||
-rwxr-xr-x | vgaswitcheroo_start.sh | 7 |
4 files changed, 11 insertions, 15 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Mon Dec 21 00:34:06 UTC 2015 +# Mon Dec 21 00:46:54 UTC 2015 pkgbase = systemd-vgaswitcheroo-units pkgdesc = Disable discrete GPU at boot for AMD/NVIDIA & Intel dual stuff. This is based on the old AUR package that was not migrated to AUR4. pkgver = 1.3 @@ -14,9 +14,9 @@ pkgbase = systemd-vgaswitcheroo-units source = vgaswitcheroo_stop.sh source = check_active_gpu.sh md5sums = a01b63dacaa632b03cd2bfe1832f4d31 - md5sums = 4919673009c0a5c54322a1a9624801e9 + md5sums = f0305d6f4be6e2f3e3d8cf80b889b744 md5sums = fcbb48340873f67f4ad493a96ef951a4 - md5sums = 1f105cbe6dc07c4e76862944b9086596 + md5sums = 31363eacd067cd53a0571b2436600dcf pkgname = systemd-vgaswitcheroo-units @@ -16,9 +16,9 @@ source=('vgaswitcheroo.service' 'vgaswitcheroo_stop.sh' 'check_active_gpu.sh') md5sums=('a01b63dacaa632b03cd2bfe1832f4d31' - '4919673009c0a5c54322a1a9624801e9' + 'f0305d6f4be6e2f3e3d8cf80b889b744' 'fcbb48340873f67f4ad493a96ef951a4' - '1f105cbe6dc07c4e76862944b9086596') + '31363eacd067cd53a0571b2436600dcf') package() { install -Dm644 "${srcdir}/vgaswitcheroo.service" "${pkgdir}/usr/lib/systemd/system/vgaswitcheroo.service" diff --git a/check_active_gpu.sh b/check_active_gpu.sh index a130b04e6cbe..4d9e0b73c030 100755 --- a/check_active_gpu.sh +++ b/check_active_gpu.sh @@ -3,12 +3,5 @@ vgaswitcheroo_path='/sys/kernel/debug/vgaswitcheroo/switch' active_card=`grep '+' $vgaswitcheroo_path|awk '{split($0,a,":"); print a[2]}'` -if [ "$active_card" == "IGD" ]; -then - echo "Integrated" -elif [ "$active_card" == "DIS" ]; -then - echo "Discrete" -fi - +echo $active_card diff --git a/vgaswitcheroo_start.sh b/vgaswitcheroo_start.sh index 2f2a59a20298..47f9f4c76728 100755 --- a/vgaswitcheroo_start.sh +++ b/vgaswitcheroo_start.sh @@ -11,5 +11,8 @@ do fi done -echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch -echo OFF > /sys/kernel/debug/vgaswitcheroo/switch +if [ "$(check_active_gpu.sh)" == "IGD" ]; then + echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch + echo OFF > /sys/kernel/debug/vgaswitcheroo/switch +fi + |