sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

commit 48301ac1e9b1742515e5d4a7b8217b481d018179
parent 54fbe95e9d80aba1b96f4cf93438a67c1bd31c99
Author: x0tero <gxoelotero@gmail.com>
Date:   Tue, 10 Oct 2023 00:53:00 +0200

boton layout es/us integrado en dwm

Diffstat:
Mportatil/dwm/config.h | 2++
Mportatil/dwm/dwm | 0
Mportatil/dwm/dwm.o | 0
Aportatil/dwmblocks/layout.sh | 15+++++++++++++++
4 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/portatil/dwm/config.h b/portatil/dwm/config.h @@ -32,6 +32,7 @@ static const char *decvol[] = { "/bin/bash", "-c", "amixer sset Master 1%- | pk static const char *upvol[] = { "/bin/bash", "-c", "amixer sset Master 1%+ | kill -44 $(pidof dwmblocks)", NULL }; static const char *decbrillo[] = { "/bin/bash", "-c", "brightnessctl -d \"intel_backlight\" set 5%-", NULL }; static const char *upbrillo[] = { "/bin/bash", "-c", "brightnessctl -d \"intel_backlight\" set 5%+", NULL }; +static const char *cambiarTeclado[] = { "/bin/bash", "-c", "layout | pkill -RTMIN+10 dwmblocks", NULL }; static const char *colors[][3] = { /* fg bg border */ @@ -137,6 +138,7 @@ static Key keys[] = { { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }, { 0, XF86XK_MonBrightnessDown, spawn, {.v = decbrillo } }, { 0, XF86XK_MonBrightnessUp, spawn, {.v = upbrillo } }, + { MODKEY, XK_w, spawn, {.v = cambiarTeclado } }, //{ 0, XF86XK_AudioLowerVolume, spawn, {.v = "amixer sset Master 1%- | pkill -RTMIN+10 dwmblocks" } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) diff --git a/portatil/dwm/dwm b/portatil/dwm/dwm Binary files differ. diff --git a/portatil/dwm/dwm.o b/portatil/dwm/dwm.o Binary files differ. diff --git a/portatil/dwmblocks/layout.sh b/portatil/dwmblocks/layout.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Read the XKBLAYOUT value from /etc/default/keyboard +xkblayout=$(setxkbmap -query | grep layout | awk -F " " '{print $2}') +#xkblayout=$(cat /etc/default/keyboard | grep XKBLAYOUT | awk -F"\"" '{print $2}') + +# Check if XKBLAYOUT is "us" +if [ "$xkblayout" == "us" ]; then + setxkbmap es +# Check if XKBLAYOUT is "pt" +elif [ "$xkblayout" == "es" ]; then + setxkbmap us +else + echo "Keyboard layout is not 'us' or 'pt'." +fi