PRIMARY CATEGORY → SETUP
sxhkd → Simple X Hotkey Daemon
sxhkd
process is listen and reacts to input events and execute commands according to them
Most of that commands are bspc
invocations. That bspc
commands write in bspwm
’s socket
sxhkd
is launched by bspwm from bspwmrc script →
INFO
Note that
checkProcess
andlaunchProcess
are shell functions declared in the~/.config/bspwm/src/bspwmrc.sh
source fileAbove implementation would be something similar to the usual approach through
pgrep --exact process_name || binary|script_path &
All input events such as hotkeys are defined within its configuration file.
It declares all hotkeys related to launch and deploy processes and its functionalities such as:
- bspwm → Windows Generation, Configuration Daemon Reload, Shortcuts…
- kitty → Launchs Terminal Emulator
- roffi → Deploys Program Launcher
- Other processes such as Firefox, Burpsuite…
Configuration File → ~/.config/sxhkd/sxhkdrc
More information here
Installation
CAUTION
First, see the bspwm’s installation before proceeding with this one related to
sxhkd
There are some dependencies that are needed in the following installation steps
Clone the sxhkd’s Github Repository →
~/.config/sxhkd
directory and sxhkdrc
file →
IMPORTANT
Be aware that
sxhkdrc
’s example/template file is copied from thebspwm
repository rather than from thesxhkd
one
That’s it
Custom Shortcuts ~ TL;DR
Sxhkd
Action | Shortcut |
---|---|
Reload Sxhkd Configuration File | Super-Esc |
Bspwm
Action | Shortcut |
---|---|
Quit Bspwm (Return to the greeter | Super-S-q |
Restart Bspwm | Super-S-r |
OS Window
Action | Shortcut |
---|---|
OS Windows Closing | Super-q |
OS Windows - Monocle Layout | Super-m |
OS Windows - Tiled Layout | Super-t |
OS Windows - Floating Layout | Super-s |
OS Windows - Full Screen | Super-f |
Os Windows Focus ⬅️⬇️⬆️➡️ | Super-{h,j,k,l} |
OS Windows Movement ⬅️⬇️⬆️➡️ | Super-S-{h,j,k,l} |
OS Windows Resize ⬅️⬇️⬆️➡️ | Super-M-{h,j,k,l} |
OS Windows to another Desktop | Super-S-DESKTOP_NUMBER |
Desktop Focus | Super-DESKTOP_NUMBER |
Last Desktop Focus | Super-TAB |
Program Launch
Action | Shortcut |
---|---|
Kitty | Super-Enter |
Rofi | Super-d |
Firefox | Super-S-f |
Burpsuite | Super-S-b |
I3Lock-Fancy | Super-S-x |
Configuration File
Copy from here the sxhkdrc
Full Customised Configuration File
sxhkd Section
Reload sxhkd’s Configuration File → Super-Esc
Note that super refers to the Windows key
bspwm Section
The rest of the key bindings related to
bspwm
in thesxhkdrc
file are in the link above
Quit/Restart → Super-S-{q,r}
To Return to the greeter closing the Windows Manager → W-S-q
To Restart the Windos Manager → W-S-r
OS Windows - Open/Close → Super-Enter/Super-q
- Open → Check the Kitty Section
- Close, as follows →
OS Windows State - Monocle Layout (Zoom {in,out}) → Super-m
See the different OS Windows Layouts/States for bspwm here
It switches the Focused Windows display to a Monocle State
OS Windows State - Tiled → Super-t
bspwm Layouts/States here
It switches the Focused Windows display to its default state, the Tiled one
OS Windows State - Floating → Super-s
bspwm Layouts/States here
It switches the Focused Windows display to a Floating State
OS Windows State - Full-Screen → Super-f
bspwm Layouts/States here
It switches the Focused Windows display to a Full-Screen State
OS Windows - Focus → Super-{h,j,k,l}
To change the focus between the different OS Windows on a specific Desktop →
OS Windows - Movement → Super-S-{h,j,k,l}
Moves the focused OS Window in the specificed direction. It is like a Windows Exchange
OS Windows - Resize → Super-M-{h,j,k,l}
In the bspwm
keybinding section, a custom bash script is set as the command to be executed when the following input events (hotkeys) are performed →
The above code allows to resize an OS Window with the super + alt
shortcut regardless of the state
Create a directory inside ~/.config/bspwm
called bin
and store the bspwm_resize.sh
’s content as a script (i.e. an executable file)
bspwm_resize.sh Content here
OS Windows - Move it to another Desktop → Super-S-desktop_number
Moves the focused OS Windows to another bspwm Desktop
OS Desktop - Focus → Super-desktop_number
To move between the different OS Desktops via the Desktop Number → Super-desktop_number
To move to the last OS Desktop → Super-Tab