summaryrefslogtreecommitdiff
path: root/repo/laptop-mode-tools
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-08-29 13:01:02 +0000
committerdavidovski <david@davidovski.xyz>2022-08-29 13:01:02 +0000
commitc38dfe6188112ca490090966a63faefe5ec7e9a0 (patch)
tree0b5cb4f2b5148784d852070317d90485ab31e122 /repo/laptop-mode-tools
parent49fa1762a5c52ff2cf981f29a45e1797e3885bb4 (diff)
added snes9x and php
Diffstat (limited to 'repo/laptop-mode-tools')
-rw-r--r--repo/laptop-mode-tools/laptop-mode-tools.xibuild22
-rw-r--r--repo/laptop-mode-tools/laptop-mode.initd52
2 files changed, 74 insertions, 0 deletions
diff --git a/repo/laptop-mode-tools/laptop-mode-tools.xibuild b/repo/laptop-mode-tools/laptop-mode-tools.xibuild
new file mode 100644
index 0000000..b07e671
--- /dev/null
+++ b/repo/laptop-mode-tools/laptop-mode-tools.xibuild
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+NAME="laptop-mode-tools"
+DESC="Power Savings tool for Linux"
+
+MAKEDEPS="make sh"
+DEPS=""
+
+PKG_VER=1.74
+SOURCE="https://github.com/rickysarraf/laptop-mode-tools/releases/download/$PKG_VER/laptop-mode-tools_$PKG_VER.tar.gz"
+
+ADDITIONAL="laptop-mode.initd"
+
+package () {
+ DESTDIR="${PKG_DEST}" \
+ INIT_D="none" \
+ MAN_D="/usr/share/man" \
+ PMU="disabled" \
+ sh ./install.sh
+
+ install -Dm755 laptop-mode.initd /etc/init.d/laptop-mode
+}
diff --git a/repo/laptop-mode-tools/laptop-mode.initd b/repo/laptop-mode-tools/laptop-mode.initd
new file mode 100644
index 0000000..eef8199
--- /dev/null
+++ b/repo/laptop-mode-tools/laptop-mode.initd
@@ -0,0 +1,52 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ use acpid hald
+ after bootmisc
+}
+
+checkconfig() {
+ if [ ! -f /proc/sys/vm/laptop_mode ] ; then
+ eerror "Kernel does not support laptop_mode"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting laptop_mode"
+ # bug #342049 fix
+ # check if dir exists and creates if it doesn't
+ checkpath -q -d -m 755 /var/run/laptop-mode-tools
+ touch /var/run/laptop-mode-tools/enabled
+ /usr/sbin/laptop_mode auto >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping laptop_mode"
+ rm -f /var/run/laptop-mode-tools/enabled
+ /usr/sbin/laptop_mode stop >/dev/null
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} has not yet been started"
+ return 1
+ fi
+
+ ebegin "Reloading laptop_mode"
+ /usr/sbin/laptop_mode stop >/dev/null
+ rm -f /var/run/laptop-mode-tools/*
+ /usr/sbin/laptop_mode auto force >/dev/null
+ eend $?
+}
+
+# vim: set ts=4 :