Pipemenu Mega Thread

A place to share tips, guides, application configurations and scripts about all elements of ArchLabs

Moderator: Founder

Pipemenu Mega Thread

PostPosted by Dobbie03 » Sun Jun 04, 2017 9:25 am

Post you favourite Pipemenus here.

If you could include instructions for those of us who are new to pipemenus.
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: Pipemenu Mega Thread

PostPosted by Dobbie03 » Sun Jun 04, 2017 9:28 am

Here's a pipemenu for those of you who use MPD. Launches MPD as a ncmpcpp + visualiser in URXVT as well as volume and play/pause functions.

Code: Select all
#! /bin/zsh
 
# MPD/MPC by olshrimpeyes
# Modified for use with ArchLabs by Dobbie03
nowplaying=`mpc | grep - | sed -e 's/\&/&/g'`
playing=`mpc | grep playing `
 
echo "<openbox_pipe_menu>"
echo "<item label=\"Launch MPD\"><action name=\"Execute\"><execute>urxvt --geometry 275x40 -e ncmpcpp -S visualizer</execute></action></item>"
echo "<separator/>"
if  [[ -z $nowplaying ]]
 
then
 
echo "<item label=\"Not Playing\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
 
else
 
echo "<item label=\""$nowplaying"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
 
if [[ -z $playing ]]
 
then
 
echo "<item label=\"Paused\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
 
else
 
echo "<item label=\""$playing"\"><action name=\"Execute\"><execute>mpc</execute></action></item>"
 
fi
 
fi
 
echo "<separator/>"
 
if [[ -z $playing ]]
 
then
 
echo "<item label=\"Play\"><action name=\"Execute\"><execute>mpc play</execute></action></item>"
 
else
 
echo "<item label=\"Pause\"><action name=\"Execute\"><execute>mpc pause</execute></action></item>"
echo "<item label=\"Stop\"><action name=\"Execute\"><execute>mpc stop</execute></action></item>"
 
fi
 
echo "<item label=\"Next\"><action name=\"Execute\"><execute>mpc next</execute></action></item>"
echo "<item label=\"Previous\"><action name=\"Execute\"><execute>mpc prev</execute></action></item>"
echo "<separator/>"
echo "<item label=\"Update DB\"><action name=\"Execute\"><execute>mpc update</execute></action></item>"
echo "<item label=\"Volume\"><action name=\"Execute\"><execute>urxvt -e alsamixer</execute></action></item>"
echo "</openbox_pipe_menu>"


Put this as a .sh in /usr/bin/. Make the .sh executable. Add this line to your menu.xml:

Code: Select all
<menu execute="/usr/bin/al-mpd-pipemenu" id="pipe-mpd" label="MPD Info" />


Reconfigure Openbox for the menu to show in obmenu and you are all set.
Last edited by Dobbie03 on Sun Jun 04, 2017 9:29 am, edited 1 time in total.
Reason: fix spelling
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang


Return to Configs, Scripts, Tutorials and Tips

Who is online

Users browsing this forum: No registered users and 0 guests

cron