0

While working with ubuntu 23.10, I want to disable the functioning of the Windows key from the command or program. How can I achieve it?

graham
  • 10,436
  • Does this answer your question? https://askubuntu.com/q/93746/730458 – Chuck Liu Feb 06 '24 at 07:37
  • @ChuckLiu yes, but when I am trying to execute it with c code it is not working. while other commands work perfectly. – Umang Jais Feb 06 '24 at 07:42
  • in C , I am using system("gsettings set org.gnome.mutter overlay-key ' ' "); – Umang Jais Feb 06 '24 at 07:43
  • Your comment has a space inside ' ', whereas one of the linked question's answers does not and has "" – Daniel T Feb 06 '24 at 08:57
  • I did it without space. But still not working. – Umang Jais Feb 06 '24 at 09:37
  • What do you get if you type gsettings get org.gnome.mutter overlay-key in bash? – Daniel T Feb 06 '24 at 09:38
  • ' ' I got this after the executing the command (gsettings get org.gnome.mutter overlay-key) – Umang Jais Feb 06 '24 at 10:55
  • Then the C and bash code is fine. Do you have anything else in Settings > Keyboard > Keyboard shortcuts > View... set to that Windows key? You can also try setting the overlay-key to something else you don't need like 'Menu' – Daniel T Feb 06 '24 at 10:58
  • As I tried every single possibilities to do it with code. And I noticed that If I run it as script and try to run in terminal without using sudo i.e; ./script.sh it works. But If I try to run it with sudo i.e; sudo ./script.sh it does not works. what is the logic for it? anyone please. command that I used in my script file is :-

    gsettings set org.gnome.mutter overlay-key ''

    – Umang Jais Feb 07 '24 at 08:18
  • When you run it as root, it writes to /root/.config/dconf/user. When you run it without sudo, it writes to /home/username/.config/dconf/user. These are two different files. You might want system("su username -c \"gsettings set org.gnome.mutter overlay-key '' \""); – Daniel T Feb 07 '24 at 08:20

0 Answers0