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

Post History

66%
+2 −0
Q&A Alternating 2 keyboard layouts with Key Combination

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 combina...

1 answer  ·  posted 6mo ago by Arpad Horvath‭  ·  edited 6mo ago by Arpad Horvath‭

#7: Post edited by user avatar Arpad Horvath‭ · 2023-11-10T11:28:15Z (6 months ago)
Additional combination
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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` but not with `Super+Space` nor with `Alt-Shift-Space`.
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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`.
#6: Post edited by user avatar Arpad Horvath‭ · 2023-11-10T11:15:05Z (6 months ago)
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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` but not with `Super+Space`
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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` but not with `Super+Space` nor with `Alt-Shift-Space`.
#5: Post edited by user avatar Arpad Horvath‭ · 2023-11-10T11:12:57Z (6 months ago)
Update 2
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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**: The permission is `-rwxrwxr-x` so the problem is not that.
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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` but not with `Super+Space`
#4: Post edited by user avatar Arpad Horvath‭ · 2023-11-10T11:07:13Z (6 months ago)
typo
  • 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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.
  • Works properly from command line:
  • ```
  • $ sh change-xkbmap.sh
  • $ #;;''
  • $ sh change-xkbmap.sh
  • $ #ééáá
  • ```
  • But when I set the key combination, it doesn't work.
  • ![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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**: The permission is `-rwxrwxr-x` so the problem is not that.
  • **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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/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](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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**: The permission is `-rwxrwxr-x` so the problem is not that.
#3: Post edited by user avatar Arpad Horvath‭ · 2023-11-10T07:55:31Z (6 months ago)
Update: permission
  • 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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.
  • Works properly from command line:
  • ```
  • $ sh change-xkbmap.sh
  • $ #;;''
  • $ sh change-xkbmap.sh
  • $ #ééáá
  • ```
  • But when I set the key combination, it doesn't work.
  • ![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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.
  • 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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.
  • Works properly from command line:
  • ```
  • $ sh change-xkbmap.sh
  • $ #;;''
  • $ sh change-xkbmap.sh
  • $ #ééáá
  • ```
  • But when I set the key combination, it doesn't work.
  • ![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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**: The permission is `-rwxrwxr-x` so the problem is not that.
#2: Post edited by user avatar Arpad Horvath‭ · 2023-11-09T14:27:47Z (6 months ago)
fix
  • 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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.
  • Works properly from command line:
  • ```
  • $ sh change-xkbmap.sh
  • $ #;;''
  • $ sh change-xkbmap.sh
  • $ #ééáá
  • ```
  • But when I set the key combination, it doesn't work.
  • ![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • I have used the same key combination for `setxkbmap hu` and it worked.
  • If it's possible, I would use `Win+Shift`, but it's worse. It 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.
  • 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:
  • ```shell
  • CURRENT=`/home/ha/bin/xkblayout-state print "%s"`
  • case $CURRENT in
  • us)
  • setxkbmap hu
  • ;;
  • hu)
  • setxkbmap us
  • ;;
  • esac
  • ```
  • I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.
  • Works properly from command line:
  • ```
  • $ sh change-xkbmap.sh
  • $ #;;''
  • $ sh change-xkbmap.sh
  • $ #ééáá
  • ```
  • But when I set the key combination, it doesn't work.
  • ![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)
  • 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.
#1: Initial revision by user avatar Arpad Horvath‭ · 2023-11-09T14:22:04Z (6 months ago)
Alternating 2 keyboard layouts with Key Combination
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:

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

I've installed [xkblayout-state](https://github.com/nonpop/xkblayout-state) from source.

Works properly from command line:

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

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

![setting kb combination](https://linux.codidact.com/uploads/j7d0w8n46ruccj5n1o8a3d6ye9sr)

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

If it's possible, I would use `Win+Shift`, but it's worse. It 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.