diff options
-rw-r--r-- | PKGBUILD | 15 | ||||
-rw-r--r-- | x200-my.confd | 5 | ||||
-rw-r--r-- | x200-my.initd | 19 |
3 files changed, 26 insertions, 13 deletions
@@ -1,8 +1,8 @@ | |||
1 | # Maintainer: Robert Alessi <alessi@robertalessi.net> | 1 | # Maintainer: Robert Alessi <alessi@robertalessi.net> |
2 | 2 | ||
3 | pkgname=x200-my | 3 | pkgname=x200-my |
4 | pkgver=0.1 | 4 | pkgver=0.2 |
5 | pkgrel=2 | 5 | pkgrel=1 |
6 | pkgdesc="Service which removes whining noise from Thinkpads X200. Also powers off the wifi on shutdown." | 6 | pkgdesc="Service which removes whining noise from Thinkpads X200. Also powers off the wifi on shutdown." |
7 | arch=(any) | 7 | arch=(any) |
8 | license=(GPL2) | 8 | license=(GPL2) |
@@ -10,10 +10,12 @@ url="http://git.robertalessi.net/x200-my" | |||
10 | depends=('sysvinit' 'networkmanager' 'acpid') | 10 | depends=('sysvinit' 'networkmanager' 'acpid') |
11 | install=x200-my.install | 11 | install=x200-my.install |
12 | source=('x200-my.initd' | 12 | source=('x200-my.initd' |
13 | 'x200-my-lid.sh' | 13 | 'x200-my.confd' |
14 | 'x200-my-sleep.sh' | 14 | 'x200-my-lid.sh' |
15 | 'x200-my.sh') | 15 | 'x200-my-sleep.sh' |
16 | sha512sums=('af5ade50214a9ffe0a24d0a0c8ad93d9802a6bfab64c53a832f0d21ef4abf9c465aec88e8be6b1af90c5bb02f9718aa3a495bcb8ed496f8de2c1ad130afdf70f' | 16 | 'x200-my.sh') |
17 | sha512sums=('b8cab7790ecb542fa8aa930f26ac3f293bce772585643a0de189285415a0d7c12f5e9fb98602dd15ff9bb52afdc93acbcd658b153f1b9c1cb640646e55c3b73c' | ||
18 | '172d5def88c12118c9d736404bb7a028ee39578dd6f2dd632224e7c03ee30a34a19412725fb09c17f31aedc14846e0f2f0682f1d9077c4ff202bd7b7cf48c467' | ||
17 | '0dc141f1a26f2cd570d49a05bcc9496ba4c49fde39afad46f5a0783e83c07ec810ca81454a28c3241bcffc62ac31274e2a8d726bbd3c1e91d8cf5315b783c3f8' | 19 | '0dc141f1a26f2cd570d49a05bcc9496ba4c49fde39afad46f5a0783e83c07ec810ca81454a28c3241bcffc62ac31274e2a8d726bbd3c1e91d8cf5315b783c3f8' |
18 | '610564aa853c5dbc4e370ec2a4d3b5590e53ed235a1960927c0986a31f6c77d135086b1f5752b56fd511ea4a0294082fc7e98ee2fa7b69b37776a59f45c2ec34' | 20 | '610564aa853c5dbc4e370ec2a4d3b5590e53ed235a1960927c0986a31f6c77d135086b1f5752b56fd511ea4a0294082fc7e98ee2fa7b69b37776a59f45c2ec34' |
19 | 'cb765075f02b5cd16bcfc31571cf7c31ddcd74ff3aa832df1acd96bd8feb62855c0cf90c31c3e0028180765a51eafc5c74fb1f0406dd9172bdc0f5ec02b39f8c') | 21 | 'cb765075f02b5cd16bcfc31571cf7c31ddcd74ff3aa832df1acd96bd8feb62855c0cf90c31c3e0028180765a51eafc5c74fb1f0406dd9172bdc0f5ec02b39f8c') |
@@ -22,6 +24,7 @@ package() { | |||
22 | install -Dm755 x200-my.initd "$pkgdir"/etc/init.d/x200-my | 24 | install -Dm755 x200-my.initd "$pkgdir"/etc/init.d/x200-my |
23 | sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \ | 25 | sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \ |
24 | -i $pkgdir/etc/init.d/x200-my | 26 | -i $pkgdir/etc/init.d/x200-my |
27 | install -Dm644 "x200-my.confd" "$pkgdir/etc/conf.d/x200-my" | ||
25 | install -Dm644 "x200-my-lid.sh" "$pkgdir/etc/acpi/events/x200-my-lid" | 28 | install -Dm644 "x200-my-lid.sh" "$pkgdir/etc/acpi/events/x200-my-lid" |
26 | install -Dm644 "x200-my-sleep.sh" "$pkgdir/etc/acpi/events/x200-my-sleep" | 29 | install -Dm644 "x200-my-sleep.sh" "$pkgdir/etc/acpi/events/x200-my-sleep" |
27 | install -Dm755 "x200-my.sh" "$pkgdir/etc/acpi/x200-my.sh" | 30 | install -Dm755 "x200-my.sh" "$pkgdir/etc/acpi/x200-my.sh" |
diff --git a/x200-my.confd b/x200-my.confd new file mode 100644 index 0000000..44312bc --- /dev/null +++ b/x200-my.confd | |||
@@ -0,0 +1,5 @@ | |||
1 | # /etc/conf.d/x200-my: config file for /etc/init.d/x200-my | ||
2 | |||
3 | # Options to pass to the x200-my daemon. | ||
4 | |||
5 | PWMFREQ_RATE="0x8bb7b16dc5b6a" | ||
diff --git a/x200-my.initd b/x200-my.initd index 9d8442d..8edefd6 100644 --- a/x200-my.initd +++ b/x200-my.initd | |||
@@ -4,15 +4,20 @@ | |||
4 | 4 | ||
5 | description="Removes whining noise from Thinkpads X200 and powers off the wifi on shutdown." | 5 | description="Removes whining noise from Thinkpads X200 and powers off the wifi on shutdown." |
6 | 6 | ||
7 | start() { | 7 | command="/usr/bin/intel_reg" |
8 | if [ "${RC_CMD}" = "restart" ]; | 8 | pwmfreq="${PWMFREQ_RATE}" |
9 | then | 9 | |
10 | /usr/bin/nmcli radio all off | 10 | command_args="write 0x00061254 $pwmfreq" |
11 | fi | ||
12 | 11 | ||
13 | /usr/bin/intel_reg write 0x00061254 0x8bb7b16dc5b6a 2>/dev/null | 12 | start() { |
13 | if [ "${RC_CMD}" = "restart" ]; | ||
14 | then | ||
15 | /usr/bin/nmcli radio all off | ||
16 | fi | ||
17 | |||
18 | exec $command $command_args 2>/dev/null | ||
14 | } | 19 | } |
15 | 20 | ||
16 | stop() { | 21 | stop() { |
17 | /usr/bin/nmcli radio all off | 22 | /usr/bin/nmcli radio all off |
18 | } | 23 | } |