Controlling mpd via dmenu

Hi,
i already posted the script in the "Post your handy self made command line utilities" thread, but probably hardly anybody will look at the programming forum when searching for something like this.
I hope it is ok to post it again here, if not feel free to delete this topic (if you are a mod)
This script lets you select any track of your current mpd playlist via dmenu and makes mpd play it immediately.
I think it is pretty useful when bound to a keyboard shortcut in any tiling wm.
Yes, it took only a few minutes to do this, but maybe you'll find it useful nontheless.
#!/bin/bash
mpc play `mpc playlist | sed -e "s/^>/ /" | dmenu -i | grep -P -o "^ \d+" `

i think we need a dmenu hacks thread, hehe.  anyway here's my version of the same thing (did someone say bikeshed?)
mine accepts search parameters or 'all' to put up the whole playlist.  that way i can search from CLI or bind the 'msearch all' to a key as mentioned.
example:
  msearch a love supreme
  msearch led zeppelin
  msearch all
#!/bin/bash
if [ -f $HOME/.dmenurc ]; then
. $HOME/.dmenurc
else
DMENU='dmenu -i'
fi
if [ $# -eq 1 -a "$1" = "all" ]; then
mpc --no-status play $(mpc playlist --format '%title% by %artist%' | cut -c 2- | sed 's/)/ -/g' | $DMENU | awk '{print $1}')
else
mpc --no-status play $(mpc playlist --format '%title% by %artist% #| %album%' | cut -c 2- | sed 's/)/ -/g' | grep -i "$*" | cut -d '|' -f 1 | $DMENU | awk '{print $1}')
fi
i also keep a file at $HOME/.dmenurc that contains the DMENU variable so my 4 different dmenu scripts can all source it and keep consistent font/colors which i can change easily from one file.

Similar Messages

  • Muss: a new way to control mpd with dmenu

    muss is fast and simple. It allows you to type a few word fragments and then it automatically creates a playlist with all matching music files. The interface is bimodal: either pure command-line search (similar to plait) OR a dmenu-based browse interface showing all of your music files as you enter keywords. Again, the difference from other mpd controllers is that ALL of the matching items from dmenu get put into the playlist, not just one. (This ability to return multiple results requires a small patch to dmenu, as described in the documentation)
    For code and docs, see https://github.com/dbro/muss
    Suggestions and comments are welcome.
    Dan

    A new way to keep up with all the Office 365 Dev news, tips and tricksToday we’re excited to announce The Office Dev Show, a new dedicated Channel 9 show devoted to all things Office 365 dev-related. The show, hosted by Sonya Koptyev, will include guests from the Office 365 Extensibility engineering team, as well as key community members. The show will feature new code and capabilities that have been added for devs to customize the Office platform, including the desktop, online and mobile versions, as well as a series on how to “Get Started” building on the platform. The Office Dev Show airs weekly, on Wednesdays.The first show, released on July 17, 2015, features an interview with Yina Arenas, senior program manager, who describes all the great features available in the Office 365 unified API Preview.Upcoming showsIn the following...

  • [Solved] Control MPD with Macbook Pro Play/Pause keys

    I have mpd installed and working with ncmpcpp as the client.
    I have a 17" C2D 9600GT Mac book Po.
    I have pommed installed and working.
    I'm using openbox, but I sometimes use awesome when I feel like it.
    I think that's all you really need to know. This is probably really simple, but I'm not sure how to do it.
    I would like the play/pause key to play/pause, skip forward key to skip forward and the skip back to skip back.
    This is a little unrelated, but if any of you have a macbook pro you would know about the alternate to the F3 key. In mac It takes all of your active windows and tiles them across the screen so you can select what window. In awesome, to change the tiling mode you press Command(super)+space. Can I make that alternate F3 key mapped to this?
    Thanks guys.
    Last edited by starfox5194 (2011-01-10 22:14:48)

    Got it all set. Thanks dude. That link helped quite a bit.
    Just in case anyone was wondering, I ended up figuring out what the keys were mapped to and assigned them to control mpc via the rc.xml for openbox.
    So basically, copy and paste this into your rc.xml as long as your keys are mapped to XF86 correctly.
    <keybind key="XF86AudioPrev">
    <action name="Execute">
    <execute>mpc prev</execute>
    </action>
    </keybind>
    <keybind key="XF86AudioPlay">
    <action name="Execute">
    <execute>mpc toggle</execute>
    </action>
    </keybind>
    <keybind key="XF86AudioNext">
    <action name="Execute">
    <execute>mpc next</execute>
    </action>
    </keybind>
    Last edited by starfox5194 (2011-01-10 22:14:34)

  • Controlling Matlab via TestStand COM Objects

    I am attempting to control MATLAB via teststand activex com objects.  I set up my module to use the matlab 7 automation server, and when I try to run the sequence, I get this error:
    "Create New Object" in automation call failed.
    No such interface supported
    One reason this can occur is if the interface of your COM server cannot be marshaled. This can happen if your server is not using the default OLE marshaling implementation and does not implement its own proxy and stub code. If you write your server using Visual C++ you can add the oleautomation attribute to your interface in order to use the default OLE marshaling implementation. Alternatively, COM does not require marshaling if the server's threading model is the same as the client thread's apartment. You can try changing your server's threading model or the client thread's apartment to avoid the need to marshal the interface."
    Anyone know how to fix this?
    -Joey

    It turns out this issue was a bug within Matlab itself.  The correct registry keys were not being added for the Matlab ActiveX server with version 7.2.  The bug report is located here.  Once the correct registry keys were added there was no problem calling the Matlab ActiveX interface.
    Pat P.
    Software Engineer
    National Instruments

  • Is there a way for the 5s to HOST CONTROL devices via Lightning or otherwise?

    So I asked this question in the regular Apple forum because I am trying to help a company why is not very Apple savvy
    figure out how to offer the same level of control they offer on Android devices with the iPhone 5, 5c and 5s. They realize
    there are restrictions on the Lightning side but I was wondering if such functions can be controlled via the 3.5 jack being
    as that is an output source for the iPhone.
    I realize the EASIEST solution is for them to make their device BlueTooth capable and that would solve the issue right
    then and there but they already have several thousand units boxed and ready to go so this would be a solution for all their
    customers who own Apple devices and do not have the ability to control the device the way Android users can.
    If anyone knows of ANY device that can be host controlled by any Lightning cabled device, please let me know so they
    can look into it and get this going.
    Thank you.

    I can't answer the "host control" part of your question, but there are plenty of devices that can be controlled by an app running on the iPod. For example, the Square credit card reader connects to the headphone jack.
    If the device vendor wants to use the Lightning port, they should join the MFi Program.
    https://developer.apple.com/programs/mfi/

  • Sent control cycles via IDOC

    Hi,
    I want to use the following IDOCs to execute the KANBAN process in an external system.
    Inbound SAP: CONF51 (for Kanban status)
    Outbound SAP: PKHD5 (control cycle) + PKHD5 (kanban) information
    How can I trigger that the outbound information is sent once a day?
    Using a job I guess that is checking what happend the last day in table PKPS. I want to put in 2 fields different information from other tables. How can I do that?
    What must be setup to sent out IDOC information from SAP?
    I already setup for testing via WE19 the following and it worked:
    - Partner system with the relevant outbound message types.
    Cheers
    Mathias

    Hi,
    I have the same requirement.Please tell me how to got it done

  • Can't control iphone via car dashboard anymore

    I have a 2014 Hyundai Accent that has an iPod USB connector.  Until about a few days ago I was able to play things using the dashboard of the car.  All of a sudden now, when I plug in the iPhone nothing will play.  I have to manually press Play on the iPhone itself to get it to play or switch songs (as you might imagine this is very bad as I can't do this while driving).  If I press the "Seek" button on the dashboard, it will skip through the music but it won't actually play it, and when I select a Podcast or a song, it will display in the dashboard console but won't actually play unless I start it from the iPhone itself.  I can control the volume and change tracks but it seems like it's not recognizing it.
    This doesn't seem to be a thing with the car, since it was working fine up until a few days ago, but I'm not sure if I accidentally hit something or turned some feature on/off on the phone that's stopping this. 
    Anyone have any ideas?

    Hi, The Ruby Warlock.  
    Thank you for visiting Apple Support Communities.  
    I understand that you are unable to control your iPod via your car controls.  I have experienced this issue myself and forcing all open applications, restarting your phone may resolve this issue.  Make sure to try additional cables as well.  If this issue persists, try the remaining troubleshooting steps in the second article below.  
    Force an app to close in iOS
    http://support.apple.com/kb/ht5137
    Get help using your iPhone, iPad, or iPod touch with your car stereo
    http://support.apple.com/en-us/HT203412
    Cheers,
    Jason H.

  • How to control valve via PCI6023E and labview

    I have a PCI6023 board and labview 5.1. I need to control the opening/closing of a gas valve via these two.The problem is that the power needed to operate the valve is 24 volts while the PCI6023E board has the power of only 5V. What can be done? Please help.

    Run a secondary power supply to the valve via a transistor triggered by the DAQ board. You can get a cheap AC/DC wall plug in supply for a coupla bucks and transistors are a few cents.
    / <---- 24V2Collector
    |
    DAQ2Base----->|
    |
    \ -----> Emitter2valve
    2006 Ultimate LabVIEW G-eek.

  • Control Levels via Expression

    Is there a way to use a slider to control the various attributes that make up a levels adjustment via expression?  I am able to set them via scripting and have done so.  However, the stopwatch that lets me create an expression is linked to the histogram as a whole, not its individual components, i.e. input black, input white, gamma, etc.  Is this possible or am I barking up the wrong tree here?  The goal is to control multiple levels applied to individual clips in one nice, neat location.  An adjustment layer will not work for me because of layering.  Also, I do not want my background to be effected by the adjustment, just a few of the pieces that make up my foreground objects.

    You have to use Levels Individual controls..

  • USB6356 to control PGAs via SPI

    I need to control two PGAs via SPI protocol with my USB 6356. I have attached my code for this, my problem is that the PGA does not seem to be changing gain or doing anything at all. I am wondering if it has anything to do with the way I am sending the signal from the 6356 in Labview? Please help!
    Attachments:
    conditionalExecute PGA test.vi ‏64 KB

    Hi mc11
    There are some missing VIs... With no changing in the gain, do you mean that the SPI waveform signal is not changing?

  • Can control desktop via devices, but not streaming TO devices?

    Just got "Remote" app, and have iTunes on my PC/desktop. I've turned on Home Sharing on both desktop iTunes and on iPad 3 and iPhone 5. I can browse iTunes just fine from devices, and control my desktop just fine from here in another room, but the music is not streaming to devices as I believe it should.
    What step am I missing? In "Settings" in both remote devices, I don't see a "More" option in either "Music" or "Videos" like the online instructions say.
    Suggestions?
    Thanks

    Hi
    +"Is it possible that my computer at work only accepts incoming connections but can't connect to the outside?"+
    Yes. Some network environments (typically Windows Active Directory/ISA Servers) block outbound VPN and/or VNC connections. I have known this at a number of sites I support. Especially educational sites where you may be dealing with more than one filter/proxy. Outbound connectivity may be allowed locally but may be blocked further upstream.
    Has it ever worked? If it has in the past and it's not working now that may be because your home IP address (external one) has changed? Residential IP addresses are generally dynamically assigned. You may want to consider logmein instead? This makes connectivity possible via standard http ports.
    HTH
    Tony

  • Control FLVPlayback via ExternalAPI

    I read an article in ADOBE LIVEDOCS about how use External
    API to control an FLV in a SWF file, but it uses a simple Video
    component. Is possibile to use an FLV component to stop the video
    inside by a button in HTML which interact to SWF via javascript?
    This is the article:
    http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveD ocs_Parts&file=00001601.html

    What Internet Browser do you use? If you use Firefox,
    then download an extension called Foxytunes which
    allows you to control basic functions - not sure you
    can select the AirTunes speaker option in it though
    as it's designed for a variety of different media
    players.
    When you close iTunes you will be asked if to close
    as other applications are using the scripting
    interface - just say yes. Not sure of any others
    though.
    Hope this helps,
    Nik
    I've looked at FoxyTunes, but thats not what I intend;
    I use a server in my house with all my music which I share with iTunes. I use iTunes for Windows on my laptop and acces my music.
    Thoug I'd like to control my iTunes via my PDA (like a advanced remote control), when iTunes has a web interface I could use the browser on my PDA to control it.
    (By the way I use Firofox)

  • Control Blackberry via USB?

    Has anyone seen any software that's capable of controlling a Blackberry on a PC via USB?
    (sort of like Logmein Rescue/B*Nator does but not wireless, as this is very slow). 

    The SOTI Pocket Controller-Pro for BlackBerry is a good program for this.  It cost $40, but I have recently found a promo code that will give you 50%, but it may run out soon.  The Promo code is BBAPPWORLD you can put this on when you're at the purchase screen on the website. You can also download it and try out the trail version for about a week.  I've attached the links below and a youtube video that demonstrates what it can do, 
    This is a link to download the app to the Blackberry (the Blackberry needs to be connected when you're doing this)
    http://appworld.blackberry.com/webstore/content/13746/?lang=EN
    This link is the software you need to download onto your computer
    http://www.soti.net/PCProBB/
    This is the youtube video
    http://www.youtube.com/watch?v=UWewyWFfr1w

  • Controling IPOD via Ituens or other.

    Hello,
    my IPOD is hoocked up to my TV and charges trough my Powerbook, if some one calls me, i can mute it without getting up....
    But not pause it, i know it sounds lazy, but i have so many calls........
    Is there like a software i can use or something else to pause, next movie etc?
    Thank you

    I'm kind of confused.
    Do you want to control the iPod with your computer?
    Select the iPod in iTunes.
    On the Summary tab, select "Manully manage music and videos".
    Click the triangle in front of the iPod name.
    This will show you music and videos on the iPod.
    Select them and play them via iTunes.

  • Get FrontPanel Control references via ActiveX

    Hi,
    I've tried to get references to frontpanel controls via LabVIEW ActiveX server, equivalent to this LabVIEW code:
    but I cant find the ActiveX methods / propertis to use.   Is there a way to do this?
    /LeifS
    Solved!
    Go to Solution.

    The ActiveX Automation Server interface to the LabVIEW VI server only exposes a very small subset to the actual LabVIEW VI server. Basically it is enough to load and execute particular VIs and pass values to front panel controls by their label name, but that is it.
    The reason is twofold. When VI Server was introduced in LabVIEW around LabVIEW 5.0 this was mostly the functionality that VI server exposed altogether. There was no scripting at all, and only limited access to the object hierarchy of the frontpanel controls. Even then the ActiveX interface did not expose all methds and properties of the VI server, partly because exposure of LabVIEW internas would have required an extensive ActiveX typelibrary, partly because it was not considered a main concern to be able to do more than launching VIs through it. It was better than the DDE interface already by a long stretch.
    VI server was then extended enormously in later releases, but the ActiveX interface was not really changed much, also because Microsoft had announced .Net and declared the ActiveX hype of a few years earlier to be deprecated anyways.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for