Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from mib1982/master

Change of service
  • Loading branch information...
commit d42ec089f387abb3b45140bbb423c05a854b9a5b 2 parents e767155 + 727657c
@fredoche authored
View
11 README.md
@@ -7,13 +7,13 @@ I will happily accept pull requests if anyone knows a better way to achieve the
Description
===========
-This project consists of two files: A systemd service definition file, and a simple shell script which will issue the right command to turn the graphic adapter OFF.
+This project consists of three files: A systemd service definition file, and two simple shell scripts which will issue the right command to turn the graphic adapter OFF on booting and ON on shutdown. To turn the graphic adapter back on upon shutdown is neccessary, because otherwise it may lead to freezes when saving your alsa-levels.
Installation
============
-After cloning, move nodis.sh to the /root directory, and vgaswitcheroo.service to /lib/systemd/system/ . After that, issue the following command as root to enable the service on startup.
-```# systemctl enable plop.service```
+After cloning, move *.sh to the /usr/bin/ directory, and vgaswitcheroo.service to /lib/systemd/system/ . After that, issue the following command as root to enable the service on startup.
+```# systemctl enable vgaswitcheroo.service```
Usage
=====
@@ -22,8 +22,9 @@ This should be enough. If you need to check whether it's working or not, you can
```cat /sys/kernel/debug/vgaswitcheroo/switch```
The expected output should show that the DIScrete adapter is off.
```
-0:DIS: :Off:0000:01:00.0
-1:IGD:+:Pwr:0000:00:02.0
+0:IGD:+:Pwr:0000:00:02.0
+1:DIS-Audio: :Off:0000:01:00.1
+2:DIS: :Off:0000:01:00.0
```
View
2  nodis.sh
@@ -1,2 +0,0 @@
-#! /bin/sh
-echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
View
5 vgaswitcheroo.service
@@ -2,7 +2,10 @@
Description=Deactivate the discrete graphic
[Service]
-ExecStart=/root/nodis.sh
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/vgaswitcheroo_start.sh
+ExecStop=/usr/bin/vgaswitcheroo_stop.sh
[Install]
WantedBy=multi-user.target
View
4 vgaswitcheroo_start.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+modprobe radeon
+echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
+echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
View
2  vgaswitcheroo_stop.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo ON > /sys/kernel/debug/vgaswitcheroo/switch
Please sign in to comment.
Something went wrong with that request. Please try again.