diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh new file mode 100755 index 0000000..40b212f --- /dev/null +++ b/config/hypr/scripts/SwitchKeyboardLayout.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +layout_f="/tmp/kb_layout" +current_layout=$(cat "$layout_f") + +# Read keyboard layout settings from Settings.conf +settings_file="$HOME/.config/hypr/configs/Settings.conf" + +if [ -f "$settings_file" ]; then + # Extract the value of kb_layout from Settings.conf + kb_layout_line=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2) + IFS=',' read -ra layout_mapping <<< "$kb_layout_line" +fi + +layout_count=${#layout_mapping[@]} + +# Find the index of the current layout in the mapping +for ((i = 0; i < layout_count; i++)); do + if [ "$current_layout" == "${layout_mapping[i]}" ]; then + current_index=$i + break + fi +done + +# Calculate the index of the next layout +next_index=$(( (current_index + 1) % layout_count )) +new_layout="${layout_mapping[next_index]}" + +# Update the keyboard layout +hyprctl keyword input:kb_layout "$new_layout" +echo "$new_layout" > "$layout_f" diff --git a/config/waybar/configs/Def[Bottom]-Laptop b/config/waybar/configs/Def[Bottom]-Laptop index 8bf8ecd..d7b7d18 100644 --- a/config/waybar/configs/Def[Bottom]-Laptop +++ b/config/waybar/configs/Def[Bottom]-Laptop @@ -56,11 +56,12 @@ "custom/separator#dot-line", "pulseaudio", "custom/separator#dot-line", - //"wireplumber", "pulseaudio#microphone", "custom/separator#dot-line", "keyboard-state", "custom/separator#dot-line", + "custom/keyboard", + "custom/separator#dot-line", "custom/power", ], } diff --git a/config/waybar/configs/Def[TOP]-Laptop b/config/waybar/configs/Def[TOP]-Laptop index eabaf37..8808e76 100644 --- a/config/waybar/configs/Def[TOP]-Laptop +++ b/config/waybar/configs/Def[TOP]-Laptop @@ -56,11 +56,12 @@ "custom/separator#dot-line", "pulseaudio", "custom/separator#dot-line", - //"wireplumber", "pulseaudio#microphone", "custom/separator#dot-line", "keyboard-state", "custom/separator#dot-line", + "custom/keyboard", + "custom/separator#dot-line", "custom/power", ], } \ No newline at end of file diff --git a/config/waybar/configs/Default [Bottom] b/config/waybar/configs/Default [Bottom] index 6c37a22..1e1e5ab 100644 --- a/config/waybar/configs/Default [Bottom] +++ b/config/waybar/configs/Default [Bottom] @@ -56,6 +56,8 @@ "custom/separator#dot-line", "keyboard-state", "custom/separator#dot-line", + "custom/keyboard", + "custom/separator#dot-line", "custom/power", ], } diff --git a/config/waybar/configs/Default [TOP] b/config/waybar/configs/Default [TOP] index edc1409..acce267 100644 --- a/config/waybar/configs/Default [TOP] +++ b/config/waybar/configs/Default [TOP] @@ -56,6 +56,8 @@ "custom/separator#dot-line", "keyboard-state", "custom/separator#dot-line", + "custom/keyboard", + "custom/separator#dot-line", "custom/power", ], } \ No newline at end of file diff --git a/config/waybar/modules b/config/waybar/modules index a4567c0..fa98904 100644 --- a/config/waybar/modules +++ b/config/waybar/modules @@ -457,6 +457,14 @@ "tooltip": false, "on-click": "~/.config/hypr/scripts/KeyHints.sh", }, + + "custom/keyboard": { + "exec": "cat /tmp/kb_layout", + "interval": 3, + "format": " {}", + "on-click": "~/.config/hypr/scripts/SwitchKeyboardLayout.sh", + "tooltip": false, + }, "custom/light_dark": { "format": "", @@ -640,7 +648,7 @@ "temperature#vertical": { "interval": 10, "tooltip": true, - "hwmon-path": ["/sys/class/hwmon/hwmon1/temp1_input", "/sys/class/thermal/thermal_zone0/temp"], + "hwmon-path": ["/sys/class/hwmon/hwmon6/temp1_input", "/sys/class/thermal/thermal_zone0/temp"], //"thermal-zone": 0, "critical-threshold": 80, "format-critical": "{icon}\n{temperatureC}°C", diff --git a/config/waybar/style/Catppuccin-Latte.css b/config/waybar/style/Catppuccin-Latte.css index 619b24a..21f295b 100644 --- a/config/waybar/style/Catppuccin-Latte.css +++ b/config/waybar/style/Catppuccin-Latte.css @@ -53,8 +53,6 @@ window#waybar.hidden { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -72,6 +70,7 @@ window#waybar.hidden { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Catppuccin-Mocha.css b/config/waybar/style/Catppuccin-Mocha.css index eceb569..1d49b33 100644 --- a/config/waybar/style/Catppuccin-Mocha.css +++ b/config/waybar/style/Catppuccin-Mocha.css @@ -59,8 +59,6 @@ window#waybar.hidden { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -78,6 +76,7 @@ window#waybar.hidden { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Chroma Edge.css b/config/waybar/style/Chroma Edge.css index fac5035..7195b3f 100644 --- a/config/waybar/style/Chroma Edge.css +++ b/config/waybar/style/Chroma Edge.css @@ -107,6 +107,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Chroma Glow.css b/config/waybar/style/Chroma Glow.css index 46cfe7c..789b267 100644 --- a/config/waybar/style/Chroma Glow.css +++ b/config/waybar/style/Chroma Glow.css @@ -102,8 +102,6 @@ tooltip label{ #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -121,6 +119,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Chroma Tally.css b/config/waybar/style/Chroma Tally.css index 789cb38..263906d 100644 --- a/config/waybar/style/Chroma Tally.css +++ b/config/waybar/style/Chroma Tally.css @@ -59,8 +59,6 @@ window#waybar { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -78,6 +76,7 @@ window#waybar { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Crimson.css b/config/waybar/style/Crimson.css index 44c20e0..8d139d1 100644 --- a/config/waybar/style/Crimson.css +++ b/config/waybar/style/Crimson.css @@ -116,8 +116,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -135,6 +133,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Crystal Clear.css b/config/waybar/style/Crystal Clear.css index 324c7aa..566b196 100644 --- a/config/waybar/style/Crystal Clear.css +++ b/config/waybar/style/Crystal Clear.css @@ -102,8 +102,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -119,6 +117,7 @@ tooltip { #workspaces, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Golden Noir.css b/config/waybar/style/Golden Noir.css index 2540188..42ae216 100644 --- a/config/waybar/style/Golden Noir.css +++ b/config/waybar/style/Golden Noir.css @@ -128,8 +128,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -147,6 +145,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Monochrome Contrast.css b/config/waybar/style/Monochrome Contrast.css index 7460260..6dbb473 100644 --- a/config/waybar/style/Monochrome Contrast.css +++ b/config/waybar/style/Monochrome Contrast.css @@ -40,7 +40,7 @@ tooltip label{ .modules-right { background-color: white; color: black; - border-bottom: 2px; + border-bottom: 4px; border-style: solid; border-color: black; border-radius: 10px; @@ -52,7 +52,7 @@ tooltip label{ .modules-center { background-color: white; color: black; - border-bottom: 2px; + border-bottom: 4px; border-style: solid; border-color: black; border-radius: 10px; @@ -64,7 +64,7 @@ tooltip label{ .modules-left { background-color: white; color: black; - border-bottom: 2px; + border-bottom: 4px; border-style: solid; border-color: black; border-radius: 10px; @@ -115,8 +115,6 @@ tooltip label{ #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -134,6 +132,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Monochrome Manifest.css b/config/waybar/style/Monochrome Manifest.css index 2d4cafd..913dc8e 100644 --- a/config/waybar/style/Monochrome Manifest.css +++ b/config/waybar/style/Monochrome Manifest.css @@ -40,7 +40,7 @@ tooltip label{ .modules-right { background-color: black; color: white; - border-bottom: 2px; + border-bottom: 3px; border-style: solid; border-color: white; border-radius: 10px; @@ -52,7 +52,7 @@ tooltip label{ .modules-center { background-color: black; color: white; - border-bottom: 2px; + border-bottom: 3px; border-style: solid; border-color: white; border-radius: 10px; @@ -64,7 +64,7 @@ tooltip label{ .modules-left { background-color: black; color: white; - border-bottom: 2px; + border-bottom: 3px; border-style: solid; border-color: white; border-radius: 10px; @@ -114,8 +114,6 @@ tooltip label{ #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -133,6 +131,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Obsidian Edge.css b/config/waybar/style/Obsidian Edge.css index 59f5828..53aa79b 100644 --- a/config/waybar/style/Obsidian Edge.css +++ b/config/waybar/style/Obsidian Edge.css @@ -121,8 +121,6 @@ tooltip label { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -140,6 +138,7 @@ tooltip label { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Obsidian Glow.css b/config/waybar/style/Obsidian Glow.css index e790730..df6a968 100644 --- a/config/waybar/style/Obsidian Glow.css +++ b/config/waybar/style/Obsidian Glow.css @@ -90,8 +90,6 @@ tooltip label { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -109,6 +107,7 @@ tooltip label { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Purpl.css b/config/waybar/style/Purpl.css index 3a6c690..7d89f32 100644 --- a/config/waybar/style/Purpl.css +++ b/config/waybar/style/Purpl.css @@ -125,8 +125,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -144,6 +142,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Pywal Simple.css b/config/waybar/style/Pywal Simple.css index 83d73cd..321f6e8 100644 --- a/config/waybar/style/Pywal Simple.css +++ b/config/waybar/style/Pywal Simple.css @@ -106,8 +106,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -125,6 +123,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Pywal.css b/config/waybar/style/Pywal.css index 411cf42..a0ce502 100644 --- a/config/waybar/style/Pywal.css +++ b/config/waybar/style/Pywal.css @@ -8,7 +8,7 @@ font-weight: bold; min-height: 0; /* set font-size to 100% if font scaling is set to 1.00 using nwg-look */ - font-size: 96%; + font-size: 94%; font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"'; padding: 1px; } @@ -122,8 +122,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -141,6 +139,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Rainbow Spectrum.css b/config/waybar/style/Rainbow Spectrum.css index 9f0c704..aa140f0 100644 --- a/config/waybar/style/Rainbow Spectrum.css +++ b/config/waybar/style/Rainbow Spectrum.css @@ -57,8 +57,6 @@ tooltip label{ #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -76,6 +74,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, @@ -138,6 +137,7 @@ tooltip label{ background-color: #a6e3a1; } +#custom-keyboard, #keyboard-state, #keyboard-state label, #keyboard-state label.locked, diff --git a/config/waybar/style/Rose Pine.css b/config/waybar/style/Rose Pine.css index 261f4b6..856edc0 100644 --- a/config/waybar/style/Rose Pine.css +++ b/config/waybar/style/Rose Pine.css @@ -107,8 +107,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -123,6 +121,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Simple Pink.css b/config/waybar/style/Simple Pink.css index b21c4ac..32831fe 100644 --- a/config/waybar/style/Simple Pink.css +++ b/config/waybar/style/Simple Pink.css @@ -129,8 +129,6 @@ tooltip { #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -148,6 +146,7 @@ tooltip { #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu, diff --git a/config/waybar/style/Translucent Chromatic.css b/config/waybar/style/Translucent Chromatic.css index b6f3c41..3efc20d 100644 --- a/config/waybar/style/Translucent Chromatic.css +++ b/config/waybar/style/Translucent Chromatic.css @@ -115,8 +115,6 @@ tooltip label{ #cpu, #disk, #idle_inhibitor, -#keyboard-state label, -#keyboard-state label.locked, #keyboard-state, #memory, #mode, @@ -134,6 +132,7 @@ tooltip label{ #custom-backlight, #custom-cycle_wall, #custom-keybinds, +#custom-keyboard, #custom-light_dark, #custom-lock, #custom-menu,