LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can I check in script that what layout is set? (https://www.linuxquestions.org/questions/linux-software-2/how-can-i-check-in-script-that-what-layout-is-set-4175532942/)

kaya 02-03-2015 09:50 AM

How can I check in script that what layout is set?
 
How can I check in script that what layout is set?

I want to check it in every second because after sleep it doesnt set back to my custom layout.

I hope that when I use that japanese mozc writing engine than it will leave it.

Best would be to ask in the script that if I push altgr + a then will it be "á" or not. So if it will not be than I can just run my custom layout set program.

I was tried to run that on every wake up event, but that wasnt affected on the user environment (aka X). And when I tried to run it on the X host than the X was always frozen. So I want to check it every second...

How?

Thank you!!

veerain 02-04-2015 08:36 AM

Do you set console layout with loadkeys command?

A web search would definitely help.

kaya 02-04-2015 02:29 PM

xkbcomp $HOME/dvorakhu.xkb

I am using this one.

... And to find something would help much more.

kaya 02-07-2015 05:09 AM

Ok, I have made it.
Here:

#!/bin/bash
#
# Autobill
# GPLv3

while true; do
VAJON=`xmodmap -pke | grep aacute >/dev/null && echo 1 || echo 0`

if [ $VAJON -eq 0 ]
then
bill 2>/dev/null
fi

sleep 2; done



If you do know a nicer way, I am interested. This one is a weird solution. But it works!


All times are GMT -5. The time now is 10:48 AM.