Last active
January 2, 2020 13:05
-
-
Save jakob1379/94d5d6f125a97a7ef709962afa2a31e8 to your computer and use it in GitHub Desktop.
A small script to migrate i3 keybinding to sxhkd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # name: i32sxhkd | |
| # converts i3-config syntas to sxhkd | |
| # argument 1 - full path to config file | |
| # expected input/output - i32sxhkd [FILE] -> converted output | |
| # example suggested usage: i32sxhkd filename > outputfile | |
| file=$1 | |
| perl -pe 's/(?<=[^\s])\+(?=[^\s])/ \+ /g; | |
| s/bindsym //g; | |
| s/--no-startup-id //g; | |
| s/bindsym //g; | |
| s/\$mod/super/g; | |
| s/Shift/shift/g; | |
| s/Control/ctrl/g; | |
| s/Ctrl/ctrl/g; | |
| s/Alt/alt/g; | |
| s/Mod1/alt/g; | |
| s/ exec /\n\t/g' \ | |
| "$file" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment