From 07e4884945c713667edab729538b4e06cb4e5f53 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 26 Apr 2019 14:12:45 +0200 Subject: [PATCH] Add compose key customization --- .set_compose_key.sh | 11 +++++++++++ .xprofile | 4 +--- .zshrc | 3 +++ compose/menu | 1 + compose/rwin | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 .set_compose_key.sh create mode 100644 compose/menu create mode 100644 compose/rwin diff --git a/.set_compose_key.sh b/.set_compose_key.sh new file mode 100755 index 0000000..3dd227f --- /dev/null +++ b/.set_compose_key.sh @@ -0,0 +1,11 @@ +# Since all keyboards does not include the same keys, the compose key +# should be customized. In order to achieve that, this script requires +# a symbolic link to point to a file containing the name of the key that +# will be used as a compose key. + +COMPOSE_KEY_FILE="$HOME/compose_key" + +if [ -f "$COMPOSE_KEY_FILE" ]; then + COMPOSE_KEY=$(cat "$COMPOSE_KEY_FILE") + setxkbmap -option "compose:$COMPOSE_KEY" +fi diff --git a/.xprofile b/.xprofile index 88523d5..562e674 100644 --- a/.xprofile +++ b/.xprofile @@ -1,9 +1,7 @@ [ -f /etc/xprofile ] && . /etc/xprofile [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources [ -f ~/.setpath.sh ] && . ~/.setpath.sh - -setxkbmap -option compose:rwin -setxkbmap -option compose:menu +[ -f ~/.set_compose_key.sh ] && . ~/.set_compose_key.sh hash xcompmgr 2>/dev/null && xcompmgr & hash xscreensaver 2>/dev/null && xscreensaver -no-splash & diff --git a/.zshrc b/.zshrc index 3a0e56e..5fef728 100644 --- a/.zshrc +++ b/.zshrc @@ -50,6 +50,9 @@ pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1 && export SSH_AGENT_PID=$(pgrep # Aliases [ -f "$HOME/.aliases" ] && . "$HOME/.aliases" +# Compose key +[ -f ~/.set_compose_key.sh ] && . ~/.set_compose_key.sh + # Pew hash pew 2>/dev/null && source $(pew shell_config) diff --git a/compose/menu b/compose/menu new file mode 100644 index 0000000..e4a6a56 --- /dev/null +++ b/compose/menu @@ -0,0 +1 @@ +menu \ No newline at end of file diff --git a/compose/rwin b/compose/rwin new file mode 100644 index 0000000..2618a89 --- /dev/null +++ b/compose/rwin @@ -0,0 +1 @@ +rwin \ No newline at end of file