forked from sergei-mironov/xkb-switch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix link issue in the Lib. Add vimtest.sh
- Loading branch information
1 parent
7527a89
commit 3da7ebc
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
LIB=`dirname $0`/build/libxkbswitch.so | ||
|
||
if ! test -f "$LIB" ; then | ||
echo "$LIB not found. Try building it first" >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! which gcc ; then | ||
echo "GCC not found" >&2 | ||
exit 1 | ||
fi | ||
|
||
STDLIB=$(gcc --print-file-name=libstdc++.so) | ||
export LD_LIBRARY_PATH="`dirname $STDLIB`:$LD_LIBRARY_PATH" | ||
|
||
cat >/tmp/vimxkbswitch <<EOF | ||
let g:XkbSwitchLib = "$LIB" | ||
echo libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '') | ||
call libcall(g:XkbSwitchLib, 'Xkb_Switch_setXkbLayout', 'us') | ||
quit | ||
EOF | ||
|
||
vim -S /tmp/vimxkbswitch && echo OK | ||
|