You are not logged in.
Pages: 1
Hello!
I'm trying to set up quick little keyboards layout chooser which would on icon/applet click execute this command:
$ setxkbmap -rules evdev -layout es -model evdev
but, when I include this in "Create a new launcher" on desktop, either through "execute this command in terminal" or
directly, it doesn't do anything. Why is this not working from GUI and just from terminal? Can you maybe show me
how to write a little python GUI script that will execute this command, or point me to some link where I could learn this?
Thank you :-)
Last edited by luther7hrol (2013-12-09 13:44:31)
Offline
I have my keyboard layout commands directly in my Openbox root menu. For example, one entry in my menu simply calls "setxkbmap dvorak".
What GUI do you use? Please post the ".desktop" file you made.
Offline
In your launcher you could use the following:
xterm -iconic -e "setxkbmap -rules evdev -layout es -model evdev && notify-send -t 1000 'layout changed to es'; exit"But this isn't needed when I think about it. I'm running setxkbmap from xmonad startupHook, and it is running fine without a terminal. You can skip the xterm part, I'll leave the above command here, you might be interested in the notify-send part.
Last edited by Ashren (2013-12-09 14:42:40)
Offline
<drcouzelis> I use Cinnamon GUI (fork of GNOME). Here's .desktop file I tried with:
[Desktop Entry]
Comment=Choose Spanish Keymap
Terminal=false # tried with true, too
Name=es
Exec=setxkbmap -rules evdev -layout es -model evdev
Type=Application
Icon=gnome-panel-launcher
Maybe I could try writing my own cinnamon applet including setxkbmap command?
<Ashren> Thank you, it works with xterm part! :-) How do I do it without xterm, because when I exclude the xterm command, it doesn't do anything.
The notify-send little thing is great, i didn't know how to use it before so I've learnt something today.
Could you guys maybe tell me how this can be done from python, if it could be done easily, just curious to learn how to do it from different perspectives ![]()
Last edited by luther7hrol (2013-12-09 15:58:03)
Offline
luther7hrol:
After researching a bit it seems that commands like this should be executed within a shell:
[Desktop Entry]
Version=1.0
Type=Application
Name=test
Comment=test
Exec=bash -c "setxkbmap -rules evdev -layout es -model evdev && notify-send -t 1000 'layout changed to es'"
Icon=accessories-character-map
Path=/bin
Terminal=false
StartupNotify=falseLast edited by Ashren (2013-12-10 08:24:55)
Offline
Thank you my friend :-)
Offline
Pages: 1