Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7663165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:59:22+00:00 2026-05-31T13:59:22+00:00

I want to write lirc plugin for totem (linux video application) and one of

  • 0

I want to write lirc plugin for totem (linux video application) and one of option of this lirc plugin is to toggle between “totem” and another video application (“vlc” or “mplayer”)

Part of code which execute lirc command:

if (strcasecmp (cmd, "video") == 0)
    {
            gchar **argv;
            exit_totem();
            g_shell_parse_argv ("vlc", NULL, &argv, NULL);
            g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
            g_strfreev (argv);
    }

For this command I want to assign only one value “video” (example lircrc file configuration):

begin
    prog = totem
    button = MEDIA
    config = video
end

Problem:

How to make lirc plugin to execute “vlc” or “mplayer” if one of this is installed.

Behavior:

Press button MEDIA on remote, if vlc is installed plugin to execute vlc otherwise if mplayer is installed plugin to execute mplayer and if none of them are not installed, plugin to do nothing.

In pseudo code that does not know to solve it:

if (strcasecmp (cmd, "video") == 0)
    {

     if (vlc installed)
     ------------------
        gchar **argv;
        exit_totem();
        g_shell_parse_argv ("vlc", NULL, &argv, NULL);
        g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
        g_strfreev (argv);

     else (mplayer installed)
     ------------------------
        gchar **argv;
        exit_totem();
        g_shell_parse_argv ("mplayer", NULL, &argv, NULL);
        g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
        g_strfreev (argv);           
}

Thanks and regards,

GEO

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:59:24+00:00Added an answer on May 31, 2026 at 1:59 pm

    Wouldn’t you just call something like:

     gchar **output;
     g_spawn_command_line_sync("which vlc",output,NULL,NULL,NULL); 
     if (!g_str_has_suffix (&output,"which no"))
     {
     // call vlc goes here
     }
     gchar **output2;
     g_spawn_command_line_sync("which mplayer",output2,NULL,NULL,NULL); 
     if (!g_str_has_suffix (&output2,"which no"))
     {
     // call mplayer goes here
     }
     g_strfreev (output); 
     g_strfreev (output2); 
    

    For a more detailed example using IO Channels for reading output instead of just g_str_has_suffix see Spawning processes using glib.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I want write my own desktop sharing application in Java. The application should
I want to write a Swing application in Griffon but I am not sure
I want to write a php application using Zend Framework 2 (just the beta
I want write this sql select statment in mysql v 3.23 select * from
I want to write application to send sms via COM port. Currently I have
I want to write this in C#: SomeUnknownType x; SuperDuperInvoke(x, MethodName, param1, param2, param3);
I want write an win-form application to convert data from foxpro table into sql
I want write this query in SQL Server from ( select DISTINCT salary from
I have 2 editText objecst in my android application. I want write to such
I want to write a application in C++ or C# that will behave as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.