Git Product home page Git Product logo

firefox-ctrl-q-workaround's Introduction

firefox-ctrl-q-workaround

A workaround for Firefox 57 Quantum breaking CtrlQ Disable Extensions on Linux

How to use

Bind the script to Ctrl+Q system wide. For example, I use i3wm, so I have this in my i3 config

bindsym Control+q exec ~/noctrlq.sh

You might need to install xdotool.

How it works

I gets the active window using xdotool and if it's not Firefox, it uses xvkbd to forward the Ctrl+Q onto it, otherwise it is Firefox and it doesn't. Much thank to this StackOverflow question: https://askubuntu.com/questions/97213/application-specific-key-combination-remapping

Why the fuck?

The geniuses over at Mozilla broke every single method of turning off Ctrl+Q to quit in Firefox on Linux when they released 57/Quantum. There is a Ctrl+Q bypass addon written in WebExtensions, but a bug exists in the Linux version of Firefox that makes that addon not work (only works on macOS (╯°□°)╯︵ ┻━┻) and has been unfixed for literally fucking years.

It doesn't work!

xdotool is considered to be very buggy

Try using the noctrlq_xvkbd.sh script instead.

Make sure xvkbd installed for this.

firefox-ctrl-q-workaround's People

Contributors

colemickens avatar eepykate avatar jmdejong avatar m-gregoire avatar sasawat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

firefox-ctrl-q-workaround's Issues

Woha, this is cool

'Aloha!

Just wanna say your hack works brilliant. Even added an else statement to fire a
notify-send -t 1 "Saved your firefox from a unpleasent CTRL-Q"

/mogul

alternative

I use something like:

bindsym Ctrl+q exec /bin/false

to disable it systemwide.

And for being able to kill other applications, one may use bindsym $mod+Shift+q kill

Nightly and Mate-Terminal

I had to add "Nightly" as a window name to get this to work on Nightly, but for some reason it's still interfering with MATE. I have it bound to Ctrl+Q in MATE's keyboard shortcuts, and it successfully intercepts it for Firefox. However, it's not passing it into the terminal for the one application that needs it (micro, my preferred editor.) Any tips on trying to sort this out? I'm on Arch Linux.

Doesn't work in Ubuntu Bionic Beaver

I don't know if I'm doing it wrong but I downloaded i3-wm package, added the bindsym Ctrl+q exec ~/noctrlq.sh on my i3 config file. And copy the script to /etc/i3/
?

Noob question - xvkbd usage

Hey is there any good reason for using xvkbd over xdotool here?

Thanks for this repo BTW, it helped me with some other problem I had.

Remove the xvkbd dependency

You're already using xdotool, so why not just use that to send the key? It's one less dependency.

#!/bin/sh
W="$(xdotool getactivewindow)"
S1="$(xprop -id "$W" | awk -F '"' '/WM_CLASS/{print $4}')"
if [ "$S1" != "Firefox" ] && [ "$S1" != "Firefox Developer Edition" ]; then
	xdotool key --clearmodifiers --window "$W" "ctrl+q"
fi

--window and --clearmodifiers are to stop the computer from thinking you aren't holding ctrl anymore.

(I also made it compatible with just plain sh, instead of requiring bash)

(Also^2 it's not recommended to use /bin/bash as bash isn't required to be in /bin (But sh is). However env is required to be in /usr/bin by posix so you should do /usr/bin/env bash)

Still mention xvkbd command

xdotool key does not work properly on all systems.
For me it would not send key combinations properly.
The old code using xvkbd does work for me.

It may be good to mention the xvkbd solution too.
Maybe as outcommented code and a comment explaining that the user should try that if it doesn't work with xdotool

Choose a license

For the avoidance of doubt, it would help to specify the terms under which users may use and share this script. I acknowledge that the closure of #1 without comment indicates that GPLv3 was rejected as a license. So what is the license?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.