Openbox:Pipemenus:AudaciousControl

From Openbox

(Difference between revisions)
Jump to: navigation, search
Line 17: Line 17:
 
  # as far as these media players support the CUI control commands.
 
  # as far as these media players support the CUI control commands.
 
    
 
    
  if [ ! "$(pidof audacious)" ]; then
+
if [ ! "$(pidof audacious)" ]; then
      cat <<EOF
+
    cat <<EOF
  <openbox_pipe_menu>
+
<openbox_pipe_menu>
    <item label="Run audacious">
+
  <item label="Run audacious">
 +
    <action name="Execute">
 +
      <execute>
 +
        audacious
 +
      </execute>
 +
    </action>
 +
  </item>
 +
</openbox_pipe_menu>
 +
EOF
 +
else
 +
# if you want to show artist and album name, add next line to just below <openbox_pipe_menu>.
 +
# <separator label="`audtool --current-song-tuple-data artist`  :  `audtool --current-song-tuple-data album`" />
 +
cat <<EOF
 +
<openbox_pipe_menu>
 +
<separator label= "`audtool --current-song` (`audtool --current-song-length`)" />
 +
    <item label="Play">
 
       <action name="Execute">
 
       <action name="Execute">
 
         <execute>
 
         <execute>
           audacious
+
           audtool --playback-play
 
         </execute>
 
         </execute>
 
       </action>
 
       </action>
 
     </item>
 
     </item>
  </openbox_pipe_menu>
+
    <item label="Pause">
  EOF
+
      <action name="Execute">
  else
+
        <execute>
# if you want to show artist and album name, add next line to just below <openbox_pipe_menu>.
+
          audtool --playback-pause
# <separator label="`audtool --current-song-tuple-data artist`  :  `audtool --current-song-tuple-data album`" />
+
        </execute>
  cat <<EOF
+
      </action>
  <openbox_pipe_menu>
+
    </item>
  <separator label= "`audtool --current-song` (`audtool --current-song-length`)" />
+
    <item label="Stop">
    <item label="Play">
+
      <action name="Execute">
      <action name="Execute">
+
        <execute>
        <execute>
+
          audtool --playback-stop
          audtool --playback-play
+
        </execute>
        </execute>
+
      </action>
      </action>
+
    </item>
    </item>
+
    <item label="Previous">
    <item label="Pause">
+
      <action name="Execute">
      <action name="Execute">
+
        <execute>
        <execute>
+
          audtool --playlist-reverse
          audtool --playback-pause
+
        </execute>
        </execute>
+
      </action>
      </action>
+
    </item>
    </item>
+
    <item label="Next">
    <item label="Stop">
+
      <action name="Execute">
      <action name="Execute">
+
        <execute>
        <execute>
+
          audtool --playlist-advance
          audtool --playback-stop
+
        </execute>
        </execute>
+
      </action>
      </action>
+
    </item>
    </item>
+
    <separator/>
    <item label="Previous">
+
    <item label="Repeat `audtool --playlist-repeat-status`">
      <action name="Execute">
+
      <action name = "execute">
        <execute>
+
        <execute>
          audtool --playlist-reverse
+
          audtool --playlist-repeat-toggle
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>
    <item label="Next">
+
    <item label="Shuffle `audtool --playlist-shuffle-status`">
      <action name="Execute">
+
      <action name = "execute">
        <execute>
+
        <execute>
          audtool --playlist-advance
+
          audtool --playlist-shuffle-toggle
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>
    <separator/>
+
    <separator/>
    <item label="Repeat `audtool --playlist-repeat-status`">
+
    <item label="Jump to file">
      <action name = "execute">
+
      <action name="Execute">
        <execute>
+
        <execute>
          audtool --playlist-repeat-toggle
+
          audtool --jumptofile-show on
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>
    <item label="Shuffle `audtool --playlist-shuffle-status`">
+
    <item label="Playlist">
      <action name = "execute">
+
      <action name="Execute">
        <execute>
+
        <execute>
          audtool --playlist-shuffle-toggle
+
          audtool --playlist-show on --always-on-top on
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>
    <separator/>
+
    <item label="Add files">
    <item label="Jump to file">
+
      <action name="Execute">
      <action name="Execute">
+
        <execute>
        <execute>
+
          audtool --filebrowser-show on --always-on-top on
          audtool --jumptofile-show on
+
        </execute>
        </execute>
+
      </action>
      </action>
+
    </item>
    </item>
+
    <separator />
    <item label="Playlist">
+
    <item label="Preferences">
      <action name="Execute">
+
      <action name="Execute">
        <execute>
+
        <execute>
          audtool --playlist-show on --always-on-top on
+
          audtool --preferences-show on
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>  
    <item label="Add files">
+
    <item label="Quit audacious">
      <action name="Execute">
+
      <action name="Execute">
        <execute>
+
        <execute>
          audtool --filebrowser-show on --always-on-top on
+
          audtool --shutdown
        </execute>
+
        </execute>
      </action>
+
      </action>
    </item>
+
    </item>
    <separator />
+
</openbox_pipe_menu>
    <item label="Preferences">
+
EOF
      <action name="Execute">
+
fi
        <execute>
+
          audtool --preferences-show on
+
        </execute>
+
      </action>
+
    </item>  
+
    <item label="Quit audacious">
+
      <action name="Execute">
+
        <execute>
+
          audtool --shutdown
+
        </execute>
+
      </action>
+
    </item>
+
  </openbox_pipe_menu>
+
  EOF
+
  fi
+

Revision as of 12:58, 5 April 2011

Audacious-OpenboxPipemenu.jpg

You can control audacious from openbox menu. It allows you to control audacious easily,even if audacious window is behind other windows. I use this pipemenu from keyboard shortcut or hotkey ,like "Super + m".

I'm grateful for very useful information and examples of pipe-menus written in this wiki. Enjoy...!

#!/bin/bash
# author:Matsuda Shinpei
# Date:March 2011
#
# Openbox Pipe Menu for audacious
# Feel free to change this script as you like.
# Probably, it's not so hard to make rhythembox or other media player control menus like this,
# as far as these media players support the CUI control commands.
 
if [ ! "$(pidof audacious)" ]; then
    cat <<EOF
<openbox_pipe_menu>
  <item label="Run audacious">
    <action name="Execute">
      <execute>
        audacious 
      </execute>
    </action>
  </item>
</openbox_pipe_menu>
EOF
else
# if you want to show artist and album name, add next line to just below <openbox_pipe_menu>.
# <separator label="`audtool --current-song-tuple-data artist`  :  `audtool --current-song-tuple-data album`" />
cat <<EOF
<openbox_pipe_menu>
<separator label= "`audtool --current-song` (`audtool --current-song-length`)" />
   <item label="Play">
     <action name="Execute">
       <execute>
         audtool --playback-play
       </execute>
     </action>
   </item>
   <item label="Pause">
     <action name="Execute">
       <execute>
         audtool --playback-pause
       </execute>
     </action>
   </item>
   <item label="Stop">
     <action name="Execute">
       <execute>
         audtool --playback-stop
       </execute>
     </action>
   </item>
   <item label="Previous">
     <action name="Execute">
       <execute>
         audtool --playlist-reverse
       </execute>
     </action>
   </item>
   <item label="Next">
     <action name="Execute">
       <execute>
         audtool --playlist-advance
       </execute>
     </action>
   </item>
   <separator/>
   <item label="Repeat `audtool --playlist-repeat-status`">
     <action name = "execute">
       <execute>
         audtool --playlist-repeat-toggle
       </execute>
     </action>
   </item>
   <item label="Shuffle `audtool --playlist-shuffle-status`">
     <action name = "execute">
       <execute>
         audtool --playlist-shuffle-toggle
       </execute>
     </action>
   </item>
   <separator/>
   <item label="Jump to file">
     <action name="Execute">
       <execute>
         audtool --jumptofile-show on
       </execute>
     </action>
   </item>
   <item label="Playlist">
     <action name="Execute">
       <execute>
         audtool --playlist-show on --always-on-top on
       </execute>
     </action>
   </item>
   <item label="Add files">
     <action name="Execute">
       <execute>
         audtool --filebrowser-show on --always-on-top on
       </execute>
     </action>
   </item>
   <separator />
   <item label="Preferences">
     <action name="Execute">
       <execute>
         audtool --preferences-show on
       </execute>
     </action>
   </item> 
   <item label="Quit audacious">
     <action name="Execute">
       <execute>
         audtool --shutdown
       </execute>
     </action>
   </item>
</openbox_pipe_menu>
EOF
fi
Personal tools