Openbox rc.xml keybinds not working

Before LXQt was sufficiently developed I used Openbox as my main WM. I haven’t used it in a long time, and perhaps this forum being so quiet means a lot of people aren’t using it either? But since Openbox gets installed with LXQt I decided to set up Openbox both as a backup WM and for variety. Basically I want to set it up so I can do everything in it LXQt can, and maybe more. In this post I’d like to talk about some trouble with keybindings I’ve been having.
I like to be able to change ttys. In LXQt I can do this with ‘Ctl - Alt - F4’ for example, but none of the Ctl -Alt - F’ keys work in Openbox. I added to rc.xml:





<keybind key="W-A-3">
    <action exec="chvt 3"/>
</keybind>

<keybind key="W-A-4">
    <action exec="chvt 4"/>
</keybind>

along with some other variations but couldn’t get anything to work.
Any suggestions?
Thanks

Think it needs sudo:

chvt 3                                                                                                                          19:43:44
Couldn't get a file descriptor referring to the console.

Works with sudo. Try pkexec as sudo needs terminal.

@alama ,

    <!-- Keybindings for running applications -->
    <keybind key="W-A-F3">
       <action name="Execute">
        <command>pkexec chvt 3</command>
      </action> 
	</keybind>
    <keybind key="W-A-F4">
       <action name="Execute">
        <command>pkexec chvt 4</command>
      </action> 
	</keybind>

I’ve just learnt how to return from tty
login and then

w

shows the sessions. Mark where lightdm is. Let it be tty7
sudo chvt 7

Using pkexec in rc.xml is not working for me. However, ‘pkexec chvt N’ works fine from the terminal.
If I look at ‘man chvt’ there is no mention of it requiring sudo privileges. Also, searching the web, ‘Ctrl + Alt + F(n)’ is generally reported as the way to change ttys, independent of the Linux distribution. It works that way in LXQt, no setup necessary. So maybe my question should be, why doesn’t it work in Openbox? And are there any workarounds?

@alama ,
I tested in an EnOS newly installed Openbox with a user with administrator privilege.
The wimdow pops up for root password. It was run in boxes VM under LMDE.
Withos pkexec doesn’t work.
(As for Openbox Mabox (Arch/Manjaro based and Bunsenlabs Boron Debian based are more confortable out of the box)
So I installed EnOS Openbox like that.
and the only inserted lines into ~/.config/openbox/rc.xml are above starting from

 <!-- Keybindings for running applications -->

I prefer copying the original rc.xml before touching it.
Or if you installed the way above and didn’t deleted
./Openbox/.config/openbox/rc.xml
you can make a diff.

Openbox on Archcraft here. Pressing Ctrl+Alt+F4 works with no tweaking or sudo necessary.

I’m guessing that something is missing from your installation or there is a config issue. Did you install EOS fresh, or did you add the repo from another Arch-based installation? Did you keep your configs from a previous installation? etc.

Just trying to figure out what is different about your setup.

can you post the contents of your openbox.rc
this seems like a corrupt rc
do you have other open box issues?
are you using a gui like obkey?

Thanks for the replies. Happy to see them because this openbox subforum didn’t look all too active.
To answer some questions, I’m working with openbox on three different computers. All are running lxqt. Two of them are Arch Linux installs with the EOS repository added, and one, a laptop, is a direct EOS installation. None are available to me right now so I will post again later when I can try a few things out.
But one thing did occur to me. I never really installed openbox per se. It was installed as part of the lxqt install. So I’m wondering if something could be missing. Maybe I should try reinstalling it specifically?
Great ideas here. Since both archcraft and Bunsen Labs specialize in open box as a WM it might be worthwhile to install one or the other or both in a VM and checkout their setup.
I would expect things to work as they are expected to work and in most Linux distros. So that the usual keyboard combination for changing TTY works in archcraft tells me something. In fact even if I can only get it to work with sudo privileges it could function as a kind of screen locker, which is something I was looking to install and enable.
Will be back when I can get at these computers and do more testing.

Had a feeling it may be something like this. Are all 3 setups having the same issue?

YISS.

check and see if you have obconf

Okay. I got a chance to try it on the installed directly from an EndeavourOS USB, and the issue isn’t present. Ctl + Alt + Fn works fine to change a TTY.
So, since the other two computers were originally Arch installs, I guess this isn’t an EOS issue. Sorry about that! I won’t blame anyone who doesn’t want to continue this thread, but I’m still interested in getting to the bottom of this. When I can get a hold of those computers I will try re-installing OB and see if anything gets fixed.

I’ve installed that and lxappearance-obconf-gtk3

Thanks all

This isn’t that kinda forum :wink:

I suspect it will, but you may need to make the EOS repo the main repo, if you haven’t already, or a config or two from the Arch repos may prolong or cause future issues.

This could be your issue since you have two programs writing and overwriting to the same file. I would use just one or the other.

@alama

A brief summary of my Openbox tests:
case A: Pure EOS Openbox (per se) install with No desktop and then
a sudo pacman -Sy may be needed before running the script
The modified rc.xml works fine but the jgmenu is not automatically finds the new
programs.

case B: Installed EOS lxqt changed to Openbox session and copied rc.xml template from …xdg… to ~/.config/openbox. Modified as in my 1st post. Failed to work.

case C: Installed Debian 12 bookworm
The modified rc.xml works like a charm and if you don’t want to struggle too much this is the best option for real usage (among the ones I came across)

1 Like

Lilidog is a new one for me. The rc.xml file looks like it’s worth a try, but is there a way to get to it without downloading and installing the complete distro in a VM?

They have a GitHub too => https://github.com/sleekmason/Lilidog/tree/master/config/includes.chroot_after_packages/etc/skel/.config/openbox

I would caution you against inserting a whole foreign rc.xml. Tried no way.
These lines work both in EOS Community-Editions Openbox and in Lilidog.

   <!-- Keybindings for running applications -->
    <keybind key="W-A-F3">
       <action name="Execute">
        <command>pkexec chvt 3</command>
      </action> 
	</keybind>

the same for F4
In EOS jgmenu don’t have append.csv but there is rofi (Super+D)

To get new ideas, I’m interested in examining the rc.xml files created by developers who have specialized in openbox. Lilidog is new to me, but I’d also like to see what Archcraft and Bunsen Labs have done. Then I’ll pick and choose and apply to my own use scenario.
The big unanswered question still remains, why does Ctl + Alt + Fn work to change tty in EOS but not Arch? Hope to learn why some day. I know the Arch install is much more minimalist than EOS so maybe Openbox is needing something not there.
Anyway, what started out as expecting a simple fix has introduced me to a lot of new things I’d like to play around with. I think I’m going to create a new user login for testing to sort of sandbox things and see what I come up with.

For Archcraft, all the configs (from Openbox to Hyprland) use lots of scripts, so pretty much everything works like a full-featured window manager.

There are some things I just don’t need, like the MPD player in Polybar, and Polybar itself for that matter, as I prefer Tint2 (prefer having clickable window buttons).

you can get the package list from the github for the eos openbox edition and compare it to the arch you have.