Skip to content

Instantly share code, notes, and snippets.

@bludnic
Last active January 14, 2023 06:04
Show Gist options
  • Save bludnic/212e1cf4774a2ac144ad4a25f90c00d2 to your computer and use it in GitHub Desktop.
Save bludnic/212e1cf4774a2ac144ad4a25f90c00d2 to your computer and use it in GitHub Desktop.
Enable ChromeOS keyboard shortcuts (like Ctrl + Space) in Linux apps
#!/bin/bash
# Enabling ChromeOS keyboard shortcuts in Linux apps
# @see https://www.reddit.com/r/Crostini/wiki/enable-chrome-shortcuts-in-linux-apps/#wiki_enabling_chrome_keyboard_shortcuts_in_linux_apps
#
# The following key shortcuts will be added:
#
# Super_L (known as Search Key or Launcher key)
# <Alt> + [
# <Alt> + ]
# <Alt> + minus
# <Alt> + equal
# <Alt> + 1
# <Alt> + 2
# ...
# <Alt> + 9
# <Control> + space
#
# @see Chromebook keyboard shortcuts https://support.google.com/chromebook/answer/183101?hl=en
SERVICE_PATH="$HOME/.config/systemd/user/[email protected]"
X_SERVICE_PATH="$HOME/.config/systemd/user/[email protected]"
mkdir -p $SERVICE_PATH
mkdir -p $X_SERVICE_PATH
CONFIG="[Service]
Environment=\"SOMMELIER_ACCELERATORS=Super_L,<Alt>bracketleft,<Alt>bracketright,<Alt>minus,<Alt>equal,<Alt>1,<Alt>2,<Alt>3,<Alt>4,<Alt>5,<Alt>6,<Alt>7,<Alt>8,<Alt>9,<Control>space\"
"
echo "$CONFIG" > "$SERVICE_PATH/cros-sommelier-override.conf"
echo "$CONFIG" > "$X_SERVICE_PATH/cros-sommelier-x-override.conf"
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment