Skip to content

Instantly share code, notes, and snippets.

@edombowsky
Last active December 31, 2025 18:26
Show Gist options
  • Select an option

  • Save edombowsky/b64ee727d3bba6a47ab9fd0c026d5514 to your computer and use it in GitHub Desktop.

Select an option

Save edombowsky/b64ee727d3bba6a47ab9fd0c026d5514 to your computer and use it in GitHub Desktop.
Configuration for keymapper
## Alias definitions
# Use modifier names from ISO Nordic / US int. layout
Alt = AltLeft
AltGr = AltRight
# Shorthand aliases only to be used when it helps retaining overall alignment
AltR = AltRight
ControlL = ControlLeft
ControlR = ControlRight
Esc = Escape
ShiftL = ShiftLeft
ShiftR = ShiftRight
# Modifier groups
EitherAlt = Alt | AltGr
Win = Meta
Alt = AltLeft | AltRight # defines a logical key
##
# Most of this came from https://github.com/ristomatti/keymapper-config
##
@include "include/utils.conf"
@include "include/key_aliases.conf"
@include "include/text_expansion.conf"
# $() can be used to embed terminal commands in output expressions, which should be executed when triggered.
# Appending ^ ensures that the command is not executed repeatedly as long as the input is kept held.
Meta{E} >> $(nautilus) ^
# ? '--' >> Backspace Backspace "—"
# Replace trigger string with the second argument
trigger = ? "$0" >> repeat[Backspace, sub[length["$0"], 1]] $1
# Format date
format_date = $(date +"$0")
[default]
trigger[":time", type[format_date["%H:%M:%S"]]]
trigger[":dts", type[format_date["%Y-%m-%d-%H-%M"]]]
trigger[":ds", type[format_date["%Y-%m-%d"]]]
trigger[":--", type["—"]]
trigger[":'", type["“"]]
# Send typed output
type = $(keymapperctl --type "$0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment