You can use xfconf-query
.
Example:
xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x' -s mousepad
xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x' -s xfce4-terminal
The first command sets ctrlaltx to mousepad
, and the second switches it to xfce4-terminal
.
You can find the path for these commands in xfce4-settings-editor
. The left hand menu is -c
i.e. Channel. Then you have the Property -p
which you can get by clicking on an item under a channel and clicking the Edit button at the bottom. Then the -s
is the same as --set
.
For your script, you can query which command is set with:
xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x'
Example:
~$ xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x'
xfce4-terminal
Your script can look something like this with the xfconf-query
commands for each keyboard shortcut listed out.
#!/bin/bash
status=$(xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x')
if [ "$status" == "xfce4-terminal" ]; then
# profile 1
xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x' -s mousepad
# etc
# etc
else
# profile 2
xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/<Primary><Alt>x' -s xfce4-terminal
# etc
# etc
fi