diff --git a/files/xprofile b/files/xprofile new file mode 100644 --- /dev/null +++ b/files/xprofile @@ -0,0 +1,39 @@ +#!/bin/sh + +# A sample xprofile for setting up X user session. + +# NB: Loading xkbmap and xmodmap files do not take effect on Budgie and GNOME desktop environments +# since gnome-session overwrites user's keymaps later. A workaround is to create a setkeymaps.desktop +# file in ~/.config/autostart to load these files after X session starts. The following is a sample of +# setkeymaps.dekstop: +# +# [Desktop Entry] +# Type=Application +# Name=setkeymaps +# Description=Setting up keymaps for X session +# Exec=bash -c "/usr/bin/xmodmap ~/.Xmodmap" + +# Load keymaps +if command -v setxkbmap >/dev/null 2>&1; then + for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do + if [ -f "$file" ]; then + echo "Loading keymap: $file" + setxkbmap $(cat "$file") + XKB_IN_USE=yes + fi + done + unset file +fi + +# Load xmodmap if not using XKB +if [ -z "$XKB_IN_USE" ] && command -v xmodmap >/dev/null 2>&1; then + for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do + if [ -f "$file" ]; then + echo "Loading modmap: $file" + xmodmap "$file" + fi + done + unset file +fi + +unset XKB_IN_USE diff --git a/pspec.xml b/pspec.xml --- a/pspec.xml +++ b/pspec.xml @@ -45,6 +45,7 @@ services protocols nsswitch.conf + xprofile System.Package @@ -548,4 +549,4 @@ ikey@solusos.com - \ No newline at end of file +