12

In the Cinnamon Desktop:

  • What command or code is run in response to Alt+F2?
  • In what file is this association stored?
  • What command or code is run in response to the r command in the command prompt window opened by Alt+F2?
4
  • Related: askubuntu.com/questions/143838/… ==> pkill -HUP -f "cinnamon --replace". But I don't know if its exactly the same or if it just has the same effect.
    – pLumo
    Commented May 9, 2019 at 14:34
  • @RoVo that command locks up the session. I had to reboot and then it took an extra few minutes to login. Also that is the third part of the question.
    – DrM
    Commented May 9, 2019 at 14:59
  • Okay sorry, then I don't know
    – pLumo
    Commented May 9, 2019 at 15:23
  • @AdminBee Even though gnome has alt+f2 too, the answer is not the same for Cinnamon and Gnome. I knew about the answer for Gnome when I asked, and I asked about Cinnamon specifically. So your addition of a tag for gnome-shell is not correct.
    – DrM
    Commented Jul 30, 2021 at 18:16

2 Answers 2

7

Since posting this question, and with the help of the discussion following the earlier posted answer, I found the following answer in the Cinnamon source code:

/**
 * cinnamon_global_reexec_self:
 * @global: A #CinnamonGlobal
 *
 * Restart the current process.  Only intended for development purposes.
 */
 void cinnamon_global_reexec_self (CinnamonGlobal *global)
 {
     meta_restart ();
 }

I have implemented access to this function as a bash command (restartcinnamon) by adding the following line to my .bashrc file:

alias restartcinnamon='dbus-send --type=method_call --print-reply \\
      --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.Eval \\
      string:'\''global.reexec_self()'\'''   \\
      /usr/bin/dbus-send
2
  • The code seems to have changed, at least as of 5.4.10: dbus-send --type=method_call --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.Eval string:"global.real_restart()"
    – Gab
    Commented Oct 20, 2022 at 0:26
  • @Gab Thank you, I will probably update my version of the script for doing this. Also, there is again an applet that works, "Restart Cinnamon", and alt-f2 is again working. But, the command line is still important. There is a bug that locks up everything, precluding the above, that seems to be triggered by some wireless mice. So, still very useful.
    – DrM
    Commented Oct 20, 2022 at 19:19
6

Cinnamon, like GNOME from which it was forked, will restart the session when you type r into the Alt-F2 window. It's just telling it to re-execute itself, so it's not invoking a new command, but telling the Cinnamon window manager to re-execute.

9
  • 1
    Thank you, but that is not what I am asking. I want the exact program that runs from the ALT+F2, and the exact command or call (or signal) that is restarting the session.
    – DrM
    Commented May 9, 2019 at 20:21
  • 3
    I’m saying that your question can’t be answered that way, because it isnt running a command. If you would like to know what it is doing, check out the javascript source for the restart: github.com/linuxmint/cinnamon/blob/…
    – jsbillings
    Commented May 9, 2019 at 20:38
  • 1
    Okay, I see what you are saying. The question is still what code is getting executed. Your github link answers that in part, at least we know the name of the routine that is invoked. For gnome. there seems to be a way to invoke it form the command line, dbus-send --type=method_call --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'global.reexec_self()' What would the equivalent be for cinnamon?
    – DrM
    Commented May 10, 2019 at 2:53
  • Judging from this source code, it probably works the same in Cinnamon: github.com/linuxmint/cinnamon/blob/… . Just substitute org.cinnamon and /org/cinnamon for org.gnome.shell and /org/gnome/shell.
    – jsbillings
    Commented May 10, 2019 at 10:57
  • That's good, but it should be org.Cinnamon (capitalized). I found the dbus service with "d-feet". This answers a question that has been asked repeatedly in different ways over a few years. Anything on the other parts of the question?
    – DrM
    Commented May 10, 2019 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .