i3 – show mapped hotkeys

2019-12-02 165 words 1 min read

Here is a simple script that can show you the hotkeys bound in ~/.config/i3/config :

 

#!/bin/bash - 
#===============================================================================
#
#          FILE: i3-showkeys.sh
# 
#         USAGE: ./i3-showkeys.sh 
# 
#   DESCRIPTION: 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#  ORGANIZATION: Individual
#       CREATED: 11/26/2019 14:22
# Last modified: Tue Nov 26, 2019  02:43PM
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error


> /tmp/keys
cd ~/.config/i3
grep '^bindsym $mod' config|grep -v '^#'|grep -v 'move container to'|grep -v 'workspace $ws'|sed 's/bindsym //'|grep -v '='|while read key line
do
    printf "%20s\t?\t%s\n" "$key" "$line"  >> /tmp/keys
done

xterm -e "cat /tmp/keys; read -p 'press any key to continue'"
rm -f /tmp/keys

And once this is done, you can bind the script in i3 config like this:

 

bindsym $mod+Shift+h exec ~/bin/i3-showkeys.sh

Restart i3. And then you can press “Mod key + Shift + h” at any time to see all the bindings in your config.


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it