Skip to content

Commit

Permalink
xmodmap script with capslock improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
oizo committed Mar 18, 2022
1 parent d034b42 commit 8b1844e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ function vmware-sign-drivers() {
echo "Reboot your machine. Follow the instructions to complete the enrollment from the UEFI console."
}

function xmodmap-danish-mac() {
XMOD_FILE=".danish-mac.xmodmap"
if [ -f $XMOD_FILE ]; then
xmodmap $XMOD_FILE
fi
}

case $OS_NAME in
Darwin)
# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
Expand All @@ -66,7 +59,7 @@ case $OS_NAME in
;;

Linux)
alias dkxmodmap=xmodmap-danish-mac
alias dkxmodmap=.xmodmap-setup
if [ -x "$(command -v openfortivpn)" ]; then
alias fiftytwo_vpn="sudo bash -c 'openfortivpn -c $HOME/.fiftytwo_forti_config &'"
fi
Expand Down
15 changes: 15 additions & 0 deletions .xmodmap-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Ensure that we turn capslog off if it was previously enabled
# or else the user will be stuck WRITING LIKE THIS
CAPSLOCK_STATE=$(xset -q | sed -n 's/^.*Caps Lock:\s*\(\S*\).*$/\1/p')
if [ "$CAPSLOCK_STATE" == "on" ]; then
xdotool key Caps_Lock
fi

XMOD_FILE=${1:-".danish-mac.xmodmap"}
if [ -f $XMOD_FILE ]; then
xmodmap $XMOD_FILE
else
echo "File not found: $XMOD_FILE"
fi
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function doIt() {
.gitconfig
xmodmap/.danish-mac.xmodmap
.xprofile
.xmodmap-setup
)
for i in "${array[@]}"; do
echo "Moving: ${i}"
Expand Down
1 change: 1 addition & 0 deletions bootstrap/debian
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ PACKAGES=(
virtualbox-qt
virtualbox-guest-additions-iso
git-cola
xdotool
)

echo "Append distribution specific apt packages"
Expand Down

0 comments on commit 8b1844e

Please sign in to comment.