Created
March 26, 2016 12:03
-
-
Save fasterthanlime/3a7251a72b28a7ff14d0 to your computer and use it in GitHub Desktop.
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 ruby | |
layouts = %w(us ch(fr)) | |
current = `setxkbmap -query`.split("\n")[-1].split(':')[-1].strip | |
next_layout = layouts[(layouts.index(current) + 1) % layouts.size] | |
`setxkbmap '#{next_layout}'` | |
`notify-send '#{next_layout}'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment