LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Something is "blocking" Ctrl+S (https://www.linuxquestions.org/questions/linux-newbie-8/something-is-blocking-ctrl-s-4175654886/)

justasalad 05-30-2019 03:47 PM

Something is "blocking" Ctrl+S
 
I recently installed GalliumOS (based on Ubuntu 16.04) on my Chromebook, and it seems that Ctrl+S is the only key combination that doesn't work. It does however work after I open keyboard settings and assign a dummy shortcut to Ctrl+S, and then remove it. My desktop environment is Xfce4. Here's the output when I run xev and press Ctrl+S:

Code:

KeyPress event, serial 37, synthetic NO, window 0x4000001,
    root 0x176, subw 0x0, time 315118, (361,183), root:(1232,647),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 37, synthetic NO, window 0x4000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x4000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  4294967267 0  0  0  32  0  0  0  0  0  0  0  0  0  0  0 
          0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0


I'll happily provide logs, but I don't know what logs are useful here? :P

Shadow_7 05-31-2019 12:23 PM

Different WMs/DEs have hotkey combos that don't forward to apps. Various xterms have such combos as well. You could run the app in a Xephyr window and Cntrl+Shift to lock input to that window (again to unlock). That should bypass the WM/DE, but not so much the xterm / terminology / rxvt / ... ... ... layer.

justasalad 05-31-2019 01:03 PM

Thanks for your reply. Even though I haven't found the cause, I almost have a solution; simply to bind and unbind a dummy keyboard shortcut when I log in. It's via xfce4 settings and here's the commands:

Code:

xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Primary>s" -n -t string -s dummy
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Primary>s" -r

The problem is that it's not invoked after I put it in ~/.profile and log in. It does however work when I source ~/.profile. I've never really added anything to .profile before, and I have no idea if it's read at all. Any ideas?

ehartman 05-31-2019 01:55 PM

Quote:

Originally Posted by justasalad (Post 6000799)
The problem is that it's not invoked after I put it in ~/.profile and log in. It does however work when I source ~/.profile. I've never really added anything to .profile before, and I have no idea if it's read at all.

The .profile script is only executed when the shell your window starts is a login shell. Other shells will invoke .bashrc
And of course for both a window with a command shell will have to be started, your window environment probably doesn't do it for you (mine does, but I've explicitly enabled it in the X session startup).
Code:

test -r /etc/profile && . /etc/profile
# test -r /opt/proto/profile && . /opt/proto/profile # now through /etc/profile.d

(there's a symbolic link in /etc/profile.d to /opt/proto/profile, and that one again will execute $HOME/.profile if found).

Note that the user dependant script can be called .profile, .bash_profile OR .bash_login, but only one of those is executed BY a login shell
Quote:

any of the personal initialization files ~/.bash_profile, ~/.bash_login, or ~/.profile.
By default, bash reads these files when it is invoked as a login shell (see INVOCATION below)

INVOCATION

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
(from the bash man page)

justasalad 05-31-2019 02:18 PM

Ok, I found this: https://wiki.archlinux.org/index.php/Xprofile. I've added a .xprofile but there's still one problem. In it, I added

Code:

mkdir /home/chrx/test

xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Primary>s" -n -t string -s dummy
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Primary>s" -r

and when I login the folder is there but Ctrl+S still doesn't work, and only work after I source the file. Maybe there are components that need to be loaded before these commands work? I guess I can ask at xfce forum, if this is only specific to xfce?

justasalad 05-31-2019 06:09 PM

Finally got it working by adding the commands to a shell script, and then adding that as a new entry in xfce Session and Startup (autostart). I'm sure there's a more elegant solution, but I'm lazy and it finally works now. :)

ondoho 06-01-2019 12:19 AM

Quote:

Originally Posted by justasalad (Post 6000799)
The problem is that it's not invoked after I put it in ~/.profile and log in. It does however work when I source ~/.profile. I've never really added anything to .profile before, and I have no idea if it's read at all. Any ideas?

.profile is sourced before the GUI (Xorg) starts, and xfconf-query does not work without a GUI (Xorg) running.
that's why your most recent solution is the correct one.
If i were you I'd remove that .xprofile business again, as well as the .profile entries.

btw have you tried to only remove the shortcut? i.e. only the latter command?

justasalad 06-01-2019 09:13 AM

Quote:

Originally Posted by ondoho (Post 6000924)
btw have you tried to only remove the shortcut? i.e. only the latter command?

Oops, never tried that. Unfortunately, it didn't work. Still, I'm happy it works now despite not knowing what caused it. It turned out to be a good lesson learning about .profile, .xprofile etc... and I wrote my first shell script ever haha... two lines. :P

Shadow_7 06-02-2019 11:29 PM

The .bashrc and .profile stuff only runs when your "shell" is started. Which if you boot directly to a DE/WM doesn't happen. Until you open a terminal and a shell is run. Something that most of us don't consider, since the first thing we do in X is open a terminal / shell. Or we login on the console and launch X from that shell.


All times are GMT -5. The time now is 04:19 AM.