added another application by admiral0

This commit is contained in:
Neo 2011-06-02 23:54:54 +00:00
parent 40bd252222
commit cfc851117c
3 changed files with 134 additions and 0 deletions

View File

@ -0,0 +1,46 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# contributor: Radu Andries <admiral0 at tuxfamily.org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=kdeplasma-applets-switchy
pkgver=1.0
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc="A plasmoid for kde4 using vga_switcheroo. Only switchable graphics"
url="https://github.com/admiral0/Switchy"
makedepends=("cmake" "automoc4")
depends=('kdebase-workspace')
license=('GPL')
source=("http://kde-look.org/CONTENT/content-files/136969-Switchy-1.0.tar.bz2"
"vgad"
"org.admiral0.vgad.conf")
md5sums=('6938214b0b56c479d4872c31f4d071eb'
'd9cc95fcc86aedb4541dabc8c6ecb603'
'7d78ee23540fe0b876cf687e0d569312')
build() {
cd $srcdir/Switchy/
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
}
package() {
cd $srcdir/Switchy/build
make DESTDIR=$pkgdir install
install -D daemon/vgad $pkgdir/usr/bin/vgad
install -D client/vgac $pkgdir/usr/bin/vgac
install -D $srcdir/vgad $pkgdir/etc/rc.d/vgad
install -D $srcdir/org.admiral0.vgad.conf $pkgdir/etc/dbus-1/system.d/org.admiral0.vgad.conf
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only root can own the service -->
<policy user="root">
<allow own="org.admiral0.VgaSwitcheroo"/>
</policy>
<policy context="default">
<allow send_destination="org.admiral0.VgaSwitcheroo"
send_interface="org.freedesktop.DBus.Introspectable"/>
<allow send_destination="org.admiral0.VgaSwitcheroo"
send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="org.admiral0.VgaSwitcheroo"
send_interface="org.admiral0.VgaSwitcheroo"/>
</policy>
</busconfig>

View File

@ -0,0 +1,67 @@
#!/bin/bash
daemon_name=vgad
. /etc/rc.conf
. /etc/rc.d/functions
get_pid() {
pidof -o %PPID $daemon_name
}
case "$1" in
start)
stat_busy "Starting $daemon_name daemon"
PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
# RUN
$daemon_name &
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
echo $(get_pid) > /var/run/$daemon_name.pid
add_daemon $daemon_name
stat_done
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping $daemon_name daemon"
PID=$(get_pid)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm -f /var/run/$daemon_name.pid &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;
restart)
$0 stop
sleep 3
$0 start
;;
status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;
*)
echo "usage: $0 {start|stop|restart|status}"
esac
exit 0