Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Alternating 2 keyboard layouts with Key Combination

+2
−0

Sorry it was a typo, _ instead of -, that caused the problem.

I want to have a key combination to alter the keymaps. It worked with one for us and one for hu, but now I want to use one key combination to alternate them.

I have this script:

CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
case $CURRENT in
    us)
	    setxkbmap hu
	    ;;
    hu)
	    setxkbmap us
	    ;;
esac

I've installed xkblayout-state from source.

Works properly from command line:

$ change-xkbmap.sh 
$ #;;''
$ change-xkbmap.sh 
$ #ééáá

But when I set the key combination, it doesn't work.

setting kb combination

I have used the same key combination for setxkbmap hu and it worked.

If it's possible, I would use Super+Space, but it's worse. It also prints a space.

Ubuntu 22.04 in Hyper-V, Gnome 42.9

Before you write that I can switch without scripts. Yes I know, but it stops working after some time (after some suspend of the host Win10) in Hyper-V.

UPDATE 1: The permission is -rwxrwxr-x so the problem is not that.

UPDATE 2: There was a typo in the script's full path. It works well now with Alt-Shift-H or with Super-X but not with Super+Space nor with Alt-Shift-Space.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+3
−0

You probably need to change the permissions on the file to make it executable. You can do that with chmod:

chmod +x change-xkbmap.sh

To verify, try running ./change-xkbmap.sh in a terminal without sh.

Alternatively, using sh /home/ha/bin/change-xkbmap.sh in the shortcut dialog might also work.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »