zoukankan      html  css  js  c++  java
  • Control rhythmbox inside Emacs

    Control rhythmbox inside Emacs

    Control rhythmbox inside Emacs

    It is until recently that I came across a configuration option that emacs can send shell command to other applications such as rhythmbox, so I created a simple file to make this work inside emacs.

    The rhythmbox comes with a client tool to make it possible to control the playing from a terminal, so that life will be a lot easier when implementing controlling inside emacs, the functions involved is as follows:

    (defun rhythmbox-linux-command (command-name)
      "Execute command for rhythmbox inside emacs"
      (interactive)
      (setq command-text (format "rhythmbox-client %s" command-name))
      (shell-command command-text))
    
    (defun rhythmbox-toggle ()
      "Play/Pause rhythmbox"
      (interactive)
      (rhythmbox-linux-command "--play-pause"))
    
    (defun rhythmbox-next ()
      "Next song in rhythmbox"
      (interactive)
      (rhythmbox-linux-command "--next"))
    
    (defun rhythmbox-previous ()
      "Previous song in the rhythmbox"
      (interactive)
      (rhythmbox-linux-command "--previous"))
    
    (defun rhythmbox-volume-up ()
      "Increase the playback valume"
      (interactive)
      (rhythmbox-linux-command "--volume-up"))
    
    (defun rhythmbox-volume-down ()
      "Decrease the playback volume"
      (interactive)
      (rhythmbox-linux-command "--volume-down"))
    
    (global-set-key (kbd "<C-kp-4>") 'rhythmbox-previous)
    (global-set-key (kbd "<C-kp-6>") 'rhythmbox-next)
    (global-set-key (kbd "<C-kp-5>") 'rhythmbox-toggle)
    (global-set-key (kbd "<C-kp-8>") 'rhythmbox-volume-up)
    (global-set-key (kbd "<C-kp-2>") 'rhythmbox-volume-down)
    

    I only implemented some common controlling functions for the rhythmbox, more can be added with the reference manual of rhythmbox-client.

    Author: wujing

    Created: 2014-10-07 二 21:09

    Emacs 24.3.1 (Org mode 8.2.6)

    Validate

  • 相关阅读:
    VMware中安装Ubuntu后,安装VMwareTools提示“Not enough free space to extract VMwareTools-10.3.10-13959562.tar.gz”的解决办法
    XShell下便捷上载/下载文件到虚拟机
    无法获取 vmci 驱动程序版本: 句柄无效。 驱动程序 vmci.sys 版本不正确。请尝试重新安装 VMware Workstation。 打开模块DevicePowerOn电源失败。
    VMware Workstation pro无法在Windows上运行,检查可在Windows上运行的此应用的更新版本
    mybatisplus运行时修改@TableName注解的schema值
    easyexcel不创建对象导出图片
    鸿蒙(HarmonyOS)开发笔记四:项目结构
    鸿蒙(HarmonyOS)开发笔记三:核心概念
    鸿蒙(HarmonyOS)开发笔记二:使用DevEco Studio创建一个项目
    鸿蒙(HarmonyOS)开发笔记一:系统简介
  • 原文地址:https://www.cnblogs.com/wujingcqu/p/4009826.html
Copyright © 2011-2022 走看看