Coder Social home page Coder Social logo

gxhk's Introduction

gxhk

gxhk is a hotkey daemon for X, something like sxhkd. What makes it special is the fact that it can be configured on-the-fly the same way as bspwm: through a socket in which commands to bind keys, to unbind previously bound keys, or even infos about the bound keys can be sent and displayed by clients.

Usage

Hotkeys are case-insensitive, with this syntax: modifier1-modifier2-...-key. For more info on this, check this link of the underlaying library. Note that, for this moment, controling for the lock (Caps Lock) and the mod2 (Num Lock) modifiers isn't allowed.

The app uses by default some config files: /etc/gxhkrc and $XDG_CONFIG_HOME/gxhk/gxhkrc. Using the -C flag, they can be ignored, and with the -c flag, new ones can be specified. Using the -s flag, a different socket besides the default /tmp/gxhk$DISPLAY.sock can be specified.

Here are some examples:

$ gxhk bind mod4-d 'rofi -show drun' # Spawn the rofi app menu when Super+d gets pressed
$ gxhk bind mod4-d 'rofi -show drun' 'Launch app menu' # The same thing, but with a description
$ gxhk bind Print 'maim ~/screenshot-$(date +%s).png && notify-send "Screenshot saved!"' # The command will be run using `sh -c`, so feel free to add variables, command chains, etc.
$ gxhk bind -r Mod4-Shift-Return '$TERMINAL' 'Launch terminal' # The terminal will be spawned when the hotkey Super+Shift+Enter gets released, not when it gets pressed as it happens with the ones above
$ gxhk info # Shows all the bound hotkeys so far
On mod4-d press: Launch app menu
On print press: Spawn 'maim ~/screenshot-$(date +%s).png && notify-send "Screenshot saved!"'
On mod4-shift-return release: Launch terminal
$ gxhk unbind Mod4-d # The Super+d hotkey will be unbound
$ gxhk info # Let's see what happens now
On print press: Spawn 'maim ~/screenshot-$(date +%s).png && notify-send "Screenshot saved!"'
On mod4-shift-return release: Launch terminal

You can check the gxhkrc file for more inspiration, or, once you've installed the app, just copy the default config file like this: install -Dm755 /etc/gxhkrc ~/.config/gxhk/gxhkrc and start editing.

Installation

Arch Linux & friends

Install the gxhk-git package from the AUR the way you like it. For instance, I like it this way:

yay -S gxhk-git

From source

Run make build to build the app, then sudo make install to install it.

gxhk's People

Contributors

alex11br avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.