Announcement

Collapse
No announcement yet.

Can Yakuake be configured to run a command at startup?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can Yakuake be configured to run a command at startup?

    This question would also be pertinent to Konsole as well.

    I want to automatically run a command when Yakuake is activated. Can that be done? If so, how? I haven't found what I'm looking for via Google.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    #2
    Adding the command to the end of your ~/.bashrc (or ~/.bash_profile?) will work - but the command will also run in your TTYs, Dolphin terminal, etc

    You can call konsole with a command, and just create a short script that does so, bind a shortcut to that script.

    As far as I can determine, I don't believe Yakuake is able to accept a command line option to run, like Konsole does - e.g konsole -e mc

    Comment


      #3
      You can use a custom command in Konsole profiles, I think that Yakuake also uses those profiles but I am not sure as I don't use it personally.

      Comment


        #4
        Originally posted by Bings View Post
        You can use a custom command in Konsole profiles,
        Yes, but where? Adding a command to the "Command" option (next to /bin/bash) for example breaks things.


        Comment


          #5
          Originally posted by claydoh View Post

          Yes, but where? Adding a command to the "Command" option (next to /bin/bash) for example breaks things.

          Don't type it next to /bin/bash in the command field, type it instead of. Example, I use terminal apps like neomutt, toot and newsboat with konsole profiles and I use the colours in konsole profiles to theme them. I can then add the command to open the profiles as entries in the application menu.

          Click image for larger version

Name:	Screenshot_20230817_182208.png
Views:	202
Size:	23.5 KB
ID:	673419

          Comment


            #6
            Originally posted by Snowhog View Post
            This question would also be pertinent to Konsole as well.

            I want to automatically run a command when Yakuake is activated. Can that be done? If so, how? I haven't found what I'm looking for via Google.
            I’m not sure about Yakuake or Konsole but maybe Krunner will.

            Supposedly, KRunner is a handy tool for running terminal commands without having to open a terminal, however I have not tried it myself. Here is an article about it.
            The KDE Plasma desktop has a lot of tricks up its sleeve, one of which makes using the KDE desktop even more efficient.

            Comment


              #7
              Depending on how you invoke yakuake, you could hijack that to run what you want, then yakuake, or bring it up via qdbus:
              Code:
              qdbus org.kde.yakuake /yakuake/window org.kde.yakuake.toggleWindowState
              For example, if you get to yakuake with a keyboard shortcut, change that to run a script that does stuff then yakuake.

              It's konsole behind the scenes. For the first invocation one can use environment variables to communicate with your .bashrc (or whatever your shell's startup script is), sort of. .bashrc can check /proc/$PPID/cmdline to see what started the shell.

              Conceivably, and somewhat deviously, you could have a job that watches the dbus for messages to yakuake with dbus-monitor. Working that out would have a lot of trial and error.
              Regards, John Little

              Comment


                #8
                Thanks for all the suggestions/observations. It doesn't appear that there is a simple way to do what I want; launch yakuake and have this executable run: /usr/bin/ucaresystem-core

                What I want 'ideally', is for that executable to be run when Yakuake is launched, and only when Yakuake is launched; not when Konsole is launched.

                Seems my wants exceed what is capable. Not the first time. Wont be the last time.
                Using Kubuntu Linux since March 23, 2007
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Originally posted by Snowhog View Post
                  What I want 'ideally', is for that executable to be run when Yakuake is launched, and only when Yakuake is launched

                  I'll keep an eye out for that information.


                  Comment


                    #10
                    Code:
                    qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 0 "/usr/bin/ucaresystem-core"
                    But you most likely will have to nuke some notifications in Plasma Workspace, because of this message and sound:

                    The D-Bus method runCommand was just used. There are security concerns about allowing these methods to be public. If desired, these methods can be changed to internal use only by re-compiling Yakuake. This warning will only show once for this Yakuake instance.

                    There is no Yakuake notification or setting to turn this off.

                    Also, it might need to be scripted to run yakuake, wait a moment, then use the qdbus command to run the command - sometimes they don't run in my quick tests.




                    EDIT : GIMME A SEC, BRB

                    Edit the edit, sorry, no go. I can't seem to get rid of the message without nuking a potentially useful or important warning popup/sound

                    Source
                    Source 2
                    (dunno how I missed those before.)
                    Last edited by claydoh; Aug 31, 2023, 10:29 PM.

                    Comment

                    Working...
                    X