0

I have succeeded in setting custom key commands in the dconf database; the results are visible in dconf editor and using gsettings (see below). However, the entered key mappings don't work.

Any ideas why this might be, specific to the dconf database?

$ gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name
'shcut'

$ gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command
'whiptail --msgbox hello 30 30'

$ gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding
'<Alt>p'

EDIT: Thanks to @Jacob Vlijm 's helpful suggestion:

gnome-terminal -e "whiptail --msgbox hello 10 10"

the message box appeared.

To send a value to the clipboard from an invoked program, the following will work. Set the shortcut to :

/bin/bash -e "/home/craig/bin/shcut"

The content of the invoked file is:

echo "testtext" | xclip -selection clipboard

After that "xclip -selection clipboard" will remain visible as a listed process

$ ps -aux | grep xclip
craig     1248  0.0  0.0  29112   308 ?        S    21:20   0:00 xclip -selection clipboard

until such time as something else is pasted into the clipboard, at which point the process will terminate.

  • Seems a command that should run in terminal. How do you expect the terminal to appear? – Jacob Vlijm Feb 11 '18 at 6:52
  • @JacobVlijm Thanks for your comment. whiplash (/bin/whiplash) is a standard program on ubuntu which pops up a message box. It is not a program which outputs to standard out. Does that make a difference to your comment, or are you saying some programs require explicitly invoking a shell to invoke the desired program? – Craig Hicks Feb 11 '18 at 21:46
  • Never worked with it, but running the command you mention without a terminal window to run from does nothing. however the command tilix -e "whiptail --msgbox hello 30 30", or in your case probably gnome-terminal -e "whiptail --msgbox hello 30 30" does open a terminal and shows something. – Jacob Vlijm Feb 11 '18 at 22:28
  • Thanks - the "gnome terminal ..." did the trick of popping up a window. )To get the text and OK button to appear the size had to be changed to 10 10). Actually my end goal was to evoke a program which calculated a value and placed it in the clipboard. I have modified my original question to show this. – Craig Hicks Feb 12 '18 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.