Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: ubuntu 13.04 select applications to open when media player is detected ?

  1. #1
    Join Date
    Nov 2005
    Beans
    822
    Distro
    Ubuntu 13.04 Raring Ringtail

    ubuntu 13.04 select applications to open when media player is detected ?

    I want to be able to select which program opens when a media device is plugged in.

    For example:
    System Settings / Details / Removable Media / Music Player / Other Applications from the pulldown menu
    I want to select an application that is not shown in this pulldown list ?

    The applicating or program I want to select is a custom script.

    Please advise
    Last edited by AgentZ86; June 23rd, 2013 at 03:14 PM.

  2. #2
    Join Date
    Jul 2009
    Beans
    47
    Distro
    Kubuntu 13.04 Raring Ringtail

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    System Settings -> Hardware -> Device Actions

    and add your programs
    Please mark your thread as solved if you get a satisfactory response.

  3. #3
    Join Date
    Oct 2008
    Beans
    3,509

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Your post is tagged kubuntu but sounds like your using ubuntu.

    Find your application's launcher in /usr/share/applications
    Copy it to ~/.local/share/applications
    Drag the copied launcher from ~/.local/share/applications and drop in a gedit window.
    Look for an Exec= line and append with a space then %U

    Eg
    Code:
    Exec=smplayer %U
    Your app should now show up in "other application"

    To revert just delete the launcher from ~/.local/share/applications
    Last edited by stinkeye; June 17th, 2013 at 02:02 PM.

  4. #4
    Join Date
    Nov 2005
    Beans
    822
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Quote Originally Posted by Shrek01 View Post
    System Settings -> Hardware -> Device Actions

    and add your programs
    Thanks, please reread my post I don't have the option I'm looking for in there
    I need to add my script or program that I want

    On 13.04 it's
    System Settings / Details / Removable Media / Music Player / Other Applications
    But there is not option to select custom or point to a different script or application except for what is listed there

  5. #5
    Join Date
    Nov 2005
    Beans
    822
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Quote Originally Posted by stinkeye View Post
    Your post is tagged kubuntu but sounds like your using ubuntu.

    Find your application's launcher in /usr/share/applications
    Copy it to ~/.local/share/applications
    Drag the copied launcher from ~/.local/share/applications and drop in a gedit window.
    Look for an Exec= line and append with a space then %U

    Eg
    Code:
    Exec=smplayer %U
    Your app should now show up in "other application"

    To revert just delete the launcher from ~/.local/share/applications
    Yep I don't know why they retagged this as kubuntu I posted it as ubuntu.

    Anyhow, I see the local/share/applications folder but I can't drag or write anything to that folder for some reason
    So I copied my script to the applications folder with sudo cp
    I see a symlink in that folder that says defaultlist which is a symlink to etc/gnome/list

    I do not see a file called applications but only an applications folder
    Last edited by AgentZ86; June 17th, 2013 at 04:31 PM.

  6. #6
    Join Date
    Oct 2008
    Beans
    3,509

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    What's the application you want to use?

  7. #7
    Join Date
    Nov 2005
    Beans
    822
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Quote Originally Posted by stinkeye View Post
    What's the application you want to use?
    It's my own script I wrote that copies files to the media device automatically and is already executable but I wanted it to run on dection of the removable media device
    I still want prompting like you would get but just wanted to add my own application or script to the list

    I'm not sure I understand what you mean by applications's launcher.

    I see the applications folder but no applications launcher, except for the default symlink I mentioned

  8. #8
    Join Date
    Oct 2008
    Beans
    3,509

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Quote Originally Posted by AgentZ86 View Post
    It's my own script I wrote that copies files to the media device automatically and is already executable but I wanted it to run on dection of the removable media device
    I still want prompting like you would get but just wanted to add my own application or script to the list

    I'm not sure I understand what you mean by applications's launcher.

    I see the applications folder but no applications launcher, except for the default symlink I mentioned
    The files in ~/.local/share/applications and /usr/share/applications are what I call launchers or .desktop files.
    They are the same format in both locations except in /usr/share/applications they show the icon with no .desktop extension. (permission thing)

    By default there is no ~/.local/share/applications directory but when created, .desktop files placed in this directory will
    override desktop files in /usr/share/applications

    If it's a script you want in the list, make a .desktop file for it.
    eg create the file in terminal with...
    Code:
    gedit ~/.local/share/applications/usb-copy.desktop
    Paste in this....
    Code:
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon=gnome-panel-launcher
    Name=usb-copy
    Exec=/full/path/to/script %U
    Comment=usb copy script
    Edit for the path to your own icon if desired.
    Edit using full path to your script

    Save the file and you should have a usb-copy that shows in the dash and other applications
    Last edited by stinkeye; June 18th, 2013 at 06:45 PM.

  9. #9
    Join Date
    Nov 2005
    Beans
    822
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Thanks for the replies.
    This will help me with some other apps I want to write also until I learn how to make a daemon and use dbus in the future.

    So when you say it will show in the dash and other applications great.
    Will it be available in the list where you select which application starts when a removeable drive plugged in ?

    Thanks again

  10. #10
    Join Date
    Oct 2008
    Beans
    3,509

    Re: ubuntu 13.04 select applications to open when media player is detected ?

    Yep.
    Must use %U in the Exec line of the .desktop file as shown earlier.
    Attached Images Attached Images
    Last edited by stinkeye; June 21st, 2013 at 02:02 AM.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •