From: Florian Fainelli Date: Sat, 12 Jul 2008 08:23:58 +0000 (+0000) Subject: Add anyremote (#3433) X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=3447f823deee730fa05d81e25f6a68263cd14b82;ds=sidebyside Add anyremote (#3433) SVN-Revision: 11780 --- diff --git a/utils/anyremote/Makefile b/utils/anyremote/Makefile new file mode 100644 index 0000000000..63b23835de --- /dev/null +++ b/utils/anyremote/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=anyremote +PKG_VERSION:=4.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/${PKG_NAME} +PKG_MD5SUM:=a8fce6470c32cc263c3610d92e7b4141 + +include $(INCLUDE_DIR)/package.mk + +define Package/anyremote + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A bluetooth remote control app + DEPENDS:=+bluez-libs + URL:=http://anyremote.sourceforge.net/ +endef + +define Package/anyremote/description + Remote control your machine via bluetooth +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-xtest \ + ) +endef + +define Package/anyremote/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/anyremote.cfg $(1)/etc/anyremote.cfg + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/anyremote.init $(1)/etc/init.d/anyremote +endef + +$(eval $(call BuildPackage,anyremote)) diff --git a/utils/anyremote/files/anyremote.cfg b/utils/anyremote/files/anyremote.cfg new file mode 100644 index 0000000000..cd94999266 --- /dev/null +++ b/utils/anyremote/files/anyremote.cfg @@ -0,0 +1,66 @@ +% +% anyremote configuration file for sound management. (Server-mode) +% prerequisites: amixer utility +% + +% STATUS stable +% XTEST no +% SOUND mixer +% ENV no + +% Uncomment if needed +%AutoRepeat=false +%Baudrate=19200 +Device=bluetooth:19 +%Log=true +Screen=true + +GuiAppName=Sound volume test +GuiAppIcon=sound.png +GuiAppType=Example +GuiAppBinary=true + +% 1 - increase sound volume +% 2 - mute/unmute +% 3 - increase sound volume +% 5 - show list of available controls + +[Aliases] + +% Aliases for AverMedia IR remote +VOLUMEDOWN=1 +MIN_INTERESTING=2 +VOLUMEUP=3 +TEXT=* + +[End] + +[Keys] + +(Init) =Macro(SET_CARD);Macro(TEST_MIXER);Macro(INIT_CONTROL); +(Connect)=Set(parameter,debug,on);\ + Set(icons,SoundControl,1,minus,2,mute,3,plus,4,default,5,configure,6,default,7,default,8,default,9,default,0,default,*,question,#,default);\ + Macro(SET_VIEW); + +SET_CARD =Make(var,mixer_card,echo 'if [ -f $HOME/.anyRemote/amixer.card ]; then cat $HOME/.anyRemote/amixer.card; else true; fi;'|bash -f -s); +TEST_MIXER =Exec(echo 'TEST=`amixer $(mixer_card) sget Master,0`;U=`echo $TEST|grep "Usage: amixer" |wc -l`;KD=`which kdialog|grep kdialog|grep -v not|wc -l`;if [ "x$KD" == "x1" ]; then M="kdialog --msgbox"; else M="echo";fi;if [ "x$U" != "x0" ]; then $M "ERROR: You have to correct example according to Your system configuration !"; fi;'|bash -f -s); +INIT_CONTROL=Exec(echo 'if [ -f $HOME/.anyRemote/amixer.control ]; then true; else echo "Master@0" > $HOME/.anyRemote/amixer.control; fi;'|bash -f -s) +SET_VIEW =Set(menu,add,Controls);ExecAndSet(title,cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"); + +Cancel=Exit + +Controls=ExecAndSet(list,replace,Mixer Controls,amixer scontrols|sed 's/Simple mixer control //;s/,/@/;s/$/,/');Set(menu,replace,Choose); +Choose($$)=Exec(echo $(Param) > $HOME/.anyRemote/amixer.control);Set(list,close);Macro(SET_VIEW); +Back=Set(text,close);Macro(SET_VIEW); +Back($$)=Set(list,close);Macro(SET_VIEW); + +1=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%- -q) +2=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` toggle -q) +3=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%+ -q) + +5=Macro(Controls); + +* *=Set(text,replace,Help,1 - Vol-\n2 - Mute/Unmute\n3 - Vol+\n5 - Choose mixer control) + +[End] + diff --git a/utils/anyremote/files/anyremote.init b/utils/anyremote/files/anyremote.init new file mode 100644 index 0000000000..e32b615090 --- /dev/null +++ b/utils/anyremote/files/anyremote.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +START=95 + +start() { + /usr/sbin/anyremote -f /etc/anyremote.cfg > /dev/null & +} + +stop() { + killall anyremote +} + +