neodotfiles/user/.config/suckless/dwmblocks/scripts/block_layout

12 lines
402 B
Text
Raw Normal View History

2023-09-04 17:36:18 +00:00
#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A dwmblocks script to print the keyboard layout
# - Dependencies: dwm, dwmblocks, setxkbmap
# this variable will store the current keyboard layout in X
2023-05-26 06:32:03 +00:00
layout=$(setxkbmap -query | grep -oP 'layout:\s*\K\w+');
2023-09-04 17:36:18 +00:00
# print the current keyboard layout in all caps
2023-05-26 06:32:03 +00:00
echo "󰥻 $layout " | tr '[:lower:]' '[:upper:]';