I have configured a button bar from which I launch a number of applications. I want to also have a button that “Quits” my FVWM session and returns me to my Gentoo terminal, but I cannot for the life of me work out the command wording. I’ve consulted the man pages, and tried many variations of the “Quit” and “exec Quit” and “exec quit” commands, but to no avail. This should be so simple – but I must confess I’m baffled. Can someone please tell me the magic words? Thanks.
[color=red]Edited by theBlackDragon:
-> moved from General questions[/color]
Well, the “Quit” command (“Exec Quit” won’t help you given that there is no external command called ‘Quit’ most likely) does do just that – exit FVWM. Depending on how you have X11 launched, that’ll either return you to your display manager, or put you to a terminal. If you wanted to explicitly change to a VT (a proper virtual terminal) you could just do:
Exec sudo chvt 1
Or, if you wanted to restart with just an xterm, for instance, you could use:
Making that change, I tried the “Restart” and the “Restart xterm,” but all they accomplished for me was, respectively, to restart fvwm and to get me into the xterm within fvwm.
What I really want is to be able to leave fvwm and return to my Gentoo command line – as the quit command in my root menu does. But I tried inserting the same root menu command (or variations of it) into my button bar configuration, but that doesn’t work.
At least I discovered my typo error in my code – which of course is so often the problem.
Thomas: VERY EMBARRASSING! Now that I discovered that typo in my code, I tried a simple “Quit” again – and that worked! Very sorry to have put you through the trouble of trying to help me with this. Many, many thanks. Jim
Using instructions contained there, I was able to configure things so that I can effect a system restart from the Gentoo command line entering a simple “restart” and a system shutdown using a simple “halt.”
However, it turns out that these commands do not work with my FVWM button bar in the manner of code entry which ultimately worked for the “Quit” command as described in my earlier postings above. I do not understand why “Quit” works so well and not “restart” and “halt” similarly. All work fine from the command line.
Anyone have an explanation – and solution? Thanks, Jim
Thanks guys. That worked fine. I appended “Exec exec…” I believe that yesterday when I tried a sole “exec,” that didn’t work, but I don’t recall for certain. Anyway, I thought I had nothing to lose by using a double “exec.”
It’s important you realise the difference, of course. A single exec spawns a shell and then the external command (via execve()). Of course, given “Exec” is spawning a shell in the first place, it makes sense that when launching the external command then you replace the shell, as it’s typically not needed. That’s what the “Exec exec” is for.
Note that the case matters – the first command – the “Exec” that FVWM knows about (since it is an FVWM command) can be in any case you like. But given that as soon as you use it you’re then at the shell level, case matters – hence why it’s then in lower case, since “exec” at the shell is a builtin.