Kaffeine Forum

Kaffeine Media Player forum

Kaffeine Forum            
Log in to check your private messages Log in to check your private messages
MCE Remote control

 
Post new topic   Reply to topic    Kaffeine Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
RobPotts



Joined: 13 Oct 2009
Posts: 4

PostPosted: Tue Oct 13, 2009 6:41 pm    Post subject: MCE Remote control Reply with quote

Hi,

I have a fuly updated PCLOS KDE4, running Kaffeine 1 pre 1. I would love to get a remote working with it, I used to use IRKick, but Kaffeine add on is not in the pipe line because kaffeine is not KDE4 ready.

Is there an way to make my phillips MCE remote work with Kaffeine. I did see a post saying that the remote buttons could be bassed to keyboard shortcuts, however I did not understand the instructions on doing this, nor do I know how to add additional shortcuts which are not on the shortcut list.

Any help would be great.

Thanks
Rob
Back to top
View user's profile Send private message
FlyingPC



Joined: 11 Oct 2009
Posts: 5

PostPosted: Sun Nov 01, 2009 3:22 pm    Post subject: Reply with quote

Hi,

My remote works fine with kaffeine 1.0 pre. I use lirc and in my .lircrc file, I use irxevent to send different key signals to kaffeine. So I don't use dcop or dbus.
Back to top
View user's profile Send private message
RobPotts



Joined: 13 Oct 2009
Posts: 4

PostPosted: Thu May 27, 2010 8:01 pm    Post subject: Reply with quote

HI,

I know it has been a while, but I've been busy. Can you please give me step by step instructions how to use irxevents to control my kaffeine. I have lirc installed and irw works. I cannot find a .lircrc file anywhere. When I try to look at the shortcuts I cannot find a way to put code into it.

I did find this link which may be useful but have no idea what to do with it.
http://www.earos.dk/mce.lircrc

I really would love to get this solved.

Cheers
Rob
Back to top
View user's profile Send private message
laraaj



Joined: 04 May 2010
Posts: 7

PostPosted: Mon May 31, 2010 12:12 am    Post subject: Solution Reply with quote

here is a copy of my .lircrc file just copy this code to a file named /tmp/lircrc
Code:

#
#
begin
        prog = irxevent
        button = Teletext   
        config = Key alt-tab RootWindow
end
#
# Suspend
#
begin
        prog = irexec
        button = Power
        config = pm-suspend
end
#
# Change Desktop
# dbus-send --print-reply  --dest=org.kde.kwin /KWin  org.kde.KWin.nextDesktop
begin
      prog = irexec
      button = Print
      config = dbus-send --print-reply  --dest=org.kde.kwin /KWin  org.kde.KWin.nextDesktop
end
#
# Up/Down/Left/Right
#
begin
        prog = irxevent
        button = Right   
        config = Key Right CurrentWindow
end
begin
        prog = irxevent
        button = Left   
        config = Key Left CurrentWindow
end
begin
        prog = irxevent
        button = Up   
        config = Key Up CurrentWindow
end
begin
        prog = irxevent
        button = Down   
        config = Key Down CurrentWindow
end
#
# Enter
#
begin
        prog = irxevent
        button = OK   
        config = Key Return CurrentWindow
end
#
# TAB
#
begin
        prog = irxevent
        button = Enter   
        config = Key Tab CurrentWindow
end
#
# Alt
#
begin
        prog = irxevent
        button = Clear   
        config = Key alt CurrentWindow
end
#
# Start Kaffeine kde3
#
begin
        prog = irexec
        button = Home   
        config = kaffeine&
end
#
##############################################
#                                            #
#               Kaffeine                     #
#                                            #
##############################################
#
# Closing Kaffeine
#

begin
        prog = irxevent
        button = Home   
        config =  Key ctrl-q Kaffeine
end
#
# change channels up and donw
#
begin
        prog = irxevent
        button = ChanUp 
        config = Key Next Kaffeine
end
begin
        prog = irxevent
        button = ChanDown     
        config = Key Prior Kaffeine
end
#
# change Volume up, donw, Mute.
#
begin
        prog = irxevent
        button = VolDown   
        config = Key minus Kaffeine
end
begin
        prog = irxevent
        button = VolUp   
        config = Key shift-equal Kaffeine
end
begin
        prog = irxevent
        button = Mute   
        config = Key m Kaffeine
end
#
# Numbers
#
begin
        prog = irxevent
        button = Zero   
        config = Key 0 Kaffeine
end
begin
        prog = irxevent
        button = One   
        config = Key 1 Kaffeine
end
begin
        prog = irxevent
        button = Two   
        config = Key 2 Kaffeine
end
begin
        prog = irxevent
        button = Three   
        config = Key 3 Kaffeine
end
begin
        prog = irxevent
        button = Four   
        config = Key 4 Kaffeine
end
begin
        prog = irxevent
        button = Five   
        config = Key 5 Kaffeine
end
begin
        prog = irxevent
        button = Six   
        config = Key 6 Kaffeine
end
begin
        prog = irxevent
        button = Seven   
        config = Key 7 Kaffeine
end
begin
        prog = irxevent
        button = Eight   
        config = Key 8 Kaffeine
end
begin
        prog = irxevent
        button = Nine   
        config = Key 9 Kaffeine
end
##################################
#      DVB Commands              #
##################################
#
# Info
#
begin
        prog = irxevent
        button = More   
        config = Key o Kaffeine
end
#
# Recall
#
begin
        prog = irxevent
        button = Back   
        config = Key ctrl-shift-z Kaffeine
end
#
# Instant record
#
begin
        prog = irxevent
        button = Record   
        config = Key ctrl-r Kaffeine
end
#
# OSD next/previous channel
#
begin
        prog = irxevent
        button = Red
        config = Key ctrl-shift-w Kaffeine
end
begin
        prog = irxevent
        button = Green   
        config = Key ctrl-shift-q Kaffeine
end
#
# OSD next/previous event
#
begin
        prog = irxevent
        button = Yellow   
        config = Key ctrl-shift-a Kaffeine
end
begin
        prog = irxevent
        button = Blue   
        config = Key ctrl-shift-s Kaffeine
end
#
# Control screen size.
#
begin
        prog = irxevent
        button = LiveTV
        config = Key f Kaffeine       
#        config = Key shift-f Kaffeine
#        config = Key shif-d Kaffeine
        config = Key period Kaffeine
        config = Key period Kaffeine
#        config = Key m Kaffeine
end
#
# Control playback.
#
#
begin
        prog = irxevent
        button = Play
        config = Key space Kaffeine
end
begin
        prog = irxevent
        button = Pause
        config = Key space Kaffeine
end
begin
        prog = irxevent
        button = Stop 
        config = Key BackSpace Kaffeine
end
begin
        prog = irxevent
        button = Forward   
        config = Key ctrl-right Kaffeine
end
begin
        prog = irxevent
        button = Rewind   
        config = Key ctrl-left Kaffeine
end
begin
        prog = irxevent
        button = Replay 
        config = Key Page_Up Kaffeine
end
begin
        prog = irxevent
        button = Skip 
        config = Key Page_Down Kaffeine
end
#
# Control playback.
#
#
begin
        prog = irxevent
        button = DVD
        config = Key alt-e Kaffeine
        config = Key alt-i Kaffeine
        config = Key alt-y Kaffeine       
        config = Key alt-a Kaffeine
end



then run this commands
Code:

cp /tmp/lircrc ~/.lircrc
irxevent -d
irexec -d

it's for Kaffeine 1 pre3
you may need to create a script that runs irxevent and irexec after your X starts
you can't run them before X because they need to connect to it.[/code]
Back to top
View user's profile Send private message
RobPotts



Joined: 13 Oct 2009
Posts: 4

PostPosted: Mon May 31, 2010 10:37 am    Post subject: Reply with quote

HI

This is excellent, and does the trick, the only problem is that I cannot get it to work on startup. I have created a file in my .kde4/autostart called irxevent.desktop, set it as executable with the following code:
[/code]

#!bin/sh

irxevent -d &
irexec -d &
Type= Application
[code/]
However I get the following message:

The desktop entry file /home/robert/.kde4/Autostart/irxeventStart.desktop has no Type=... entry

Any more help would be great.

Thanks again.

Rob
Code:
Code:
Back to top
View user's profile Send private message
RobPotts



Joined: 13 Oct 2009
Posts: 4

PostPosted: Tue Jun 01, 2010 9:03 pm    Post subject: Reply with quote

HI,

I have now solved this, I created to links to applications in this folder and they seem to work a treat.

Rob
Back to top
View user's profile Send private message
laraaj



Joined: 04 May 2010
Posts: 7

PostPosted: Wed Jun 02, 2010 2:44 am    Post subject: Reply with quote

first you don't need to use the & to run irexec and irxevent in the background because the switch -d already instruct them to run as daemons.

here is what i use to run them before KDE starts.
cop this code to a new file for example /tmp/lirc and save it
Code:


#!/bin/bash
#
# ---------------------------------------------------------------------
#
# LIRC starter (called 'lircs' for simplicity)
#
# A simple shell script to make the configuration of LIRC more comfortable.
#
# It may be necessary to change the script if ...
# - you have a non-standard installation or
# - you use more or other client applications (see below) or
# - the init scripts are located elsewhere on your Linux system (see below).
#
# ---------------------------------------------------------------------
#
# author: Michael Kammerer <M.Kammerer@gmx.de>
#
# PLEASE send me your comments, ideas, bug reports, ... via E-Mail.
#
# ---------------------------------------------------------------------

# location of the LIRC config file
# change this if your LIRC config file is located elsewhere
CONFIG_FILE=${HOME}/.lircrc

# any editor to edit LIRC config file
FILE_EDITOR=vim



# function declarations

start_clients () {
   if [ -s ${CONFIG_FILE} ]; then
      echo -n Starting LIRC clients ...

      # add more clients HERE or change the ones I put here as a start
      irxevent -d
      irexec --daemon

      echo " done"
   else
      echo "LIRC config file not found in ${CONFIG_FILE}"
      exit 1
   fi
}

restart_lircd () {
   if [ "${USER}" = "root" ]; then
      # change this if your Linux system keeps the init scripts elsewhere
      /etc/rc.d/rc.lircd restart
   else
      echo "`basename ${0}`: you must be 'root' to restart the LIRC daemon (lircd)."
      exit 1
   fi
}

stop_lircd () {
   if [ "${USER}" = "root" ]; then
      # change this if your Linux system keeps the init scripts elsewhere
      /etc/rc.d/rc.lircd stop
   else
      echo "`basename ${0}`: you must be 'root' to stop the LIRC daemon (lircd)."
      exit 1
   fi
}

edit_config_file () {
   ${FILE_EDITOR} ${CONFIG_FILE}
}

print_info () {
   echo "LIRC starter version 0.2, 09/2000 "
   echo "Written by Michael Kammerer <M.Kammerer@gmx.de>."
   echo "Visit 'www.crosswinds.net/~michaelkammerer/lircs' for updates."
}

print_help () {
   echo "LIRC starter usage: lirc [option]"
   echo "'option' can be:"
   echo "as any user:"
   echo "-h | --help     print this short help text"
   echo "-c | --clients  start LIRC clients (necessary if lircd was restarted)"
   echo "-e | --edit     edit LIRC config file '${CONFIG_FILE}'"
   echo "-v | --version  print script version and other info"
   echo "only as 'root':"
   echo "-r | --restart  restart LIRC daemon (lircd) "
   echo "-s | --stop     stop LIRC daemon"
}


# processing of command line arguments

case $1 in
   -r)
      restart_lircd
      ;;
   --restart)
      restart_lircd
      ;;
   -s)
      stop_lircd
      ;;
   --stop)
      restart_lircd
      ;;
   -c)
      start_clients
      ;;
   --clients)
      start_clients
      ;;
   -h)
      print_help
      ;;
   --help)
      print_help
      ;;
   -e)
      edit_config_file
      ;;
   --edit)
      edit_config_file
      ;;
   -v)
      print_info
      ;;
   --version)
      print_info
      ;;
   *)
      print_help
      ;;
esac


then run these commands in the terminal
Code:


cp /tmp/lirc /usr/local/bin/lirc

chmod +x /usr/local/bin/lirc

echo "/usr/local/bin/lirc -c" > ~/.kde/env/lirc.sh

chmod +x ~/.kde/env/lirc.sh



i'm assuming you are using KDE otherwise just create a shell scrip with the command lirc -c and call it before or during your window manager startup.

as for the .lircrc i posted above i forgot to tell you that i used pm-suspend command to suspend the computer. i don't know which distribution you are using so you may have to replace it with another command to suspend your computer with your remote controller.
and to wake it up from suspension with your remote controller you just need to activate wake up on USB there are alot of tutorials online about how you can do that depending on the distribution you are using.
so with that you will be able to turn on and off your computer from your remote controller.
also there are some shortcuts that are not activated by default in Kaffeine so you will have to activate them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Kaffeine Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Anti Bot Question MOD - phpBB MOD against Spam Bots
Blocked registrations / posts: 8266 / 0