hypr conf update
language label added to hyprlock monitors and workspaces configs added to hyprland conf
This commit is contained in:
parent
d91ed1f180
commit
878e339cf6
@ -7,9 +7,8 @@
|
|||||||
### MONITORS ###
|
### MONITORS ###
|
||||||
################
|
################
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
source = ./monitors.conf
|
||||||
monitor=,preferred,auto,auto
|
source = ./workspaces.conf
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
### MY PROGRAMS ###
|
### MY PROGRAMS ###
|
||||||
|
@ -82,3 +82,17 @@ label {
|
|||||||
# halign = center
|
# halign = center
|
||||||
# valign = center
|
# valign = center
|
||||||
# }
|
# }
|
||||||
|
# selected layout
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] ~/.config/scripts/get_layout.sh
|
||||||
|
color = rgba(200, 200, 200, 1.0)
|
||||||
|
font_size = 20
|
||||||
|
font_family = Fira Semibold
|
||||||
|
position = -20, 20
|
||||||
|
halign = right
|
||||||
|
valign = bottom
|
||||||
|
shadow_passes = 5
|
||||||
|
shadow_size = 10
|
||||||
|
}
|
||||||
|
|
||||||
|
30
.config/scripts/get_layout.sh
Executable file
30
.config/scripts/get_layout.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
getFlagEmoji() {
|
||||||
|
local countryCode=$1
|
||||||
|
local flag=""
|
||||||
|
|
||||||
|
# Convert country code to uppercase
|
||||||
|
countryCode=$(echo "$countryCode" | tr '[:lower:]' '[:upper:]')
|
||||||
|
|
||||||
|
# Iterate over each character in the country code
|
||||||
|
for (( i=0; i<${#countryCode}; i++ )); do
|
||||||
|
char="${countryCode:$i:1}"
|
||||||
|
# Calculate the code point for the flag emoji
|
||||||
|
codePoint=$((127397 + $(printf "%d" "'$char")))
|
||||||
|
# Convert code point to the corresponding Unicode character
|
||||||
|
flag+=$(printf "\\U$(printf '%08x' $codePoint)")
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "$flag"
|
||||||
|
}
|
||||||
|
# TODO: get keyboard name dynamically
|
||||||
|
countryCode=$(hyprctl devices -j |
|
||||||
|
jq -r '.keyboards[] | select(.name == "at-translated-set-2-keyboard") | .active_keymap' |
|
||||||
|
cut -c1-2 |
|
||||||
|
tr 'a-z' 'A-Z')
|
||||||
|
|
||||||
|
if [ "$countryCode" = "EN" ]; then
|
||||||
|
flagEmoji="🇺🇸"
|
||||||
|
else
|
||||||
|
flagEmoji=$(getFlagEmoji "$countryCode")
|
||||||
|
fi
|
||||||
|
echo "$flagEmoji"
|
Loading…
x
Reference in New Issue
Block a user