Jump to content

Hotcaps


Djhg2K
 Share

Recommended Posts

I recently wrote a script (or two, one for Linux and one for Windows) to turn caps lock into a dynamic hotkey (as opposed to a static hotkey which only does one thing)

The way it works is that when you press it in a normal situation it brings up Google Search in your default browser, ready for you to start typing.

But if you have new email the LED lights up and the key will take you to GMail in your default browser instead.

I've found it to save me a lot of time when I need to look something up as the browser doesn't even have to be running before you press it.

A small comparison of what it takes to search for "Hak5" on Google in a new tab from the desktop (no browser running, icon on desktop, no new mail):

Vanilla: [Double Click][Ctrl+T][G][O][O][G][L][E][.][C][O][M][Enter][H][A][K][5][Enter], hand moves 17 times
HotCaps: [Caps Lock][H][A][K][5][Enter], hand moves 5 times

Of course if you're a fan of Yahoo! Search or in worst case Bing Search, you can use that too if you want.

However in its current state the LED feature is only compatible with GMail.

I've included the full source in case you wish to implement your own service/feature/whatever.

Now there is a bug in current versions of Debian Sid x86_64 (not sure how widespread this bug is) where "xset led" is broken for caps lock, try by executing "xset led 1" and see if it lights up.

If you have this issue you might need my setcapsled utility too, full source to that in the Linux download link as well.

It's a small C program which uses IOCTL to set a bitmask for keyboard LEDs in the kernel, therefore it requires you to be root (or rather have write access to /dev/console which a regular user should never have).

If "xset led 1" works, just use the hotcaps_xset script, you don't need anything but the regular dependencies.

You may modify and redistribute the scripts and code all you want provided you give proper credit to everyone listed in there.

Dependencies (Linux):

curl (for GMail checking)

zenity (for username and password)

setcapsled (in case your xset utility is broken)

gcc (to compile setcapsled)

Dependencies (Windows):

AutoHotkey Basic (not L)

Download links:

Linux

Windows

Additional note for Linux users:

You need to set the caps lock key to run "/path/to/hotcaps --hotkey" as the script doesn't do that automatically (yet?)

Enjoy!

/ Djhg2K

Edited by Djhg2K
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...